All public Sources
Public document

Mathematical Recreations and Essays

PDF document375 original pagesAdded to Pandi 6 November 2026
AskTalkView media
Reading progressPage 22 of 81

counters to bring them into the order given in the first diagram. Hence in this case the problem would be insoluble.

The easiest way of finding the number of simple interchanges necessary in order to obtain one given arrangement from another is to make the transformation by a series of cycles. For example, suppose that we take the counters in the box in any definite order, such as taking the successive rows from left to right, and suppose the original order and the final order to be respectively

1, 13, 2, 3, 5, 7, 12, 8, 15, 6, 9, 4, 11, 10, 14, and 11, 2, 3, 4, 5, 6, 7, 1, 9, 10, 13, 12, 8, 14, 15.

We can deduce the second order from the first by 12 simple interchanges. The simplest way of seeing this is to arrange the process in three separate cycles as follows:—

1, 11, 8 ; | 13, 2, 3, 4, 12, 7, 6, 10, 14, 15, 9 ; | 5. 11, 8, 1 ; | 2, 3, 4, 12, 7, 6, 10, 14, 15, 9, 13 ; | 5.

Thus, if in the first row of figures 11 is substituted for 1, then 8 for 11, then 1 for 8, we have made a cyclical interchange of 3 numbers, which is equivalent to 2 simple interchanges (namely, interchanging 1 and 11, and then 1 and 8). Thus the whole process is equivalent to one cyclical interchange of 3 numbers, another of 11 numbers, and another of 1 number. Hence it is equivalent to (2 + 10 + 0) simple interchanges. This is an even number, and thus one of these orders can be deduced from the other by moving the counters about in the box.

It is obvious that, if the initial order is the same as the required order except that the last three counters are in the order 15, 14, 13, it would require one interchange to put them in the order 13, 14, 15; hence the problem is insoluble.

If however the box is turned through a right angle, so as to make ADAD the top, this rotation will be equivalent to 13 simple interchanges. For, if we keep the sixteenth square always blank, then such a rotation would change any order such as

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, to 13, 9, 5, 1, 14, 10, 6, 2, 15, 11, 7, 3, 12, 8, 4,

which is equivalent to 13 simple interchanges. Hence it will change the arrangement from one in which a solution is impossible to one where it is possible, and vice versa.

Again, even if the initial order is one which makes a solution impossible, yet if the first cell and not the last is left blank it will be possible to arrange the fifteen counters in their natural order. For, if we represent the blank cell by bb, this will be equivalent to changing the order

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, b, b, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 151, \ 2, \ 3, \ 4, \ 5, \ 6, \ 7, \ 8, \ 9, \ 10, \ 11, \ 12, \ 13, \ 14, \ 15, \ b, \ b, \ 1, \ 2, \ 3, \ 4, \ 5, \ 6, \ 7, \ 8, \ 9, \ 10, \ 11, \ 12, \ 13, \ 14, \ 15 :

this is a cyclical interchange of 16 things and therefore is equivalent to 15 simple interchanges. Hence it will change the arrangement from one in which a solution is impossible to one where it is possible, and vice versa.

It is evident that the above principles are applicable equally to a rectangular box containing mnmn cells or spaces and mn−1mn - 1 counters which are numbered. Of course mm may be equal to nn. If such a box is turned through a right angle, and mm and nn are both even, it will be equivalent to mn−3mn - 3 simple interchanges—and thus will change an impossible position to a possible one, and vice versa—but unless both mm and nn are even the rotation is equivalent to only an even number of interchanges. Similarly, if either mm or nn is even, and it is impossible to solve the problem when the last cell is left blank, then it will be possible to solve it by leaving the first cell blank.

The problem may be made more difficult by limiting the possible movements by fixing bars inside the box which will prevent the movement of a counter transverse to their directions. We can conceive also of a similar cubical puzzle, but we could not work it practically except by sections.

THE TOWER OF HANOI.

I may mention next the ingenious puzzle known as the Tower of Hanoi. It was brought out in 1883 by M. Claus (Lucas).

It consists of three pegs fastened to a stand, and of eight circular discs of wood or cardboard each of which has a hole in the middle so that a peg can be put through it. These discs are of different radii, and initially they are placed all on one peg, so that the biggest is at the bottom, and the radii of the successive discs decrease as we ascend: thus the smallest disc is at the top. This arrangement is called the Tower. The problem is to shift the discs from one peg to another in such a way that a disc shall never rest on one smaller than itself, and

finally to transfer the tower (i.e. all the discs in their proper order) from the peg on which they initially rested to one of the other pegs.

The method of effecting this is as follows. (i) If initially there are nn discs on the peg AA, the first operation is to transfer gradually the top n−1n-1 discs from the peg AA to the peg BB, leaving the peg CC vacant: suppose that this requires xx separate transfers. (ii) Next, move the bottom disc to the peg CC. (iii) Then, reversing the first process, transfer gradually the n−1n-1 discs from BB to CC, which will necessitate xx transfers. Hence, if it requires xx transfers of simple discs to move a tower of n−1n-1 discs, then it will require 2x+12x+1 separate transfers of single discs to move a tower of nn discs. Now with 2 discs it requires 3 transfers, i.e. 22−12^2-1 transfers; hence with 3 discs the number of transfers required will be 2(22−1)+12(2^2-1)+1, that is, 23−12^3-1. Proceeding in this way we see that with a tower of nn discs it will require 2n−12^n-1 transfers of single discs to effect the complete transfer. Thus the eight discs of the puzzle will require 255 single transfers. The result can be also obtained by the theory of finite differences. It will be noticed that every alternate move consists of a transfer of the smallest disc from one peg to another, the pegs being taken in cyclical order.

M. De Parville gives an account of the origin of the toy which is a sufficiently pretty conceit to deserve repetition*. In the great temple at Benares, says he, beneath the dome which marks the centre of the world, rests a brass-plate in which are fixed three diamond needles, each a cubit high and as thick as the body of a bee. On one of these needles, at the creation, God placed sixty-four discs of pure gold, the largest disc resting on the brass plate, and the others getting smaller and smaller up to the top one. This is the Tower of Bramah. Day and night unceasingly the priests transfer the discs from one diamond needle to another according to the fixed and immutable laws of Bramah, which require that the priest must not move more than one disc at a time and that he must place this disc on a needle so that there is no smaller disc below it. When the sixty-four discs shall have been thus transferred from the needle on which at the creation God placed them to one of the other needles, tower, temple, and Brahmins alike will crumble into dust, and with a thunder-clap the world will vanish. Would that English writers were in the habit of inventing equally interesting origins for the puzzles they produce!

  • La Nature, Paris, 1884, part I, pp. 285–286.

The number of separate transfers of single discs which the Brahmins must make to effect the transfer of the tower is 264−12^{64}-1, that is, is 18,446744,073709,551615: a number which, even if the priests never made a mistake, would require many thousands of millions of years to carry out.

Chinese Rings.* A somewhat more elaborate toy, known as Chinese Rings, which is on sale in most English toy-shops, is represented in the accompanying figure. It consists of a number of rings hung upon a bar in such a manner that the ring at one end (say AA) can be taken off or put on the bar at pleasure; but any other ring can be taken off or put on only when the one next to it towards AA is on, and all the rest towards AA are off the bar. The order of the rings cannot be changed.

Line drawing of Chinese Rings, with rings hanging from a bar above a horizontal platform and a ring at the end.
Only one ring can be taken off or put on at a time. [In the toy, as usually sold, the first two rings form an exception to the rule. Both these can be taken off or put on together. To simplify the discussion I shall assume at first that only one ring is taken off or put on at a time.] I proceed to show that, if there are nn rings, then in order to

* It was described by Cardan in 1550 in his De Subtilitate, bk. xv, paragr. 2, ed. Sponius, vol. III, p. 587; by Wallis in his Algebra, second edition, 1693, Opera, vol. II, chap. 111, pp. 472–478; and allusion is made to it also in Ozanam’s Récérations, 1723 edition, vol. IV, p. 439.

disconnect them from the bar, it will be necessary to take a ring off or to put a ring on either 13(2n+1−1)\frac{1}{3}(2^{n+1}-1) times or 13(2n+1−2)\frac{1}{3}(2^{n+1}-2) times according as nn is odd or even.

Let the taking a ring off the bar or putting a ring on the bar be called a step. It is usual to number the rings from the free end AA. Let us suppose that we commence with the first mm rings off the bar and all the rest on the bar; and suppose that then it requires x−1x-1 steps to take off the next ring, that is, it requires x−1x-1 additional steps to arrange the rings so that the first m+1m+1 of them are off the bar and all the rest are on it. Before taking these steps we can take off the (m+2)(m+2)th ring and thus it will require xx steps from our initial position to remove the (m+1)(m+1)th and (m+2)(m+2)th rings.

Suppose that these xx steps have been made and that thus the first m+2m+2 rings are off the bar and the rest on it, and let us find how many additional steps are now necessary to take off the (m+3)(m+3)th and (m+4)(m+4)th rings. To take these off we begin by taking off the (m+4)(m+4)th ring: this requires 1 step. Before we can take off the (m+3)(m+3)th we must arrange the rings so that the (m+2)(m+2)th is on and the first m+1m+1 rings are off: to effect this, (i) we must get the (m+1)(m+1)th ring on and the first mm rings off, which requires x−1x-1 steps, (ii) then we must put on the (m+2)(m+2)th ring, which requires 1 step, (iii) and lastly we must take the (m+1)(m+1)th ring off, which requires x−1x-1 steps: thus this series of movements requires in all {2(x−1)+1}\{2(x-1)+1\} steps. Next we can take the (m+3)(m+3)th ring off, which requires 1 step; this leaves us with the first m+1m+1 rings off, the (m+2)(m+2)th on, the (m+3)(m+3)th off and all the rest on. Finally to take off the (m+2)(m+2)th ring, (i) we get the (m+1)(m+1)th ring on and the first mm rings off, which requires x−1x-1 steps, (ii) we take off the (m+2)(m+2)th ring, which requires 1 step, (iii) we take (m+1)(m+1)th ring off, which requires x−1x-1 steps: thus this series of movements requires {2(x−1)+1}\{2(x-1)+1\} steps.

Continue reading
Page 22 of 81