Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The Birthday Problem. If there are a group of n people in a room, what is the probability that two or more of them have

The Birthday Problem. If there are a group of n people in a room, what is the probability that two or more of them have the same birthday [month and day only, ignore the year]. It is possible to determine the answer to this question by simulation. Write a function that calculates the probability that two or more of n people will have the same birthday, where n is the calling argument.

[HINT: To do this, the function should create an array of size n and generate n birthdays in the range 1 to 365 randomly. It should then check to see if any of the n birthdays are identical. The function should perform this experiment at least 5000 times and calculate the fraction of those times in which two or more people had the same birthday.]

Then, write a test program [calling program] that calculates and prints out [using a user defined function] the probability that 2 or more of n people witll have the same birthday for n = 2, 3, 4, 40.

LastName_FirstName_P6_xxxxx

Notes: the xxxx can be whatever you want.

USE MATLAB FOR THIS.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intranet And Web Databases For Dummies

Authors: Paul Litwin

1st Edition

0764502212, 9780764502217

More Books

Students also viewed these Databases questions