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

Home > Probability
Gamow's Elevator (Posted on 2020-07-26) Difficulty: 3 of 5
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: 2.6667 (3 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
soln - w/ logic and computer | Comment 9 of 10 |
<pre>

Just to get the answer in one place, I put it all here,

Also thanks Charlie: Doing a sim caused me to see the light. 
---

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

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

        end 

</pre>


Edited on July 28, 2020, 9:46 pm
  Posted by Steven Lord on 2020-07-28 21:45:44

Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (12)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information