Question: Exercise 7 . 2 7 - The Birthday Problem Make a matlab function BirthdayProblem.m with the declaration function p = BirthdayProblem ( n ) where

Exercise 7.27- The Birthday Problem
Make a matlab function BirthdayProblem.m with the declaration
function p= BirthdayProblem(n)
where n is a number of people and p is a probability vector. You can find the details of the Birthday Problem in the textbook,
but I am making the following modifications to the instructions:
The Birthday Problem primary function will create an (n-1)-vector of probabilities and a plot of those probabilities versus n. You
will perform a numerical experiment (described in the problem's hint) in a subfunction that your primary function calls.
So if I input
p= BirthdayProblem(40)
p should be a vector of length n-1 that holds the probabilities of 2,3,4,dots,40 people sharing a birthday and your program
should create a plot of these probabilities. Inside your program, each of these individual probabilities should be calculated by
calling a subfunction that runs the numerical experiment for a given value of people. Use a loop call the subfunction to do the
experiment n-1 times.
Exercise 7 . 2 7 - The Birthday Problem Make a

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 Programming Questions!