All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 Gamow's Elevator (Posted on 2020-07-26)
George Gamow and Marvin Stern occupied offices on the second and sixth floors of a seven-story building, and noted that when either took the elevator to the other's floor, it was going the wrong way. It's apparent why: there were ten segments of the elevator's 12-segment cycle (6 going up and 6 going down in a continuous cycle) where the first elevator arrival would be going the wrong way and only two segments where it would be going the desired direction the next time it passed the boarding floor.

But what if a second elevator were placed in the building. What would the probability be that the next elevator to arrive would be going the wrong way? Ignore stops along the way, as they do not affect the distance that need be traveled and probably have more of them for longer trips. The two elevators move independently of each other.

Gamow himself did not get the correct answer for the two-elevator case, but the correct answer was found by Donald Knuth.

 See The Solution Submitted by Charlie Rating: 1.5000 (2 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
 re(2): what I have so far... -- Hint | Comment 6 of 10 |
(In reply to re: what I have so far... -- Hint by Charlie)

Thanks Charlie - Doing a sim caused me to see the light.

New approach: consider these three zones starting from where
the elevator leaves floor 2 going up:

|2U  3U  4U  5U  6U  7D  6D  5D  4D  3D  2D  1U  |
| Zone 1                                    |Zone2  |Zone 3 |

An elevator has 4/6 chance of being in zone 1 and
1/6 of being in 2 and 1/6 in 3.

There is a 50/50 race between an up and a down elevator
to get to floor 2 if and only if one is in zone 2 and the other in 3.

Here are the probabilities for the location of the two elevators and the chance up will arrive first:

Elevators in Zones      ways/36        Pr(Up wins)
-----------------------------------------------------
3 & 3                      1/36                1
1 & 3                      8/36                1
2 & 3                      2/36              1/2
1 & 2                     25/26               0

So Up now gets prob ( 1 + 8 + 2 x 0.5)/ 36 = 10/36 = 0.2777...,
(way better than 1/6 = 0.1666... for the single elevator)

So with 1 elevator, on floor 2 prob(up) = 1/6, prob(down) = 5/6
Two elevators, prob(up) = 5/18, prob(down) = 13/18

here is the simulationord@rabbit-3 ~ % gamow

sim: prob. up = 0.278 analytic = 0.278

lord@rabbit-3 ~ %

lord@rabbit-3 ~ % more gamow.f

program gamow

implicit none

integer iseed,i,cnt

real rat,a,b,da,db,x

iseed=time8()

cnt=0

do i=1,1000000

a=rand()*12

b=rand()*12

da=10.-a ! unneeded!

if(a.gt.10)da=10.-a

db=10.-b ! uneeded !

if(b.gt.10)db=10.-b

if(abs(da).lt.abs(db).and.da.lt.0)cnt=cnt+1

if(abs(db).lt.abs(da).and.db.lt.0)cnt=cnt+1

enddo

rat=cnt/1000000.

x=10/36.

print 1, rat,x

1       format('sim: prob. up = ',f5.3,' analytic = ',f5.3)

end

Edited on July 28, 2020, 7:12 am
 Posted by Steven Lord on 2020-07-27 22:53:52

 Search: Search body:
Forums (0)
Random Problem
Site Statistics
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox: