discrete expected number of trials before success A directory on a computer’s hard disk contains 12 files, 3 of which have viruses. If a file with a 
virus is selected, the virus is detected and another file is then selected. Find the expected 
number of files that must be selected in order to get a virus-free file. This is without replacement so 12 files in total to work with (3 virus, 9 clean) 
Is this the correct way to do this problem? 
1 + (n/(b+1)) where b is # of clean files and n is # of viruses
The answer I believe to be between 1 and 4, your best and worst case scenarios. 
Using that formula I get 1.3 but I'm not sure it's correct. 
 A: \begin{cases}
\Pr(\text{1st is virus-free)}) & = \dfrac9{12} \\[6pt]
\Pr(\text{1st is infected & 2nd is virus-free}) & = \dfrac 3{12}\cdot\dfrac 9 {11} \\[6pt]
\Pr(\text{1st & 2nd are infected and 3rd is virus-free}) & = \dfrac 3 {12}\cdot\dfrac 2 {11}\cdot\dfrac 9 {10} \\[8pt]
\Pr(\text{1st, 2nd, & 3rd are infected}) & = \dfrac 3{12}\cdot\dfrac 2 {11}\cdot\dfrac 1 {10}
\end{cases}
In the last case, the fourth one is necessarily clean.
So $1$ times the first probability plus $2$ times the second plus $3$ times the third plus $4$ times the fourth is the expected number needed to get a virus-free file.
A: We use the notation of the post, with $n$ the number of viruses and $b$ the number of clean files. Of course we assume that $b\ge 1$. Let the viruses be labelled $v_1$ to $v_n$
For $i=1$ to $n$, let $X_i=1$ if the  virus labelled $v_i$ comes before any clean file, and let $X_i=0$ otherwise. Then the number of trials up to and including the first clean file is $1+X_1+\cdots+X_n$. By the linearity of expectation our expected number of trials is 
$$1+E(X_1)+E(X_2)+E(X_n).$$
The probability that the virus labelled $v_i$ comes before any clean file is $\frac{1}{1+b}$. We conclude that the required expectation is $1+\frac{n}{b+1}$.
Remark: Alternately, one can first find the distribution of the number of trials. But the method of indicator random variables  that we used is more efficient.
