TITLE: Probability that a stick randomly broken in two places can form a triangle
QUESTION [32 upvotes]: Randomly break a stick (or a piece of dry spaghetti, etc.) in two places, forming three pieces.  The probability that these three pieces can form a triangle is $\frac14$ (coordinatize the stick form $0$ to $1$, call the breaking points $x$ and $y$, consider the unit square of the coordinate plane, shade the areas that satisfy the triangle inequality edit: see comments on the question, below, for a better explanation of this).
The other day in class*, my professor was demonstrating how to do a Monte Carlo simulation of this problem on a calculator and wrote a program that, for each trial did the following:

Pick a random number $x$ between $0$ and $1$.  This is the first side length.
Pick a random number $y$ between $0$ and $1 - x$ (the remaning part of the stick).  This is the second side length.
The third side length is $1 - x - y$.
Test if the three side lengths satisfy the triangle inequality (in all three permutations).

He ran around $1000$ trials and was getting $0.19$, which he said was probably just random-chance error off $0.25$, but every time the program was run, no matter who's calculator we used, the result was around $0.19$.
What's wrong with the simulation method?  What is the theoretical answer to the problem actually being simulated?
(* the other day was more than $10$ years ago)

REPLY [11 votes]: FYI:  This question was included in a Martin Gardner 'Mathematical Games' article for Scientific American some years ago.  He showed that there were 2 ways of randomly choosing the 2 'break' points:

choose two random numbers from 0 to 1, or
choose one random number, break the stick at that point, then choose one of the two shortened sticks at random, and break it at a random point.

The two methods give different answers.