Math Is Fun Forum

  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 2008-12-26 09:29:30

luca-deltodesco
Member
Registered: 2006-05-05
Posts: 1,470

possiblity of sharing birthdays

What is the number of people needed such that the probablity of any two people sharing a birthday? 23, although the exact probablity is closer to 0.507266.

What about the probabilty of 3 people sharing a birthday, or 4 or 5, heres a graph i've produced (would have done higher quality if i had the patience to let it do the calculations) showing the probablities

Here is the method i've used to approximate these probablities, obviously higher number of iterations will converge on exact probablity.

const int iterations = 400000;
float prob(int groupsize, int matchsize)
{
    int count = 0;

    int exist [365];
    int number [365];

    for(int i = 1; i<=iterations; i++)
    {
        for(int j = 0; j<groupsize; j++)
        {
            int k = rand()%365;
            if(exist[k]==i)
            {
                if(++number[k]==matchsize)
                {
                    count++;
                    break;
                }
            }else
            {
                exist[k] = i;
                number[k] = 1;
            }
        }
    }

    return float(count)/float(iterations);
}

The Beginning Of All Things To End.
The End Of All Things To Come.

Offline

#2 2008-12-26 09:50:21

bossk171
Member
Registered: 2007-07-16
Posts: 305

Re: possiblity of sharing birthdays

Very, very cool.


There are 10 types of people in the world, those who understand binary, those who don't, and those who can use induction.

Offline

#3 2008-12-31 02:48:05

Jai Ganesh
Administrator
Registered: 2005-06-28
Posts: 45,956

Re: possiblity of sharing birthdays

Thats a lovely graph, luca-deltodesco!

If I am interpreting the graph correctly, the chances of six people sharing their birthday is more possible than not in a crowd of about 460! Truly difficult to believe!

creative.jpg


It appears to me that if one wants to make progress in mathematics, one should study the masters and not the pupils. - Niels Henrik Abel.

Nothing is better than reading and gaining more and more knowledge - Stephen William Hawking.

Offline

#4 2008-12-31 03:09:08

luca-deltodesco
Member
Registered: 2006-05-05
Posts: 1,470

Re: possiblity of sharing birthdays

Yep, and if you prefer this is the same as asking; what is the probablity that 'n' number of dice, dice which have 365 numbers on them, will all roll the same number tongue


The Beginning Of All Things To End.
The End Of All Things To Come.

Offline

#5 2008-12-31 06:11:05

Ricky
Moderator
Registered: 2005-12-04
Posts: 3,791

Re: possiblity of sharing birthdays

Can we find a closed form solution to these curves?  If you could post data on them, we could find Lagrange (polynomial) and Taylor approximations to them.

On second thought, Taylor would only be possible using linear extrapolation to nonintegral coordinates.  It would be more useful if the question could be extended to all real numbers.  In other words, 2.48386 people, what is the chance that they have the same birthday?


"In the real world, this would be a problem.  But in mathematics, we can just define a place where this problem doesn't exist.  So we'll go ahead and do that now..."

Offline

#6 2009-01-01 06:56:20

luca-deltodesco
Member
Registered: 2006-05-05
Posts: 1,470

Re: possiblity of sharing birthdays

from here: http://leaver.org/noca//birthday/other.html, you can calculate the probablity of 2 people sharing a birthday as:

although clearly this doesn't work when n is larger than 365 for group size.


The Beginning Of All Things To End.
The End Of All Things To Come.

Offline

Board footer

Powered by FluxBB