Easy Games and Hard Games

Similar documents
Pennies vs Paperclips

Problem Set 4 Due: Wednesday, November 12th, 2014

Pearl Puzzles are NP-complete

arxiv:cs/ v2 [cs.cc] 27 Jul 2001

Positive Triangle Game

How hard are computer games? Graham Cormode, DIMACS

BMT 2018 Combinatorics Test Solutions March 18, 2018

Heuristic Search with Pre-Computed Databases

2048 IS (PSPACE) HARD, BUT SOMETIMES EASY

28,800 Extremely Magic 5 5 Squares Arthur Holshouser. Harold Reiter.

Introduction Solvability Rules Computer Solution Implementation. Connect Four. March 9, Connect Four 1

Weighted Polya Theorem. Solitaire

Selected Game Examples

An Exploration of the Minimum Clue Sudoku Problem

Physical Zero-Knowledge Proof: From Sudoku to Nonogram

Week 1. 1 What Is Combinatorics?

Formidable Fourteen Puzzle = 6. Boxing Match Example. Part II - Sums of Games. Sums of Games. Example Contd. Mathematical Games II Sums of Games

Lecture 19 November 6, 2014

arxiv: v2 [math.ho] 23 Aug 2018

CSE548, AMS542: Analysis of Algorithms, Fall 2016 Date: Sep 25. Homework #1. ( Due: Oct 10 ) Figure 1: The laser game.

Intriguing Problems for Students in a Proofs Class

Which Rectangular Chessboards Have a Bishop s Tour?

37 Game Theory. Bebe b1 b2 b3. a Abe a a A Two-Person Zero-Sum Game

More NP Complete Games Richard Carini and Connor Lemp February 17, 2015

STAJSIC, DAVORIN, M.A. Combinatorial Game Theory (2010) Directed by Dr. Clifford Smyth. pp.40

This watermark does not appear in the registered version - Sokoban Protocol Document

arxiv: v1 [cs.cc] 21 Jun 2017

Edge-disjoint tree representation of three tree degree sequences

Senior Math Circles February 10, 2010 Game Theory II

Undergraduate Research Opportunity Programme in Science. The Game of Kalah

Permutations. = f 1 f = I A

The first player to construct his or her obelisk is the winner, and if a player has no legal moves, he or she immediately loses the game.

The mathematics of Septoku

Sokoban: Reversed Solving

UNO is hard, even for a single playe. Demaine, Erik D.; Demaine, Martin L. Citation Theoretical Computer Science, 521: 5

Techniques for Generating Sudoku Instances

Surreal Numbers and Games. February 2010

Permutation group and determinants. (Dated: September 19, 2018)

Chapter 4 Number Theory

12. 6 jokes are minimal.

Solution Algorithm to the Sam Loyd (n 2 1) Puzzle

New Sliding Puzzle with Neighbors Swap Motion

The Complexity of Generalized Pipe Link Puzzles

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

On the fairness and complexity of generalized k-in-a-row games

Plan. Related courses. A Take-Away Game. Mathematical Games , (21-801) - Mathematical Games Look for it in Spring 11

(b) In the position given in the figure below, find a winning move, if any. (b) In the position given in Figure 4.2, find a winning move, if any.

Mathematics Competition Practice Session 6. Hagerstown Community College: STEM Club November 20, :00 pm - 1:00 pm STC-170

arxiv: v1 [cs.cc] 14 Jun 2018

SOLITAIRE CLOBBER AS AN OPTIMIZATION PROBLEM ON WORDS

Math 152: Applicable Mathematics and Computing

THE GAMES OF COMPUTER SCIENCE. Topics

Advanced Automata Theory 4 Games

A GRAPH THEORETICAL APPROACH TO SOLVING SCRAMBLE SQUARES PUZZLES. 1. Introduction

Some results on Su Doku

arxiv: v1 [cs.cc] 7 Mar 2012

Generalized Amazons is PSPACE Complete

The Symmetric Traveling Salesman Problem by Howard Kleiman

Lumines is NP-complete

Grade 6 Math Circles March 7/8, Magic and Latin Squares

The Complexity of Escaping Labyrinths and Enchanted Forests

Question Score Max Cover Total 149

A Group-theoretic Approach to Human Solving Strategies in Sudoku

Coin Cappers. Tic Tac Toe

Sudoku goes Classic. Gaming equipment and the common DOMINARI - rule. for 2 players from the age of 8 up

1 Introduction. 2 An Easy Start. KenKen. Charlotte Teachers Institute, 2015

Zsombor Sárosdi THE MATHEMATICS OF SUDOKU

Lecture 1, CS 2050, Intro Discrete Math for Computer Science

Realizing Strategies for winning games. Senior Project Presented by Tiffany Johnson Math 498 Fall 1999

CS 32 Puzzles, Games & Algorithms Fall 2013

1st UKPA Sudoku Championship

Graphs of Tilings. Patrick Callahan, University of California Office of the President, Oakland, CA

Investigation of Algorithmic Solutions of Sudoku Puzzles

Combined Games. Block, Alexander Huang, Boao. icamp Summer Research Program University of California, Irvine Irvine, CA

Combinatorial Game Theory: An Introduction to Tree Topplers

Scrabble is PSPACE-Complete

The patterns considered here are black and white and represented by a rectangular grid of cells. Here is a typical pattern: [Redundant]

Bulgarian Solitaire in Three Dimensions

Data Analysis and Probability

The Classification of Quadratic Rook Polynomials of a Generalized Three Dimensional Board

arxiv: v2 [cs.cc] 18 Mar 2013

Contents. MA 327/ECO 327 Introduction to Game Theory Fall 2017 Notes. 1 Wednesday, August Friday, August Monday, August 28 6

A1 Problem Statement Unit Pricing

Game Theory Lecturer: Ji Liu Thanks for Jerry Zhu's slides

Mathematics (JUN11MD0201) General Certificate of Education Advanced Level Examination June Unit Decision TOTAL.

LMI-MONTHLY TEST JUN 2010 'SPEED SIXES'

A year ago I investigated a mathematical problem relating to Latin squares. Most people, whether knowing it or not, have actually seen a Latin square

LMI Monthly Test May 2010 Instruction Booklet

UNO is hard, even for a single player

Analyzing Games: Solutions

Counting Permutations by Putting Balls into Boxes

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

COCI 2008/2009 Contest #3, 13 th December 2008 TASK PET KEMIJA CROSS MATRICA BST NAJKRACI

Computational aspects of two-player zero-sum games Course notes for Computational Game Theory Section 3 Fall 2010

Multiagent Systems: Intro to Game Theory. CS 486/686: Introduction to Artificial Intelligence

FOM 11 Ch. 1 Practice Test Name: Inductive and Deductive Reasoning

Table of Contents. Table of Contents 1

1. Non-Adaptive Weighing

Game Theory and an Exploration of 3 x n Chomp! Boards. Senior Mathematics Project. Emily Bergman

Solitaire Games. MATH 171 Freshman Seminar for Mathematics Majors. J. Robert Buchanan. Department of Mathematics. Fall 2010

Transcription:

Easy Games and Hard Games Igor Minevich April 30, 2014

Outline 1 Lights Out Puzzle 2 NP Completeness 3 Sokoban 4 Timeline 5 Mancala

Original Lights Out Puzzle There is an m n grid of lamps that can be on or off. Clicking a lamp switches the state of it and the lamps adjacent to it (vertically and horizontally). Starting with all lamps on (or some subset of lamps on), the goal is to switch them all off.

Generalized Lights Out Puzzle There is an undirected graph with vertices that are black or white. Click a vertex makes it and all its adjacent vertices switch color. Goal: starting with all vertices black, make all vertices white.

Mathematical Interpretation The vertices are elements of a vector with entries in F 2. Black = 0; White = 1. Let A be the adjacency matrix of the graph (A ij = 1 vertex i is adjacent to vertex j). A is symmetric, and its diagonal entries are all 1. We want a vector x such that A x = 1, the all-1 s vector.

My Theorem Theorem Let A be a symmetric matrix over F 2. Then the vector d composed of the diagonal entries of A is in the range of A. Proof We want to show d Range(A) = Range(A T ) = Nul(A). Thus we want to show d x = 0 if A x = 0. WLOG x = (1,..., 1, 0,..., 0) T where the first k elements are 1 (otherwise, permute corresponding rows and columns of A). Computation shows d x = k i=1 A ii = 0.

Computation If A is N N and A(1,..., 1, 0,..., 0) T = 0 then for all j = 1,..., N k 1 A jk = A jj + Therefore, i=1 i j A ji k 1 k 1 A kk = A kj = j=1 j=1 k 1 k 1 k 1 k 1 = A jj + A ji = A jj + 2 j=1 Therefore, j=1 i=1 i j j=1 k A jj = 0 j=1 A jk k 1 j>i 1 A ji k 1 = j=1 A jj

The Theorem is Sharp Other Fields A = ( 1 2 2 4 ) B = ( 1 θ θ θ 2 A shows the theorem does not hold in any characteristic p 2, and B shows it does not hold in F 2 2, hence in any F 2 n. Here, θ is a generator for the multiplicative group of F 2 2. Not Symmetric The theorem is not true if the matrix is not symmetric: e.g. ( ) 1 0 C = 1 0 )

Solving the Lights Out Puzzle Just write down the adjacency matrix A and solve A x = 1. Gaussian elimination takes O(n 3 ) operations if A is n n. If we work with even a 4 4 grid, then n = 16; computation is already difficult for a human. For a standard computer, even n = 1000 is easily doable. Strategy for the grid version: start with an arbitrary combination on the bottom row and then work upwards. Try all combos until you get one that works.

Classes of Problems P ( polynomial time ) is the class of problems (involving a variable n of inputs) which can be solved in polynomial time (in terms of n). NP ( nondeterministic polynomial time ) is the class of problems whose solution is verifiable in polynomial time. NP-hard is the class of problems that are at least as hard as the hardest NP problems, i.e. a problem p is NP-hard iff any NP problem can be reduced to p in polynomial time. NP-complete = NP NP-hard P vs. NP problem: Does P = NP?

Some NP-Complete Problems Hamiltonian Path Problem Subset Sum Problem Generalized Sudoku (n 2 n 2 board with n n blocks) Bejeweled Kakuro Battleship Puzzle

Sokoban Sokoban means warehouse worker in Japanese. Setup: there is a warehouse (a rectangular grid) with boxes, walls, storage locations, and a worker (these are all 1 1). Goal: the worker needs to push all the boxes into storage locations. Rules: The worker cannot move a wall, and he cannot push more than one box at a time.

PSPACE Completeness PSPACE is the class of all problems that can be solved using polynomial space. PSPACE-complete is the class of problems p in PSPACE such that any PSPACE problem can be reduced to p in polynomial time. Sokoban is PSPACE-complete, hence much harder than an NP-complete problem.

Mahjong The usual solitaire game is PSPACE-complete (the goal is to determine the play which is likeliest to yield a win). If peeking under the tiles is allowed, Mahjong is NP-complete.

Start of Timeline 3000 BC: Earliest game similar to checkers found 500 BC: Mahjong invented by Confucius (according to myth) 700 AD: Earliest instance of Mancala-like game found 1971: P vs. NP introduced by Stephen Cook 1979: Sudoku was probably invented by Howard Garns from Connersville, IN 1981: Sokoban created

End of Timeline 1983: Vulcan Electronics released XL-25, later known as Lights Out (Tiger Toys in 1995) 1994: I was introduced to Sokoban 1997: Sokoban proven PSPACE-complete by Joseph Culberson 2012: I proved my theorem. Last Wednesday: I defended my thesis!

Rules The board consists of two rows of holes with marbles in them and also two score-keeping holes called kallahah on the sides. Players start with 4 (or 5 or 6, etc.) marbles in each hole. They take turns sowing by taking all the marbles in one of the holes on their side and distributing them counterclockwise to the other holes, excluding the opponent s kallahah. If the last sown marble lands in an empty hole on the player s side, the player captures it and all the marbles in the opposite hole on the opponent s side. If the last sown marble lands in the player s kallahah, the player goes again. If a player cannot move because he has no marbles left, the opponent captures all the marbles on his side and the game ends.

Analysis As far as I know, generalizations such as n 2 boards or starting with n marbles in each hole have not been considered. It is difficult enough to analyze the usual game. One way to analyze positions is to disregard the captured marbles, using induction.

Oware Captures are different: if the last marble sown ends on the opponent s side and as a result the tally for that hole is 2 or 3, the player captures those 2 or 3 marbles. In case of a capture, one goes clockwise backwards and applies the same procedure: if the tally had increased to 2 or 3, then those marbles are captured. Game cycles can occur in Oware (same position happens more than once). The game-tree complexity of Oware is much larger.

Other Rules The player must make sure the opponent has marbles to play with, if possible. The player cannot capture all of the opponent s pieces. Ethiopian rules: a player cannot sow from a hole that only has one marble, but he can sow in either direction.