You are on page 1of 7

How Long Is a Game of Snakes and Ladders? Author(s): S. C. Althoen, L. King, K.

Schilling Source: The Mathematical Gazette, Vol. 77, No. 478 (Mar., 1993), pp. 71-76 Published by: The Mathematical Association Stable URL: http://www.jstor.org/stable/3619261 Accessed: 16/10/2009 02:05
Your use of the JSTOR archive indicates your acceptance of JSTOR's Terms and Conditions of Use, available at http://www.jstor.org/page/info/about/policies/terms.jsp. JSTOR's Terms and Conditions of Use provides, in part, that unless you have obtained prior permission, you may not download an entire issue of a journal or multiple copies of articles, and you may use content in the JSTOR archive only for your personal, non-commercial use. Please contact the publisher regarding any further use of this work. Publisher contact information may be obtained at http://www.jstor.org/action/showPublisher?publisherCode=mathas. Each copy of any part of a JSTOR transmission must contain the same copyright notice that appears on the screen or printed page of such transmission. JSTOR is a not-for-profit service that helps scholars, researchers, and students discover, use, and build upon a wide range of content in a trusted digital archive. We use information technology and tools to increase productivity and facilitate new forms of scholarship. For more information about JSTOR, please contact support@jstor.org.

The Mathematical Association is collaborating with JSTOR to digitize, preserve and extend access to The Mathematical Gazette.

http://www.jstor.org

Similarly if the token lands on the squareat the top of a snake.78) In the Americanversion the snakes are called chutes. If a token lands on a squarecontainingthe bottom of a ladderit is immediatelymoved to the squareat the top of the ladder.91) (80.L. Snakes and Ladders provides a list of good behaviours(bottom of ladders) and their rewards (tops of ladders).75) (98.73)(95. it is immediatelymoved to the square at the bottom of the snake.24) (93. which in the U. The Hindu version is Snakes and Arrows. (56. Startingoff the board(in state 0). Thus.60) (87. a serious commentary and religious interpretationof the Hindu board game Leela.84) (36.S. the token is not moved.26) (49.44) (51.HOWLONG A GAME SNAKES IS OF ANDLADDERS? 71 How long is a game of snakesand ladders? S."for 50? in 1943 by the Milton Bradley Company of Springfield.The player to first reach square 100 exactly wins.11). The Game is Leela.19) (64.C.31) (21. ALTHOEN. 53) (62. players in turnroll a six-faced die or use a spinner to determine how many squares to advance. Two or more tokens may occupy the same square simultaneously.14) (9. which is amenableto mathematicalas well as moral analysis. the Game in which each of us is a player acting out his role. As a lesson in morality. Leela is essentially the game Snakes and Ladders.67) (71.38) (4.100) Snakes: (16.This game is really a 101 state absorbingMarkovchain.6) (47. KING and K. The Milton .14) represents"Study"leading to "Knowledge"and the snake (64. the universal play of cosmic energy. is the popular children's game Chutes and Ladders. specifically the expected playing time. In what follows we investigate only the mathematical side of this diversion. The game contains 10 snakes and 9 ladders with beginning and ending states given by the following orderedpairs: Ladders: (1. Similarly for snakes and bad behaviours. the ladder (4. Massachusetts. If a move would take the player beyond the last square.England's famous indoor sport. Description The game we discuss is played on a ten by ten board with squares numberedI to 100.60) represents "Carelessness" leading to "Injury". first marketed as "the improved new version of snakes and ladders. SCHILLING "Thereis really only one Game." Thus begins Harish Johari in Leela: the game of selfknowledge.42) (28.

7 7 158 4 5 6 7 8 9 10 39. since opponents act independentlyas they move theirtokens along the board.1 . Leela has 73 states (0 through72) with 10 snakes and 10 arrows.0 7 7 7 8 7 7 7 205 187 198 207 176 185 242 Overallaveragelength:39. RND(X) generates the same "random" numbers.In the BASIC programminglanguage.in most versions of BASIC each time you run a program. We simulated the Milton Bradley game using a version of BASIC called UBASIC86 (created by Yuji Kida of Kanazawa University) because its random number generator can produce distinct sequences.it is ignored.8 7 175 7 39.Even changing the "seed"X doesn't help . there is even a 7 by 7 travel version with 50 states. Here are the resultsof a simulationof 10 runs of 1000 games each: Run Number 1 2 3 Average Length ShortestGame Longest Game 39. four snakes (called slides) and four ladders(called steps).5 38. how long does it typically take a single player to finish a game by reachingsquare 100? Simulation It is easy to simulate any version of the game Snakes and Ladders using any programming language thathas a randomnumbergenerator.But be careful .but considering them would take us too far afield. the function RND(X) is used to generate randomnumbers. we will consider a solitaire version.The question is. For example. There are other dangers in using random number generators.8 39.S.9 39. In the U.5 38.72 E GAZETI THEMATHEMATICAL Bradley game merely has cartoon illustrations of behaviours at the beginning and ends of the chutes and ladders.5 38.2 185 38.3 39. State 68 (Cosmic Consciousness) is the winning state (there is a snake in state 72 to get you back to earth (state 51)) and there are special rules regardingthe roll of a six.There are other versions of the game. Though Snakes and Laddersis intendedto be played by two or more players.

As a hint. 5. 4. for if he lands on square 1 the ladder (1.M)-l. 6. the player's state before his first roll puts him on the board.(Rolls of 1. 2. 2. a die roll which would cause the player to go past State 100 results in no move. This is because we first add a State 0. Let (sij) = (I . For example. Theoryof MarkovChains One can use the theory of Markov chains in a standardway to compute the exact expected (i. average)length of a game of Snakes and Ladders. Our Markov chain will be an 82 x 82 matrix with most rows containing 6 consecutive 1/6's. here are the right ends of the last few rows labelled with the corresponding squares: 75 94 76 (I 77 (I 7X 6 79 81 0 82 (l 13 / 84 ( K5 (I 0 A6 88 (I N9 (i '9 91 (X 92 94 ( 96 97 I0 61 99 1 *(X ( 96 ( ( /I h (! (I (I (I /1 ( I 0 0 0 (I (I (I 0 I I 0(I 0 ( 0 ( 0 0I 0 0 0 ( I The theory of Markov chains says that we may compute the expected (average)playing time for this game as follows: Let M be the 81 x 81 matrix obtained by deleting the last row and column from the transitionmatrix.M)-1. and that there are several ways to obtain this minimum. First. Of course. Then soj is the expected numberof rolls the player will spend in squarey. 6. with two kinds of exceptions. 6. the last few rows must reflect the fact that a player must reach State 100 exactly. the row corresponding to any state from which you can reach a snake or laddermust be changed to take into account the effect of that snake or ladder. It is not hardto see that the shortestpossible game lasts only seven moves. We leave it to the reader to construct the entire transitionmatrix for Snakes and Ladders.38) immediately deposits him into State 38. Second.e.ANDLADDERS? OF IS HOWLONG A GAME SNAKES 73 It seems safe to say that the average length of a game of Snakes and Laddersis about 39 moves. thereis no longest game. 6 are two of them). 5. Let I be the 81 x 81 identity matrix. a player is never actually in State 1. 5. The expected numberof rolls needed to complete the game is the sum of the entries in the top row of the matrix(I . .We then delete each state corresponding to the beginning of a snake or ladder. 3 and 4. 6. it is most naturalto model the game as a Markovchain with 82 states. Although the game board for Snakes and Ladders has 100 squares. The transitionmatrix for a Markov chain with n states is an n x n matrix where the entry in row i and column j is the probabilitythat a player in state i on one turn will be in state j on the next turn.

instead of storing the decimal approximation of each number.it is not hardto see that (I .74 THEMATHEMATICAL GAZ'I'I'E We performedthis computationon a Zenith microcomputer...that is. = 1 for 0 Sjj A. You may recall that the average length of a game of Snakes and Ladders was about 39 moves. In orderto avoid roundofferror.i = 0 for i < j k- = nsJk n-k k s.M)-l = (sij).. These values were obtainedby Gaussianelimination..again using the language UBASIC86. we stored its exact numeratorand denominator. our MarkovChainhas n+ 1 states. We chose UBASIC86 because it allows very large integers.mi . (Of course... We will model the game with a slightly differentMarkovchain from the one we used in before. We used UBASIC86 and these formulasto find the expected playing time for a 100-squaregame played with a six-sided die.we used exact computations.) The exact expected number of moves in the Milton Bradleyversion of Chutesand Laddersis 225837582538403273407117496273279920181931269186581786048583 5757472998140039232950575874628786131130999406013041613400 which is approximately39.0. as above.m. Consider a general Snakes and Ladders-stylegame with n squares. 0.m <j< n n-m i= k. and its (n+1) x (n+l) transition matrixhas rows (0.0) with m consecutive I/m 's .. when the 'must land exactly on squaren' rule takes effect. l/m. no irrationalnumbersarise in the computationof the inverse of a matrix with integer entries... s for j <k< = -m n-Ij for n.. Apparentlythe snakes lengthen the game . where s. First consider the game with no snakes or ladders.1 < j s1 JJJ n. 1/m.t s. played with an m-sided die. i = k . In this case. (That is... Snakes and Ladders with neither snakes nor ladders!) It is almost exactly 33 moves.except in the last few rows.. This is reasonablyclose to our simulations in above. s. Sensitivity Whateffect does addinga single snake or ladderhave on the average length of a game? In this section we show how to answerthis question. Ji for n-m < k < n. If M is the matrixobtainedby deleting the last row and column of this transitionmatrix.2.

For each snake or ladder... Therefore. say from squarei to squarej. i 1.0) where the 1 is in columnj. let's add snakes and/or ladders.... that is.0) J (0.. the exact playing time of the game is x1.0. If we multiply either of these rows by the Ithcolumn of S-1 1l Snl ...0.0.. The matrixremains(n + 1) x (n + 1)... The ilh row of 5' = I.0.M' is i J (0.M)-1.. 1.M. Whatis the effect of addinga new snake or ladderfrom state i to statej ? To answer this question. k i.. for 85lthe Kroneckerdelta.. Since S and S' agree in all but the ith row.-1. E must be the identity matrixin all but the itl row: el =8k..-1.The ithrow of E is the ilh row of S' times S -1.0... By changing instead of eliminatingrow i....HOW LONG IS A GAME OF SNAKES AND LADDERS? 75 more than the laddersshortenit..0. We need to computeS'-1 = (s'/) where S' = I ... Suppose that we know all of the entries (sk. and the next turn is spent at its other end.if we have snakes and laddersfrom states in the set 3. 1.0) dependingupon whetheri < j or i > j.. change row i of the transitionmatrixto (0. and the matrixM obtainedby removing its last row and column will be n x n. 1 if k = 1.) = S-1. Now suppose that we fix a game with matrixM as in the preceding Let paragraph.. so ES = S'. and (st.).. Let E = S' 5-1. 0 if k ? 1... Next.M'.. where (sij) = (1. S = I. let M' be the transitionmatrix (minus last row and column) of the game with the new snake or ladder. we have modelled a game where one turn is spent at the top of a snake or bottom of a ladder...0.0..

76 we obtain e. K. since it increases the chances of missing the importantladderfrom state 80 to 100. if we insert a ladderfrom state 46 to state 94 the expected length of the game drops from about 39. U.. Think of computing E-1 by Gauss-Jordanreduction..0.sl.To save space in what follows we have roundedthe exact rationalanswers.Sji Skli (S S(i \ii Z S. 0. Michigan. Flint.C. The University of Michigan .. In general.) for | 5 . ALTHOEN.9. SCHILLING Department of Mathematics. if instead we insert a snake from state 83 to state 7. SJ. where f ik = k. Jt1 compute S'-1 = S-IE-1. Similarly. . since E is invertible. The matrixE is the n x n identitymatrixwith its ithrow replacedby eil = sil .8 moves. In each column except column i we would use the row operationRi . the game lengthens to about 45.. we k S= + l? . to obtainS'-1 from S-1 we need only calculate E-1.j).' I I . say.Flint.2 to about 29. Thus E-1 = (f.adding a snake to the originalgame from state 29 to state 27 shortens the game by over a move to about 38.eildR These operations reduce E to the identity except for the eii left on the diagonal.L. KING. Surprisingly. ts. . Adding a ladder to the original game from state 79 to state 81 lengthens the expected playing time by more than two moves to about 41.8.. s.sj.this is not always the case. for k ? i Aj e.5for k I = i This formulacan be used to calculate quickly and exactly the effect of adding a snake or ladderon.Then by considering the two cases 1 ? i and I = i we obtain the answer: Note that det E = eii = si.l = sl . since it gives a second chance at the long ladderfrom 28 to 84. . For example. 1.A. Let S'-1 = ('kl). S.sjl.. Snakes and Ladders. h THEMATHEMATICAL GAZETl Since S'-1 = S -1E-l. To complete the reductionwe divide row i by eii .S. .. _1 1 e. one expects that an additional ladder will shorten the game and an additionalsnake will lengthen it. Finally.