There are $30$ students in a class. The lecturer has noted the birthday (month and day) of each student in the class. Assume that all the students in the class have birthdays that are independent, that there are $365$ days in a year, and that any day is equally likely to be the birthday of a particular student. What is the probability that at least one male and one female student shared the same birthday if:
(i) There are $15$ male students and $15$ female students.
(ii) There are $10$ male students and $20$ female students.
(Note: Shared birthdays between, say, two male students do not count)

For (i), since the number of male and female students are equal, we can form $15$ pairs, each consists of $1$ male and $1$ female student. Therefore the number of distinct birthday for a pair is $365^2$ and the required probability is:
$P = 1-\frac{{{{365}^2} \times ({{365}^2} - 1) \times ... \times ({{365}^2} - 14)}}{{{{365}^2}}}$
As for part (ii), I haven't figured out how to do it. Any help is appreciated, thanks!

  • 1
    $\begingroup$ It is quite convenient to look at both questions as $P(S)=1-P(\textit{ no female and male have birthday on the same day})$ where $S$ is the desired event $\endgroup$
    – Alex
    Nov 25, 2012 at 4:14
  • $\begingroup$ @Alex: Can you elaborate a little more on this? $\endgroup$
    – drawar
    Nov 25, 2012 at 6:40
  • 2
    $\begingroup$ Start with finding all ways of putting $k$ identical while balls into $n=365$ bins (each bin may contain up to $k$ balls). Then find the number of ways of putting $m$ identical black balls in the remaining bins $n-j, 1 \leq j \leq k$ bins. Then find $P(S^c)$, probability of these events. $1-P(S^c)$ is what you want $\endgroup$
    – Alex
    Nov 25, 2012 at 8:13
  • $\begingroup$ I don't understand your reasoning for the first part. $\endgroup$
    – leonbloy
    Aug 21, 2013 at 2:46
  • $\begingroup$ drawar, could you perhaps streamline this question, so remove any irrelevant information, you could probably get rid of the attempt for (i) since it seems to be incorrect... $\endgroup$
    – Garrett
    Mar 12, 2014 at 9:11

1 Answer 1


Let $M,F$ be the amount of males and females, and $D=365$ the amount of available days.

Then the total number of configurations that don't have a male-female pair with the same birthday is

$$ \sum_{k=1}^M {D \choose k} k! \, S_{M,k} (D-k)^F $$

Here $k$ is be the amount of different birthdays for the male population; and $S_{M,k}$ is the Stirling number of the second kind.

Hence $$ p=1- \frac{\sum_{k=1}^M {D \choose k} k! \, S_{M,k} (D-k)^F}{D^{F+M}} $$

  • $\begingroup$ In the first equation, $S_{M,k}$ is the number of ways to group the males into "same-birthday groups" with at least one male per birthday; $\binom{D}{k}$ is the number of ways to choose the particular $k$ days; and $k!$ is the number of ways to assign the $k$ groups (of males) to the chosen days. With the males sorted, $(D-k)^F$ is the number of ways the females can be arranged where they don't land on a male's birthday. $\endgroup$
    – Garrett
    Mar 12, 2014 at 9:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .