The lifetime $X$ (in days) of a device has an exponential distribution with parameter $\lambda.$ Moreover, the fraction of time which the device is used each day has a uniform distribution over the interval $[0,1],$ independent from one day to the other. Let $N$ be the number of complete days during which the device is in a working state.
(a) Show that $P[N\geq n]=(1-e^{-\lambda})^n/\lambda^n,$ for $1,2,\dots$
Also,
(b) $E(N \mid N \leq 2 )$
Attempt:
I believe the trick here is the law of total probability
$$ P(N \geq n) = \int_0^{\infty} P(N \geq n \mid X \leq x) f_X(x) dx $$
My trouble is in computing $P(N \geq n \mid X \leq x)$. Im having difficulties on this part. How can we interpret it?
As for b), once we show a), we can just use the fact that $E(X) = \sum P(X > x) $. To see that
$$ E(N \leq N \leq 2) = \sum_{n=1}^2 P(N \geq n) = \frac{1-e^{-\lambda}}{\lambda} + \frac{(1-e^{-\lambda})^2}{\lambda^2} $$
am I on the right track so far?