Tribute to Martin Gardner: Combinatorial Card Problems Doug Ensley, SU Math Department October 7, 2010
Combinatorial Card Problems The column originally appeared in Scientific American magazine.
Combinatorial Card Problems The column originally appeared in Scientific American magazine. Reprinted in the book, Time Travel and Other Mathematical Bewilderments, published in 1988.
Combinatorial Card Problems The column originally appeared in Scientific American magazine. Reprinted in the book, Time Travel and Other Mathematical Bewilderments, published in 1988. Released in the complete collection, Martin Gardners Mathematical Games, by MAA on DVD.
Combinatorial Card Problems The column originally appeared in Scientific American magazine. Reprinted in the book, Time Travel and Other Mathematical Bewilderments, published in 1988. Released in the complete collection, Martin Gardners Mathematical Games, by MAA on DVD. Applets to accompany some of the puzzles can be found at http://webspace.ship.edu/deensley/flash/
Dramatizing an important number theorem... [Place your cards] face down in a row with the ace at the left. The following turning procedure is now applied, starting at the left at each step and proceeding to the right: Turn over every card. Turn over every second card. (Cards 2, 4, 6, 8,10, and Q are turned face down.) Turn over every third card. Continue in this manner, turning every fourth card, every fifth card, and so on until you turn over only the last card.
Dramatizing an important number theorem... A good classroom exercise is to prepare 100 small cards bearing numbers 1 through 100, stand them with their backs out in serial order on a blackboard ledge and apply the turning procedure. Sure enough, at the finish the only visible numbers will be the squares: 1, 4, 9, 16, 25, 36, 49, 64, 81, and 100. That is too large a sampling to be coincidental. The next step is to prove that no matter how large the deck, only squares survive the turning procedure.
Dramatizing an important number theorem... A simple roof introduces one of the oldest and most fundamental of number theorems: A positive integer has an odd number of divisors (the divisors include 1 and the number itself), if and only if the number is a square. This is easy to see. Most divisors of a number come in pairs. Consider 72. The smallest divisor, 1, goes into the number 72 times, giving the pair 1 and 72. The next-larger divisor, 2, goes into the number 36 times, giving the pair 2 and 36. Similarly, 72 = 3 24 = 4 18 = 6 12 = 8 9. The only divisor of a number that is not paired with a different number is a divisor that is a square root. Consequently, all non-squares have an even number of divisors, and all squares have an odd number of divisors.
Lehmers Motel Manager Problem Mr. Smith manages a motel. It consists of n rooms in a straight row. There is no vacancy. Smith is a psychologist who plans to study the effects of rearranging his guests in all possible ways. Every morning he gives them a new permutation. The weather is miserable, raining almost daily. To minimize his guests discomfort, each daily rearrangement is made by exchanging the occupants of two adjoining rooms. Is there a simple algorithm that will run through all possible arrangements by switching adjacent occupants at each step?
Lehmer s Motel Manager Problem Model the problem for 4 guests using cards A, 2, 3, 4 from your packet. Here is a list of all permutations. Try to do only adjacent swaps while checking off all of them. A234 2A34 3A24 4A23 A243 2A43 3A42 4A32 A324 23A4 32A4 42A3 A342 234A 324A 423A A423 24A3 34A2 43A2 A432 243A 342A 432A
Lehmer s Motel Manager Problem [An algorithmic solution] has important applications in computer science. Many problems require a computer in order to run through all permutations of n elements, and if this can be done by exchanging adjacent pairs, there is a significant reduction in computer time.... Hugo Steinhaus, a Polish mathematician, was the first to discover [the algorithm]. It provides a solution for the abacus problem on page 49 of his One Hundred Problems in Elementary Mathematics, first published in Poland in 1958. In the early 1960 s the procedure was independently rediscovered at almost the same time by H. F. Trotter and Selmer M. Johnson, each of whom published it separately.
Lehmer s Motel Manager Problem Solution. Think about it recursively. First solve the problem for n = 3 cards. A23 A32 3A2 32A 23A 2A3
Lehmer s Motel Manager Problem Solution. Think about it recursively. First solve the problem for n = 3 cards, and follow the 3... A23 A32 3A2 32A 23A 2A3
Lehmer s Motel Manager Problem Algorithm : Weave the 4 through the solution to the puzzle when n = 3, and you will have a solution to the puzzle when n = 4. A234 A342 432A 243A A243 A324 342A 423A A423 3A24 324A 42A3 4A23 3A42 32A4 24A3 4A32 34A2 23A4 2A43 A432 43A2 234A 2A34
John Conway s game of TopSwops Hold packet of 13 cards face up in your hand. Value of top card tells you how many to deal onto the table.
John Conway s game of TopSwops Hold packet of 13 cards face up in your hand. Value of top card tells you how many to deal onto the table. After dealing, collect the cards from the table and replace these on top of the packet in your hand.
John Conway s game of TopSwops Hold packet of 13 cards face up in your hand. Value of top card tells you how many to deal onto the table. After dealing, collect the cards from the table and replace these on top of the packet in your hand. Applet: http://webspace.ship.edu/deensley/flash/ topswots/topswots.html
John Conway s game of TopSwops
John Conway s game of TopSwops The process definitely gets into a loop when an Ace is on top of the packet. Are there longer cycles that repeat, or do we always end up stuck with an Ace on top?
John Conway s game of TopSwops Theorem (Wilf) The game of TopSwops always ends with an Ace on top. Proof. For a given arrangement of the cards c 1 c 2... c 13, a card is considered to be in its natural position if card c i has value i. For example, in the following arrangement cards 2 and 7 are in their natural positions: 6, 2, Q, 4, 8, T, 7, 9, 5, J, A, K, 3
John Conway s game of TopSwops Theorem (Wilf) The game of TopSwops always ends with an Ace on top. Proof continued... Define the function F as follows: F (c 1, c 2,..., c 13 ) = 2 j c j is natural If the top card has value K, then after one move in the game, that card is in its natural position. Moreover, any cards that were previously in natural positions have values less than K.
John Conway s game of TopSwops Theorem (Wilf) The game of TopSwops always ends with an Ace on top. Proof continued... For example, F (6, 2, Q, 4, 8, T, 7, 9, 5, J, A, K, 3) = 2 2 + 2 7 = 132 and after the TopSwops move, we have F (T, 8, 4, Q, 2, 6, 7, 9, 5, J, A, K, 3) = 2 6 + 2 7 = 192 Since I gained 2 6 = 64 and risked losing at most 2 1 + 2 2 + 2 3 + 2 4 + 2 5, the value of F definitely goes up with each move. The only exception is when A is first. Since F goes up with every other move, the process must terminate with an A on top.
John Conway s game of TopSwops Wilf writes, Since the numbers increase steadily but cannot exceed 16382, it follows that the game must halt after at most that many moves. A slightly more careful study shows, in fact, that for a game with n cards, no more than 2 n 1 moves can take place. This raises an interesting unsolved question: What arrangement of the thirteen cards provides the longest possible game of TopSwops?
John Conway s other games BotDrops (call the bottom card, count, and put the reversed set on the bottom) is more interesting. If you play it for a while, Conway writes, you might convince yourself that it always loops in a KQKQKQ... sequence, but that is not always the case. On rare occasions other loops are possible. (Can you find one?) Applet: http://webspace.ship.edu/deensley/flash/ botdrops/botdrops.html
John Conway s other games When the game is extended to two or more players, each with a packet, it becomes much harder to analyze. For instance, suppose two players have packets of thirteen cards each. One has spades, the other hearts. They play two player TopSwops as follows. Each shuffles his packet. Player A calls his top card, then B counts that number off his packet and replaces the reversed cards on top of his packet. B now calls his top card, A counts and replaces the reversed cards on top of his packet. This continues with players alternating calls. Applet: http://webspace.ship.edu/deensley/flash/ topswots/topswotsfor2.html
John Conway s other games It is a curious fact, reports Conway, that as soon as an ace is called, the calls go into a loop that starts with an ace, then a sequence, then an ace again (either the same ace or the other one), then the same sequence is repeated in reverse. For example, the first called ace might generate the following loop: 1-3-2-6-4-1-4-6-2-3-1. Note that the sequence between the first two ace calls is the reverse of the sequence between the second and third ace calls. It is an unproved conjecture (or was when I last heard from Conway) that in two-player TopSwops an ace is always called. It is not known if the game can conclude in a loop without an ace, although it is known that if a loop includes an ace, it includes it just twice.
Langford Puzzle Remove from a deck all the cards of three suits that bear values of ace through 9. Try to arrange these twenty-seven cards in a single row to meet the following proviso. Between the first two cards of every value k there are exactly k cards, and between the second and third cards of every value k there also are exactly k cards. For instance, between the first and second 7 s there must be just seven cards, not counting the two 7 s. Similarly, seven cards separate the second and third 7 s. The rule applies to each value from 1 through 9.
Silverman Card Puzzle Use two complete suits, say spades and diamonds, and match cards in pairs so that the sum of each pair is a perfect square. Ace = 1, Jack = 11, Queen = 12, King = 13 Applet: http://webspace.ship.edu/deensley/flash/ combinatorialcards/card_comb.html
Silverman Card Puzzle
Silverman Card Puzzle General question: For what values of n can the numbers in {1, 2, 3,..., n} be paired with the numbers in {1, 2, 3,..., n} so that the pairs each sum to perfect a square?
Silverman Card Puzzle General question: For what values of n can the numbers in {1, 2, 3,..., n} be paired with the numbers in {1, 2, 3,..., n} so that the pairs each sum to perfect a square? Example solution when n = 5: (1,3), (2,2), (3,1), (4,5), (5,4)
Silverman Card Puzzle General question: For what values of n can the numbers in {1, 2, 3,..., n} be paired with the numbers in {1, 2, 3,..., n} so that the pairs each sum to perfect a square? Example solution when n = 5: (1,3), (2,2), (3,1), (4,5), (5,4) Card puzzle addresses n = 13.
Silverman Card Puzzle Alan Hadsell and Stoddard Vandersteel together used a computer to generalize Silverman s problem. When you use a packet of cards from a single suit, solutions exist only for n = 3, 5, 8, 9, 10, 12, and 13, and each solution is unique.
Silverman Card Puzzle Alan Hadsell and Stoddard Vandersteel together used a computer to generalize Silverman s problem. When you use a packet of cards from a single suit, solutions exist only for n = 3, 5, 8, 9, 10, 12, and 13, and each solution is unique. From 14 through 31 all values of n have multiple solutions.
Silverman Card Puzzle Alan Hadsell and Stoddard Vandersteel together used a computer to generalize Silverman s problem. When you use a packet of cards from a single suit, solutions exist only for n = 3, 5, 8, 9, 10, 12, and 13, and each solution is unique. From 14 through 31 all values of n have multiple solutions. They report that the number of solutions, beginning with n = 14, are 2, 4, 3, 2, 5, 15, 21, 66, 37, 51, 144, 263, 601, 333, 2119, 2154, 2189, 3280,...