<s>[INST] How to compute $\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 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?
 [/INST] You start off good:
$\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}$
But you can simplify here:
$$\frac{x}{x+y}\frac{x+m}{x+m+y}+\frac{y}{x+y}\frac{x}{x+y+m} = $$
$$\frac{1}{x+y}\left(x\cdot\frac{x+m}{x+y+m}+y\cdot\frac{x}{x+y+m} \right)= $$
$$\frac{1}{x+y}\left(x\cdot\frac{x+m}{x+y+m}+x\cdot\frac{y}{x+y+m} \right) =$$
$$\frac{x}{x+y}\left(\frac{x+y+m}{x+y+m}\right) = $$
$$\frac{x}{x+y}$$
And thus by induction, $X_1 = X_k$.
</s>