All public Sources
Public document

Mathematical Recreations and Essays

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

An example where the solution is obvious is if x=2nx = 2n, a=2a = 2, b=2b = 2, in which case y=n(2n−1)y = n(2n - 1), z=2n−1z = 2n - 1.

If we take the case x=15x = 15, a=3a = 3, b=2b = 2, we find y=35y = 35; and it happens that these 35 rows can be divided into 7 sets, each of which contains all the symbols; hence z=7z = 7. More generally, if x=5×3mx = 5 \times 3^m, a=3a = 3, b=2b = 2, we find y=32(x−1)/xy = \frac{3}{2}(x - 1)/x, z=12(x−1)z = \frac{1}{2}(x - 1). It will be noticed that in the solutions of the original fifteen school-girls problem and of Walecki’s extension of it given above every possible pair of girls walk together once; hence we might infer that in these cases we could determine zz as well as yy.

The results of the last paragraph were given by Kirkman† in 1850. In the same memoir he also proved that, if pp is a prime, and if x=pmx = p^m, a=pa = p, b=2b = 2, then y=(pm−1)/(p−1)y = (p^m - 1)/(p - 1); if x=(p2+p+1)(p+1)x = (p^2 + p + 1)(p + 1) where p2+p+1p^2 + p + 1 has no divisor less than p+1p + 1, a=p+1a = p + 1, b=2b = 2, then y=x(x−1)/p(p+1)y = x(x - 1)/p(p + 1); if x=p3+p+1x = p^3 + p + 1, a=p+1a = p + 1, b=2b = 2, then y=xy = x;


  • Philosophical Magazine, July, 1850, series 3, vol. XXXVII, p. 52; a solution by Sylvester is given in the Philosophical Magazine, May, 1861, series 4, vol. XXI, p. 371.

† Cambridge and Dublin Mathematical Journal, 1850, vol. v, pp. 255–262.

and Sylvester’s result that if x=15x=15, a=3a=3, b=3b=3, y=455y=455, z=91z=91. Three years later Kirkman∗^{*} solved the problem when x=2nx=2^n, a=4a=4, b=3b=3. Lastly, in 1893, Sylvester†^{\dagger} published the solution when x=9x=9, a=3a=3, b=3b=3, in which case y=84y=84, z=28z=28; and stated that a similar method was applicable when x=3mx=3^m, a=3a=3, b=3b=3: thus 9 girls can be arranged to walk out 28 times (say 4 times a day for a week) so that in any day the same pair never are together more than once and so that at the end of the week each girl has been associated with every possible pair of her schoolfellows.

In 1867 Mr S. Bills‡^{\ddagger} showed that if x=7x=7, a=3a=3, b=2b=2, then y=7y=7: if x=15x=15, a=3a=3, b=2b=2, then y=35y=35: if x=31x=31, a=3a=3, b=2b=2, then y=155y=155: and the method by which these results are proved will give the value of yy, if x=2n−1x=2^n-1, a=3a=3, b=2b=2. Shortly afterwards Mr W. Lea§^{\S} showed that if x=11x=11, a=5a=5, b=4b=4, then y=66y=66; also that if x=16x=16, a=4a=4, b=3b=3, then y=140y=140; the latter result is a particular case of Kirkman’s theorems. It will be noticed that these writers did not confine their discussion to cases where xx is an exact multiple of aa.

PROBLEMS CONNECTED WITH A PACK OF CARDS.

I mentioned in chapter I that an ordinary pack of playing cards could be used to illustrate many tricks depending on simple properties of numbers. Most of these involve the relative position of the cards. The principle of solution generally consists in re-arranging the pack in a particular manner so as to bring the card into some definite position. Any such rearrangement is a species of shuffling.

I shall treat in succession of problems connected with shuffling a pack, arrangements by rows and columns, the determination of a pair out of 12n(n+1)\frac{1}{2}n(n+1) pairs, Gergonne’s pile problem, and the game known as the mouse trap.

SHUFFLING A PACK.

Any system of shuffling a pack of cards, if carried out consistently, leads to an arrangement which can be calculated; but tricks that depend on it generally require considerable


∗^{*} Ibid., 1853, vol. VIII, pp. 38–42.

†^{\dagger} Messenger of Mathematics, February, 1893, vol. XXII, pp. 159–160.

‡^{\ddagger} Educational Times Reprints, London, 1867, vol. VIII, pp. 32–33.

§^{\S} Ibid., 1868, vol. IX, pp. 35–36; and 1874, vol. XXII, pp. 74–76; see also the volume for 1869, vol. XI, p. 97.

Original PDF link to page 30

technical skill.

Suppose for instance that a pack of nn cards is shuffled, as is not unusual, by placing the second card on the first, the third below these, the fourth above them, and so on. The theory of this system of shuffling is due to Monge*. The following are some of the results and are not difficult to prove directly.

If the pack contains 6p+46p + 4 cards, the (2p+2) (2p + 2)th card will occupy the same position in the shuffled pack. For instance, if a complete pack of 52 cards is shuffled as described above, the 18th card will remain the 18th card.

Again, if a pack of 10p+210p + 2 cards is shuffled in this way, the (2p+1) (2p + 1)th and the (6p×2) (6p \times 2)th cards will interchange places. For instance, if an écarté pack of 32 cards is shuffled as described above, the 7th and the 20th cards will change places.

More generally, one shuffle of a pack of 2p2p cards will move the card which was in the x0x_0th place to the x1x_1th place, where x1=12(2p+x0+1)x_1 = \frac{1}{2}(2p + x_0 + 1) if x0x_0 is odd, and x1=12(2p−x0+2)x_1 = \frac{1}{2}(2p - x_0 + 2) if x0x_0 is even, from which the above results can be deduced. By repeated applications of the above formulae we can show that the effect of mm such shuffles is to move the card which was initially in the x0x_0th place to the xmx_mth place where 2m+1xm=(4p+1)(2m−1±2m−2±⋯±2±1)±2x0+2m±12^{m+1}x_m = (4p + 1)(2^{m-1} \pm 2^{m-2} \pm \cdots \pm 2 \pm 1) \pm 2x_0 + 2^m \pm 1, the sign ±\pm representing an ambiguity of sign.

Again, in any pack of nn cards after a certain number of shufflings, not greater than nn, the cards will return to their primitive order. This will always be the case as soon as the original top card occupies that position again. To determine the number of shuffles required for a pack of 2p2p cards, it is sufficient to put xm=x0x_m = x_0 and find the smallest value of mm which satisfies the resulting equation for all values of x0x_0 from 1 to 2p2p. It follows that, if mm is the least number which makes 4m−14^m - 1 divisible by 4p+14p + 1, then mm shuffles will be required if either 2m+12^m + 1 or 2m−12^m - 1 is divisible by 4p+14p + 1, otherwise 2m2m shuffles will be required. The number


  • Monge’s investigations are printed in the Mémoires de l’Académie des Sciences. Paris, 1773, pp. 390–412. Among those who have studied the subject afresh I may in particular mention V. Bouniakowski, Bulletin physico-mathématique de St Pétersbourg, 1857, vol. xv, pp. 202–205, summarised in the Nouvelles annales de mathématiques, 1858, pp. 66–67; T. de St Laurent, Mémoires de l’Académie de Gard, 1865; L. Tanner, Educational Times Reprints, 1880, vol. XXXIII, pp. 73–75; and M.J. Bourget, Liouville’s Journal, 1882, pp. 413–434. The solutions given by Prof. Tanner are simple and concise.

for a pack of 2p+12p+1 cards is the same as that for a pack of 2p2p cards. With an écarté pack of 32 cards, six shuffles are sufficient; with a pack of 2n2^n cards, n+1n+1 shuffles are sufficient; with a full pack of 52 cards, twelve shuffles are sufficient; with a pack of 13 cards ten shuffles are sufficient; while with a pack of 50 cards fifty shuffles are required; and so on.

Mr W.H.H. Hudson* has also shown that, whatever is the law of shuffling, yet if it is repeated again and again on a pack of nn cards, the cards will ultimately fall into their initial positions after a number of shufflings not greater than the greatest possible L.C.M. of all numbers whose sum is nn.

For suppose that any particular position is occupied after the 1st, 2nd, . . ., ppth shuffles by the cards A1,A2,…,ApA_1, A_2, \ldots, A_p respectively, and that initially the position is occupied by the card A0A_0. Suppose further that after the ppth shuffle A0A_0 returns to its initial position, therefore A0=ApA_0 = A_p. Then at the second shuffling A2A_2 succeeds A1A_1 by the same law by which A1A_1 succeeded A0A_0 at the first; hence it follows that previous to the second shuffling A2A_2 must have been in the place occupied by A1A_1 previous to the first. Thus the cards which after the successive shuffles take the place initially occupied by A1A_1 are A2,A3,…,Ap,A1A_2, A_3, \ldots, A_p, A_1; that is, after the ppth shuffle A1A_1 has returned to the place initially occupied by it: and so for all the other cards A2,A3,…,Ap−1A_2, A_3, \ldots, A_{p-1}.

Hence the cards A1,A2,…,ApA_1, A_2, \ldots, A_p form a cycle of pp cards, one or other of which is always in one or other of pp positions in the pack, and which go through all their changes in pp shufflings. Let the number nn of the pack be divided into p,q,r,…p, q, r, \ldots such cycles, whose sum is nn; then the L.C.M. of p,q,r,…p, q, r, \ldots is the utmost number of shufflings necessary before all the cards will be brought back to their original places.

In the case of a pack of 52 cards, the greatest L.C.M. of numbers whose sum is 52 will be found by trial to be 180180.

ARRANGEMENTS BY ROWS AND COLUMNS. A not uncommon trick, which rests on a species of shuffling, depends on the obvious fact that if n2n^2 cards are arranged in the form of a square of nn rows, each containing nn cards, then any card will be defined if the row and the column in which it lies are mentioned.

This information is generally elicited by first asking in which row the selected card lies, and noting the extreme left-hand card of that


  • Educational Times Reprints, London, 1865, vol. II, p. 105.

row. The cards in each column are then taken up, face upwards, one at a time beginning with the lowest card of each column and taking the columns in their order from right to left–each card taken up being placed on the top of those previously taken up. The cards are then dealt out again in rows, from left to right, beginning with the top left-hand corner, and a question is put as to which row contains the card. The selected card will be that card in the row mentioned which is in the same vertical column as the card which was originally noted.

The above is the form in which the trick is usually presented, but it is greatly improved by allowing the pack to be cut as often as is liked before the cards are re-dealt, and then giving one cut at the end so as to make the top card in the pack one of those originally in the top row.

Grid of sixteen numbered squares arranged in four rows, with each row containing four numbered squares.
Figure i.
Grid of sixteen numbered squares arranged in four rows, with each row containing four numbered squares.
Figure ii.

The explanation is obvious. For, if 16 cards are taken, the first and second arrangements may be represented by figures i and ii. For example, if we are told that in figure i the card is in the third row, it must be either 9, 10, 11, or 12: hence, if we know in which row of figure ii it lies, it is determined. If we allow the pack to be cut between the deals, we must secure somehow that the top card is either 1, 2, 3, or 4, since that will leave the cards in each row of figure ii unaltered though the positions of the rows will be changed.

Continue reading
Page 26 of 81