Random Dental Floss Odds

Solution 1:

I understand “hit the $50$-use mark” to mean that you can tell when the $50$-th use has used up the roll, and you don't need to pick it one more time to find that it's empty.

The probability that the other roll has $0\lt k\le 50$ uses left is

$$ \mathsf P(K=k)=2^{-(100-k)}\binom{99-k}{49}, $$

since in that case you chose the now empty roll any $49$ times out of $99-k$ times and then once tonight.

I assume that you're implying that you haven't hit the $50$-use mark on the other roll yet, so we want the conditional probabilities $\mathsf P(K=k\mid K\gt0)$. Fortunately, we have $\mathsf P(K\gt0)$ by symmetry, so for $k\gt0$ we have

$$ \mathsf P(K=k\mid K\gt0)=\frac{\mathsf P(K=k\land K\gt0)}{\mathsf P(K\gt0)}=\frac{\mathsf P(K=k)}{\mathsf P(K\gt0)}=2\mathsf P(K=k)\;. $$

Thus

\begin{eqnarray*} \mathsf E[K\mid K\gt0] &=& \sum_{k=1}^{50}k\,\mathsf P(K=k\mid K\gt0) \\ &=& \sum_{k=1}^{50}k\cdot2\cdot2^{-(100-k)}\binom{99-k}{49} \\ &=& \frac{315285451704888104171289053925}{39614081257132168796771975168} \\ &\approx& 7.96\;, \end{eqnarray*}

in agreement with your simulation.

Alternatively, you could get the factor of $2$ by saying that the last use emptied either of the rolls, so you don't get a factor of $\frac12$ for the last use, and then using $2^{-(99-k)}$ for the probability of a certain pattern of choices of that or the other roll.

Solution 2:

Model your floss use as a random walk in the plane starting at $(0,0)$ and taking a unit step to the right when you pick from roll A, and a unit step up when you pick from roll B.

The first time you use up one of the rolls, there are $k$ uses remaining in the other roll, for some $k$ between $1$ and $50$. There are two mutually exclusive possibilities: you must have arrived at the point $(50, 50-k)$ by taking a step to the right of the point $(49, 50-k)$, or you arrived at the point $(50-k, 50)$ by taking a step up from the point $(50-k, 49)$.

For the first option there are $49 + (50-k)\choose 49$ ways to reach the penultimate point, followed by a step to the right; each path has probability $(1/2)^{99-k}\cdot(1/2)$, giving an overall probability of ${99-k\choose 49}(1/2)^{100-k}$. Since same result holds for the second option, the probability that the remaining roll has $k$ uses is twice this last number: $$p_k:={99-k\choose 49}\left(\frac12\right)^{99-k}.\tag1$$ To compute $E(K)$, the expected number of uses in the remaining roll, you can evaluate the summation $\sum k p_k$, as in @joriki's approach. Alternatively you can use the following device to obtain a closed form expression: Rearrange (1) into the recursion relation $$ 2[50-k]p_k = [100-(k+1)]p_{k+1},\tag2 $$ valid for all $k=1,\ldots,50$. Sum both sides of (2) over all $k$: $$ 2[50 - E(K)] = 100(1-p_1) - (E(K)-p_1).\tag3 $$ Finally rearrange (3) to obtain $$E(K)=99p_1= 99{98\choose49}\left(\frac12\right)^{98}\approx7.96.$$