How to show this conditional expectation? 
A factory has produced $n$ robots, each of which is faulty with probability $\phi$. To each robot a test is applied which detects the fault (if present) with probability $\delta$. Let $X$ be the number of faulty robots, $Y$ be the number detected as  faulty. Assuming the usual independence (each $x_i$ are iid and each $y_i$ are iid), show that
  $$E(X\mid Y=y)=\frac{n\phi(1-\delta)+(1-\phi)y}{1-\phi\delta}.$$

My progress is:  
$E(X|Y)=\sum_{x=0}^{n}xP(X=x\mid Y=y)$ and $P(X=x\mid Y=y)=\dfrac{P(X=x, Y=y)}{P(Y=y)}$. Where the numerator is ${n\choose x} \phi^x (1-\phi)^{n-x} {x\choose y}\delta^y(1-\delta)^{x-y}$, and denominator is $\sum_{x=0}^{n}{x\choose y}\delta^y(1-\delta)^{x-y}$. This sum is really hard to do it by hand.
 A: Each robot is either faulty or functioning. Furthermore, each robot either passes the test or fails the test.
Functioning robots will never fail the test.
You know that $y$ robots were faulty and failed the test.
The remaining $n-y$ robots all passed the test, but are either functioning or faulty.
Thanks to independence, we can find the probability that any given one of the remaining robots is faulty:
$$P(\text{faulty} \mathop{|} \text{passed})
= \frac{P(\text{passed}\mathop{|}\text{faulty})P(\text{faulty})}{P(\text{passed})}
% =\frac{(1-\delta)\phi}{\phi(1-\delta)+(1-\phi)}
= \frac{(1-\delta)\phi}{1-\phi\delta}$$
Then
$$\begin{align}
& E[X|Y=y] 
\\ & = y + E[\text{number of robots that passed and are faulty}\mathop{|}y\text{ robots were faulty and failed}]
\\ &= y + (n-y)P(\text{faulty} \mathop{|} \text{passed})
\\ &= y + (n-y)\frac{(1-\delta)\phi}{1-\phi\delta}
\end{align}$$
Rearranging terms gives you the result.

Edit: Here is a table to help visualize what information is given, and how you should use Bayes' Rule.
\begin{array}{c|c|c}
 & \text{passed} & \text{failed}  \\ \hline \text{faulty} &  & y \\ \hline \text{functioning} &  & 0 \\ \hline \textbf{total} & n-y & y\\ 
\end{array}
