In each trial the presence indicators of and are independent Bernoulli random variables, with probabilities and . Independence across trials makes their two entire indicator sequences independent. Let be the number of trials before the first ; then . Among these preceding trials, the indicators are independent with probability .
Thus the count is the random sum from part i, andAn outcome on the stopping trial contributes nothing, because the question counts only outcomes strictly before the first .