elevators, - stanford universityjq634mf7751/jq634... · 2015. 10. 20. · j entertaining topics as...

4
! i Up-and-down elevator games and Piet Hem's mechanical puzzles by .Martin Gardner Elevators, unlike cars, trains, planes, ships and other common modes I of transportation, have been un- duly neglected by recreational mathe- maticians. This month we undertake to rectifv the situation by considering four unusual elevator problems. The first three were provided by Donald E. Knuth, a computer scientist at Stanford University and author of a classic seven- volume work in progress titled The Art of Computer Programming. Before dis- cussing two combinatorial problems that appear for the first time in his third vol- ume (published in January by Addison- Weslev), we consider a well-known probability paradox with a startling gen- eralization that Knuth discovered a few years ago. George Gamow and Marvin Stern in- troduced the elevator paradox in the pro- logue to their little book Puzzle-Math (Viking, 1958). Gamow once had an office on the second floor of a seven-story building in San Diego and Stern had an office on the sixth floor. When Gamow wanted to go up to see he noticed that in about five cases out of six the first elevator to stop on his floor was going down. It seemed as if elevators were being manufactured on the roof .and then sent down the shafts to be stored in the basement. For Stern the situation was the opposite. When he wanted to go down to see about five times tors is complicated hy cond i abilities. As Knuth puts it of which elevator is first to j second floor is partly ... whether it was above us or ( an elevator that is belov*. floor when we begin to v*. .. i out of six the first elevator to arrive was arrive ahead of an elevatoi "'■ . on its way up. Were elevators being fab- (all other things being t-ij ricated in the basement and then sent to 1969 paper [see "Bihlioft . the roof to be carried off by helicopters? 124] Knuth analyzes Gam.. . The explanation, as Knuth pointed as follows: Consider the *- out later, requires a few idealizing as- elevator's route that starts .. sumptions. Suppose each elevator trav- floor, then goes down to ll* els independently in continuous cycles and up to the second, a t..:A from bottomfloor to top and back again, 1/3 of the entire route. I)., moving with constant speed .and with half of this portion the the same average waiting time on each next at the second floor goi floor. Thus at the time a button is pushed during the other half it » . on any floor we can assume that each going up. Therefore we i.u. elevator is at a random point in its cycle. unbiased portion, since it For a single elevator, calculating the toward up or down. probability that it is on its way down If there are n 1 when it stops on a given floor is quite distinguishes two cases: easy on the sixth floor, has five 1. No elevator is in thr u floors below and one above; therefore tion. The probability of ll the probability is 5/6 that the elevator since it is 2/3 for each elr- .' is below him and will be moving up elevator to stop on the m « when it arrives. on the second be going down, floor, has five floors .above and one be- 2. At least one elevatm low 'therefore the probability is 5/6 that biased portion. The pn. the elevator is above him and will reach (2/3)". We can ignore am < his floor on its way down. Gamow and side the unbiased portum Stern explained this in their book, but those in the unbiased poll then they made a slip. If there is more sarily reach the second i than one elevator, they wrote, the prob- case the elevator will abilities "of course remain the same." with probability 1/2. The slip is understandable because the Combining these' rcM.ii statement seems so intuitively true. Ap- ability of (2/3)" +*< " parently Knuth was the first to realize 5i(2/3)» that the firs. . " that it is not true at .all! Indeed, as the on the second floor win number of elevators approaches infinity If there are just two i- . the probability that the first elevator to Gamow's seven-stor\ stop on anv floor (except the top or hot- elevator to stop .it t>* torn floors) is going up (or down) ap- be headed w: "j preaches exactly 1/2-a rather unex- £ + 2/9-13/18. pected result. Yet the probability (for, than so that ""' catching an up e.ev.i' If there are seven < '■■ ability of an elevator's: be 2,315/4,374, win ■' u k /b d k /b [u k /b) [d k /b] 0 . 2 3/2 0 1/2. Knuth gives the ■:.■ any building by *>■>'' tance from a given «-" divided by the dist.u..' bottom floors. For (»»' Stern p is 5/6. The k< all values of p bet we« "■" 2 3 3 2 3.2 2 2 2 0 0 3/2 __ . > —»--.. aa, * : .''.i*' , -_-__- --p- -- -- i »xiT A 1 T A J 1 I"T1 C\ sav > e second floor) rm,, If 4TI 1^ VI VH Iw\ i I \illf Va every individual elevator. .., The solution for two .. r i b = 2

Upload: others

Post on 13-Feb-2021

1 views

Category:

Documents


0 download

TRANSCRIPT

  • !

    i

    Up-and-down elevator games andPiet Hem's mechanical puzzles

    by .Martin Gardner

    Elevators, unlike cars, trains, planes,ships and other common modesI of transportation, have been un-duly neglected by recreational mathe-maticians. This month we undertake torectifv the situation by considering fourunusual elevator problems. The firstthree were provided by Donald E.Knuth, a computer scientist at StanfordUniversity and author of a classic seven-volume work in progress titled The Artof Computer Programming. Before dis-cussing two combinatorial problems thatappear for the first time in his third vol-ume (published in January by Addison-Weslev), we consider a well-knownprobability paradox with a startling gen-eralization that Knuth discovered a fewyears ago.

    George Gamow and Marvin Stern in-troduced theelevator paradox in the pro-logue to their little book Puzzle-Math(Viking, 1958). Gamow once had anoffice on the second floor of a seven-storybuilding in San Diego and Stern had anoffice on the sixth floor. When Gamowwanted to go up to see

    Stern,

    he noticedthat in about five cases out of sixthe firstelevator to stop on his floor was goingdown. It seemed as if elevators werebeing manufactured on the roof .andthen sent down the shafts to be stored inthe basement. For Stern the situationwas the opposite. When he wanted to godown to see

    Gamow,

    about five times

    tors is complicated hy cond iabilities. As Knuth puts itof which elevator is first to jsecond floor is partly ...whether it was above us or (an elevator that is belov*.floor when we begin to v*. .. i

    out of six the first elevator to arrive was arrive ahead of an elevatoi "'■ .on its wayup. Were elevators being fab- (all other things being t-ijricated in the basement and then sent to 1969 paper [see "Bihlioft .the roof to be carried off by helicopters? 124] Knuth analyzes Gam.. .

    The explanation, as Knuth pointed as follows: Consider the *-out later, requires a few idealizing as- elevator's route that starts ..sumptions. Suppose each elevator trav- floor, then goes down to ll*els independently in continuous cycles and up to the second, a t..:Afrom bottomfloor to top and back again, 1/3 of the entire route. I).,moving with constant speed .and with half of this portion thethe same average waiting time on each next at the second floor goifloor. Thus at the timea button is pushed during the other half it » .on any floor we can assume that each going up. Therefore we i.u.elevator is at a random point in its cycle. unbiased portion, since it

    For a single elevator, calculating the towardup or down.probability that it is on its way down If there are n

    elevator*,

    1

    when it stops on a given floor is quite distinguishes two cases:easy

    Stem,

    on the sixth floor, has five 1. No elevator is in thr ufloors below and one above; therefore tion. The probability of llthe probability is 5/6 that the elevator since it is 2/3 for each elr- .'is below him and will be moving up elevator to stop on the m «when it arrives.

    Gamow,

    on the second be going down,floor, has five floors .above and one be- 2. At least one elevatm

    low'therefore theprobability is 5/6 that biased portion. The pn.the elevator is above him and will reach (2/3)". We can ignore am <his floor on its way down. Gamow and side the unbiased portumStern explained this in their book, but those in the unbiased pollthen they made a slip. If there is more sarily reach the second i

    than one elevator, they wrote, the prob- case the elevator willabilities "of course remain the same." withprobability 1/2.The slip is understandable because the Combining these' rcM.iistatement seems so intuitively true. Ap- ability of (2/3)" +*< "parently Knuth was the first to realize 5i(2/3)» that the firs.

    . "that it is not true at .all! Indeed, as the on the second floor winnumber of elevators approaches infinity If there are just two i- .the probability that the first elevator to Gamow's seven-stor\stop on anv floor (except the top or hot- elevator to stop .it t>*torn floors) is going up (or down) ap- be headed

    w:"jpreaches exactly 1/2-a rather unex- £ + 2/9-13/18.pected result. Yet the probability (for, than

    5/6,

    so that ""'catching an up e.ev.i'If there are seven < '■■abilityof an elevator's:be 2,315/4,374, win ■'

    uk/b dk/b [uk /b) [dk /b]

    0 . 23/20 1/2.Knuth gives the ■:.■

    any building by *>■>''tance from a given «-"divided by the dist.u..'bottom floors. For (»»'Stern p is 5/6. The k<all values of p betwe«"■"

    2 3

    5/23/2

    3 23.2

    5/2

    2 2

    3/23/2

    2 003/2

    __ . > —»--.. aa, * : .''.i*'

    , -_-__- --p- -- -- i »xiT A 1 T A J 1 I"T1 C\ sav> e second floor) rm,,If 4TI 1^ VI VH Iw\ i I \illf Va every individual elevator. ..,The solution for two ..r i

    b = 2

  • 107

    5/6 forsll eleva-B next to

    re eleva-nal prob-le choiceve on theigent on

    3W,

    sincesecond

    likely to: is above." In hisij" pagesituationon of anic fourth

    st floor

    tor stopsown, andrext stopall it theot biased

    mth now

    ised por-(2/3)",

    The nextfloor will

    a the un-:y is 1 —

    out-:e one of"ill neces-st. In thisig down

    a prob-r) = * +to arriveng down,rnning in

    the firstfloor will"obabilityduly lesslances of

    iproved.he prob-vn wouldfar from

    niula forthe dis-

    e bottoma top and:

    1/6,

    formla for

    is

    -i

    , The pair of vertical lines indicate theabsolute value of the expressionbetween

    j them. The probability approaches 1/2as n, the number of elevators, approach-

    i es infinity.Our second elevator problem is from

    the third volume of Knuth's series, abook that deals entirely with computer( techniques of sorting and searching forinformation. Like its two predecessors,it is comprehensive in scope, written in aclear, informal style (although at timesit is necessarily terse and technical)and rich in humor, historical data andproblems of great recreational interest.

    On pages 11 through 72, for instance,Knuth brilliantly summarizes .almost ev-erything known about the combinatorialproperties of permutations, a topic thatties in with scores of classic puzzle prob-lems. The book's exercises concern such

    j entertaining topics as solitaire cardj games, shuffling, anagrams, snowplows,

    the design of tennis tournaments (in-cluding Lewis Carroll's flawed efforts tofind a design that does the best possible! justice to the second-best player), rook

    | problems, sorting puzzles, the unsolved-. weight-ranking problem, the Josephusproblem, parking problems, Fibonaccinumbers, the odd "tableaux" of AlfredYoung (which have a curious relevanceto the eightfold way of particle theory)

    j and a hundred other things that leadstraight intorecreational mathematics.

    Here we are concerned with pages357 through 360, where Knuth regardstheelevator as a model of one-tape com-puter sorting. A building has n floors,

    ♦ each holding exactly c people. There isI a single elevator that carries at most h

    people. We assume that the building is3 full (contains en people). Exactly c per-sons want to go to each floor: c to thefirst

    floor,

    c to the second floor and soI on. Some people may already be on theirdesired floor, but it is more interestingto assume that all or most are misfitswho want to be on another floor.

    The elevator always starts at the bot-tom. It movesup and down, loading andunloading passengers, until each personis where he wants to be. The elevatorthen returns to the first floor. A move-ment of the elevator from

    any

    floor tothe next floor above or below will becalled a unit trip. The problem is to findan algorithm that willsort all the peoplein a minimum number of unit trips. Thisoperation is equivalent, of course, tominimizing the distance traveled or (as-

    \ suming a constant elevator speed) tominimizing the time required for thesorting.

    As Knuth points out, the people cor-respond to records that are to be com- Richard M. Karp's algorithm

    f 4/12 =' the first

    A

    5 5~J ..

  • /NATION FOR THE 1976 TEXAS INSTRUMENTS FOUNDATION FOUNDERS' PRIZE IN PHYSICAL

    SCIFNrFc,

    /i.ff. SCIENCES, MANAGEMENT SCIENCES, ENGINEERING OR MATHEMATICS "liA^L bLIENCES »

    PLEASE TYPE

    AddressTelephone Number

    The nomination concerns the achievement of record in the field of [specify one[ ] Physical Sciences[ ] Health Sciences[ ] Management Sciences[ ] Engineering [designate specific discipline]IUJ Mathematics

    [2] Include factual statement by recognized authority in the field.

    [3] Include nominator's statement of expected path of the nominee as a result of this work

    [4] Include breadth of person's activity in other areas, if any.

    2.

    3.

    Name of Nominator Position or Title

    Address

    Telephone Number

    Date Signature

    Nomination concerning nccompl ishment in thc specified field should be accompanied bv acompleted copy ol thiT form to he considered by the Selection Committee. l

    [1] Include summary of the description of the achievement record qualiying for the award.

    [5] List three peer referees who may serve to evaluate this nominee in his primary field.1.

  • SU-50

    (10-72) STANFORD UNIVERSITYINTERDEPARTMENTAL MEMO

    To^QV- >^VWI^XJL J--Answer Full ParticularsApprove and Return Note and File)

    DepiM.^ Comment Note and Return/ \/C .a*i .f\ \\ xj, Correction Prepare Reply._^_r=. Conference Signature.—Conference Signature

    Dept File Suggestions-Handling

    Date _ I J&a.^.G. Return to.REMARKS