# Breaking stick consecutively

There are a lot of questions here for the task of breaking a stick of length 1 into three parts such that they form a triangle. I came across a bit more complex version of it when the breaks are done consecutively. Namely, first we do the first break, then take the longer part and break it once again. I was trying to derive the CDF of second break, i.e. length of the left part after the second break.

This is what I have got so far. Let us denote $$A$$ as the length of the left part after the first break, and $$B$$ as the length of the left part after the second break. Thus, I have to find $$F_B(x)=P(B.

I know that $$A\sim U[0,1]$$, thus

$$\begin{equation*} F_A(x)=\begin{cases} 0 \quad &\text{if} \, x \leq 0 \\ x \quad &\text{if} \, 01 \\ \end{cases} \end{equation*}$$

It is also obvious that $$B|A\sim U[0, \max(A,1-A)]$$ and $$\begin{equation*} F_{B|A}(x|a)=\begin{cases} 0 \quad &\text{if} \, x \leq 0 \\ \frac{x}{\max(a,1-a)} \quad &\text{if} \, 0\max(a,1-a) \\ \end{cases} \end{equation*}$$

Thus unconditioned CDF can be computed as $$F_B(x)=\int_{-\infty}^{+\infty}F_{B|A}(x|a)f_A(a)da=\int_0^1F_{B|A}(x|a)da$$

And here I am stuck since I cannot understand how this integral can be calculated.

Any help is much appreciated.