This basic course on probability and statistics is the first course where I feel like a total idiot... especially since I've already forgotten much from the basic courses at discrete mathematics and analysis. Sigh...

The task from a former test:

> 
> A HDD contains $x+y$ infected programs; $x$ are infected by malware $X$ and $y$ are infected by malware $Y$. The user runs random programs. Each time a program infected by malware $X$ is run $m$ uninfected programs become infected by malware $X$; same for malware $Y$. Compute the probability that when the $k$th infected program is run it is infected by malware $X$.
> 
> 
> 

Let $X\_1=1$ iff the first infected program is infected by $X$, similary let's define $Y\_1$, $X\_2$, etc.

We have:

$\operatorname{P}(X\_1)=\frac{x}{x+y}$

$\operatorname{P}(Y\_1)=\frac{y}{x+y}$

$\operatorname{P}(X\_2)=\operatorname{P}(X\_1)\operatorname{P}(X\_2|X\_1)+\operatorname{P}(Y\_1)\operatorname{P}(X\_2|Y\_1)=\frac{x}{x+y}\frac{x+m}{x+m+y}+\frac{y}{x+y}\frac{x}{x+y+m}$

$P(Y\_2)=\operatorname{P}(X\_1)\operatorname{P}(Y\_2|X\_1)+\operatorname{P}(Y\_1)\operatorname{P}(Y\_2|Y\_1)=\frac{x}{x+y}\frac{y}{x+m+y}+\frac{y}{x+y}\frac{y+m}{x+y+m}$

$\operatorname{P}(X\_3)=\frac{x}{x+y}\frac{x+m}{x+m+y}\frac{x+2m}{x+2m+y}+\frac{y}{x+y}\frac{x}{x+y+m}\frac{x+m}{x+m+y+m}+\frac{x}{x+y}\frac{y}{x+m+y}\frac{x+m}{x+m+y+m}+\frac{y}{y+m}\frac{y+m}{x+y+m}+\frac{x}{x+y+2m}$

More generally:

$\operatorname{P}(X\_k)=\sum^k\_{i=0}{k\choose i}\frac{\prod\_{j=0}^{i-1}(x+jm)\prod\_{j=0}^{k-i-1}(y+jm)}{\prod\_{j=0}^{k-1}(x+y+jm)}$

This is madness for me. That's not even binomial theorem, albeit it's a little bit similar.

Am I doing something wrong? Or how am I supposed to get a closed formula from this sum?