# Expected value of the modified Birthday problem

If I want the expected number of triples (not pairs) out of n people that are have birthdays of within 1 day of each other

$${n \choose 3}*\frac{\text{something}}{365^2}$$

I know that the first bday is given, but how do I count the ways in which the other two can have their bdays fall within the qualified statement. I know I have 3 options for Person 2 but person 3's match depends upon person 2's match.

-

The factor $n \choose 3$ is just the number of triplets, so let us concentrate on the probability that the first three people are within one day (presumably you mean a span of two days). The first can be anything. If the second matches exactly (chance $\frac 1{365}$) the third can be any of three days (chance $\frac 3{365}$). If the second is one of the two neighboring days (chance $\frac 2{365}$) then the third has only two choices (again chance $\frac 2{365}$). So the total probability is $\frac {1\cdot 3 + 2 \cdot 2}{365^2}=\frac 7{365^2}$ Then the expected number of matches is ${n \choose 3} \frac 7{365^2}$

-
Given three people (A,B,C), and assuming that each birthday is an independent choice from the integers mod $365$, there are $7$ ways that the three birthdays could all be within one day of each other. Let's say A's birthday is on day $a$.
• three ways with B and C on the same day, which is one of $\{a-1, a, a+1\}$
• two with C one day after B, so B on $a-1$ or $a$.
• two with C one day before B, so B on $a$ or $a+1$.
So the probability that (A,B,C) have their birthdays within one day of each other is $7/365^2$. There are $n \choose 3$ unordered triples, so the expected number is ${n \choose 3} \frac{7}{365^2}$.