How to compute $E[X(Y)]$? I am concerned about how to compute $E[X(Y)]$. That is $Y$ is a random variable, and for each $Y=t$, $X(t)$ is a random variable. The question raised from the following problem:
Consider the following system. Suppose that there is a Poisson arrival process, by which jobs
arrive to the system at rate $\lambda$. When a job arrives, it first arrives to an infinite-server queueing system $S_1$, in which processing times are i.i.d. exponentially distributed with rate 3 (mean $3^{-1}$). After
completing at $S_1$, a given job moves to a second infinite-server system $S_2$, where processing times are also
i.i.d. exponentially distributed with rate 3. After finishing at $S_2$, there is a third infinite-server
system $S_3$, and a fourth, etc. In fact, there is an endless chain of infinite-server systems. Whenever a job
completes at system $S_i$
, it moves to system $S_{i+1}$, at which its processing time is also i.i.d. exponentially
distributed with rate 3. Suppose it takes zero time to move between systems. Suppose that whenever
a job first arrives to the system $S_1$, it is given 1 dollar. Every time it begins service at a new system, its
wealth doubles. Thus when it arrives to $S_2$, its wealth goes from 1 dollar to 2 dollars, etc. Also suppose
that at time 0, the system is empty. Let $Z$ denote an exponentially distributed r.v. with rate 8 (mean $8^{-1}$),
independent of all else. Let Dollars($t$) denote the total amount of money collectively had by all jobs in the
system by time t, namely the sum, over all jobs in the system at time t, of the amount of money each of
those jobs has at time $t$. Thus if there are 4 jobs in the system, and one has 1 dollar, 2 have 4 dollars, and
1 has 16 dollars, Dollars($t$) would equal 25. Compute $E[\text{Dollars}(Z)].$
It seems $\text{Dollars}$ is a random variable about time, and $Z$ itself is a random variable. I try to use $E[\text{Dollars}(Z)]=\int_0^\infty \text{Dollars}(t)P(Z=t)dt$, while the $\text{Dollars(t)}$ is not deterministic. I wonder if $E[\text{Dollars}(Z)]$ is a random variable. I don't know how to compute such expectation. And to solve the whole problem, I suspect we need to use Poisson splitting for non-homogeneous Poisson process.  
 A: Define $X=Dollars(Z)$. For your main question, you can use the "law of total expectation": $$E[X] = \int_{0}^{\infty} E[X|Z=z]f_Z(z)dz  $$ 
Yet, computing $E[X|Z=z]$ for each $z\geq 0$ is not trivial and requires a bit more work. In fact, this initial conditioning may not be the best way to solve the problem.   
A better way, which is likely the way intended by the problem-maker, exploits the independent and memoryless nature of $Z$: Whenever a new job arrives before $Z$ expires, the remaining time it has to progress through the system is again exponential of rate $8$. For example, you can define $Dollars_i$ as the number of dollars generated by arrival $i \in \{1, 2, 3, ...\}$ and then: 
$$ X = \sum_{i=1}^{\infty} Dollars_i \implies E[X] = \sum_{i=1}^{\infty} E[Dollars_i] $$
and note that for each $i \in \{1, 2, 3, ...\}$: 
$$ Dollars_i = \left\{ \begin{array}{ll}
0 &\mbox{ if job $i$ arrives after time $Z$} \\
2^{K_i}  & \mbox{ otherwise} 
\end{array}
\right.$$
where $K_i$ is the number of servers job $i$ manages to see. [edit: As Connor points out below, the above $2^{K_i}$ should really be $2^{K_i-1}$.]
