+ Reply to Thread
Results 1 to 2 of 2

Birthday Problem Simulation

  1. #1
    Registered User
    Join Date
    09-09-2011
    Location
    Makassar
    MS-Off Ver
    Excel 2007
    Posts
    1

    Birthday Problem Simulation

    Hi everybody

    I have assignment performing the simulation of birthday problem that is:

    what is the probability that in a class of 23 children, two or more children have the same birthday?

    the task is I have to perform some steps using any kind of software. In this case, I decide to use ms. excel, but I have no idea of some of the steps that had been given to me as instruction from my lecturer.

    step 1: initialize n = 100.000 (number of runs)
    teller = 0; r = 1

    step 2
    for i = 1, ... , 23 use RAND to generate a random number Ui and compute the birthday
    ki = 1 + rounddown (365 * Ui)

    step 3
    Test whether Ki - Kj = 0, for some i is not equal to j

    if so,

    teller = teller + 1
    r = r + 1. If r < n, repeat steps 2

    Step 4
    the estimation of the desired probability = teller / n

    my questions?

    1. how to initialize n as many as 100.000?
    2. what does teller = 0 and r = 1 mean? (I am not sure of whether the writing of teller is true since I just note my lecturer's writing in blackboard)
    3. In step 3, what does teller = teller 1 mean, and why if r < n, I must repeat steps 2

    thank you very much

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,288

    Re: Birthday Problem Simulation

    Hi wawar05 and welcome to the program,

    I hate doing all your homework for you but here is an answer. In a class of 23, about 53.5% of the time two students have the same birthdate.

    See the attached and read the code to change class size and accuracy of results.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1