Question: Please perform this in MatLab Prototyping and Projects (ECE 112) MatLab Birthday Perhaps you've heard that in a group of 23 people the odds are

Please perform this in MatLab Prototyping and Projects (ECE 112) MatLab BirthdayPlease perform this in MatLab

Prototyping and Projects (ECE 112) MatLab Birthday Perhaps you've heard that in a group of 23 people the odds are about even that two people will have the same birthday. To put this another way, if you were to create 1000 random groups of people there should be about 500 of these groups that have two people with the same birthday. If you increase the size of the group to 50 people there is a 97% chance that two people have the same birthday. Your goal is to create a program in Matlab that will find the percent chance that a group of size n has at least two people with the same birthday. You will do this by creating 1000 random groups of size n and testing to see how many of them have the same birthday. The number of people in the group (n) should be an input into the program. Turn in the following items: E-mail Dr. Woolverton your Matlab code. Here are some tips: You don't need to assign an actual birthday to each person. A number from 1 to 365 will work. You don't need to consider leap years. . Use the rand command to assign each person a birthday number. The rand command gives a random number between 0 and 1. How can you make this a random number between 1 and 365? You may also find the ceil command helpful. Don't try to tackle the whole problem at once. First try and create a program that gets the input of n and creates an array that contains n random birthdays. You can use the sort command to rearrange the array from lowest to highest. To check if a = b you should use: if a == b Each time you find a birthday match in a group, set a counter. You can do this very simply with something like: count=count+1 . Once you get the program to get the input, form the birthdays and check for matches, add a loop so that you are doing it 1,000 times. Prototyping and Projects (ECE 112) MatLab Birthday Perhaps you've heard that in a group of 23 people the odds are about even that two people will have the same birthday. To put this another way, if you were to create 1000 random groups of people there should be about 500 of these groups that have two people with the same birthday. If you increase the size of the group to 50 people there is a 97% chance that two people have the same birthday. Your goal is to create a program in Matlab that will find the percent chance that a group of size n has at least two people with the same birthday. You will do this by creating 1000 random groups of size n and testing to see how many of them have the same birthday. The number of people in the group (n) should be an input into the program. Turn in the following items: E-mail Dr. Woolverton your Matlab code. Here are some tips: You don't need to assign an actual birthday to each person. A number from 1 to 365 will work. You don't need to consider leap years. . Use the rand command to assign each person a birthday number. The rand command gives a random number between 0 and 1. How can you make this a random number between 1 and 365? You may also find the ceil command helpful. Don't try to tackle the whole problem at once. First try and create a program that gets the input of n and creates an array that contains n random birthdays. You can use the sort command to rearrange the array from lowest to highest. To check if a = b you should use: if a == b Each time you find a birthday match in a group, set a counter. You can do this very simply with something like: count=count+1 . Once you get the program to get the input, form the birthdays and check for matches, add a loop so that you are doing it 1,000 times

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!