# Probability that a stick randomly broken in five places can form a tetrahedron

Edit (March. 2014) This question has been moved to mathoverflow; see here.

Randomly break a stick in five places.

Question: What is the probability that the resulting six pieces can form a tetrahedron?

Clearly satisfying the triangle inequality on each face is a necessary but not sufficient condition; an example is provided below.

Furthermore, another commenter kindly points to a reference that may be of help in resolving this problem. In particular, it relates the question of when six numbers can be edges of a tetrahedron to a certain $5 \times 5$ determinant.

Finally, a third commenter points out that since one such construction is possible, there is an admissible neighborhood around this arrangement, so that the probability is in fact positive.

In any event, this problem is far harder than the classic $2D$ "form a triangle" one.

Several numerical attacks can be found below; I will be grateful if anyone can provide an exact solution.

-
Of course, triangle inequalities are not sufficient, simple counterexample: 5,5,5,5,5,9. –  Egor Skriptunoff Apr 7 '13 at 8:31
A Theorem of Menger (1928) says six lengths are edges of a non-degenerate tetrahedron iff (1) the triangle inequality is satisfied by all faces, and (2) the Cayley-Menger determinant is positive. This PDF ("Edge lengths determining tetrahedrons" by Wirth and Dreiding) references Menger's result: google.com/… –  Blue Apr 7 '13 at 9:52
@Thus: The answer is strictly positive. There is at least one admissible configuration, where all lengths are equal; since all required inequalities are fulfilled at this point, they're fulfilled in a neighbourhood of this point; that neighbourhood has non-zero measure. –  joriki Apr 7 '13 at 12:41
If I didn't make any mistake, a brute force $N = 10^6$ simulation find 65505 tetrahedra. This gives us an estimate of the probability $p \sim 0.0655$. Since the outcome is binary, the standard derivation in estimation of $p$ should be of the order of $\sqrt{\frac{p(1-p)}{N}} \sim 0.00025$. –  achille hui Apr 7 '13 at 13:32
@ChristianBlatter: Yes, Menger's Theorem addresses the tetrahedrality of a set of lengths that are already presumed to determine a face structure. OP mentions satisfaction of the triangle inequality on faces as a necessary condition, acknowledging that arranging his sub-sticks around faces is a first step to testing viability. Clearly, with an un-ordered collection of sub-sticks, one needs to test multiple arrangements (taking care not to distinguish between arrangements that determine identical face structures). How this figures into a probability argument is for someone else to say. –  Blue Apr 7 '13 at 15:32

Not an answer, but it might help to progress further. [The derivation that follows provides a strict -but practically useless- bound. The second part of the answer has some results that might be of interest, but they are merely empirical]

Let's consider the (much more restricted) event that the six lengths form a tetrahedron in whatever order. In the linked pdf this set of lengths is called "completely tetrahedral", and a necessary-sufficient condition is given (Theorem 4.2) which is equivalent to the following: $u \le \sqrt{2}v$, where $u,v$ are the maximum and minimum lengths. This, informally, would correspond to "almost regular" tetrahedra. Let's then compute the probability that the lengths are completely tetrahedral. Because the points are chosen at random, uniformly, the lengths are probabilistically equivalent to a set of iid exponential variables with arbitrary parameter, conditioned to a constant sum. Because we are only interested in ratios, we can even ignore this conditioning. Now, the joint probability of the maximum and minimum of a set of $n$ iid variables is given by

$$f_{u,v}= n(n-1) f(u) f(v) [F(u) -F(v)]^{n-2}, \hskip{1cm} u\ge v$$

In our case: $n=6$, $f(u)=e^{-u}$, and the probability that $u<a \, v$ is a straightforward integral, which gives:

$$P(u<a \, v)= 5 (a -1)\left( \frac{1}{1+5\,a}-\frac{4}{2+4\,a}+\frac{6}{3+3\,a}-\frac{4}{4+2\,a}+\frac{1}{5+1\,a} \right)$$

And $P(u<\sqrt{2} v) \approx 7.46 \times 10^{-5}$ This should be a strict bound on the desired probability, but, surely, far from tight.

[Update: indeed, the bound is indeed practically useless, it corresponds to an irrelevant tail. The probability, as per my simulations, is around $p=0.06528$ ($N=10^9$ tries, $3 \, \sigma \approx 2.3 \times 10^{-5}$), which agrees with other results.]

The only empirical result that might be of interest: It's easy to see that, from the $6!$ possible permutations of the lenghts, we can restrict ourselves to $30$, from symmetry considerations; now, from my simulations, I've found that it's sufficient to consider 7 permutations, the first two being already enough for more than $90\%$ of the successes; and the (need to consider the) seventh one is extremely small. These permutations are:

$$p_1 = [0 , 1 , 4 , 5 , 3 , 2] \hskip{1 cm} (0.75837)\\ p_2 = [0 , 1 , 4 , 3 , 5 , 2] \hskip{1 cm} (0.15231)\\ p_3 = [0 , 2 , 4 , 1 , 5 , 3] \hskip{1 cm} (0.08165)\\ p_4 = [0 , 1 , 4 , 5 , 2 , 3] \hskip{1 cm} (0.00404)\\ p_5 = [0 , 1 , 4 , 2 , 5 , 3] \hskip{1 cm} (0.00245)\\ p_6 = [0 , 1 , 3 , 5 , 4 , 2] \hskip{1 cm} (0.00116)\\ p_7 = [0 , 1 , 3 , 4 , 5 , 2] \hskip{1 cm} (0.00002)\\$$

The length indexes correspond to a sorted array (say, ascending), and following the convention of the linked paper: the first three sides have a common vertex, the following three are the corresponding opposite sides (so, for example, in the first permutation, and by far the most favorable one, the longest and shortest sides are opposite). The numbers on the right are the probability that this permutation (when one tries in the above order) is the successful one (given that they form a tetrahedron). I cannot be totally sure if there is some rare case that requires other permutation (very improbable, I'd say), but I'm quite sure (unless I've made some mistake) that the set cannot be further reduced.

-
I don't see a clear way to extend this argument, but it's certainly quite interesting. Thanks! –  Benjamin Dickman Apr 12 '13 at 18:19

This is not an answer but a long comment to other person's request of details.

Following is some details of my simulation. I hope this will be useful for those who are interested in numerics.

On a tetrahedron, I will use 6 variables $a,b,c,A,B,C$ to represent the lengths of 6 edges. $a,b,c$ corresponds to the edges connected to an arbitrary vertex and $A,B,C$ are lengths of corresponding opposite edges.

Step 1 Pre-generate the set of 120 permutations of 5 symbols and filter away equivalent ones down to 30. \begin{align} &S\; = \operatorname{Perm}(\{\,1,2,3,4,5\,\})\\ \xrightarrow{\text{filter}} & S' = \{\, \pi \in S : \pi(1) = \min(\pi(1),\pi(2),\pi(4),\pi(5))\, \} \end{align}

The filtering condition corresponds to the fact once a pair of opposite edge $(a,A)$ is chosen, there is a 4-fold symmetry in assigning the remaining 2 pairs of opposite edges. Following 4 assignments of lengths leads to equivalent tetrahedra.

$$(a,b,c,A,B,C) \equiv (a,c,b,A,C,B) \equiv (a,B,C,A,b,c) \equiv (a,C,B,A,c,b)$$

Step 2 Draw 5 uniform random numbers from $[0,1]$, sort them and turn them into 6 lengths:
\begin{align}& X_i = \operatorname{Rand}(0,1), i = 1,\ldots 5\\ \xrightarrow{\text{sort} X_i} & 0 \le X_1 \le \ldots \le X_5 \le 1\\ \xrightarrow{Y_i = X_{i+1}-X_i} &Y_0 = X_1,\,Y_1 = X_2-X_1,\, \ldots,\, Y_5 = 1-X_5 \end{align}

Step 3 Loop through the list of permuation in $S'$, for each permutation $\pi$, assign the 6 lengths to the 6 edges:

$$(Y_0, Y_{\pi(1)}, Y_{\pi(2)}, \ldots, Y_{\pi(5)}) \longrightarrow (a, b, c, A, B, C )$$

Verify whether this assignment generate a valid teterhedron by checking:

• All faces satisfies the triangular inequality. This can be compactly represented as: $$\min(a+b+c,a+B+C,A+b+C,A+B+c) > \max(a+A,b+B,c+C)$$
• The corresponding Cayler-Menger determinant is positive. Up to a scaling factor, this is:

$$\left|\begin{matrix}0 & 1 & 1 & 1 & 1\cr 1 & 0 & {a}^{2} & {b}^{2} & {c}^{2}\cr 1 & {a}^{2} & 0 & {C}^{2} & {B}^{2}\cr 1 & {b}^{2} & {C}^{2} & 0 & {A}^{2}\cr 1 & {c}^{2} & {B}^{2} & {A}^{2} & 0\end{matrix}\right| > 0$$

If this configuration is admissible, record it and goes to Step 2. If not, try other permutations from $S'$.

A $N = 10^9$ simulation is definitely not enough. The probability of forming a tetrahedron is about $p = 0.065$. Such a simulation will give us a number accurate to about $\sqrt{\frac{p(1-p)}{N}} \sim 1.5 \times 10^{-5}$. i.e. a 5 digit accuracy.

Up to what I heard, we need about 7 digit of accuracy before we have a chance to feed this into existing Pluoffe's Inverter and find whether this number look like a combination of simple mathematical constants.

Until one can speed up the algorithm to have a $N > 10^{13}$ simulation or have a better control of the error terms. Simulation remains only useful for cross checking purposes.

-
I enjoyed reading the description of your simulation. Thanks! –  Benjamin Dickman Apr 15 '13 at 22:53
At some level this is essentially just a Monte Carlo evaluation of the integral. As such, you should be able to use some of the classic methods for improving the convergence of Monte Carlo methods (in particular, stratified sampling) to reduce the standard deviation from $O(N^{-1/2})$ to $O(N^{-1})$; that ought to be enough for $N=10^9$ to provide enough digits of accuracy for the ISC. –  Steven Stadnicki Apr 18 '13 at 5:30

Disclaimer: This is another long comment reporting on the attempt to attack the problem numerically.

Instead of parametrizing the 6 segments of the unit stick as $$(u_1,u_2-u_1,u_3-u_2,u_4-u_3,u_5-u_4,1-u_5)$$ where $(u_1,u_2,u_3,u_4,u_5)$ are order statistics of the uniform distribution with pdf $$f_U(u_1,u_2,u_3,u_4,u_5) = 5! \cdot \left[0<u_1<u_2<u_3<u_4<u_5<1 \right]$$ I am using a different parametrization: $$(1-w_1, w_1 (1-w_2), w_1 w_2 (1-w_3), w_1 w_2 w_3 (1-w_4), w_1 w_2 w_3 w_4 (1-w_5), w_1 w_2 w_3 w_4 w_5 )$$ It is easy to solve for $\{w_k\}$ in terms of $\{u_k\}$: $$w_1 = 1-u_1, w_2 = \frac{1-u_2}{1-u_1}, w_3 = \frac{1-u_3}{1-u_2}, w_4 = \frac{1-u_4}{1-u_3}, w_5 = \frac{1-u_5}{1-u_4}$$ which allows to find their induced measure: $$f_W(w_1,w_2,w_3,w_4,w_5) = (5 w_1^4 [0<w_1<1]) \cdot (4 w_2^3 [0<w_2<1]) \cdot (3 w_3^2 [0<w_3<1] ) \cdot (2 w_4 [0<w_4<1]) \cdot ( [0<w_5<1] )$$ meaning that $w_k$ are independent random variable with different power distributions on the unit interval.

This parametrization is friendlier to numerical integration routines.

We then proceed much like @achille-hui . Here is Mathematica code I ran:

TriangleInequalities[{a_, b_, c_}] :=
a < b + c && b < a + c && c < a + b

FacialTetrahedron[{x_, y_, z_, xb_, yb_, zb_}] :=
TriangleInequalities[{x, y, zb}] &&
TriangleInequalities[{x, yb, z}] &&
TriangleInequalities[{xb, y, z}] &&
TriangleInequalities[{xb, yb, zb}]

TetrahedraSextupleQ[{x_, y_, z_, xb_, yb_, zb_}] :=
FacialTetrahedron[{x, y, z, xb, yb, zb}] &&
Det[{{0, x^2, y^2, z^2, 1}, {x^2, 0, zb^2, yb^2, 1}, {y^2, zb^2, 0,
xb^2, 1}, {z^2, yb^2, xb^2, 0, 1}, {1, 1, 1, 1, 0}}] > 0


We now build the event that one can form a tetrahedron out of 6 pieces the unit stick is divided into. The following takes a while to compute.

event2 = Assuming[
0 < w1 < 1 && 0 < w2 < 1 && 0 < w3 < 1 && 0 < w4 < 1 && 0 < w5 < 1,
Simplify[
Apply[Or,
Simplify[TetrahedraSextupleQ[#]] & /@
Permutations[{(1 - w1),
w1 (1 - w2), w1 w2 (1 - w3), w1 w2 w3 (1 - w4),
w1 w2 w3 w4 (1 - w5), w1 w2 w3 w4 w5 }]]]];


Therefore I saved the resulting predicate in paste-bin. Here is how to import it:

event2 = ToExpression[
Import["http://pastebin.com/raw.php?i=399MDkGQ", "Text"],
InputForm];


We now define a compiled filter function to decide if a random vector fires the event.

cfFunc2 = With[{ee = event2},
Compile[{{arg, _Real, 1}}, Block[{w1, w2, w3, w4, w5},
{w1, w2, w3, w4, w5} = arg;
If[ee, 1, 0]], RuntimeAttributes -> Listable]];


The function above allows to efficiently run the Monte-Carlo simulation. Here is the simulation that takes some 4.7hours:

In[3]:= Block[{sample, tot = 0, suc = 0},
While[suc <= 10^9,
sample =
RandomVariate[
ProductDistribution[PowerDistribution[1, 5],
PowerDistribution[1, 4], PowerDistribution[1, 3],
PowerDistribution[1, 2], UniformDistribution[]], 3*10^8];
tot += Length[sample];
suc += Total[cfFunc2[sample]];
];
{suc, tot}
] // AbsoluteTiming

Out[3]= {16994.098510, {1018403735, 15600000000}}


Entailing the following $(1-10^{-8})/2$-level confidence interval:

In[38]:= Block[{suc = 1018403735, tot = 15600000000},
PlusMinus[N[suc/tot],
Sqrt[2.] InverseErfc[10^-8] Sqrt[
With[{p = suc/tot}, p (1 - p)/tot]]]]

Out[38]= 0.0652823 \[PlusMinus] 0.0000113341


The advantage of the $w$-parametrization is that Cartesian quadrature rules can be applied. Using the fact that $w_k = 2^{-1/k}$ for $1 \leqslant k \leqslant 5$ furnishes a tetrahedral splitting:

In[160]:= event2 /. {w1 -> (1/2)^(1/5), w2 -> (1/2)^(1/4),
w3 -> (1/2)^(1/3), w4 -> (1/2)^(1/2), w5 -> 1/2}

Out[160]= True


we can help numerical quadrature algorithm to find a sample point inside the region of interest. So with enough time at hand it should be possible to get a more precise quadrature answer:

AbsoluteTiming[
prob = NIntegrate[
f[w1, w2, w3, w4, w5], {w1, 0, (1/2)^(1/5), 1}, {w2,
0, (1/2)^(1/4), 1}, {w3, 0, (1/2)^(1/3), 1}, {w4, 0, (1/2)^(1/2),
1}, {w5, 0, 1/2, 1},
Method -> {"CartesianRule", "SymbolicProcessing" -> 0},
MaxRecursion -> 14]]


However, after some 20 hours, this integration command is still running... I will post the answer once the evaluation is complete.

-
It's still running? –  Benjamin Dickman Apr 25 '13 at 4:20
Yes, it still does. The function $f(w_1,\ldots,w_5)$ is discontinuous, therefore adaptive numerical quadrature methods run into trouble endlessly subdividing close the boundary. The call I quoted finished in 22 hours, but converged to only 2 significant digits of precision, which is less than what Monte-Carlo gave. I rerun the computation with different settings, which will hopefully improve the matter. Ultimately, I think one would need to resolve to hybrid symbolic-numeric approach, like integrate wrt last variable symbolically. –  Sasha Apr 25 '13 at 4:27
@Sasha What a pity, I also want to know more digits. In your way of computing the numerical integral, will it be easier to compute the contribution from the 7 permutations mentioned in leonbloy's update one by one? I suspect the lower probability for a permutation, the more problematic it will be for adaptive quadratures. –  achille hui Apr 25 '13 at 9:56
Still running?${}$ –  Eckhard Apr 5 '14 at 22:37

This is not an answer, but just another long(ish) comment.

I tried to simplify the original problem in order to see if there's any chance of solving the problem with computer algebra systems such as Mathematica.

I thus ignored the non-linear constraint coming from the Cayley-Menger determinant, and computed the probability that six uniformly random, independent edge lengths satisfy four triangle inequalities. To make things even simpler I also assumed the edge lengths to be in decreasing order, but that is of course not a big restriction.

Even with these assumption Mathematica is struggling, but eventually gives the result $19/72$, which is confirmed by the following MC simulation:

nn = 10^7;
cnt = 0;
e = RandomReal[{0, 1}, {nn, 6}];
For[n = 1, n <= nn, n = n + 1,
etemp = Sort[e[[n, All]]];
If[And @@ (Abs[#[[2]] - #[[3]]] < #[[1]] < #[[2]] + #[[3]] &@
Part[etemp, #] & /@ {{1, 2, 3}, {1, 4, 5}, {2, 4, 6}, {3, 5, 6}}), cnt = cnt+1];
];
p = cnt/nn // N
Sqrt[(p (1 - p))/nn]
`

I'm not optimistic about Mathematica being able to handle the original problem.

-

Small improvement for the Monte-Carlo approximation, instead of sampling from the real distribution, sample from a symmetric Dirichlet distribution with concentration parameter $\alpha \sim 2.2$. It roughly cuts the variance by a factor of 3-4.

-

if stick pieces are s1 (longest) to s6 shortest.

Picture the tetrahedron with longest side s1 out of view. Then s2 is the spine and any combination of pairs from {s3,s4,s5,s6} can make the two side triangles Hence s3+s6 needs to be longer than s2 (P=0.25) And s4+s5 needs to be longer than s2. (P=0.25) so P(can form)=0.25*0.25=0.0625

-
Is this using anything stronger than the triangle inequality on each face? As mentioned in the initial question (and answer) that would be a necessary condition to form a tetrahedron, but not a sufficient one. –  Benjamin Dickman Oct 3 '13 at 20:14

Too long for a comment: The necessary and sufficient conditions that describe your tetrahedron are:

1. The sum of all six segments is constant: $$(a+b+c)+(x+y+z)=L$$

2. And three of these segments form the sides of a triangle: $$\begin{cases}a+b>c\\b+c>a\\c+a>b\end{cases}$$

3. And two more segments form a triangle with at least one of the former three sides: $$\begin{cases}a+x>y\\a+y>x\\x+y>a\end{cases}\qquad\text{ or}\qquad\begin{cases}b+x>y\\b+y>x\\x+y>b\end{cases}\qquad\text{or}\qquad\begin{cases}c+x>y\\c+y>x\\x+y>c\end{cases}$$

4. And the sixth and final side z has to be smaller than the length of the “other” diagonal of the quadrilateral formed by these previous five sides when the (incomplete) figure is stretched onto a plane or flat surface. (One of the first three sides [a, b, c] is of course the “first” diagonal of the geometric figure formed by the other four).

Is this approach helpful ? Does it help clear things up, or make them easier ?

-

Let the stick be of unit length. We generate five random numbers uniformly distributed between 0 and 1, and after we sort them in ascending order we have some r1, r2, r3, r4, r5. Let a=r1, b=r2-r1, c=r3-r2, d=r4-r3, e=r5-r4, f=1-r5 be the edges of a possible tetrahedron. The edges should satisfy the triangle inequalities for the four faces of tetrahedron. A program based on this reasoning for 1000000 trials yields an approximate probability p = 0.0185 .

Best regards

Emmanuel.

-
Please read the rest of the thread (including the statement of the original question). Thanks. –  Benjamin Dickman Apr 18 '13 at 6:37