A stick of length 1 is broken in a random place that is U(0, 1). Let X be the length of the longer piece and let Y be the length of the shorter piece.

A stick of length $1$ is broken in a random place that is $U(0, 1)$. Let $X$ be the length of the longer piece and let $Y$ be the length of the shorter piece.

$a)$ Find the pdf and expected value of $X$.

$b)$ Find the pdf and expected value of $Y$.

$U \sim U(0,1)$

I got to the point where I have an equation for the cdf of $X$:

$$\frac{1}{2}[P(1-U \leq X \:\:|\:\: U < \frac{1}{2}) + P(U \leq X \:\:|\:\: U > \frac{1}{2})]$$

but I don't know how to get the pdf from that at all.

Any help on this question would be appreciated.


Solution 1:

$U \sim U(0,1)$

Define $X = \text{max}\{U, 1-U\}$

so that

$$X = \begin{cases} 1-U, & 0 < U < 1/2 \\ U, & 1/2 \leq U < 1 \end{cases} $$

It follows that

$$X = \frac{1 + |2U - 1|}{2}$$


$$F_X(x) = P (X \leq x), \:\:\:\: 1/2 < x < 1$$

$$=P\left(\frac{1 + |2U - 1|}{2} \leq x \right)$$

$$=P(|2U - 1| \leq 2x-1)$$

$$=P(-2x+1 \leq 2U - 1 \leq 2x-1)$$

$$=P(1-x \leq U \leq x)$$

$$=P(1-x < U \leq x)$$

$$=F_U(x) - F_U(1-x)$$

Differentiating with respect to $x$:

$$f_X(x) = f_U(x) + f_U(1-x), \:\:\:\:\: \text{for}\:\:\: 1/2 < x < 1$$

It follows that

$$f_X(x) = \begin{cases} 2, & \text{if}\:\:\:1/2 < x < 1, \\ 0, & \text{otherwise} \end{cases} $$

and since we have for a uniform variable

$$f_Z(z) = \begin{cases} \frac{1}{b-a}, & \text{if}\:\:\:a < z < b, \\ 0, & \text{otherwise} \end{cases} $$

$$E[Z] = \frac{b+a}{2} $$

It follows that

$$E[X] = \frac{1 + 1/2}{2} = \frac{3}{4} $$