Write a program that uses the random-number generator to simulate dropping a gla
ID: 3545589 • Letter: W
Question
Write a program that uses the random-number generator to simulate dropping a glass rod that breaks into three pieces. The purpose of the experiment is to estimate the probability that the pieces might form the sides of a triangle. If you use the line segment 0 to 1 (on the real number line) as a mathematical model of the glass rod, a random number generator (function) can be used to generate two numbers between 0 and 1 representing the coordinates of the breaks.
The triangle inequality (the sum of the lengths of two sides of a triangle are always greater than the length of the third side) may be used to test the length of each piece against the lengths of the other two pieces.
I got off to a good start with this program, but now I am hopelessly stuck. Any good ideas out there?