Breaking sticks

We want break a stick into three pieces and ask what is the probability that the pieces can form a triangle.  Three lengths form can form a triangle if and only if the triangle inequalities hold.  Here is a function which takes three lengths and returns 1 if they can form a triangle and 0 otherwise.

FormsTriangle[{a_,b_,c_}]:= If[a≤b+c && b≤a+c&&c≤a+b,1,0]

For a stick of length 1 one can see after some thought you can see that this happens if and only if the longest piece has length at most 1/2, or equivalently, if all three pieces have length at most 1/2.

There is more than one way to randomly break a stick into three pieces and the answers for the probabilities are different.

Randomly and independently choose two break points.

If the stick has unit length and the break points are the points x, y chosen at random then there are two cases which can form a triangle
(x < y, x <= 1/2, y-x<= 1/2, 1-y <= 1/2)  OR (y < x, y <= 1/2, x-y<= 1/2, 1-x <= 1/2)
Here is a plot.  The probability is the area of the shaded region or P = 1/4.

RegionPlot[(x<y&&x≤1/2&&y-x<=1/2&&1-y≤1/2) || (y<x&&y≤1/2&&x-y≤1/2&&1-x≤1/2),{x,0,1},{y,0,1}]

We can test it with a simulation.  Here is a function which independently chooses the two break points and returns the three lengths as a list.  And another function which does the stick experiment and returns 1 if a triangle can be formed and 0 if not.

BreakStickInThree[length_]:= Module[{x=Random[Real,{0,length}],y=Random[Real,{0,length}],lengths},
	If[x<y,{x,y-x,1-y},{y,x-y,1-x}]]

DoStickExperiment[length_]:=FormsTriangle[BreakStickInThree[length]]

Now we repeat the experiment many times and look at the frequency.  It should be close to 1/4.

TriangleFrequencies[n_] := Plus@@Table[DoStickExperiment[1],{i,1,n}]/n//N
TriangleFrequencies[100000]

First one break, then another.

Here is another way to break a stick. Finally, change the rules so that we first break the stick but then randomly break the longer of the two pieces.  Since the answer is harder to get theoretically, we will begin with a simulation.  First we create a function which breaks a stick and returns the two lengths as a list.  Then we make another which takes such a list and further breaks the longer length returning the three lengths as a list.  Finally we have a function which does this stick experiment and returns 1 if a triangle can be formed and 0 if not.

BreakStick[length_]:= With[{x=Random[Real,{0,length}]},{x,length-x}]
BreakLongerPiece[{a_,b_}]:= If[a≤b,Join[{a},BreakStick[b]],Join[{b},BreakStick[a]]]
DoStickExperiment2[length_]:=FormsTriangle[BreakLongerPiece[BreakStick[length]]]

TriangleFrequencies[n_] := Plus@@Table[DoStickExperiment2[1],{i,1,n}]/n//N
TriangleFrequencies[100000]

The theoretical value is  2 Log [2] -1 = 0.386294 ....  Here is one way to arrive at this strange result.  The difficulty is that the second random choice (how to split the longer piece) depends on the result of the first.  If we try to use the lengths of both break points as variables, the second break point will not be chosen independently from [0,1] and we end up with a nonuniform distrbitution in the plane.  To avoid this we can instead make the second choice a ratio r in [0,1], that is, we split the longer piece into pieces which are proportions r and (1-r) of the remaining length.

Choose the first break point by choosing the shorter length x in [0 1/2].  Then choose r in [0,1] and let the other two lengths be r(1-x) and (1-r)(1-x).  The sample space is the rectangle [0,1/2] x [0, 1] with a uniform distribution.  The subset corresponding to our event is the one where all the lengths are at most 1/2.  In other words, we need  r(1-x) <= 1/2  and (1-r)(1-x) <= 1/2 or equivalently 
r <= 1/(2(1-x))  and r >= 1- 1/(2(1-x)).  
Here is a plot.

RegionPlot[r*(1-x)≤1/2&&(1-r)(1-x)≤1/2,{x,0,1/2},{r,0,1}]

Use an integral to find the area of this region.  The ratio of this to the area of the rectangle is 2Log [2] -1.