Analyzing Games: Solutions

Similar documents
Problem 4.R1: Best Range

Grade 7/8 Math Circles Game Theory October 27/28, 2015

Grade 6 Math Circles Combinatorial Games November 3/4, 2015

I.M.O. Winter Training Camp 2008: Invariants and Monovariants

Problem Set 10 2 E = 3 F

Senior Math Circles February 10, 2010 Game Theory II

Grade 6 Math Circles Combinatorial Games - Solutions November 3/4, 2015

arxiv: v1 [math.co] 7 Jan 2010

Beeches Holiday Lets Games Manual

Probability. Misha Lavrov. ARML Practice 5/5/2013

The tenure game. The tenure game. Winning strategies for the tenure game. Winning condition for the tenure game

Grade 7 & 8 Math Circles. Mathematical Games

12. 6 jokes are minimal.

Comprehensive Rules Document v1.1

Combinatorial Games. Jeffrey Kwan. October 2, 2017

GEOGRAPHY PLAYED ON AN N-CYCLE TIMES A 4-CYCLE

PUTNAM PROBLEMS FINITE MATHEMATICS, COMBINATORICS

Topics to be covered

Massachusetts Institute of Technology 6.042J/18.062J, Spring 04: Mathematics for Computer Science April 16 Prof. Albert R. Meyer and Dr.

3. If you can t make the sum with your cards, you must draw one card. 4. Players take turns rolling and discarding cards.

BAPC The Problem Set

Game Theory and Algorithms Lecture 19: Nim & Impartial Combinatorial Games

Games of Skill ANSWERS Lesson 1 of 9, work in pairs

The Caster Chronicles Comprehensive Rules ver. 1.0 Last Update:October 20 th, 2017 Effective:October 20 th, 2017

18.S34 (FALL, 2007) PROBLEMS ON PROBABILITY

PLAYERS AGES MINS.

Olympiad Combinatorics. Pranav A. Sriram

Solutions for the Practice Final

The Galaxy. Christopher Gutierrez, Brenda Garcia, Katrina Nieh. August 18, 2012

Eleventh Annual Ohio Wesleyan University Programming Contest April 1, 2017 Rules: 1. There are six questions to be completed in four hours. 2.

BMT 2018 Combinatorics Test Solutions March 18, 2018

Programming an Othello AI Michael An (man4), Evan Liang (liange)

SMT 2014 Advanced Topics Test Solutions February 15, 2014

New Values for Top Entails

Impartial Combinatorial Games Berkeley Math Circle Intermediate II Ted Alper Evans Hall, room 740 Sept 1, 2015

Practice Session 2. HW 1 Review

Pennies vs Paperclips

Game, Set, and Match Carl W. Lee September 2016

VARIATIONS ON NARROW DOTS-AND-BOXES AND DOTS-AND-TRIANGLES

Solutions to Part I of Game Theory

Math 1111 Math Exam Study Guide

Ovals and Diamonds and Squiggles, Oh My! (The Game of SET)

MONUMENTAL RULES. COMPONENTS Cards AIM OF THE GAME SETUP Funforge. Matthew Dunstan. 1 4 players l min l Ages 14+ Tokens

ON SPLITTING UP PILES OF STONES

Print and Play Instructions: 1. Print Swamped Print and Play.pdf on 6 pages front and back. Cut all odd-numbered pages.

The 2016 ACM-ICPC Asia China-Final Contest Problems

OCTAGON 5 IN 1 GAME SET

Figure 1: The Game of Fifteen

Notes for Recitation 3

3 The multiplication rule/miscellaneous counting problems

Alberta 55 plus Cribbage Rules

4th Pui Ching Invitational Mathematics Competition. Final Event (Secondary 1)

Problem A To and Fro (Problem appeared in the 2004/2005 Regional Competition in North America East Central.)

CSE 21 Practice Final Exam Winter 2016

COMPONENTS GAME SETUP GAME SEQUENCE

Date. Probability. Chapter

Games for Drill and Practice

Card Racer. By Brad Bachelor and Mike Nicholson

Yale University Department of Computer Science

Al-Jabar A mathematical game of strategy Cyrus Hettle and Robert Schneider

ECS 20 (Spring 2013) Phillip Rogaway Lecture 1

Sequential games. Moty Katzman. November 14, 2017

2. The Extensive Form of a Game

Positive Triangle Game

Lightseekers Trading Card Game Rules

Problem A Rearranging a Sequence

Advanced Microeconomics: Game Theory

CMPUT 396 Tic-Tac-Toe Game

CONTENTS. 1. Number of Players. 2. General. 3. Ending the Game. FF-TCG Comprehensive Rules ver.1.0 Last Update: 22/11/2017

Activity 6: Playing Elevens

Phase 10 Masters Edition Copyright 2000 Kenneth R. Johnson For 2 to 4 Players

Dan Heisman. Is Your Move Safe? Boston

1 = 3 2 = 3 ( ) = = = 33( ) 98 = = =

Mind Ninja The Game of Boundless Forms

Background. Game Theory and Nim. The Game of Nim. Game is Finite 1/27/2011

Content Page. Odds about Card Distribution P Strategies in defending

Run Very Fast. Sam Blake Gabe Grow. February 27, 2017 GIMM 290 Game Design Theory Dr. Ted Apel

Jamie Mulholland, Simon Fraser University

Combinatorics. PIE and Binomial Coefficients. Misha Lavrov. ARML Practice 10/20/2013

Only and are worth points. The point value of and is printed at the bottom of the card.

Underleague Game Rules

DIVISION III (Grades 4-5) Common Rules

game tree complete all possible moves

Muandlotsmore.qxp:4-in1_Regel.qxp 10/3/07 5:31 PM Page 1

On the Periodicity of Graph Games

2005 Galois Contest Wednesday, April 20, 2005

Building Successful Problem Solvers

arxiv: v1 [math.co] 30 Jul 2015

PHASE 10 CARD GAME Copyright 1982 by Kenneth R. Johnson

Selected Game Examples

Asymptotic Results for the Queen Packing Problem

Probability 1. Name: Total Marks: 1. An unbiased spinner is shown below.

Probability and Statistics

AL-JABAR. Concepts. A Mathematical Game of Strategy. Robert P. Schneider and Cyrus Hettle University of Kentucky

Game, Set, and Match Carl W. Lee September 2016

The Canadian Open Mathematics Challenge November 3/4, 2016

New Toads and Frogs Results

Tarot Combat. Table of Contents. James W. Gray Introduction

Math 1111 Math Exam Study Guide

Binary Games. Keep this tetrahedron handy, we will use it when we play the game of Nim.

Transcription:

Writing Proofs Misha Lavrov Analyzing Games: olutions Western PA ARML Practice March 13, 2016 Here are some key ideas that show up in these problems. You may gain some understanding of them by reading the explanations below, but more understanding by reading the solutions, and even more by solving the problems yourself. Problems #1, #2, and in a way #7 rely on classifying positions in the game into N-positions (ones that are advantageous for the Next player to move) and P-positions (ones that are advantageous for the Previous player, the one that moved into this position). This can be done recursively by the rule that a position is P if all the moves that can be made lead to N-positions or lose the game outright; a position is N if a move can be made that leads to a P-position or wins the game. If all positions in the game are classified, this determines which player has the winning strategy. Problems #3 and #4 exploit pairing, or mirror strategies: one of the players sets up a situation in which potential moves are paired up to preserve an invariant. For instance, if a game is lost when no moves are possible, breaking it up into two identical and separate subgames is yields a P-position, since a move in one subgame can be responded to by a move in the other subgame. Problems #6 and #8 involve greedy strategies: strategies that work by avoiding an immediate loss. In some games, this is a terrible idea: for instance, if you play chess by choosing a move at random that does not lead to being checkmated, you will not mind if I take your queen, and eventually you will find that all your moves lead to being checkmated. In other games, it can be shown that a non-losing move always exists, which proves that some strategy gains at least a draw. 1. A box contains 300 matches. Two players take turns taking some matches from the box; each player must take at least one match, but no more than half the matches. When only one match is left, the player whose turn it is (with no legal move to make) loses. Who has the winning strategy? The first player can win by first taking 45 matches (leaving 255), and thereafter playing so that the number of matches left is one less than a power of 2. This is always possible: if there are 2 k 1 matches before the second player s turn, then no matter how many matches the second player takes, there will be between 2 k 1 and 2 k 2 matches left. In all of these cases, it s possible for the first player to leave exactly 2 k 1 1 matches on the next turn. In fact, the power of 2 will decrease by 1 after each pair of moves, so the number of matches will be 255, then 127, then 63, then 31, then 15, then 7, then 3, then finally 1 after each of the first player s moves. It will be the second player s turn when there is 1 match left, so the first player wins. 2. Two players play a game with a stack of 1000 pennies. They take turns taking some pennies from the top of the stack; on his or her turn, a player can either take 1 penny, or half the pennies (if the number of pennies in the stack is odd, the player takes half the pennies, rounded up). If the player taking the last penny wins, which player has the winning strategy? 1

Ignoring the physical improbability of a stack of 1000 pennies, the second player has the winning strategy. We begin by proving, by induction, that all stacks of an odd number of pennies are N-positions (good for the Next player to move). This is true for a stack of 1 penny: the next player takes the last penny and wins. Now suppose that a stack of 2k 1 pennies is an N-position. A stack of 2k + 1 pennies can be reduced to a stack of either k pennies or 2k pennies. If the k-penny stack is a P-position, then the (2k + 1)-penny stack has a move to a P-position, so it is an N-position. If the k-penny stack is an N-position, then from the 2k-penny stack, both moves (to k pennies and to 2k 1 pennies) lead to N-positions so the 2k-penny stack is a P-position. Once again, the (2k + 1)-penny stack has a move to a P-position, so it is an N-position. Now we claim that a stack of 2 a (2b + 1) pennies is an N-position if a is even, and a P-position if a is odd. (All numbers can be factored as an odd number times a power of 2, so this completes the analysis.) We prove this by a second induction, this time on a. Our previous proof for odd numbers forms the base case a = 0. uppose we have a stack of 2 a (2b + 1) pennies, where a > 0. From this stack, we can go to a stack of 2 a 1 (2b + 1) pennies, or to a stack of 2 a (2b + 1) 1 pennies. If a is even, then the first stack is a P-position by the induction hypothesis, so there is a move to a P-position, and therefore the stack is an N-position. If a is odd, then the first stack is an N-position by the induction hypothesis; the second stack is an N-position because it is odd. o both moves are to N-positions, and therefore the stack is a P-position. By induction, this rule holds for all a. ince 1000 = 2 3 125, it is a P-position, so the second player has a winning strategy. 3. (Martin Gardner) A game is played with a length of string exactly 10π inches long, tied so that it makes a loop. Two players take turns cutting a length of exactly 1 inch from somewhere in the string, and picking it up. Eventually, the string may end up in several pieces. In that case, the players may either pick up a piece exactly 1 inch long, or cut out a 1-inch length from the middle or end of a piece longer than 1 inch. The player who cannot take a turn, because all remaining pieces of string are shorter than 1 inch, loses. Which player has the winning strategy? The first player has no choice: after the first move, the string ends up as a single (un-looped) piece of length 10π 1. The second player can remove a 1-inch length from the exact middle of this string, and leave two pieces of length 5π 1. Thereafter, the second player can use a pairing strategy. Whatever the first player does to the first piece of length 5π 1 (or anything that came from it), the second player can do to the second piece of length 5π 1 (or anything that came from it), and vice versa. By ensuring that all strings come in pairs of equal length, the second player ensures that there will always be a move to make, and wins. 2

4. (UAMO 2004) Alice and Bob play a game on a 6 6 grid. On his or her turn, a player chooses a rational number not yet appearing in the grid and writes it in an empty square of the grid. Alice goes first and then the players alternate. When all squares have numbers written in them, in each row, the square with the greatest number in that row is colored black. Alice wins if she can then draw a path from the top of the grid to the bottom of the grid that stays in black squares, and Bob wins if she can t. (If two squares share a vertex, Alice can draw a path from one to the other that stays in those two squares.) Find, with proof, a winning strategy for one of the players. Bob can win by ensuring that in the end, the black squares are chosen from the shaded squares in the diagram below: ince there is no path even in the shaded squares between top and bottom, there will not be a path in the black squares either. Here s how Bob can do this. Note that each row has exactly three white squares and three shaded squares. Whenever Alice plays in a row, Bob plays in the same row by the following rule: If Alice wrote a number in a shaded square, Bob writes a smaller number in an unshaded square. If Alice wrote a number in an unshaded square, Bob writes a larger number in a shaded square. After each pair of moves, the number of shaded and unshaded squares that are empty in each row remains equal, so this is always possible. In the end, this strategy ensures that the largest number in a row is always in a shaded square. 5. (BMO 2003) Alice and Barbara play a game with a pack of 2n cards, on each of which is written a positive integer. (The integers can be arbitrary.) The pack is shuffled and the cards laid out in a row, with the numbers facing upwards. Alice starts, and the girls take turns to remove one card from either end of the row, until Barbara picks up the final card. Each girl s score is the sum of the numbers on her chosen cards at the end of the game. Prove that Alice can always obtain a score at least as great as Barbara s. If Alice wants, she can force Barbara to pick up all the cards in the even positions, leaving the cards in the odd positions for herself. To do this, she picks up the card in position #1, leaving Barbara to choose between positions #2 and #2n. Thereafter, she picks up a card from the same end that Barbara chose a card from, making sure that the cards on the end are in even positions after her move. If Alice instead begins by taking the card in position #2n, she leaves Barbara with the choice 3

of positions #1 and #(2n 1). Repeating the same strategy, Barbara always ends up forced to pick an odd card. Choosing between these two strategies, Alice has the option of ending with either the evenposition cards, and the odd-position cards, and can just choose whichever is greater. 6. (Putnam 1993) Consider the following game played with a deck of 2n cards numbered from 1 to 2n. The deck is randomly shuffled and n cards are dealt to each of two players. Beginning with A, the players take turns discarding one of their remaining cards and announcing its number. The game ends as soon as the sum of the numbers on the discarded cards is divisible by 2n + 1. The last person to discard wins the game. Assuming optimal strategy by both A and B, what is the probability that A wins? Player B wins with probability 1. ince the cards are known ahead of time, and each player can see their cards, they can infer their opponent s cards, so all are public information. At an intermediate point in the game, when it s B s turn, A has k cards and B has k + 1. No matter what B plays, A has at most one winning play in response, since all card values are different modulo 2n + 1. Furthermore, none of A s cards can be the winning reply to two of B s plays, since those two plays result in a different sum modulo 2n + 1. ince B has more cards than A, B must have an option that A does not have an immediate winning reply to. Therefore B can keep playing without losing until the end of the game. At that point, the sum of the cards on the table is 1 + 2 + + 2n = n(2n + 1), which is divisible by 2n + 1, and so B wins. 7. (Germany 1984) Two players take turns writing an integer between 1 and 6 on the board. When 2n numbers have been written, the game ends; the second player wins if the sum of the numbers is divisible by 9. For which values of n does the second player have a winning strategy? The second player has a winning strategy if n is divisible by 9. While this can be discovered by working backwards, the strategy itself is very simple to describe: whenever the first player writes down x, the second player responds with 7 x, which ensures that the sum of the numbers will be 7n, a multiple of 9 in this case. When n is not divisible by 9, player 1 can counter with a similar strategy. It can be checked that in all such cases, at least one of 2n 2, 2n 1, or 2n is congruent to a number between 1 and 6 modulo 9. Player 1 begins with such a number; thereafter, whenever the second player writes down x, the first player responds with 7 x. This means the middle 2n 2 numbers will sum to 7(n 1), so the total before the second player s last turn will be one of 7(n 1)+2n 2 0, 7(n 1)+2n 1 1, or 7(n 1)+2n 2 modulo 9. In each of these cases, there is no number the second player can write down to make the total divisible by 9, so the first player wins. 8. (UAMO 1999) The Y2K game is played on a 1 2000 grid as follows. Two players in turn write either an or an O in an empty square. The first player who produces three consecutive 4

boxes that spell O wins. If all boxes are filled without producing O then the game is a draw. Prove that the second player has a winning strategy. It is not too hard to check that whenever the grid has a 1 4 block with the pattern the middle two squares are deadly : any player that enters an or an O in either of them gives the other player a chance to win the game. With a little more work, we see that a square can only be deadly if it is one of the middle squares of such a pattern: If entering an O in a square would lose the game, the square must be adjacent to an and an empty square, which means that (up to reflection), the square must look like the in the pattern below: If entering an in that square would also be deadly, the square must either be adjacent to an O followed by an empty square (which is impossible in the case above) or to an empty square followed by an, which produces (again, up to reflection) the pattern: Whenever it is the second player s turn to play, an odd number of squares are empty. ince deadly squares come in pairs located between two letters, there must be at least one square that s not deadly: there is a letter to enter in it that does not immediately lose. This already is enough to guarantee a draw for the second player. (The player should also check if there is any place to win the game, since the first player can use such a spot if the second player doesn t. But we ve shown that a play exist that does not create new places to win the game.) We can do better by beginning the game cleverly. After the first player s first move, the second player responds by playing an in a square far from the first player s move or from either end. (Three squares is sufficiently far.) After the first player s second move, the second player either completes an O (if one exists) or responds by playing an three spaces away from his or her first, in a direction that avoids playing close to the first player s second move. This ensures that some deadly squares exist in the grid. Thereafter, the second player just needs to avoid them (and not miss any place where a winning play exists). ince the second player can always avoid deadly squares, eventually the first player must play on a deadly square, giving the second player a chance to win. 5