The well-known Broken Stick problem goes as follows:
Given a stick with length $1,$ if we broke it at two points randomly, then what is the probability that the three pieces can form a triangle?
It is well-known that the answer is $\frac{1}{4}.$ However, my calculations below are not able to get the answer (I got $\frac{1}{8}$ instead). I am not sure where is my mistake.
Let $X,Y$ be random variables denoting the length of first and second piece respectively. Then they follow the uniform distribution on $(0,1)$ with probability density function $1.$ So, $$ \begin{align*} \mathbb{P}(\text{formed triangle}) & = \mathbb{P}(\frac{1}{2} \leq X+Y\leq 1, 0\leq X\leq \frac{1}{2}, 0\leq Y\leq \frac{1}{2}) \\ &= \int\int_C dxdy = \text{area of }C \end{align*} $$ where $C = \{ (x,y)\in [0,1]^2: \frac{1}{2} \leq x+y\leq 1, 0\leq x\leq \frac{1}{2}, 0\leq y\leq \frac{1}{2} \}.$ However, clearly the area of $C$ is $$\frac{1}{2} \times \frac{1}{2} \times \frac{1}{2} = \frac{1}{8}.$$ I am not sure where is my mistake.
The distribution of $X$ and $Y$ is not independent (for example if $X$ happens to have length $1/2-1/10000$ then the probability that $Y$ has length $\leq 1/2$ is much greater than $1/2$).
A correct version of your kind of reasoning is: $X$ is the length of the first piece, chosen uniformly from $[0,1]$, and the $Y$ is the length of second piece, chosen uniformly from $[0,1-X]$. So the integral to be calculated is $1/8$ as you say, but to correct the calculation we need to recall that our probability is conditional on $Y\leq 1-X$, so we need to divide it by the probability of that happening, which is $1/2$.