How to beat your friends at the dots-and-boxes game!

43
How to beat your friends at the dots-and-boxes game! John Schmitt Middlebury College Governor’s Institute in Mathematical Sciences June 26, 2008 John Schmitt Middlebury College How to beat your friends at the dots-and-boxes game!

Transcript of How to beat your friends at the dots-and-boxes game!

Page 1: How to beat your friends at the dots-and-boxes game!

How to beat your friends at the dots-and-boxes

game!

John SchmittMiddlebury College

Governor’s Institute in Mathematical SciencesJune 26, 2008

John Schmitt Middlebury College How to beat your friends at the dots-and-boxes game!

Page 2: How to beat your friends at the dots-and-boxes game!

Combinatorial Games

Combinatorial games:

◮ are two-player games with alternating play and play continuesuntil player whose turn it is to move has no legal move,

John Schmitt Middlebury College How to beat your friends at the dots-and-boxes game!

Page 3: How to beat your friends at the dots-and-boxes game!

Combinatorial Games

Combinatorial games:

◮ are two-player games with alternating play and play continuesuntil player whose turn it is to move has no legal move,

◮ have no chance involved (no dice, no spinners and no carddeals),

John Schmitt Middlebury College How to beat your friends at the dots-and-boxes game!

Page 4: How to beat your friends at the dots-and-boxes game!

Combinatorial Games

Combinatorial games:

◮ are two-player games with alternating play and play continuesuntil player whose turn it is to move has no legal move,

◮ have no chance involved (no dice, no spinners and no carddeals),

◮ and have no hidden information.

John Schmitt Middlebury College How to beat your friends at the dots-and-boxes game!

Page 5: How to beat your friends at the dots-and-boxes game!

Combinatorial Games

Combinatorial games:

◮ are two-player games with alternating play and play continuesuntil player whose turn it is to move has no legal move,

◮ have no chance involved (no dice, no spinners and no carddeals),

◮ and have no hidden information.

Outcome is restricted to win-loss, tie-tie or draw-draw.

John Schmitt Middlebury College How to beat your friends at the dots-and-boxes game!

Page 6: How to beat your friends at the dots-and-boxes game!

Combinatorial Games

Combinatorial games:

◮ are two-player games with alternating play and play continuesuntil player whose turn it is to move has no legal move,

◮ have no chance involved (no dice, no spinners and no carddeals),

◮ and have no hidden information.

Outcome is restricted to win-loss, tie-tie or draw-draw.

Examples: Go, Chess, Checkers, Tic-tac-toe, Brussel Sprouts,Clobber, Domineering, Hex, Nim, Snort andDOTS-AND-BOXES.

John Schmitt Middlebury College How to beat your friends at the dots-and-boxes game!

Page 7: How to beat your friends at the dots-and-boxes game!

Combinatorial Games

Combinatorial games:

◮ are two-player games with alternating play and play continuesuntil player whose turn it is to move has no legal move,

◮ have no chance involved (no dice, no spinners and no carddeals),

◮ and have no hidden information.

Outcome is restricted to win-loss, tie-tie or draw-draw.

Examples: Go, Chess, Checkers, Tic-tac-toe, Brussel Sprouts,Clobber, Domineering, Hex, Nim, Snort andDOTS-AND-BOXES.

Not: Backgammon (has dice), Poker (has card deal), Stratego(has hidden information), Monopoly (has dice and > 2 playerssometimes)

John Schmitt Middlebury College How to beat your friends at the dots-and-boxes game!

Page 8: How to beat your friends at the dots-and-boxes game!

Dots-and-boxes - how to play

◮ Played on a rectangular grid with m rows, each containing n

dots.

◮ A move consists of drawing a horizontal or vertical lineconnecting two dots.

◮ Upon completing a box, a player ‘claims’ it and moves again.

◮ Play ends when all possible lines are drawn.

◮ The winner is the person who has claimed the most boxes. Ifboth players have the same number of boxes, then it is a tie.

John Schmitt Middlebury College How to beat your friends at the dots-and-boxes game!

Page 9: How to beat your friends at the dots-and-boxes game!

Let’s play!

The 9-box game (4 × 4-game).

John Schmitt Middlebury College How to beat your friends at the dots-and-boxes game!

Page 10: How to beat your friends at the dots-and-boxes game!

Let’s play from here (49 moves and turns played) - player A playsodd numbered turns, player B plays even turns:

John Schmitt Middlebury College How to beat your friends at the dots-and-boxes game!

Page 11: How to beat your friends at the dots-and-boxes game!

Let’s play from here (49 moves and turns played) - player A playsodd numbered turns, player B plays even turns:

What is the greedy approach?

John Schmitt Middlebury College How to beat your friends at the dots-and-boxes game!

Page 12: How to beat your friends at the dots-and-boxes game!

Let’s play from here (49 moves and turns played) - player A playsodd numbered turns, player B plays even turns:

Don’t take the greedy approach! Let’s make double-dealing

moves. Your opponent will be double-crossed (forced to take twoboxes with one pen-stroke).

John Schmitt Middlebury College How to beat your friends at the dots-and-boxes game!

Page 13: How to beat your friends at the dots-and-boxes game!

John Schmitt Middlebury College How to beat your friends at the dots-and-boxes game!

Page 14: How to beat your friends at the dots-and-boxes game!

Chain

John Schmitt Middlebury College How to beat your friends at the dots-and-boxes game!

Page 15: How to beat your friends at the dots-and-boxes game!

Chain

John Schmitt Middlebury College How to beat your friends at the dots-and-boxes game!

Page 16: How to beat your friends at the dots-and-boxes game!

Chain

5

8

9

3

John Schmitt Middlebury College How to beat your friends at the dots-and-boxes game!

Page 17: How to beat your friends at the dots-and-boxes game!

Strategy

◮ Make sure there are long chains about and try to force youropponent to be first to ‘open’ one.

John Schmitt Middlebury College How to beat your friends at the dots-and-boxes game!

Page 18: How to beat your friends at the dots-and-boxes game!

Strategy

◮ Make sure there are long chains about and try to force youropponent to be first to ‘open’ one.

◮ If you can force your opponent to ‘open’ a long chain, youhave control...try to GET CONTROL, man!

John Schmitt Middlebury College How to beat your friends at the dots-and-boxes game!

Page 19: How to beat your friends at the dots-and-boxes game!

Strategy

◮ Make sure there are long chains about and try to force youropponent to be first to ‘open’ one.

◮ If you can force your opponent to ‘open’ a long chain, youhave control...try to GET CONTROL, man!

◮ Once you have control, KEEP CONTROL, dude, by (politely)declining 2 boxes of every long chain except the last. (So, youwill be last to play.)

John Schmitt Middlebury College How to beat your friends at the dots-and-boxes game!

Page 20: How to beat your friends at the dots-and-boxes game!

To get control

Player A tries to make # of initial dots + #double-crossed movesodd.Player B tries to make # of initial dots + #double-crossed moveseven.

John Schmitt Middlebury College How to beat your friends at the dots-and-boxes game!

Page 21: How to beat your friends at the dots-and-boxes game!

To get control

Player A tries to make # of initial dots + #double-crossed movesodd.Player B tries to make # of initial dots + #double-crossed moveseven.Generally, # of double-crosses is one less than the # of longchains.

John Schmitt Middlebury College How to beat your friends at the dots-and-boxes game!

Page 22: How to beat your friends at the dots-and-boxes game!

To get control

Player A tries to make # of initial dots + #double-crossed movesodd.Player B tries to make # of initial dots + #double-crossed moveseven.Generally, # of double-crosses is one less than the # of longchains.LONG CHAIN RULE Try to make # of initial dots + # eventuallong chains even if you are A, odd if you are B.

John Schmitt Middlebury College How to beat your friends at the dots-and-boxes game!

Page 23: How to beat your friends at the dots-and-boxes game!

To get control

Player A tries to make # of initial dots + #double-crossed movesodd.Player B tries to make # of initial dots + #double-crossed moveseven.Generally, # of double-crosses is one less than the # of longchains.LONG CHAIN RULE Try to make # of initial dots + # eventuallong chains even if you are A, odd if you are B.WHY? # of initial dots + # of double-crosses = total # of turnsin game.

John Schmitt Middlebury College How to beat your friends at the dots-and-boxes game!

Page 24: How to beat your friends at the dots-and-boxes game!

Proof of Long Chain Rule

Game board has m rows with n dots each.

John Schmitt Middlebury College How to beat your friends at the dots-and-boxes game!

Page 25: How to beat your friends at the dots-and-boxes game!

Proof of Long Chain Rule

Game board has m rows with n dots each.# of dots = mn.

John Schmitt Middlebury College How to beat your friends at the dots-and-boxes game!

Page 26: How to beat your friends at the dots-and-boxes game!

Proof of Long Chain Rule

Game board has m rows with n dots each.# of dots = mn.

# of horizontal moves = m(n − 1) = mn − m.

John Schmitt Middlebury College How to beat your friends at the dots-and-boxes game!

Page 27: How to beat your friends at the dots-and-boxes game!

Proof of Long Chain Rule

Game board has m rows with n dots each.# of dots = mn.

# of horizontal moves = m(n − 1) = mn − m.

# of vertical moves = n(m − 1) = mn − n.

John Schmitt Middlebury College How to beat your friends at the dots-and-boxes game!

Page 28: How to beat your friends at the dots-and-boxes game!

Proof of Long Chain Rule

Game board has m rows with n dots each.# of dots = mn.

# of horizontal moves = m(n − 1) = mn − m.

# of vertical moves = n(m − 1) = mn − n.

# of moves = # vertical + # horizonal = 2mn − m − n.

John Schmitt Middlebury College How to beat your friends at the dots-and-boxes game!

Page 29: How to beat your friends at the dots-and-boxes game!

Proof of Long Chain Rule

Game board has m rows with n dots each.# of dots = mn.

# of horizontal moves = m(n − 1) = mn − m.

# of vertical moves = n(m − 1) = mn − n.

# of moves = # vertical + # horizonal = 2mn − m − n.

# of boxes = (m − 1)(n − 1) = mn − m − n + 1.

John Schmitt Middlebury College How to beat your friends at the dots-and-boxes game!

Page 30: How to beat your friends at the dots-and-boxes game!

Proof of Long Chain Rule

Game board has m rows with n dots each.# of dots = mn.

# of horizontal moves = m(n − 1) = mn − m.

# of vertical moves = n(m − 1) = mn − n.

# of moves = # vertical + # horizonal = 2mn − m − n.

# of boxes = (m − 1)(n − 1) = mn − m − n + 1.# moves −# of boxes = mn − 1.

John Schmitt Middlebury College How to beat your friends at the dots-and-boxes game!

Page 31: How to beat your friends at the dots-and-boxes game!

Proof of Long Chain Rule

Game board has m rows with n dots each.# of dots = mn.

# of horizontal moves = m(n − 1) = mn − m.

# of vertical moves = n(m − 1) = mn − n.

# of moves = # vertical + # horizonal = 2mn − m − n.

# of boxes = (m − 1)(n − 1) = mn − m − n + 1.# moves −# of boxes = mn − 1.# of completed turns = # of moves −# of boxes +# ofdouble-crosses.

John Schmitt Middlebury College How to beat your friends at the dots-and-boxes game!

Page 32: How to beat your friends at the dots-and-boxes game!

Proof of Long Chain Rule

Game board has m rows with n dots each.# of dots = mn.

# of horizontal moves = m(n − 1) = mn − m.

# of vertical moves = n(m − 1) = mn − n.

# of moves = # vertical + # horizonal = 2mn − m − n.

# of boxes = (m − 1)(n − 1) = mn − m − n + 1.# moves −# of boxes = mn − 1.# of completed turns = # of moves −# of boxes +# ofdouble-crosses.# of completed turns = mn − 1 + # of double-crosses = # ofdots -1 + # of double-crosses.

John Schmitt Middlebury College How to beat your friends at the dots-and-boxes game!

Page 33: How to beat your friends at the dots-and-boxes game!

Proof of Long Chain Rule

Game board has m rows with n dots each.# of dots = mn.

# of horizontal moves = m(n − 1) = mn − m.

# of vertical moves = n(m − 1) = mn − n.

# of moves = # vertical + # horizonal = 2mn − m − n.

# of boxes = (m − 1)(n − 1) = mn − m − n + 1.# moves −# of boxes = mn − 1.# of completed turns = # of moves −# of boxes +# ofdouble-crosses.# of completed turns = mn − 1 + # of double-crosses = # ofdots -1 + # of double-crosses.Last move of game must complete a box, so final turn isincomplete. Adding this turn to total:

John Schmitt Middlebury College How to beat your friends at the dots-and-boxes game!

Page 34: How to beat your friends at the dots-and-boxes game!

Proof of Long Chain Rule

Game board has m rows with n dots each.# of dots = mn.

# of horizontal moves = m(n − 1) = mn − m.

# of vertical moves = n(m − 1) = mn − n.

# of moves = # vertical + # horizonal = 2mn − m − n.

# of boxes = (m − 1)(n − 1) = mn − m − n + 1.# moves −# of boxes = mn − 1.# of completed turns = # of moves −# of boxes +# ofdouble-crosses.# of completed turns = mn − 1 + # of double-crosses = # ofdots -1 + # of double-crosses.Last move of game must complete a box, so final turn isincomplete. Adding this turn to total:# of turns = # of dots +# of double-crosses.

John Schmitt Middlebury College How to beat your friends at the dots-and-boxes game!

Page 35: How to beat your friends at the dots-and-boxes game!

Chain Counting Problems - Puzzle 1

John Schmitt Middlebury College How to beat your friends at the dots-and-boxes game!

Page 36: How to beat your friends at the dots-and-boxes game!

Chain Counting Problems - Puzzle 1

10 moves made, so it is A’s turn.

John Schmitt Middlebury College How to beat your friends at the dots-and-boxes game!

Page 37: How to beat your friends at the dots-and-boxes game!

Chain Counting Problems - Puzzle 1

10 moves made, so it is A’s turn. # dots is 16, an even number.

John Schmitt Middlebury College How to beat your friends at the dots-and-boxes game!

Page 38: How to beat your friends at the dots-and-boxes game!

Chain Counting Problems - Puzzle 1

10 moves made, so it is A’s turn. # dots is 16, an even number.By the long chain rule, A wants an even number of long chains.

John Schmitt Middlebury College How to beat your friends at the dots-and-boxes game!

Page 39: How to beat your friends at the dots-and-boxes game!

Chain Counting Problems - Solution 1

The dashed line indicates best move. It ensures 2 chains.

John Schmitt Middlebury College How to beat your friends at the dots-and-boxes game!

Page 40: How to beat your friends at the dots-and-boxes game!

Chain Counting Problems

John Schmitt Middlebury College How to beat your friends at the dots-and-boxes game!

Page 41: How to beat your friends at the dots-and-boxes game!

Chain Counting Problems

John Schmitt Middlebury College How to beat your friends at the dots-and-boxes game!

Page 42: How to beat your friends at the dots-and-boxes game!

Chain Counting Problems

John Schmitt Middlebury College How to beat your friends at the dots-and-boxes game!

Page 43: How to beat your friends at the dots-and-boxes game!

Thanks!!

◮ Talk based on book by Elwyn Berlekamp entitled “TheDots-and-Boxes Game: Sophisticated Child’s Play.”

◮ Slides available from my homepage:http://community.middlebury.edu/∼jschmitt/.

John Schmitt Middlebury College How to beat your friends at the dots-and-boxes game!