0

I'm following this problem Average length of the longest segment, but I have a mistake in how I compute part of it. The problem is that a rope of 1m is divided into three pieces by two random points. Find the average length of the largest segment.

They start by noting (their text copied)

Here we have two independent random variables $X,Y$, both uniform on $[0,1]$. Let $A=\min (X,Y), B=\max (X,Y)$ and $C=\max (A, 1-B, B-A)$. First we want to find the probability density function $f_C(a)$ of $C$. Let $F_C(a)$ be the cumulative distribution function. Then $$ F_C(a) = P(C\le a)=P(A\le a, 1-B\le a, B-A\le a).$$ By rewriting this probability as area in the unit square, I get $$F_C(a)=\left\{\begin{array}{ll} (3a-1)^2 & \frac{1}{3}\le a\le \frac{1}{2}\\ 1-3(1-a)^2 & \frac{1}{2}\le a\le 1\end{array}\right.$$

(my text) However, I can't follow how they get those probabilities. I noted (thanks saulspatz) that the inequalities can be written as \begin{align} A&\leq a\\ B&\geq 1-a\\ B&\leq A+a\\ B&\geq A \end{align} and we also have that $A\in [0,1],B\in [0,1]$. For $\frac{1}{2}\leq a\leq 1$, I 'think' that the first two inequalities give us a square of area $a^2$, and the third forces us to remove a triangle with two sides of length $1-a$ and thus area $\frac{(1-a)^2}{2}$, while the fourth forces us to remove a triangle with two sides of length $a-(1-a)=2a-1$, which has area $\frac{(2a-1)^2}{2}$. This is shown below for $a=2/3$ in the shaded area with the x-axis being $A$ and the y-axis being $B$ using wolfram alpha. enter image description here

However, this doesn't match what they did or anyone else's solution: what am I doing wrong?

mlstudent
  • 581

1 Answers1

1

One way to describe your error is that by moving from the $X,Y$-space to the $A,B$-space, you are no longer dealing with the unit square $[0,1] \times [0,1]$ as your possible space for the valid $(X,Y)$ coordinates. You are now dealing with the "upper left diagonal half" of that square as the possible space for your $(A,B)$ coordinates, the triangle formed by the points $(0,0), (1,1)$ and $(0,1)$.

So while your construction of the geometric polygon where the maximum length of the parts is at most $a$ is correct, the incorrect part is that you use that as the probability of it occuring. You are building the quotient of the area of the constructed polygon with the area of all possible values, which you assume is the whole $[0,1] \times [0,1]$ square, with area $1$. But corect would be to use the area of the triangle I described, which has area $\frac12$.

So the geometric area of your polygon is $a^2 - \frac{(1-a)^2}2 - \frac {(2a-1)^2}2$, as you correctly calculated, but the probability is actually double that, as you need to divide by $\frac12$:

$$ \begin{eqnarray} 2a^2 \color{red}{-(1-a)^2} \color{blue}{- (2a-1)^2} &=& 2a^2 \color{red}{- 1 + 2a - a^2} \color{blue}{- 4a^2 + 4a - 1}\\ &=&-3a^2+6a-2 \\ &=& 1 - (3a^2-6a+3)\\ &=& 1-3(a-1)^2 \end{eqnarray} $$

which is the result in the other answer!

But there is still a hidden assumption made here that turns out to be correct, but is worth pointing out because it may not always be true.

By divding the area of the found polygon by the area of the triangle, we implictely assume that the way we arrive at the points in that triangle makes them uniformly distributed over that triangle.

It is true, but it isn't clear or trivial at all, because we are now no longer dealing with $(X,Y)$ coordinates that come from independent, uniformly distributed random variables $X,Y$. We are know dealing with dependent, non-uniformly distributed random variables $A,B$.

That they are dependent should be clear, if you know that that $B=0.7$, $A$ can't be $0.8$ any more. That is "captured" by the $B \ge A$ condition.

That they are non-uniform can be seen by finding the probability that $B \le \frac12$. Since $B$ is the maximum of $A,B$, this is equivalent of finding the probability that $X \le \frac12, Y \le \frac12$. Since $X$ and $Y$ are independent, that probability is just the product of the separate probabilities, so we get

$$ \begin{eqnarray} P\left(B \le \frac12\right) &=& P\left(X \le \frac12, Y \le \frac12\right) \\ &=&P\left(X \le \frac12\right) P\left( Y \le \frac12\right)\\ &=& \frac12\frac12 = \frac14 \end{eqnarray} $$

If $B$ would be uniformly distributed over $[0,1]$, that probability would have to be $\frac12$.

There is a way to transform your solution to work in the 'easy to understand/argue about' X,Y space. Simply divide the $[0,1] \times [0,1]$ square into the "upper left diagonal" triangle from above and the "lower right diagonal" part formed by $(0,0),(1,1)$ and $(1,0)$. Then realize that the upper left diagonal part is where $A=X, B=Y$ and the lower right diagonal part is where $A=Y, B=X$.

Your construction in the upper left diagonal part from above works exactly the same as before, only now you get to apply it again to the lower right diagonal part, where it produces a polygonal area of the same shape (I'm sorry, I'm not that good with making a picture of that).

So now your two "good" areas combined have double the area as before, so this again leads to the same probability as above.

Ingix
  • 14,494
  • This is a really good answer. I tried to do this last night, when I was half asleep, but I kept slipping into $X,Y$-space from $A,B$-space, and getting all tangled up. I cam back to do it today, only to find that you've already written a better answer than I would have. I take your point that we have to show the points are uniformly distributed over the triangle, that is, that the probability of an event in $(A,B)$ space is proportional to its area, but I'm not sure how to go about proving it. Could you comment on this, please? – saulspatz Mar 24 '21 at 16:16
  • @saulspatz On the intuitive level, if you have a point $(a,b)$ in $A,B$-space not on the border of the triangle I mentioned, then you can draw a small circle with radius $r$ around it that is still inside the triangle. It should be easy to see that the points inside that circle in $A,B$-space come from exactly from the 2 circles centered on $(a,b)$ and $(b,a)$ with the samw radius $r$ in $X,Y$-space. So we can see that the density is doubled in $A,B$-space vs. $X,Y$-space. – Ingix Mar 24 '21 at 17:50
  • 1
    Formaly, I'd determine the joint cdf of $A$ and $B$. We have $P(A \ge a, B \le b)=(b-a)^2$ and $P(B \le b)=b^2$, so $F_{A,B}(a,b)=P(A \le a, B \le b)=b^2 - (b-a)^2= 2ab-a^2$.

    The joint pdf is then the mixed derivative, of $F_{A,B}(a,b)$ to $a$ and $b$, which comes out as the constant 2, as expected.

    – Ingix Mar 24 '21 at 17:54