3

Problem:

I have 610 friends. Each one of them will invite me to his birthday party, and I will accept every invitation. What is the probability that I will be attending at least one birthday party on every day of the year?

My attempt has been to try counting how many ways in which there could be at least one day where there are no birthday celebrations, and subtract the resulting probability from 1, but of course I end up having to use the inclusion-exclusion principle, and with these numbers it becomes unwieldy. Hopefully someone can kindly show me a nicer way of tackling this.

2 Answers2

1

I know this uses inclusion-exclusion which you stated is not what you wanted. I don't know how far you got into it, or if other users know the end result, but I figured this is too long for a comment and thought someone might find it useful.

Let $p$ be the desired probability. We will calculate the complimentary probability $q=1-p$ that no birthday is attended in at least one day of the year.

Let $C_i$ be the event that no birthday is attended on day $i$. Then:

$$q=\mathbb{P}\left(\bigcup_{i=1}^{365}C_i\right)$$

Let $[365]=\{1,2,\dots,365\}$. Using inclusion-exclusion, we can rewrite that as

$$q=\sum_{k=1}^{365}\left({(-1)}^{k-1}\sum_{\substack{I\subset[365]\\|I|=k}}\mathbb{P}(C_I)\right),$$

where $C_I=\cap_{i \in I}C_i$.

Now we need only calculate the $\mathbb{P}(C_I)$; this is much easier. For each of our $610$ friends, there are $|I|$ days of the year that are forbidden. Hence

$$\mathbb{P}(C_I)={\left(\frac{365-|I|}{365}\right)}^{610}={\left(1-\frac{|I|}{365}\right)}^{610}$$

and we may write

$$q=\sum_{k=1}^{365}\left({(-1)}^{k-1}\sum_{\substack{I\subset[365]\\|I|=k}}{\left(1-\frac{k}{365}\right)}^{610}\right).$$

This may be further simplified. Indeed, for each $k$ there are $\binom{365}{k}$ sets $I\subset[365]$ with $|I|=k$. Thus

$$q=\sum_{k=1}^{365}{(-1)}^{k-1}\binom{365}{k}{\left(1-\frac{k}{365}\right)}^{610},$$

and the desired probability is

\begin{align} p&=1+\sum_{k=1}^{365}{(-1)}^{k}\binom{365}{k}{\left(1-\frac{k}{365}\right)}^{610}\\ &=\hphantom{1+}\,\,\sum_{k=0}^{365}{(-1)}^{k}\binom{365}{k}{\left(1-\frac{k}{365}\right)}^{610}. \end{align}

Fimpellizzeri
  • 23,321
0

Here I gave a simulation solution which is based on Monte Carlo sampling. You can set up the number of sampling experiments, but the result is alway 0 since the probability of this kind of event is pretty low.

The C++ code is as below:

#include <iostream>
#include <map>
#include <vector>
#include <math.h>
#include <stdlib.h>     /* srand, rand */
using namespace std;

int main(int argc, char **argv) 
{
  std::cout << "Hello, world!" << std::endl;
  int friendNum=610;
  int ROICaseNum=0;
  int experimentNum=100;
  double prob = 1.0/365.0;

  for (int i=0;i<experimentNum;i++)
  {
    std::vector<bool> yesVec;
    for (int n=1;n<=365;n++)
    {
        int yes_sum=0;
        for (int j=0;j<friendNum;j++)
        {
            if (((double) rand() / (RAND_MAX))<prob)
            {
                yes_sum = yes_sum+1;
            }
        }
        if (yes_sum>=1)
        {
            yesVec.push_back(true);
        }
        else
        {
            yesVec.push_back(false);
        }
    }
    bool yes_ROICase=true;
    for (int k=0;k<yesVec.size();k++)
    {
        yes_ROICase = yes_ROICase&&yesVec[k];
    }
    if (yes_ROICase==true)
    {
        ROICaseNum = ROICaseNum+1;
    }
    cout<<"size of yesVec is "<<yesVec.size()<<endl;

  }
  cout<<"probability is="<<((double)(ROICaseNum/experimentNum))<<endl;
  return 0;
}
duanduan
  • 456