AE1APS Algorithmic Problem Solving John Drake..  Previously we introduced matchstick games, using one pile of matches  It is possible to have more than.

Slides:



Advertisements
Similar presentations
Week 6 - Wednesday CS322.
Advertisements

Great Theoretical Ideas in Computer Science
AE1APS Algorithmic Problem Solving John Drake.  Coursework 3 due on Thursday at 1pm  (i.e. before the start of the tutorial).  Submit either hard-copy.
AE1APS Algorithmic Problem Solving John Drake
1 CS 385 Fall 2006 Chapter 4 Heuristic Search. 2 Heuristics eurisko ("I discover" in Greek) "the study of the methods and rules of discovery and invention."
Introduction to Combinatorial Game Acm Honored Class Weitao.
1 Discrete Structures & Algorithms Graphs and Trees: III EECE 320.
Multi-item auctions with identical items limited supply: M items (M smaller than number of bidders, n). Three possible bidder types: –Unit-demand bidders.
MIT and James Orlin © Dynamic Programming 1 –Recursion –Principle of Optimality.
Game Theory An Overview of Game Theory by Kian Mirjalali.
AE1APS Algorithmic Problem Solving John Drake.  Invariants – Chapter 2  River Crossing – Chapter 3  Logic Puzzles – Chapter 5  Matchstick Games -
EC941 - Game Theory Lecture 7 Prof. Francesco Squintani
4 Games and Fuses U:\APPS\Ghostgum\gsview Shared folder U:\2nd Year Share\Computer Science Courses\Semester One\Algortithmic Problem Solving Book: Algorithmic.
Lecture 12: Lower bounds By "lower bounds" here we mean a lower bound on the complexity of a problem, not an algorithm. Basically we need to prove that.
Five Problems CSE 421 Richard Anderson Winter 2009, Lecture 3.
Induction.
AE1APS Algorithmic Problem Solving John Drake.  Invariants – Chapter 2  River Crossing – Chapter 3  Logic Puzzles – Chapter 5 (13) ◦ Knights and Knaves.
Progressively Finite Games
Copyright © 2006 Addison-Wesley. All rights reserved.1-1 ICS 410: Programming Languages Chapter 3 : Describing Syntax and Semantics Axiomatic Semantics.
1 By Gil Kalai Institute of Mathematics and Center for Rationality, Hebrew University, Jerusalem, Israel presented by: Yair Cymbalista.
CompSci Recursion & Minimax Playing Against the Computer Recursion & the Minimax Algorithm Key to Acing Computer Science If you understand everything,
Great Theoretical Ideas in Computer Science.
Discrete Structures & Algorithms More on Methods of Proof / Mathematical Induction EECE 320 — UBC.
1 Maximal Independent Set. 2 Independent Set (IS): In a graph, any set of nodes that are not adjacent.
1 Discrete Structures & Algorithms Graphs and Trees: II EECE 320.
Complexity 11-1 Complexity Andrei Bulatov Space Complexity.
The Game of Nim on Graphs: NimG Gwendolyn Stockman Alan Frieze and Juan Vera.
CSE115/ENGR160 Discrete Mathematics 02/07/12
Great Theoretical Ideas in Computer Science.
Discrete Structures Chapter 2 Part B Mathematical Induction
Job Scheduling Lecture 19: March 19. Job Scheduling: Unrelated Multiple Machines There are n jobs, each job has: a processing time p(i,j) (the time to.
View from 30,000 feet and Introduction to Graph Problems Lecture 19 CS 312.
Using Reduction for the Game of NIM. At each turn, a player chooses one pile and removes some sticks. The player who takes the last stick wins. Problem:
Minimum Spanning Trees. Subgraph A graph G is a subgraph of graph H if –The vertices of G are a subset of the vertices of H, and –The edges of G are a.
Great Theoretical Ideas in Computer Science.
Great Theoretical Ideas in Computer Science.
Discrete Mathematics CS 2610 March 26, 2009 Skip: structural induction generalized induction Skip section 4.5.
Chapter 9 Games with Imperfect Information Bayesian Games.
CP Summer School Modelling for Constraint Programming Barbara Smith 1.Definitions, Viewpoints, Constraints 2.Implied Constraints, Optimization,
Part II - Sums of Games Consider a game called Boxing Match which was defined in a programming contest m.short.html.
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.
Games with Imperfect Information Bayesian Games. Complete versus Incomplete Information So far we have assumed that players hold the correct belief about.
6 Sums of Games.. Lecture6 Admin Plagiarism forms Answer football cup final problem. //Daisy Problem hints e.g. try a smaller size. General problem solving.
Lecture 19 Greedy Algorithms Minimum Spanning Tree Problem.
Graph Colouring L09: Oct 10. This Lecture Graph coloring is another important problem in graph theory. It also has many applications, including the famous.
Chapter 10 Graph Theory Eulerian Cycle and the property of graph theory 10.3 The important property of graph theory and its representation 10.4.
1 Parrondo's Paradox. 2 Two losing games can be combined to make a winning game. Game A: repeatedly flip a biased coin (coin a) that comes up head with.
Planar Graphs Lecture 10: Oct 21. This Lecture Today we will talk about planar graphs, and how to color a map using 6 colors. Planar graphs Euler’s formula.
Tuesday, April 30 Dynamic Programming – Recursion – Principle of Optimality Handouts: Lecture Notes.
Chapter 9 Finding the Optimum 9.1 Finding the Best Tree.
Relations Over Asymptotic Notations. Overview of Previous Lecture Although Estimation but Useful It is not always possible to determine behaviour of an.
The Basics Of Chess Student Name: Jovannie Charles Date: 3/25/11.
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.
+ Chapter 5 Overview 5.1 Introducing Probability 5.2 Combining Events 5.3 Conditional Probability 5.4 Counting Methods 1.
CS Lecture 26 Monochrome Despite Himself. Pigeonhole Principle: If we put n+1 pigeons into n holes, some hole must receive at least 2 pigeons.
The Standard Genetic Algorithm Start with a “population” of “individuals” Rank these individuals according to their “fitness” Select pairs of individuals.
More Induction Discrete Structures (CS 173) Madhusudan Parthasarathy, University of Illinois 1 A Pork-Butchers Shop Seen from a Window Van Gogh.
Lecture Coursework 2. Rectangle Game Look at proof of matchsticks Read thru the question. A rectangular board is divided into m columns by n rows. The.
CompSci Recursion & Minimax Recursion & the Minimax Algorithm Key to Acing Computer Science If you understand everything, ace your computer science.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 3.
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.
Introductory Game Theory
Data Structures Lab Algorithm Animation.
Great Theoretical Ideas in Computer Science
Recitation #3 Tel Aviv University 2016/2017 Slava Novgorodov
Inequalities.
NIM - a two person game n objects are in one pile
Try starting with fewer objects to investigate.
Game Theory Day 2: More Simple Games.
Instructor: Aaron Roth
Presentation transcript:

AE1APS Algorithmic Problem Solving John Drake.

 Previously we introduced matchstick games, using one pile of matches  It is possible to have more than one pile of matches  First a pile must be chosen, then matches may be removed from the chosen pile according to some rule (which may differ from pile to pile)  The game is thus a combination of two games  Combinations of games is such a way are known as sum games

 We have two games, each with its own rules  Let us call the two games, the left and right games  A position in the sum game is the combination of the position in the left game and the position in the right game  A move in the sum game is a move in one of the left or right games

 A graph represents a game.  The positions are represented by nodes.  The moves are represented by edges.  Imagine a coin placed on a node.

 A graph represents a game.  The positions are represented by nodes.  The moves are represented by edges.  Imagine a coin placed on a node.

 A graph represents a game.  The positions are represented by nodes.  The moves are represented by edges.  Imagine a coin placed on a node.

 A graph represents a game.  The positions are represented by nodes.  The moves are represented by edges.  Imagine a coin placed on a node.

 In the sum game, two coins are used  One coin being placed over a node in each of the two graphs  A move is then to choose one of the coins, and move it along an edge to another node  A move changes the position of one of the coins

 The two games are unstructured, thus we have to use brute force to determine if they are winning or losing positions  The left game has 15 positions, the right game has 11 positions  How many positions are there in the sum game?

 There are 15*11 positions (165)  Brute force is not a desirable approach  We now look at how to compute a strategy for the sum of two games  We find that the computation effort needed to find winning and losing states is not the product, but the sum of the computational effort for the individual games.

 Suppose there are two piles of matches  A move is to choose a pile of matches, and remove at least one match from that pile  The game is lost when a player cannot remove any matches.

 Given a pile of matches, remove at least one  The winning positions are the positions where there is at least one match  The winning strategy is to remove all the matches  The losing position contains no matches  Draw the state transition diagram

 The single game strategy cannot be applied directly to the sum game  Why not?

 Symmetry between left and right allows us to identify a winning strategy.  Let m, n represent the number of matches in the two piles.  In the end m=n=0.  This suggests m=n identifies losing positions.  Choose the larger pile and restore the property that m=n. i.e. maintain the invariant

 The property n!=m is the precondition for the winning strategy to be applied  Equivalently m<n or n<m.  If m<n, we infer 1 <= n-m <=n  So n-m matches can be removed from the pile with n matches.  After the assignment n:=n-(n-m), the property m=n will hold.

 Suppose K matches can be removed (K is fixed)  This restriction disallows some winning moves  We are not allowed to remove m-n matches when K<m-n  The property m=n no longer characterises losing positions.

 Example K=1  Lets set K=1  (2, 0).  A player is forced to move to (1, 0) and the opponent can then win the game.

 It seems that the strategy of restoring symmetry no longer applies  Worse, if the number of matches we are allowed to remove from the two piles differs

 Even worse, the left and right games may be completely different!!!

 With one pile of matches, where M matches at most can be removed,  The winning strategy is to continually restore the property that the remainder after dividing the number of matches by M+1 is 0 (i.e. m mod (M+1) == 0)  The number, m mod (M+1) == 0, determines if the position is winning or not.

 The one player game suggests the symmetry as:m mod (M+1) = n mod (N+1)  We will prove this in later lectures.  In the final position (0,0), this property is satisfied.