Page 1 of 5 12345 LastLast
Results 1 to 25 of 105
  1. #1
    Aspiring Guru
    poolcleaner's Avatar
    Join Date
    Jun 2005
    Last Online
    27-07-2006 @ 09:21 PM
    Location
    pratunam
    Posts
    4,456

    The Birthday Paradox

    When I'm not posting total bollocks on here or destroying my liver and other organs I like to shag!
    But on the odd occasion that I'm drunk enough and I can't get it up again and the internet card has expired I like to wrestle with complex mathematical problems.

    This one's intruiging..

    A random sample of 23 people will mathematically produce two people who's birthdays fall on the same day!!

    "Bullshit Pooly" I hear you shout!

    Care to put it to the test?

    I'll go first....................October 1st
    Cap.................................?
    Next.....?





    The Birthday Paradox
    Philip J. Erdelsky
    July 4, 2001


    A favorite problem in elementary probability and statistics courses is the Birthday Problem: What is the probability that at least two of N randomly selected people have the same birthday? (Same month and day, but not necessarily the same year.)

    A second part of the problem: How large must N be so that the probability is greater than 50 percent? The answer is 23, which strikes most people as unreasonably small. For this reason, the problem is often called the Birthday Paradox. Some sharpies recommend betting, at even money, that there are duplicate birthdays among any group of 23 or more people. Presumably, there are some ill-informed suckers who will accept the bet.

    The problem is usually simplified by assuming two things:

    1. Nobody was born on February 29.
    2. People's birthdays are equally distributed over the other 365 days of the year.

    One of the first things to notice about this problem is that it is much easier to solve the complementary problem: What is the probability that N randomly selected people have all different birthdays? We can write this as a recursive function:

    double different_birthdays(int n)
    {
    return n == 1 ? 1.0 : different_birthdays(n-1) * (365.0-(n-1))/365.0;
    }

    Obviously, for N = 1 the probability is 1. For N>1, the probability is the product of two probabilities:

    1. That the first N-1 people have all different birthdays.
    2. That the N-th person has a birthday different from any of the first N-1.

    A program to display the probabilities goes something like this:

    void main(void)
    {
    int n;
    for (n = 1; n <= 365; n++)
    printf("%3d: %e\n", n, 1.0-different_birthdays(n));
    }

    The result is something like this:

    1: 0.000000e+00
    2: 2.739726e-03
    3: 8.204166e-03
    4: 1.635591e-02
    5: 2.713557e-02
    ***
    20: 4.114384e-01
    21: 4.436883e-01
    22: 4.756953e-01
    23: 5.072972e-01
    24: 5.383443e-01
    25: 5.686997e-01
    ***

    The probability that at least two of N people have the same birthday rises above 0.5 when N=23.

    BUT WHAT ABOUT LEAP YEAR?

    The original problem can be solved with a slide rule, which is exactly what I did when I first heard it many, many years ago.

    If we add February 29 to the mix, it gets considerably more complicated. In this case, we make some additional assumptions:

    1. Equal numbers of people are born on days other than February 29.
    2. The number of people born on February 29 is one-fourth of the number of people born on any other day.

    Hence the probability that a randomly selected person was born on February 29 is 0.25/365.25, and the probability that a randomly selected person was born on another specified day is 1/365.25.

    The probability that N persons, possibly including one born on February 29, have distinct birthdays is the sum of two probabilities:

    1. That the N persons were born on N different days other than February 29.
    2. That the N persons were born on N different days, and include one person born on February 29.

    The probabilities add because the two cases are mutually exclusive.

    Now each probability can be expressed recursively:

    double different_birthdays_excluding_Feb_29(int n)
    {
    return n == 1 ? 365.0/365.25 :
    different_birthdays_excluding_Feb_29(n-1) * (365.0-(n-1)) / 365.25;
    }

    double different_birthdays_including_Feb_29(int n)
    {
    return n == 1 ? 0.25 / 365.25 :
    different_birthdays_including_Feb_29(n-1) * (365.0-(n-2)) / 365.25 +
    different_birthdays_excluding_Feb_29(n-1) * 0.25 / 365.25;
    }

    A program to display the probabilities goes something like this:

    void main(void)
    {
    int n;
    for (n = 1; n <= 366; n++)
    printf("%3d: %e\n", n, 1.0-different_birthdays_excluding_Feb_29(n) -
    different_birthdays_including_Feb_29(n));
    }

    The result is something like this:

    1: -8.348357e-18
    2: 2.736445e-03
    3: 8.194354e-03
    4: 1.633640e-02
    5: 2.710333e-02
    ***
    20: 4.110536e-01
    21: 4.432853e-01
    22: 4.752764e-01
    23: 5.068650e-01
    24: 5.379013e-01
    25: 5.682487e-01
    ***

    As expected, the probabilities are slightly lower, because there is a lower probability of matching birthdays when there are more possible birthdays. But the smallest number with probability greater than 0.5 is still 23.

    Of course, a mathematical purist may argue that leap years don't always come every four years, so the calculations need further modification. However, the last quadrennial year that wasn't a leap year was 1900, and the next one will be 2100. The number of persons now living who were born in 1900 is so small that I think our approximation is valid for all practical purposes. But you are welcome to make the required modifications if you wish.

    The Birthday Paradox has implications beyond the world of parlor betting. A standard technique in data storage is to assign each item a number called a hash code. The item is then stored in a bin corresponding to its hash code. This speeds up retrieval because only a single bin must be searched. The Birthday Paradox shows that the probability that two or more items will end up in the same bin is high even if the number of items is considerably less than the number of bins. Hence efficient handling of bins containing two or more items is required in all cases.
    Anotter Poolcleaner Production for your mental stimulation and inner well-being!

  2. #2
    Thailand Expat

    Join Date
    Jun 2005
    Last Online
    20-09-2006 @ 09:55 PM
    Posts
    2,975
    I reckon the answer is 23 Pooly. I worked my way through it systematically and as I was born on the 5th, it was all too obvious that 23 is the answer.

    Am I right?

  3. #3
    Aspiring Guru
    poolcleaner's Avatar
    Join Date
    Jun 2005
    Last Online
    27-07-2006 @ 09:21 PM
    Location
    pratunam
    Posts
    4,456
    Well let's wait for the next random 21 shall we?

    Pooly............Oct 1st
    Cap..............Oct 5th
    ?..................?

  4. #4
    Not an expat
    Fabian's Avatar
    Join Date
    Jul 2005
    Last Online
    04-09-2017 @ 09:31 PM
    Location
    Hamburg, cold dark Germany
    Posts
    5,381
    November 22nd

  5. #5
    Aspiring Guru
    poolcleaner's Avatar
    Join Date
    Jun 2005
    Last Online
    27-07-2006 @ 09:21 PM
    Location
    pratunam
    Posts
    4,456
    Really need a cut and paste to make this work...

    1..........Pooly.........Oct 1st
    2..........Cap...........Oct 5th
    3..........Fab...........Nov 22nd
    4..........
    5..........
    6.........
    7.........
    8.........
    9.........
    10.......
    11.......
    12.......
    13.......
    14.......
    15.........
    16........
    17........
    18........
    19........
    20........
    21........
    22........
    23........

  6. #6
    Member
    seth106's Avatar
    Join Date
    Jul 2005
    Last Online
    25-04-2013 @ 03:15 PM
    Location
    Not quite sure really
    Posts
    607
    Bua laow




  7. #7
    punk douche bag
    ChiangMai noon's Avatar
    Join Date
    Aug 2005
    Last Online
    @
    Location
    o dan y bryn
    Posts
    29,256
    20th April.
    By the way, it's a little bit odd that tim Henman and Greg Rusedski share a birthday.

  8. #8
    Thailand Expat
    dirtydog's Avatar
    Join Date
    Jun 2005
    Last Online
    @
    Location
    Pattaya Jomtien
    Posts
    58,774
    4th of feb, poolie stick to donating money to poor hoes i reckon

  9. #9
    A bladdy woman
    Goddess of Whatever's Avatar
    Join Date
    Jul 2005
    Last Online
    29-04-2009 @ 05:13 PM
    Location
    Somewhere I belong but it won't be last long
    Posts
    4,247
    1..........Pooly..........Oct 1st
    2..........Cap............Oct 5th
    3..........Fab............Nov 22nd
    4..........CMn...........Apr 20th
    5..........DD.............Feb 4th
    6..........GoW...........Jul 3rd
    7..........
    8.........
    9.........
    10.......
    11.......
    12.......
    13.......
    14.......
    15.........
    16........
    17........
    18........
    19........
    20........
    21........
    22........
    23........

  10. #10
    A bladdy woman
    Goddess of Whatever's Avatar
    Join Date
    Jul 2005
    Last Online
    29-04-2009 @ 05:13 PM
    Location
    Somewhere I belong but it won't be last long
    Posts
    4,247
    The problem is usually simplified by assuming two things:

    1. Nobody was born on February 29.
    My friends (twin), they were born on 29th of Feb.



  11. #11
    befuddled
    danbo's Avatar
    Join Date
    Jul 2005
    Last Online
    10-08-2008 @ 10:57 PM
    Location
    Hatty Town
    Posts
    3,452
    Oh deary, deary me, I do believe that I am DD's twin.

  12. #12
    Member Bovine's Avatar
    Join Date
    Jul 2005
    Last Online
    07-08-2006 @ 09:10 PM
    Posts
    87
    I'm 10th april..... juz call me ram for short

  13. #13
    Newbie
    Xzyte's Avatar
    Join Date
    Jun 2005
    Last Online
    @
    Location
    /usr/bin/php
    Posts
    159
    1..........Pooly..........Oct 1st
    2..........Cap............Oct 5th
    3..........Fab............Nov 22nd
    4..........CMn...........Apr 20th
    5..........DD.............Feb 4th
    6..........GoW...........Jul 3rd
    7..........Bovine........Apr 10th
    8..........Xzyte.........Jun 2nd
    9..........
    10........
    11........
    12........
    13........
    14........
    15........
    16........
    17........
    18........
    19........
    20........
    21........
    22........
    23........
    Last edited by Xzyte; 15-12-2005 at 06:43 AM.

  14. #14
    punk douche bag
    ChiangMai noon's Avatar
    Join Date
    Aug 2005
    Last Online
    @
    Location
    o dan y bryn
    Posts
    29,256
    No. Bovine's was the 10th of April.

    Adolf Hitler was the 20th.

  15. #15
    Thailand Expat

    Join Date
    Jul 2005
    Last Online
    @
    Location
    In a rather cold and dark place
    Posts
    12,823
    3rd February

  16. #16
    A bladdy woman
    Goddess of Whatever's Avatar
    Join Date
    Jul 2005
    Last Online
    29-04-2009 @ 05:13 PM
    Location
    Somewhere I belong but it won't be last long
    Posts
    4,247
    1..........Pooly..........Oct 1st
    2..........Cap............Oct 5th
    3..........Fab............Nov 22nd
    4..........CMn...........Apr 20th
    5..........DD.............Feb 4th
    6..........GoW...........Jul 3rd
    7..........Bovine........Apr 10th
    8..........Xzyte.........Jun 2nd
    9..........MtD...........Dec 12th
    10........Mrs Q.........Feb 3rd
    11........Danbo........Feb 4th
    12........
    13........
    14........
    15........
    16........
    17........
    18........
    19........
    20........
    21........
    22........
    23........

  17. #17
    Thailand Expat
    Marmite the Dog's Avatar
    Join Date
    Jun 2005
    Last Online
    08-09-2014 @ 10:43 AM
    Location
    Simian Islands
    Posts
    34,827
    12th December, as most of you are aware....

  18. #18
    Not again! machangezi's Avatar
    Join Date
    Jun 2005
    Last Online
    24-06-2018 @ 03:47 AM
    Location
    Out there!
    Posts
    7,676
    3rd of March.

  19. #19
    Aspiring Guru
    poolcleaner's Avatar
    Join Date
    Jun 2005
    Last Online
    27-07-2006 @ 09:21 PM
    Location
    pratunam
    Posts
    4,456
    Topic Closed

  20. #20
    Elite Member
    kenkannif's Avatar
    Join Date
    Jun 2005
    Last Online
    10-11-2006 @ 11:41 AM
    Posts
    1,534
    LoL.

    2nd May and my mate Whitely Boy (who I know from the UK) on Ajarn (don't post much) has the same.

  21. #21
    A bladdy woman
    Goddess of Whatever's Avatar
    Join Date
    Jul 2005
    Last Online
    29-04-2009 @ 05:13 PM
    Location
    Somewhere I belong but it won't be last long
    Posts
    4,247
    1..........Pooly..........Oct 1st
    2..........Cap............Oct 5th
    3..........Fab............Nov 22nd
    4..........CMn...........Apr 20th
    5..........DD.............Feb 4th
    6..........GoW...........Jul 3rd
    7..........Bovine........Apr 10th
    8..........Xzyte.........Jun 2nd
    9..........MtD...........Dec 12th
    10........Mrs Q.........Feb 3rd
    11........Danbo........Feb 4th
    12........Macha........Mar 3rd
    13........KK.............May 2nd
    14........
    15........
    16........
    17........
    18........
    19........
    20........
    21........
    22........
    23........


  22. #22
    Thailand Expat
    MeMock's Avatar
    Join Date
    Jun 2005
    Last Online
    @
    Location
    Baan Nok Ubon / outback Australia
    Posts
    11,121
    Why is the topic closed?

  23. #23
    Elite Member
    kenkannif's Avatar
    Join Date
    Jun 2005
    Last Online
    10-11-2006 @ 11:41 AM
    Posts
    1,534
    I think PC was fucking about with Macha mate.

  24. #24
    Elite Member
    kenkannif's Avatar
    Join Date
    Jun 2005
    Last Online
    10-11-2006 @ 11:41 AM
    Posts
    1,534
    Double post I honestly wasn't being rude or anything

  25. #25
    Thailand Expat
    MeMock's Avatar
    Join Date
    Jun 2005
    Last Online
    @
    Location
    Baan Nok Ubon / outback Australia
    Posts
    11,121
    Whose macha?


Page 1 of 5 12345 LastLast

Thread Information

Users Browsing this Thread

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

Posting Permissions

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