There is a long line of people waiting to see a new movie. They announce that the first person to have the same birthday as someone standing before them in the line gets to meet one of the actors in the movie.

What place in line would maximize your chances of winning? Assume birthdays are uniformly distributed through the year.

#### Solution

20th in line would maximize your chances

A bit of a brute force solution: inspect the probabilities starting from first place in line (either manually, using code, or using spreadsheet software). Let P_{n} be the probability that the nth in line wins:

- P
_{1}= 0- Because they have no one to share a birthday with

- P
_{2}= 1 / 365 ≈ 0.00274 - P
_{3}= (1 – P_{1}– P_{2}) * (2 / 365) ≈ 0.00546- First have to consider that #1 and 2 didn’t already win. Then multiply by 2 / 365 because now we know they must have distinct birthdays

- P
_{4}= (1 – P_{1}– P_{2}– P_{3}) * (3 / 365) ≈ 0.00815 - …
- P
_{19}≈ 0.3221 - P
_{20}≈ 0.3232 - P
_{21}≈ 0.3201 - …

You will notice that probabilities increase until 20th in line, and then decrease thereafter.

For a more elegant algebraic solution, you can check out the problem on Math StackExchange.

## 2 replies on “Same Birthday in Line”

Thanks for your blog, nice to read. Do not stop.

By “standing before them,” do you mean standing DIRECTLY next to them (and before them), or ANYWHERE before them?