# What is the expected number of days in a year in which exactly $k$ people in a group of $n$ people have been born?

There is a group of $n$ people and we must find the average number of days that in each of them exactly $k$ people are born ($k$ and $n$ are given).

This question assumes that a year has $365$ days, and each day of the year is equally likely to be a birthday for someone.

-
Let $X$ be the random variable of number of days in which $k$ people are born. I think you want to find $E[X]=\sum_{i=1}^{365}{iP(\{X=i\})}$. I think it's easier to find $P(\{X\leq i\})$ and then find $P(\{X=i\})$. – user59671 Feb 25 '13 at 12:11
@CutieKrait: Expected values should be calculated using linearity of expectation whenever possible; this is usually considerably easier than summing over the distribution. – joriki Feb 25 '13 at 13:50
@joriki: thanks. it was my raw idea. – user59671 Feb 25 '13 at 13:52

By linearity of expectation, this is just $365$ times the probability that exactly $k$ people are born on a given day, which is $\binom nk(1/365)^k(364/365)^{n-k}=\binom nk364^{n-k}/365^n$, so the expected number of such days is $\binom nk364^{n-k}/365^{n-1}$.
@saeedehsadeghi: Let $p$ be the probability that exactly $k$ of the $n$ people are born on a given day. Then the expected number of days that that given day contributes to the total expected number of days is $(1-p)\cdot0+p\cdot1=p$. Since the contribution of all $365$ days is the same, the total expected number is just $365p$. – joriki Feb 25 '13 at 14:19
@saeedehsadeghi: There's no "when" and "now" here. The linearity of expectation doesn't rely on independence of events; it doesn't matter that the events of day $1$ having $k$ people and day $2$ having $k$ people are correlated. I'd suggest to a) work out a simple example, e.g. with $2$ of $2$ people on $2$ days, and b) take a look at the Wikipedia section I linked to (which stresses that independence isn't assumed). – joriki Feb 25 '13 at 15:57