Math Is Fun Forum

  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 2015-01-05 21:26:53

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,974
Website

1-dimensional geometric probability

What is the probability that a rope of length l cut into 3 random pieces can form a triangle?


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.

Offline

#2 2015-01-06 02:07:56

Bob
Administrator
Registered: 2010-06-20
Posts: 10,140

Re: 1-dimensional geometric probability

hi Agnishom,

Here's my effort on this.  I did a simulation that seems to confirm it.

Call the first length a, the second b and the third c.

c= 1 - a - b

By the triangle inequality you want

a+b > c => a + b > 1 - a - b => a+b > 0.5.  This is equivalent to c < 0.5

and

c+b > a => 1 - a - b + b > a => a < 0.5

and similarly

b < 0.5

Assuming the distributions are uniform

P(a<0.5) = 0.5 and similarly for the other two.

For all three constraints, P(a triangle) = 0.5 x 0.5 x 0.5 = 0.125

Bob


Children are not defined by school ...........The Fonz
You cannot teach a man anything;  you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you!  …………….Bob smile

Offline

#3 2015-01-06 02:38:56

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,049

Re: 1-dimensional geometric probability

But, you are counting cases in which a+b+c<1.


“Here lies the reader who will never open this book. He is forever dead.
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

#4 2015-01-06 03:50:41

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,974
Website

Re: 1-dimensional geometric probability

The answer should be 0.25


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.

Offline

#5 2015-01-06 05:03:24

Bob
Administrator
Registered: 2010-06-20
Posts: 10,140

Re: 1-dimensional geometric probability

OK.  I'll have a re-think. 

Bob


Children are not defined by school ...........The Fonz
You cannot teach a man anything;  you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you!  …………….Bob smile

Offline

#6 2015-01-06 05:14:24

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,974
Website

Re: 1-dimensional geometric probability

I found this!


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.

Offline

#7 2015-01-06 23:19:32

Bob
Administrator
Registered: 2010-06-20
Posts: 10,140

Re: 1-dimensional geometric probability

hi

But, you are counting cases in which a+b+c<1.

Yes, I accept that is wrong.  But that means the actual answer would be lower. ???

I have re-done my simulation as follows:

Choose a at random in the range (0,1)

Choose b at random in the range (a,1)

Calculate c = 1 - a - b

I have then flagged all cases where a,b,c < 0.5 and counted them.

Running this 1 000 000 times I get P = 0.019275

Typical flagged results ( 0.235791, 0.47383, 0.290379) and (0.124516, 0.42401, 0.451474)

and typical un-flagged results (0.797796, 0.08612, 0.116084) and ( 0.107225, 0.74065, 0.152125)

This simulation isn't getting results anywhere close to 0.25.  So, can anyone see what's going wrong ?

Bob


Children are not defined by school ...........The Fonz
You cannot teach a man anything;  you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you!  …………….Bob smile

Offline

#8 2015-01-07 01:52:38

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,049

Re: 1-dimensional geometric probability

Shouldn't you be picking b from (0,1-a)?


“Here lies the reader who will never open this book. He is forever dead.
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

#9 2015-01-07 06:19:03

Bob
Administrator
Registered: 2010-06-20
Posts: 10,140

Re: 1-dimensional geometric probability

Yes, I just said it wrong.  If you look at my sample data you'll see it does pick as you say.

Bob


Children are not defined by school ...........The Fonz
You cannot teach a man anything;  you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you!  …………….Bob smile

Offline

#10 2015-01-07 06:54:08

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,049

Re: 1-dimensional geometric probability

I think we can look at this geometrically. If we plot in R³ which points satisfy the conditions (i.e. x+y+z=1) it's an equilateral triangle with a side of

and the ones which also satisfy x,y,z<0.5 make up an equilateral triangle of side
. So, the answer should be 1/4. The simulation I did confirms it:

l = Select[Table[{#1, #2, 1 - #1 - #2} &[RandomReal[], RandomReal[]], {100000}], #[[3]] > 0 &];
l1 = Select[l, #[[1]] < 0.5 && #[[2]] < 0.5 && #[[3]] > 0 && #[[3]] < 0.5 &];
Length[l1]/Length[l] // N

“Here lies the reader who will never open this book. He is forever dead.
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

#11 2015-01-07 12:02:12

Bob
Administrator
Registered: 2010-06-20
Posts: 10,140

Re: 1-dimensional geometric probability

hi Stefy and Agnishom,

Oh, boy.  This question really has me beat.  First of all, Stefy, I like your solution best of all; neat way to do it.

So now for my simulation.  I found two errors (after lots of puzzling) and what follows is my best effort.  It doesn't give 0.25. It seems to want to give 0.025, which is tantalisingly close but I cannot account for the factor of ten.  dizzy.

I used Excel.  Sorry.  The command RAND() returns a number in the range 0,1. 

So I used it to pick two points, P and Q along the line from 0 to 1.

If P>Q, I compute P-Q and call this a.  Otherwise Q-P

If P>Q, I store OQ in b.  Otherwise OP.

I compute c = 1 - a - b

Then I test for all three less than 0.5 and flag this with a 1, else 0.

Then I add up all the 1s, and compute the experimental probability.

I also have done the following checks.

(1) Check that a + b + c = 1 for every case.

(2) Calculate the expected (mean average) value  a, b and c.

(3) Look at some cases to check that 1 really does mean the triangle is drawable and 0 means it isn't.  This has checked out for every case I've checked.

Here's a screen shot of the last two lines of 10000 repeats and the formulas that I used.

svbfaRN.gif

Can anyone see where I'm going wrong ?

Bob


Children are not defined by school ...........The Fonz
You cannot teach a man anything;  you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you!  …………….Bob smile

Offline

#12 2015-01-07 12:06:41

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,049

Re: 1-dimensional geometric probability

Have you tried doing it a few more times?


“Here lies the reader who will never open this book. He is forever dead.
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

#13 2015-01-07 12:07:50

Bob
Administrator
Registered: 2010-06-20
Posts: 10,140

Re: 1-dimensional geometric probability

Yes, loads.  It always gives numbers like 0.02.....

Bob


Children are not defined by school ...........The Fonz
You cannot teach a man anything;  you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you!  …………….Bob smile

Offline

#14 2015-01-07 12:10:23

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,049

Re: 1-dimensional geometric probability

I have to look at it a bit more.

Glad we're finally online at the same time. It's a bit late over there, isn't it?


“Here lies the reader who will never open this book. He is forever dead.
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

#15 2015-01-07 12:14:17

Bob
Administrator
Registered: 2010-06-20
Posts: 10,140

Re: 1-dimensional geometric probability

Yes it is.  I ought to go to bed.  Got a busy day tomorrow.  Bye for now.  sleep

Bob


Children are not defined by school ...........The Fonz
You cannot teach a man anything;  you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you!  …………….Bob smile

Offline

#16 2015-01-07 12:18:00

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,049

Re: 1-dimensional geometric probability

Good night.

When you get the chance, please tell us what you used to get the mean of the 1's and 0's.


“Here lies the reader who will never open this book. He is forever dead.
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

#17 2015-01-07 21:21:02

Bob
Administrator
Registered: 2010-06-20
Posts: 10,140

Re: 1-dimensional geometric probability

Good question.

The command in cell F10002 is =SUM(F2:F1001)/(ROW(A10001)-ROW(A2))

I had used 10000 in place of (ROW(A10001)-ROW(A2)), but decided to let Excel count the rows in case I was doing something stupid with the number of trials.  Mrs B had a similar thought so she looked at the rows and is convinced that I really had 10000.

FIRST EDIT: Got it!  Just looked at what I have typed in.  I'll just adjust that to =SUM(F2:F10001)/(ROW(A10001)-ROW(A2))  Thanks.

SECOND EDIT:  Now I'm getting 0.25.............    Hurray!!!!!!  Many many thanks.

Bob

Last edited by Bob (2015-01-07 21:24:46)


Children are not defined by school ...........The Fonz
You cannot teach a man anything;  you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you!  …………….Bob smile

Offline

#18 2015-01-07 21:32:14

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,049

Re: 1-dimensional geometric probability

Nice work! smile

I guess we can safely say the answer is 1/4.


“Here lies the reader who will never open this book. He is forever dead.
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

#19 2015-01-07 21:35:17

Bob
Administrator
Registered: 2010-06-20
Posts: 10,140

Re: 1-dimensional geometric probability

I'm happy to say that.  I may still see if I can make my original method work, now I've got a clear procedure.

Bob


Children are not defined by school ...........The Fonz
You cannot teach a man anything;  you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you!  …………….Bob smile

Offline

#20 2015-01-07 21:38:06

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,049

Re: 1-dimensional geometric probability

If you mean the one in post #7, that would be hard, because if you pick like that, the distribution of b over (0,1) is not uniform. You would need to be picking it from (0,1-a) with a non-uniform distribution, I think.


“Here lies the reader who will never open this book. He is forever dead.
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

#21 2015-01-07 21:43:23

Bob
Administrator
Registered: 2010-06-20
Posts: 10,140

Re: 1-dimensional geometric probability

Yes.  I realise that now.  It may take a while but it will be good for my brain to try.

Got to stop now.  See you tomorrow.  smile

Bob


Children are not defined by school ...........The Fonz
You cannot teach a man anything;  you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you!  …………….Bob smile

Offline

#22 2015-01-07 21:44:16

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,049

Re: 1-dimensional geometric probability

See you and good luck.


“Here lies the reader who will never open this book. He is forever dead.
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

Board footer

Powered by FluxBB