Sie sind auf Seite 1von 2

Featured Columns

(starting) player or the 2nd player, and then notify its moves in response to the opponents moves.) Solution of Game-1 One way of approaching this problem is by backward reasoning. In reasoning backwards, analysis of the last move (turn) of the game yields two key characteristics: Characteristic-1: If J is even, then J>2N/3 is sufficient for winning, by adding J/2 to J. Characteristic-2: If J is odd, then J must be greater (and for some Js - much greater) than 3N/4 for winning, since the largest proper divisor of N is not greater than N/3. Characterist-1 can be generalized: An even J yields a maximal possible increase to 3J/2. Characteristic-2 implies that an odd J yields an increase to a value lower (often much lower) than 3J/2. Moreover, the increase of odd J will surely result in an even value, since all the divisors of an odd integer are odd. The latter analysis yields the invariant of the winners strategy: Invariant: Prior to each of the winners moves J will be even. The winner will be the one who starts the game. Each of her moves will be an increase of J by 1, except for the last, winning move. The winner will always have the option of advancing J further than the opponents next move. As long as J is not large enough, she will force the opponent to yield a new, larger J. Once J will exceed 3N/2, she will increase it by J/2 and win the game. Game-2: Remaining Co-primes Given two positive integers M and N (M<N), two players remove integers from the line of integers MN. Each player removes, on her turn, one integer not yet removed. Eventually (after N-M-1 turns), only two integers will remain. If they are co-primes (their GCD is 1), then the 1st (starting) player wins; otherwise the 2nd player wins. Develop an algorithm for winning the game. In addition to winning, the algorithm should utilize as little space as possible. Solution of Game-2 We should notice that the initial number of integers may matter. If the parities of M and N are equal, then the initial number of integers to remove is odd; otherwise, it is even. In the former case, the starting, 1st player has an extra move, and this may be an important asset. As in the previous game, we may try to reach valuable insight through the game end. Here, the game ends when only two integers remain. The 1st players objective is two remaining co-primes. We may seek a simple characteristic of two integers, which implies that they are co-primes. One characteristic that often comes to mind is the following: Adjacency Characteristic: Every two consecutive integers (greater than 1), J and J+1 are co-primes. The 1st player may try to go for a strategy that leaves two adjacent integers in the end. Is this difficult to achieve? No. The 1st player approaches an initially odd number of integers. Therefore, she may remove one of the ends, and then view the remaining line as composed of a sequence of pairs of adjacent integers. She should preserve the following invariant: Invariant: After each of the 1st players moves, the integers not yet removed can be viewed as a series of adjacent pairs of the form J,J+1. The invariant implies that after making the first move, the 1st player will guarantee her win by responding to each of her opponents moves with the removal of the integer that pairs with the integer just removed by the opponent. So far we only analyzed the case where the parities of N and M are equal. When the parities are unequal, the 1st player does not have an extra move. This may significantly affect the nature of the game. The 1st player will be unable to keep the above invariant. In addition, exactly half of the integers in the beginning of the game are even, and every 3rd integer is a multiple of 3. These characteristics yield an advantage for the 2nd player. The interested reader is welcome to complete the analysis. Conclusion In reflection on the presented solutions, we highlight the relevance of backward reasoning and underlying invariants. Backward reasoning is a general problem-solving heuristic, relevant in a variety of domains. Underlying invariants are essential means in algorithm design and verification.

Nifty Assignments

Platonic Euler Solids


Nick Parlante

I
30

n polite company, its normal to talk about a favorite movie or novel. For this article, I feel Im in safe enough company that, at long last, I can come out with my all-time favorite discrete math proof. The proof has an elegance to it and happens to bring together a nice combination of concepts for the end of a discrete math course. The proof uses Eulers formula for planar graphs to show that the number of platonic solids must be exactly five. (A platonic solid is one where all of the faces and all of the vertexes are uniform, so the shape looks the same

inroads The SIGCSE Bulletin

Volume 35, Number 2, 2003 June

Featured Columns
from every side, such as a game die used to generate random numbers.) The proof is a nice example of isomorphism, in this case using reasoning about graphs (nodes, edges, and whatnot) to prove something about 3-d solids. In truth however, the real appeal of the proof to me comes down to the number five. Why are there exactly five platonic solids anyway? The five appears to be a sort of arbitrary magic constant set down in some great config file in the sky (#define PLATONIC 5, or perhaps <platonic>5</platonic>). Weve grown accustomed to real number magic constants. Lord knows, we are no longer surprised when or crops up in some seemingly unrelated bit of mathematics, but integer magic constants seem more special. I have great affection for the platonic solid proof because it takes what appears to be some sort of magic constant in geometry, and derives it in the seemingly unrelated domain of graphs. In doing this, it makes the universe seems just a little less arbitrary, a little more well thought out. The Proof Nifty Assignments often have a visual component, and this will be no exception. Well start with a clever visual isomorphism to map each platonic solid to a planar graph. Start with any platonic solid. Choose a face of the solid and stretch its edges to the outside, flattening the solid out to form a planar graph. Having moved the problem to the graph domain, well use Euler's formula to show that there are exactly five possible such graphs. Say we have V vertexes, F faces, and E edges, Euler's formula gives us V - E + F = 2. Because of the uniformity of the platonic solid, we know that each vertex has the same number of edges going into it (call this d), and each face has the same number of edges around it (call this k). The product of the number of vertexes and d is twice E, since each edge touches two vertexes (Vd = 2E). Likewise, the product of the number of faces and the number of edges around each face is twice E, since each edge touches two faces (Fk = 2E). Each vertex of the solid must join at least three faces, so d3, and each face must have at least three edges around it, so k3. Rewriting these two equations to the form V = 2E/d, F = 2E/k, and substituting into Eulers formula gives us 2E/d - E + 2E/k = 2, which simplifies to E(2/d + 2/k - 1) = 2 . At this point, there are several ways forward; however, the easiest way I know uses a slight trick. (Aside: as a student, I always had the worst time with problems that required a trick, so as an instructor, I try to give a hint if theres a spot in the problem where the way forward is especially unintuitive. Alternatively, there is a style of teaching that prizes such tricks in problem solving, but thats a discussion for another day.) Heres the trick: Looking at the above equation, notice that E must be multiplied by a positive number to yield 2, and therefore, (2/d + 2/k) must be strictly larger than one; that is, (2/d + 2/k) > 1. We already know d3 and k3, so the above is enormously constraining on d and k. Its possible to derive algebraically that d5 and k5, but in fact just inspection shows that if d or k gets very big (6 or more), theres no way the sum of the two fractions can be greater than one. With d and k constrained to between 3 and 5, its easy to find the five combinations of d, k, and E that satisfy the equation, and those combinations correspond exactly to the five platonic solids. Substitute the values into F = 2E/k, to see the number of faces for each solid 4, 6, 8, 12, and 20. I love this proof because the notion of a platonic solid seems to be such a creature of geometry, interior angles, faces, and whatnot, and yet by transforming the problem into the graph domain, the seemingly magic constant five can be made to fall out of Eulers formula.

Stretch the edges of a face to the outside to make a planar graph.

k edges around each face


31

d edges at each vertex


Volume 35, Number 2, 2003 June

inroads The SIGCSE Bulletin

Das könnte Ihnen auch gefallen