### Brain Teasers

# Triangle From a Ruler

Probability
Probability puzzles require you to weigh all the possibilities and pick the most likely outcome.

Fred had a ruler that was exactly 12 inches long. His second cousin, Pop, was practicing with her Samurai sword and made two straight slashes at arbitrary spots on the ruler, cutting it into three pieces. What is the probability that the pieces of Fred's ruler can form a triangle?

### Hint

Graphing it is easiest.### Answer

To find the answer, we will use two random variables, a and b, on a common graph with rectangular axes. Both variables are uniformly distributed between 0 and 12, so we have a probability square which each side equal to 12. We will find regions on the square that lead to three lengths that can form a triangle.Let us suppose that the two cuts are made at some lengths a and b from one end. If b > a, then the three lengths will be a, b-a, and 12-b. In order to create a triangle, any two of these lengths needs to be greater than the third. So,

a + b-a > 12-b or b > 6

b-a + 12-b > a or a < 6

a + 12-b > b-a or b < a+6

When we plot these on our graph, we get a triangle with points at (6,6), (0,6), and (6,12). The triangle formed has an area of 1/8th of the square.

If we then consider the case of a > b, then we get a similar triangular region reflected over the x=y diagonal of our graph. That triangle also has an area of 1/8th of the square.

Therefore the total area of our two regions is given by 1/8 + 1/8 = 1/4 and so the probability of Pop having created pieces capable of making a triangle is 25%.

The calculation of the probability that Fred lost a finger or two is left up to the reader.

Hide Hint Show Hint Hide Answer Show Answer

## What Next?

**Solve a Similar Brain Teaser...**

Or, get a random brain teaser.

If you become a registered user you can vote on this brain teaser, keep track of

which ones you have seen, and even make your own.

## Comments

Meh, Geometry.

I did finally figure it out though, which made me happy.

I did finally figure it out though, which made me happy.

Great teaser, however eh... i can't help but ask, if you look at your hands... how many fingers do you see?

boring

Good one Phrebh, took me a while

no offence but that is kinda stupid. I mean Who Cares about Freds ruler????

Cutting a stick into three parts to form a triangle

The solution presented is not exactly right, because it assumes the generation of two uniformly distributed random numbers between 0 and 1. The ruler of unit length is then cut at these positions. The probability of forming a triangle is then 0.25 as given in the answer.

A more realistic way is to cut the ruler first at location x (x is uniformly distributed between 0 and 1) then cut the remaining piece at location y (y is uniformly distributed between 0 and "1-x").

The resulting three pieces have lengths "x", "y", and "1-x-y". The probability of having a triangle is then

P= integral from 0 to 0.5 {integral from(0.5-x) to (0.5) [dy/(1-x)]}dx

0.5

P={-x-ln(1-x}

0

P=0.193147

The same answer can be obtained by simulation. A simple BASIC program using one million trials is shown below:

10 REM "Cutting a ruler into three pieces to form a triangle"

11 N=1000000

12 S=0

13 RANDOMIZE

14 FOR I=1 TO N

15 R1=RND(1)

16 A=R1

17 B=1-R1

18 L1=A

19 L2=B

20 R2=RND(1)

21 C=L2*R2

22 L3=L2-C

23 L2=C

24 IF (L1+L2)>L3 THEN 26

25 GOTO 29

26 IF (L1+L3)>L2 THEN 28

27 GOTO 29

28 IF (L2+L3)>L1 THEN S=S+1

29 NEXT I

30 P=S/N

31 PRINT "Probability ="; P

32 END

The solution presented is not exactly right, because it assumes the generation of two uniformly distributed random numbers between 0 and 1. The ruler of unit length is then cut at these positions. The probability of forming a triangle is then 0.25 as given in the answer.

A more realistic way is to cut the ruler first at location x (x is uniformly distributed between 0 and 1) then cut the remaining piece at location y (y is uniformly distributed between 0 and "1-x").

The resulting three pieces have lengths "x", "y", and "1-x-y". The probability of having a triangle is then

P= integral from 0 to 0.5 {integral from(0.5-x) to (0.5) [dy/(1-x)]}dx

0.5

P={-x-ln(1-x}

0

P=0.193147

The same answer can be obtained by simulation. A simple BASIC program using one million trials is shown below:

10 REM "Cutting a ruler into three pieces to form a triangle"

11 N=1000000

12 S=0

13 RANDOMIZE

14 FOR I=1 TO N

15 R1=RND(1)

16 A=R1

17 B=1-R1

18 L1=A

19 L2=B

20 R2=RND(1)

21 C=L2*R2

22 L3=L2-C

23 L2=C

24 IF (L1+L2)>L3 THEN 26

25 GOTO 29

26 IF (L1+L3)>L2 THEN 28

27 GOTO 29

28 IF (L2+L3)>L1 THEN S=S+1

29 NEXT I

30 P=S/N

31 PRINT "Probability ="; P

32 END

I believe you misread the answer. The second cut is taken from the remainder of the ruler. It's just that its length is shown in relation to the first cut.

Oh, my head hurts!!!

Good teaser I'm sure, Phreb.... but I wiggled through college Math by the skin of my teeth!! I have no idea how, except that the TA that taught the class liked me....

Good teaser I'm sure, Phreb.... but I wiggled through college Math by the skin of my teeth!! I have no idea how, except that the TA that taught the class liked me....

BTW.... I thought all you needed was three straight lines to form a triangle!! Geez... I feel stupid!!!

I don't get it. Do you mean three straight edges, with the inside being a triangle? Or do you have three pieces that fit together in a puzzle-piece manner to create a solid triangle? I'm a bit confues.

wow...I think I need to go back to playing Chess...you are doing too much Math for me. great job!

huh???????????????

To be honest, i never liked probability questions. Yours i did enjoy though.

If b>6, you can in no way form a triangle.

If b = 6, you form a "straight-line" triangle.

It seems to me then that, if the first cut is perfectly even, then 100% of the time you have the straight-line triangle.

If not, then the second cut, if made on the shorter length, will never produce a triangle. This should be 50% of the time.

If neither of those take place, then the third cut, randomly made on the longer piece, needs to not be further than 6" from either endpoint.

The probability of this depends on the length of the piece.

If b = 6, you form a "straight-line" triangle.

It seems to me then that, if the first cut is perfectly even, then 100% of the time you have the straight-line triangle.

If not, then the second cut, if made on the shorter length, will never produce a triangle. This should be 50% of the time.

If neither of those take place, then the third cut, randomly made on the longer piece, needs to not be further than 6" from either endpoint.

The probability of this depends on the length of the piece.

if any segment > 6 then triangle is not possible

if any segment is exactly = 6 then a triangle is not possible, only a straight line is.

if all segments are < 6 inches, a triangle is always possible.

So the answer is slightly less than 50%

if any segment is exactly = 6 then a triangle is not possible, only a straight line is.

if all segments are < 6 inches, a triangle is always possible.

So the answer is slightly less than 50%

No, it isn't. You are ignoring the fact that you have to look at two instances (one for each cut), not just one, so you multiply the two 50% probabilities to arrive at 25% (1/2 * 1/2 = 1/4).

I just ran it through Exel and you're right. It is about 25%.

Hurray for geometric probability! It's very powerful

You are making distinction between the first cut and second cut...

So a cut of pieces of size 4,4,4 will be counted twice..

This isn't correct right?

The correct answer then should be 12.5%

So a cut of pieces of size 4,4,4 will be counted twice..

This isn't correct right?

The correct answer then should be 12.5%

## Follow Braingle!