Sam Chow. One Player Games Bored MUMSians Han writes the numbers 1, 2,..., 100 on the MUMS whiteboard. He picks two of these numbers, erases them, and.

Slides:



Advertisements
Similar presentations
Martin Boyd Christopher Hirunthanakorn
Advertisements

AE1APS Algorithmic Problem Solving John Drake.  Invariants – Chapter 2  River Crossing – Chapter 3  Logic Puzzles – Chapter 5  Matchstick Games -
Techniques for Dealing with Hard Problems Backtrack: –Systematically enumerates all potential solutions by continually trying to extend a partial solution.
4 Games and Fuses U:\APPS\Ghostgum\gsview Shared folder U:\2nd Year Share\Computer Science Courses\Semester One\Algortithmic Problem Solving Book: Algorithmic.
Mathematical Induction II Lecture 14: Nov
Place captured red pieces here Place captured yellow pieces here To use as Kings Rules New Game Exit Left mouse click on piece – drag to desired location.
Progressively Finite Games
SCIT1003 Chapter 2: Sequential games - perfect information extensive form Prof. Tsang.
Induction and recursion
Algebra Problems… Solutions Algebra Problems… Solutions © 2007 Herbert I. Gross Set 22 By Herbert I. Gross and Richard A. Medeiros next.
CSE115/ENGR160 Discrete Mathematics 02/07/12
Invariant Method Lecture 6: Sep
Invariant Method Lecture
Prove the Impossible Lecture 6: Sep 19 (based on slides in MIT 6.042)
Algebra Problems… Solutions Algebra Problems… Solutions © 2007 Herbert I. Gross Set 12 By Herbert I. Gross and Richard A. Medeiros next.
Games, Hats, and Codes Mira Bernstein Wellesley College SUMS 2005.
Great Theoretical Ideas in Computer Science.
prime numbers: facts and discoveries
Great Theoretical Ideas in Computer Science.
Invariant Method
Key Stone Problem… Key Stone Problem… next Set 22 © 2007 Herbert I. Gross.
Brian Duddy.  Two players, X and Y, are playing a card game- goal is to find optimal strategy for X  X has red ace (A), black ace (A), and red two (2)
The Pigeonhole (Dirichlet’s box) Principle
M C S E A The English Schools Foundation Hong Kong Click when ready...
Part II - Sums of Games Consider a game called Boxing Match which was defined in a programming contest m.short.html.
Section 1.8. Section Summary Proof by Cases Existence Proofs Constructive Nonconstructive Disproof by Counterexample Nonexistence Proofs Uniqueness Proofs.
Section 3.1: Proof Strategy Now that we have a fair amount of experience with proofs, we will start to prove more difficult theorems. Our experience so.
Extending the Definition of Exponents © Math As A Second Language All Rights Reserved next #10 Taking the Fear out of Math 2 -8.
Multiplying Signed Numbers © Math As A Second Language All Rights Reserved next #9 Taking the Fear out of Math ×
Game-playing AIs Part 1 CIS 391 Fall CSE Intro to AI 2 Games: Outline of Unit Part I (this set of slides)  Motivation  Game Trees  Evaluation.
Lecture 05: Theory of Automata:08 Kleene’s Theorem and NFA.
How to Play Chess By: John. Dedication I dedicate this project to my family because we all love chess.
Welcome to BC Splash!. Financial Planning The smart way to start planning for retirement before you turn 20.
©2009, Tom McKendree Biplanes ©2009, Tom McKendree.
Algebra Problems… Solutions Algebra Problems… Solutions © 2007 Herbert I. Gross Set 10 By Herbert I. Gross and Richard A. Medeiros next.
A Classic Game of Strategy for the 21 st Century.
Crystal Bennett Joshua Chukwuka Advisor: Dr. K. Berg.
Activity 1: Play Fours Play in pairs Each player has a 3 by 3 grid Take turns to roll 2 dice Calculate the total- each spot is worth 4 points Write your.
CompSci 102 Discrete Math for Computer Science March 1, 2012 Prof. Rodger Slides modified from Rosen.
Summary of the Moves of Chess
A game based off of the esteemed classic By: Tadziu Kosiara.
An Introduction to Game Theory Math 480: Mathematics Seminar Dr. Sylvester.
How to play chess? By Mervyn George. The Rules of the Game White always move first White always move first You should always play touch a piece move a.
Every chess master was once a beginner. Irving Chernev
1 INFO 2950 Prof. Carla Gomes Module Induction Rosen, Chapter 4.
Lecture Coursework 2 AGAIN. Rectangle Game Look at proof of matchsticks A rectangular board is divided into m columns by n rows. The area of the board.
Easy, Hard, and Impossible Elaine Rich. Easy Tic Tac Toe.
Chess Strategies Component Skills Strategies Prototype Josh Waters, Ty Fenn, Tianyu Chen.
Mathematical Induction
Chapter 5. Section 5.1 Climbing an Infinite Ladder Suppose we have an infinite ladder: 1.We can reach the first rung of the ladder. 2.If we can reach.
More on Logic Today we look at the for loop and then put all of this together to look at some more complex forms of logic that a program will need The.
CHESS Club.  The game of chess is over 1300 years old and is one of the most popular games in the world. It has received more total thought time than.
Benjamin Casey C S 329 E Spring  Variants played since ancient times; resemblance to Chinese “Jianshizi” or “picking stones”  Current name and.
Mathematical Proof A domino and chessboard problem.
2-33. THE COLOR SQUARE GAME OBJECTIVE: FIGURE OUT THE ARRANGEMENT OF COLORED SQUARES ON A 3 × 3 GRID OR A 4 × 4 GRID USING AS FEW CLUES AS POSSIBLE. Rules:
Chance We will base on the frequency theory to study chances (or probability).
K 3 -Saturator By Roy Oursler. What is K 3 -Saturator K 3 -Saturator is a combinatorial game A combinatorial game is a two player game where both of the.
The Law of Averages. What does the law of average say? We know that, from the definition of probability, in the long run the frequency of some event will.
Content Game of Nim Impartial Games Sprague-Grundy theorem
Hex: a Game of Connecting Faces. Player 1 Player 2 Players take turns placing blue chips (player 1) and red chips (player 2). Player 1 plays first. Player.
Axioms and Theorems. Remember syllogisms? The Socrates Syllogism All human beings are mortal Socrates is a human being Therefore Socrates is mortal premises.
Introductory Game Theory
Great Theoretical Ideas in Computer Science
MATHS Week 8 Geometry.
Gray Code Can you find an ordering of all the n-bit strings in such a way that two consecutive n-bit strings differed by only one bit? This is called the.
Pre-K and Kindergarten
Induction and recursion
Fundamentals of Data Representation
Mathematical Games Sam Chow.
Year 10.
Presentation transcript:

Sam Chow

One Player Games

Bored MUMSians Han writes the numbers 1, 2,..., 100 on the MUMS whiteboard. He picks two of these numbers, erases them, and replaces them with their difference (so at some point in time we may have replications of a number). He repeats the process until he is left with just one number. Is it possible that he is left with the number 1?

The sum of all of the numbers on the whiteboard is initially 5050 (exercise!), which is even. With each ‘move’, the sum decreases by: a + b - |a - b|. This is always even (exercise!). Therefore the sum of all numbers on the whiteboard is at any stage even (it begins even, and then it decreases by an even amount with each move). So Han cannot be left with the number 1 (because then the sum would be odd).

Invariants An invariant is something which does not change no matter what happens. In the previous example, the parity of the sum of the numbers on the whiteboard was invariant whenever Han made a ‘move’; it remained even.

The Classic Example Take a chessboard (8x8), and remove two opposite corners. Can you tile what’s left with dominoes (1x2 blocks)?

A Simple Colouring Colour the chessboard in the usual manner. Now we have 32 black squares, but only 30 white squares. However each domino covers one white square and one black square. So we cannot cover 32 black squares, since we only have 30 white squares.

An Extension You place 21 trominoes (1x3 blocks) on a chessboard (8x8), so that there is one square not covered. What are the possible positions for this square?

Two Colourings! RBGRBGRB GRBGRBGR BGRBGRBG RBGRBGRB GRBGRBGR BGRBGRBG RBGRBGRB GRBGRBGR BRGBRGBR RGBRGBRG G BRG BRG B BRGBRGBR RGBRGBRG GBRGBRGB BRGBRGBR RGBRGBRG

In both diagrams, each tromino must cover one red square, one blue square, and one green square. In both diagrams, there are 22 red squares, but only 21 blue and green ones. So the remaining square must be red in both the first and second diagrams, giving 4 possibilities:

Four Possibilities RR RR

Final Step We still have to demonstrate that these are possible. By symmetry, we only have to show that one of them is possible:

Amoebae Three amoebae are situated at the points (0, 0), (0, 1) and (1, 0) of the Cartesian plane. Each second, one of the amoebae reproduces by splitting into two new amoebae. If the parent amoeba was at (x, y), then its offspring will begin at (x, y+1) and (x+1, y). No two amoebae may occupy the same position. Is it possible to vacate (in a finite amount of time) the original three points in a finite amount of time?

Valuing the Points We assign the points values as follows:... ¼... ½ ¼ /2 ¼...

The Invariant Let X be the sum of the values of the points on which the amoeba lie. Initially X = 2. X is invariant; it does not change when an amoeba splits. The total value of all points is 4 (see board). The total value of all points apart from the initial 3 points is 2. If we were to vacate the initial 3 points, then – in order for X to equal 2, every other point would have to be occupied, which is impossible.

Atypical Colourings In the table below, you may switch the signs of all numbers of a row, column or a parallel to one of the diagonals. In particular, you may switch the sign of each corner square. Prove that at least one -1 with always remain

Every such ‘line’ goes through either 0 or 2 (an even number of) red squares, so the parity of the number of ‘-1’s in red squares will not change! Initially it is 1, so it must stay odd. In particular it can never become

My Question Asian Pacific Mathematical Olympiad 2007, Q5. A regular 5x5 array of lights is defective, so that toggling the switch for one light causes each adjacent light in the same row and in the same column as well as the light itself to change state, from on to off, or from off to on. Initially all the lights are switched off. After a certain number of toggles, exactly one light is switched on. Find all the possible positions of this light.

First Valuation System We assign the following values to the lights. Let x be the sum of the values of the lights that are switched on at a particular point in time. By inspection, toggling any switch does not change the parity of x

Second Valuation System Now assign new values to the lights (actually we’ve just rotated the previous diagram!) Let y be the new sum. Toggling any switch does not change the parity of y

5 Possibilities So the parities of x and y are invariant. Initially x = y = 0, so x and y must always be even. The light that’s switched on at the end must have value 0 under both valuation systems (it cannot be 1, since x and y must both be even). 5 possibilities: xx x xx

Constructions By rotating the second sequence of toggles, we can attain the other three positions. So all 5 possibilities were indeed possible. TT T TTT TT TTT TTTT TT T TTT TTTTT

Something Different Nine 1x1 cells of a 10x10 square are infected. At the end of each second, any uninfected cell with at least two infected neighbours (having a common side) becomes infected. Once infected, a cell remains infected. Can the infection spread to the whole square?

A Monovariant The perimeter of the infected squares cannot increase! E.g. 1 E.g.2

...but it may decrease Initially the perimeter is at most 36 (= 9x4), and it cannot increase. So in particular, it cannot eventually become 40. So the infection cannot spread to the whole square.

Two Player Games

Definition A combinatorial game is one in which: there are two players there is no luck involved both players know the position of the game at all times there is a result (win, loss, or draw) the game does not go on forever

Crucial Fact In a combinatorial game, one of the following must be true: The first player has a winning strategy. The second player has a winning strategy. Either player can force a draw.

Double Chess The rules of chess are changed as follows: each player gets two moves instead of one. Show that there exists a strategy for white which guarantees him at least a draw (remember that white starts first).

Proof by Contradiction Suppose white has no strategy which guarantees at least a draw. Then a winning strategy must exist for black. White can move his knight out and then back, and black must still have a winning strategy from here. However, black is in the same position white was in to begin with! The implication is that white had a winning strategy to begin with. Contradiction. Hence our initial assumption is false. Instead, white must have a strategy which guarantees at least a draw.

Chomp We have an m x n block of chocolate. A move consists of eating a piece of chocolate, along with every piece of chocolate above and to the right of it. Players move alternately, and the player who eats the bottom-left piece loses (it’s poisoned). Play with the person next to you.

Existence We may not know what it is (I actually do not), but in fact we can prove that the first player has a winning strategy! Again we will use proof by contradiction. Suppose the second player has a winning strategy. If the first player bites off the top right corner (call this move A), the second player must have some winning move: call it B.

Strategy Stealing However, no matter what B actually is, player 1 could have played B to begin with! Now player 1 has a winning strategy, contradicting our assumption that player 2 has one. So our initial assumption is false: player 2 cannot have a winning strategy, so player 1 must have a winning strategy (since there are no draws). A

Yum Cha In the World Yum Cha Championships the final two waitresses ‘face-off’ in a match for eternal glory. A perfectly circular ‘lazy Susan’ stands in the middle of a table, and the two waitresses take turns placing a plate onto the lazy Susan (the plates are small, circular, and identical). Plates may not overlap (you can’t just stack them). Whoever is unable to legally place a plate loses. One year, however, the two final waitresses are both infinitely skilful! Who wins?

Copycat The first waitress confidently places a plate right in the middle of the lazy Susan. Wherever the second waitress puts a plate, the first waitress places one diametrically opposite. Whenever the second waitress has a legal placement, so does the first waitress! So eventually it will be the second waitress who runs out of legal ‘moves’.

The first waitress plays at 1, the second plays at 2, and the first plays at 3. The first waitress continues to ‘copy’ the second

Infinite Naughts and Crosses There is an infinitely long line of squares. Two players take turns placing their symbol in one of the squares. The first player to make three in a row wins. Show that neither player can force a win. This is the same as showing that either player can force a draw.

Grouping We make pairs of adjacent squares: If you’re player 2, then you just always play in the same pair as player 1. If you’re player 1, then you play somewhere random. If player 2 plays in a ‘new’ pair, then you ‘finish off’ that pair. If he finishes a pair you started, then you play somewhere random again. So both players can force a draw....

Chip Initially, there is a chip at the corner of an n x n chessboard. Two players, A and B, alternately move the chip one step in any direction (up, down, left, right). When the chip leaves a square, it disappears. The loser is the one who cannot move. For which values of n can player A win the game?

Case 1: n is odd. We pair up the remaining squares. Wherever A plays, B plays in the other square of the pair. If A has a legal move, then so will B. Eventually A will run out of moves, and B will win. 6778X

Case 2: n is even. A plays at 0, and we pair up the remaining squares (there are many ways to do this). A follows the same strategy as B followed in the odd case, so that this time A wins X

The 31 Game The total starts at 0. Two players take turns to add a number (1, 2, 3, 4 or 5) to the total. The player who reaches 31 wins. Who wins, A or B?

A adds 1, bringing the total to 1 (to see that this is the correct first move, notice that 31 is congruent to 1 modulo 6). If B adds x, A will add 6-x, bringing the total to 7. The process repeats, bringing the total (after A moves) to 13, 19, 25, and finally 31. A wins.

Token University of Melbourne (BHP Billiton) Mathematics Competition 2008 (Junior), Q8?

Interesting Choices Two players take turns to move the token in one of three ways: Inwards one Clockwise 1 Clockwise 1 twice (as distinct from clockwise 2 – see next point) You cannot move the token where it has been before. You lose if you cannot move. Prove that the first player can force a win.

Sketch of Proof A new ring has been entered (by B, or initially). A plays clockwise once, leaving 6 spots in that ring. B can enter a new ring (in which case we move onto the next ring and do the same thing), or he can go clockwise 1 or 2. A responds to the latter 2 by moving clockwise 2 or 1 (respectively), leaving 3 spots in the ring. If B doesn’t enter a new ring, A will use the same trick so that there are no spots in the ring.

Ring Out If we aren’t in the inner ring, B will have to be the one who moves inwards. If we are in the inner ring, B will run out of moves and lose. Again, we motivate the first move by observing that 8 is congruent to 2 modulo 3.

Number Game Two players start with N = 1. They alternatively multiply N by one of the numbers 2 to 9. The winner is the first to reach 1000 or more. Who wins?

Positions of Win (or Loss) Anything from 112 to 999 (inclusive) is a winning position (W), since the player facing that position can win by multiplying by 9. Anything from 56 to 111 is L, since you must put your opponent in a W position. Anything from 7 to 55 is now W, since you can move to an L position. 4, 5, 6 are L. 1 is W.

Summary of A’s Strategy A multiplies N by 4 to give N=4. B moves N somewhere between 7 and 55. A moves somewhere between 56 and 111. B moves somewhere between 112 and 999. A moves somewhere over (equal to suffices) 1000 and wins.

Nim There are a number of piles of sticks. Two players take turns to remove any number (at least one) from a pile. In ‘normal play’, the winner is the player who takes the last stick. In misère Nim, the player who takes the last stick loses. Nim has been solved!

Xor The crucial value is the binary digital sum of the pile sizes, which is known in combinatorial game theory as the Nim-sum. This operation is perhaps better known as ‘exclusive or’ (xor). Write the numbers out in binary, and add them (in binary) ‘without carrying forward’ from one digit to another. See board for example.

Lemmas of Win In normal play: Positions of non-zero Nim-sum are W. Positions of zero Nim-sum are L. Need the following lemmas (C. Bouton): If the Nim-sum is zero, any move will make it nonzero. If the Nim-sum is nonzero, there is a move that will make it zero. So the winning strategy is to make the Nim-sum zero with every move.