There are $m$ male and $f$ female students in a class (where $m$ and $f$ are each less than 365) What is the probability that a male student shares a birthday with a female student?
I have attempted the method suggested by Alex in his comment on the linked question.
The number of ways to allocated dates for males and female students is $$365^m \times(365-m)^f$$
The total number of ways to allocate birthdays without restriction to $m+f$ students is $365^{m+f}$. Hence, the probability of getting a shared birthday, using complementary probability is: $$1 - \frac{365^m \times(365-m)^f}{365^{m+f}}=1 - \frac{(365-m)^f}{365^{f}}$$
Is the approach/calculations correct?
(Comment) 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≤j≤k$ bins. Then find $P(Sc)$, probability of these events. $1−P(Sc)$ is what you want
It will be easy to first compute the probability that no male and female share the same birthday.
So we begin by computing the $u_{i}$ ways of having $m$ males among exactly $% i$ known different birthdays. $u_{i}$ is then given by : \begin{eqnarray*} u_{i} &=&\sum_{\substack{ m_{1}+\cdots +m_{i}=m \\ m_{1}\wedge \cdots \wedge m_{i}\not=0}}\frac{m!}{m_{1}!\cdots m_{i}!} \\ &=&i^{m}-iu_{i-1}-\frac{i!}{2!\left( i-2\right) !}u_{i-2}-...-iu_{1} \\ &=&\sum_{k=1}^{i}\frac{\left( -1\right) ^{i-k}i!k^{m}}{\left( i-k\right) !k!} \end{eqnarray*}
Let $v_{j}$ is the number of ways of having $f$ females among exactly $j$ known different birthdays. But there are $\frac{365!}{i!j!\left( 365-i-j\right) !}$ ways of choosing $i+j$ different birthdays, so the probability $P$ you are looking for is : \begin{eqnarray*} P=1-356^{-\left( m+f\right) }\sum_{\substack{ i\leq m \\ j\leq f}}\frac{365!% }{i!j!\left( 365-i-j\right) !}u_{i}v_{j} \end{eqnarray*}
An other method, after considering $u_{i}$, is to compute the number $w_{i}$ of ways of having $f$ females among the remaining $365-i$ different birthdays. Then : \begin{eqnarray*} w_{i}=\left( 365-i\right) ^{f} \end{eqnarray*} But there are $\frac{365!}{i!\left( 365-i\right) !}$ ways of choosing $i$ different birthdays, so the probability $P$ you are looking for is :
\begin{eqnarray*} P=1-356^{-\left( m+f\right) }\sum_{i\leq m}\frac{365!\left( 365-i\right) ^{f}% }{i!\left( 365-i\right) !}u_{i} \end{eqnarray*}