Can three sticks make a triangle? - statistical method of solving

460 Views Asked by At

I was challenged to provide as many solutions as I could to the triangle problem:

Given a stick of arbitrary length broken into three pieces of independently random lengths, what is the probability that the three pieces can form a triangle.

The answer of course is 25%, that is not in doubt. However I am unsure about a solution method that I came up with. Please let me know if this works?

1) Select the longest piece and place it on the ground standing straight up.

2) Set the other two pieces on top of the first, in random order forming a pole of arbitrary length. Call this length 100.

3) Let the two "breaks" between the three poles be labeled x, for the bottom break and y for the upper break.

4) It is obviously true that the condition in which x is less than 50 is now the exclusive condition in which the three pieces can form a triangle (since the bottom piece is the longest, and it is less than half the total length.

Here's the part I'm unclear about...we're going to sample the possible states.

5) Randomly select between x and y. There is a 50% chance of choosing x (the bottom break).

6) If you have chosen X, evaluate the height of x.

7) Since x represents the length of largest piece, it must be greater than 33.333 (this is due to our earlier ordering performed in step 1)

8) However, the total possible length of x has not changed, so it ranges randomly from 33.333 to 100.

9) Therefore, there is a 1/6 chance that it is below 50.

10) Since we eliminated 2/3rds of our permutation space in step one by selecting the longest piece as the bottom piece, and because our evaluation of height x is directly dependent on that reduced permutation space, we now multiply our result by 3. So, 3*(1/6)=50% chance that it is below 50 after this rescaling.

To be clear, we reduced our permutations to one third of their original number by selecting the longest piece to be the bottom piece, then sampled the frequency of on affected attribute (length), then multiplied our result by three in order to rescale back to the original full set of permutations.

11) So, we have 50% of choosing the bottom piece (x) from step 5, and a 50% chance of that piece being less than half the total length from step 10, for a total of 25% of all possible samples meeting the criteria for triangularity.

Obviously this has the advantage of being correct, but I'm not entirely sure how that rescaling business works. To my mind, I have sampled to entire space fairly, just did a little scaling trickery while keeping careful track of where and what to rescale back at the end.

It makes intuitive sense to me, but I'd love to hear someone explain it a bit?

Thanks!

1

There are 1 best solutions below

1
On

Statement 8 is wrong when it is suggesting that the length of the longest piece is uniformly distributed between a third of the length of the original stick and the whole length.

$$F_{\square}(x)=\begin{cases} 0 & \text{for } x \leq \frac l3, \\ \frac32(\frac x l-\frac13) & \text{for } \frac l3 < x \leq l, \\ 1 & \text{for } l \leq x. \end{cases}$$

It actually has a triangular distribution on that support, with a mode of half the length of the original stick.

$$F_{\triangle}(x)=\begin{cases} 0 & \text{for } x \leq \frac l3, \\ 9(\frac x l-\frac13)^2 & \text{for } \frac l3 < x \leq \frac l2, \\ 1-3(1-\frac x l)^2 & \text{for } \frac l2 < x < l, \\ 1 & \text{for } l \leq x. \end{cases}$$

Both distributions make the probability of the length of the longest piece being between a third and half of the length of the original stick be $\frac14$

so your method produces the correct answer for the wrong reason.