Expected and Variance of the length of a broken stick

46 Views Asked by At

A stick of length 1 is snapped into two at a point $U \sim$ Uniform$(0,1)$. What is the expected length and variance of the piece containing $s$, where $s$ is some fixed number between $0$ and $1$?
I have defined the continuous random variable $L$ to be the length of the part of the stick containing the point $s$. Then, I have considered cases:

If $U<s$, then $L=1-U$
If $U>s$, then $L=U$
Also, note that since $U\sim$ Uniform$(0,1)$, we have that:
$$ f_U(x) = \begin{cases} 1 & \text{if } x \in (0,1) \text{ and } 0 \text{ otherwise}\end{cases} $$ Also, $\mathbb{P}(U < s) = \int_{0}^{s} 1 \mathrm{d}x = s$, and similarly, $\mathbb{P}(U>s) = 1-s$, so $L=1-U$ with probability $s$ and $L=U$ with probability $1-s$.
We can think of the values that $\mathbb{E}[L]$ would take in each case as a separate random variable, call it $M$. Then, $M$ is a discrete random variables, with two outcomes, one for each case:
(1) $U<s$, so $L=1-U$ and $M=1-\frac{s}{2}$
(2) $U>s$, so $L=U$ and $M=\frac{1}{2}+\frac{s}{2}$
I claim, then, that $\mathbb{E}[L]=\mathbb{E}[M] := \sum_{m \in M(\Omega)} m \mathbb{P}(M=m) = s(1-\frac{s}{2})+(1-s)(\frac{1}{2}+\frac{s}{2}) = -s^2 + s +\frac{1}{2}$
As for the variance:
Recall that Var$(L)=\mathbb{E}[L^2]-\mathbb{E}[L]^2$. To calculate $\mathbb{E}[L^2]$, note that, similarly to before:
(1) $L^2 = (1-U)^2 = 1-2U+U^2$ with probability $s$
(2) $L^2 = U^2$ with probability $s$
So define the discrete random variable $M$ similarly to before, with $M$ taking on the value of the expected value of $L$ in each case:
So, $M$ has two possible outcomes:
(1) $U<s$, so $M = \mathbb{E}(U^2)-2\mathbb{E}(U)+1 = \frac{1}{3}s^3$
(2) $U>s$, so $M = \mathbb{E}(U^2) = \frac{1}{3}-\frac{1}{3}s^3$
So, I claim that $\mathbb{E}[L^2] = \mathbb{E}[M] := \sum_{m \in M(\Omega)} m \mathbb{P}(M=m) = \frac{1}{3}s^3s+(\frac{1}{3}-\frac{1}{3}s^3)(1-s) = \frac{2}{3}s^4-\frac{1}{3}s^3-\frac{1}{3}+\frac{1}{3}$. Then, this implies that Var$(L) = \frac{2}{3}s^4-\frac{1}{3}s^3-\frac{1}{3}s+\frac{1}{3}-(-s^2+s+\frac{1}{2})^2 = -\frac{1}{3}s^4-\frac{7}{3}s^3+\frac{2}{3}s+\frac{7}{12}$, but this expression is mostly negative on the interval $(0,1)$. Can someone point out my mistake please?

1

There are 1 best solutions below

3
On BEST ANSWER

You can do much of this directly by noting that $$L(U \mid s) = \begin{cases} 1-U, & U \in [0,s] \\ U, & U \in (s,1] \end{cases}$$ hence for a positive integer $k$ $$\begin{align} \operatorname{E}[L^k] &= \int_{u=0}^1 L(U \mid s)^k f_U(u) \, du \\ &= \int_{u=0}^s (1-u)^k \, du + \int_{u=s}^1 u^k \, du \\ &= \int_{v=1-s}^1 v^k \, dv + \left[\frac{u^{k+1}}{k+1}\right]_{u=s}^1 \\ &= \left[\frac{v^{k+1}}{k+1}\right]_{v=1-s}^1 + \frac{1 - s^{k+1}}{k+1} \\ &= \frac{1 - (1-s)^{k+1} + 1 - s^{k+1}}{k+1} \\ &= \frac{2 - s^{k+1} - (1-s)^{k+1}}{k+1}. \end{align}$$ Hence $$\operatorname{E}[L] = \frac{2 - s^2 - (1-s)^2}{2} = \frac{1}{2} + s - s^2,$$ $$\operatorname{E}[L^2] = \frac{2 - s^3 - (1-s)^3}{3} = \frac{1}{3} + s - s^2,$$ and $$\operatorname{Var}[L] = \operatorname{E}[L^2] - \operatorname{E}[L]^2 = \frac{1}{12} - s^2 (1-s)^2.$$


If we use your conditioning approach, the correct computation of the second moment of $L$ is $$\begin{align} \operatorname{E}[L^2] &= \operatorname{E}[(1-U)^2 \mid U \le s]\Pr[U \le s] + \operatorname{E}[U^2 \mid U > s]\Pr[U > s] \\ \\ &= (1 - 2\operatorname{E}[U \mid U \le s] + \operatorname{E}[U^2 \mid U \le s])s \\ &\quad + \operatorname{E}[s^2 + 2s (U-s) + (U-s)^2 \mid U > s](1-s) \\ \\ &= \left(1 - 2\cdot \frac{s}{2} + \frac{s^2}{3}\right)s + \left(s^2 + 2s \cdot \frac{1-s}{2} + \frac{(1-s)^2}{3} \right)(1-s) \\ \\ &= \frac{1}{3} + s - s^2. \end{align}$$ Note that in the case where we wanted to calculate $\operatorname{E}[U^2 \mid U > s]$, we had to do a location shift because the variable $U \mid U > s$ is uniform on $[s, 1]$, so while the first moment $\operatorname{E}[U \mid U > s]$ is easy (it is simply $(s+1)/2$), the calculation of the second moment without resorting to explicit integration requires us to consider the shifted variable $U - s \mid U > s$, which is uniform on $[0, 1-s]$, for which we know that the second moment is $$\operatorname{E}[(U - s)^2 \mid U > s] = \frac{(1-s)^3}{3(1-s)} = \frac{(1-s)^2}{3}.$$

I think you can see that this calculation is not any easier than the direct route. The desire to avoid a direct calculation through integration leads to a more conceptually difficult process. Moreover, the direct calculation is easily generalized and furnishes the general $k^{\rm th}$ moment of $L$, which means we only have to integrate once, yet we get both the first and second moments.