Breaking a unit stick uniformly into two pieces I need help with the following question:
A unit stick is broken at a point chosen at random (uniformly), what is the expected value of the longer piece?
I tried this:
X - the point chosen, $X\sim Uni[0,1]$
Y - the longer piece.
if $X>\frac12$ then $Y=X$, else if $X\le\frac12$ then $Y=1-X$
I wanted to calculate $P(Y\le y)$ but I'm having trouble with that.
$P(Y\le y)=P(\max(X,1-X)\le y) = P(1-y\le X\le y)$
(I wanted to calculate PDF, then find density and calculate the expected value)
Can give me a hint on how to procced from here?
I have seen some similar questions asked here but I could not understand the solutions suggested
 A: As you always take the greater piece it's the same as taking the expected value of a uniformly distributed random variable between $0.5$ and $1$. Why?
You can write your expected value as
$$
E[Y] = \frac 1 2 \cdot E[Y|X\geq 0.5] + \frac 1 2 \cdot E[Y|X \leq 0.5]
$$
because $X$ is uniform, so $P(X\geq 0.5) = P(X\leq 0.5) = \frac 1 2$.
However, $E[Y|X\geq 0.5]=E[Y|X\leq 0.5]$, because each possibility for $Y$ on the LHS has a correspondence on the RHS (just the shorter and longer stick switch places). So we get
$$
E[Y] = E[Y|X\geq 0.5] = E[X|X\geq 0.5] = E[Z] = \frac 3 4
$$
where $Z$ is a uniformly distributed random variable on $[0.5,1]$, because given that $X\geq 0.5$ we already know that $X$ is the biggest stick and uniformly distributed between $0.5$ and $1$.
A: I will give you two solutions, one using the method you wanted and one that I think is a little bit better and quicker.
Your method:
$\mathbb{P}[Y \leq y ] = 1 - \mathbb{P}[Y > y]$ ( a little sketch might help now but here is how the longer piece can be greater than $y$. Either the first cut is less than $1-y$ or it is greater than $y$. Both have probability $1-y$. Hence $\mathbb{P}[Y \leq y ] = 1 - 2(1-y) = 2y - 1$
Note that this is only valid for $ \frac{1}{2} \leq y \leq 1$ as the larger piece is always greater than $\frac{1}{2}$.
Hence the CDF of $Y$ is $F_Y(y)=$ \begin{cases}  
      0 & y< \frac{1}{2} \\
      2y-1 & \frac{1}{2}\leq y\leq 1  
   \end{cases}
Hence, by differentiation, the PDF of $Y$ is $f_Y(y)=$ \begin{cases}  
      0 & y< \frac{1}{2} \\
      2 & \frac{1}{2}\leq y\leq 1  
   \end{cases}
And lets integrate this to yield: $\mathbb{E}[Y] = \int_{\frac{1}{2}}^1 y\cdot2 dy =  \int_{\frac{1}{2}}^1 2y dy = \frac{3}{4}$
My method
Let us take advantage of symmetry it should be clear that given $X<\frac{1}{2}$ and given $X>\frac{1}{2}$ the longest side should be the same. And so as these two cases make up every possibility (and are disjoint) we have $\mathbb{E}[Y] = \mathbb{E}[Y | X \geq \frac{1}{2}]$. In the case that $X \geq \frac{1}{2}$ the longest piece is simply $X$ and the expected value of a uniform variable that is greater than $\frac{1}{2}$ is just $\frac{\frac{1}{2} +1}{2} = \frac{3}{4}$
