EXAMPLE: A 7-segment display shows any number from 0 to 9 at random (equal probabilities).
![]() |
|---|
We can define conditional CDF or conditional PMF in the obvious
way.
It is important to understand that the conditional
expectation/variance is a random variable, which is a function of
the conditioning random variable.
Proof: Let $X$ take values $x_1,x_2,...$ and $Y$ take values $y_1,y_2,...$. Let the joint PMF of $(X,Y)$ be $$ P(X=x_i~\&~Y=y_j) = p_{ij}. $$ Then $P(Y=y_j | X=x_i) = \frac{p_{ij}}{p_{i\bullet}}.$
So $E(Y|X=x_i) = \sum_j y_j \frac{p_{ij}}{p_{i\bullet}}.$ Expectation of this is $$ \sum_i E(Y|X=x_i) p_{i\bullet} = \sum_i \sum_j y_j \frac{p_{ij}}{p_{i\bullet}}p_{i\bullet} = \sum_i \sum_j y_j p_{ij} = \sum_j y_j \sum_i p_{ij} = \sum_j y_j p_{\bullet j} = E(Y), $$ as required. [QED] Many expectation problems can be handled step-bystep using this result. Here are some examples.EXAMPLE: A casino has two gambling games:
The tower property is very useful for computing expectations
involving a random number of random variables. Here is an
example.
EXAMPLE: A random number $N$ of customers enter a shop in a day, where $N$ takes values in $\{1,...,100\}$ with equal probabilities. The $i$-th customer pays a random amount $X_i$, where $X_i$ takes values in $\{1,2,...,10+i\}$ ith equal probabilities. Assuming that $N,X_1,...,X_N$ are all independent, find the total expected payments by the customers on that day.
SOLUTION: We have $E(X_i) = \frac{11+i}{2}.$ So $E\left(\sum_1^N X_i|N\right) = \sum_1^N E(X_i|N) = \sum_1^N E(X_i) = \sum_1^N \frac{11+i}{2} = 5.5N+\frac{N(N+1)}{4}.$ By tower property, the required answer is $E\left(5.5N+\frac{N(N+1)}{4}\right)=\cdots.$
EXAMPLE: 10 holes, numbered 1 to 10, in a row. 5 balls are dropped randomly in them (a hole may contain any number of balls). Call a ball "lonely" if there is no other ball in its hole or the adjacent holes. Find the expected number of lonely balls.
SOLUTION: Define the indicators $I_1,...,I_5$ as $$ I_i = \left\{\begin{array}{ll}1&\text{if }i\mbox{-th ball is lonely}\\0&\text{otherwise.}\end{array}\right. $$ Then the total number of lonely balls is $X = \sum I_i.$ So we are to find $E(X) = \sum E(I_i).$ Let $Y_i = $ the hole where the $i$-th ball has fallen. Then $E(I_i|Y_i=1)$ is the conditional probability that all the balls except the $i$-th one has landed in holes $2,...,10$ given that the $i$-th ball has landed in hole 1. You should be able to compute this easily. Similarly, you can compute $E(I_i|Y_i=k)$ for $k=1,...,10.$ Notice that $Y_i$ can take values $1,...,10$ with equal probabilities. So tower property should provide the answer as $$ E(X) = \sum E(E(I_i|Y_i)) = \cdots. $$
Proof: This follows directly from the tower property.
We know $$ V(Y|X) = E(Y^2|X) - E^2(Y|X), $$ and hence $$ E(V(Y|X)) = E(E(Y^2|X)) - E(E^2(Y|X)) = E(Y^2) - E(E^2(Y|X)). $$ Again, $$ V(E(Y|X)) = E(E^2(Y|X)) - E^2(E(Y|X)) = E(E^2(Y|X)) - E^2(Y). $$ So $$ E(V(Y|X)) + V(E(Y|X)) = E(Y^2)-E^2(Y) = V(Y), $$ as required. [QED]Proof: This follows immediately from the definition of conditional probability. [QED]













Let $I_j$ be the indicator variable for whether there is a
record at position $j.$ Then $P(I_j=1)$ may be computed
by total probability:
$$
P(I_j=1) = \sum_{k=j}^n P(X_j=k)P(I_j=1|X_j=k).
$$
Similarly for $P(I_jI_k=1).$
The problem is basically optimising $\sum P_i^2$ subject
to $\sum P_i$ being fixed. Cauchy-Scwartz might help.
This problem (from Ross)
refers to Example 2m. Here is that example.

















