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.

Slides:



Advertisements
Similar presentations
Great Theoretical Ideas in Computer Science
Advertisements

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.
MIT and James Orlin © Dynamic Programming 1 –Recursion –Principle of Optimality.
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.
Mathematical Induction II Lecture 14: Nov
1 Copyright © Cengage Learning. All rights reserved. 4 Probability.
Bounds on Code Length Theorem: Let l ∗ 1, l ∗ 2,..., l ∗ m be optimal codeword lengths for a source distribution p and a D-ary alphabet, and let L ∗ be.
G51IAI Introduction to AI Minmax and Alpha Beta Pruning Garry Kasparov and Deep Blue. © 1997, GM Gabriel Schwartzman's Chess Camera, courtesy IBM.
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.
Parallel Scheduling of Complex DAGs under Uncertainty Grzegorz Malewicz.
Induction Lecture 5: Sep 21 (chapter of the book and chapter of the notes)
1 Dynamic Programming Jose Rolim University of Geneva.
AE1APS Algorithmic Problem Solving John Drake..  Previously we introduced matchstick games, using one pile of matches  It is possible to have more than.
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.
State Space 4 Chapter 4 Adversarial Games. Two Flavors Games of Perfect Information ◦Each player knows everything that can be known ◦Chess, Othello Games.
1 Discrete Structures & Algorithms Graphs and Trees: II EECE 320.
Complexity 11-1 Complexity Andrei Bulatov Space Complexity.
Tirgul 10 Rehearsal about Universal Hashing Solving two problems from theoretical exercises: –T2 q. 1 –T3 q. 2.
Branch and Bound Similar to backtracking in generating a search tree and looking for one or more solutions Different in that the “objective” is constrained.
INTEGRALS Areas and Distances INTEGRALS In this section, we will learn that: We get the same special type of limit in trying to find the area under.
Counting I: One To One Correspondence and Choice Trees Great Theoretical Ideas In Computer Science Steven RudichCS Spring 2004 Lecture 9Feb 10,
CSE115/ENGR160 Discrete Mathematics 02/07/12
Great Theoretical Ideas in Computer Science.
Probability And Expected Value ————————————
UNIT II: The Basic Theory Zero-sum Games Nonzero-sum Games Nash Equilibrium: Properties and Problems Bargaining Games Bargaining and Negotiation Review.
LIMITS 2. LIMITS 2.4 The Precise Definition of a Limit In this section, we will: Define a limit precisely.
Copyright © Cengage Learning. All rights reserved. 5 Integrals.
Great Theoretical Ideas in Computer Science.
Great Theoretical Ideas in Computer Science.
Copyright © Cengage Learning. All rights reserved.
Lecture 5 Knights and Knaves.. Administration Show hand in form. Show plagiarism form. Any problems with coursework? Google knight and knaves and look.
Continuity ( Section 1.8) Alex Karassev. Definition A function f is continuous at a number a if Thus, we can use direct substitution to compute the limit.
Basic Counting. This Lecture We will study some basic rules for counting. Sum rule, product rule, generalized product rule Permutations, combinations.
Part II - Sums of Games Consider a game called Boxing Match which was defined in a programming contest m.short.html.
10.4 How to Find a Perfect Matching We have a condition for the existence of a perfect matching in a graph that is necessary and sufficient. Does this.
Multivariate Statistics Matrix Algebra II W. M. van der Veld University of Amsterdam.
Section 1.8. Section Summary Proof by Cases Existence Proofs Constructive Nonconstructive Disproof by Counterexample Nonexistence Proofs Uniqueness Proofs.
Final Lecture. Instructions in Exam ANSWER 2 QUESTIONS. There will be a choice of 3 questions. Each question will be in parts e.g. a, b, c. You can see.
Discrete Mathematics Tutorial 11 Chin
Copyright © Cengage Learning. All rights reserved. 4 Integrals.
Games. Adversaries Consider the process of reasoning when an adversary is trying to defeat our efforts In game playing situations one searches down the.
GRAPHS THEROY. 2 –Graphs Graph basics and definitions Vertices/nodes, edges, adjacency, incidence Degree, in-degree, out-degree Subgraphs, unions, isomorphism.
Graph Colouring L09: Oct 10. This Lecture Graph coloring is another important problem in graph theory. It also has many applications, including the famous.
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.
Adversarial Games. Two Flavors  Perfect Information –everything that can be known is known –Chess, Othello  Imperfect Information –Player’s have each.
Tuesday, April 30 Dynamic Programming – Recursion – Principle of Optimality Handouts: Lecture Notes.
Every chess master was once a beginner. Irving Chernev
1 INFO 2950 Prof. Carla Gomes Module Induction Rosen, Chapter 4.
Counting I: One To One Correspondence and Choice Trees Great Theoretical Ideas In Computer Science Steven RudichCS Spring 2004 Lecture 9Feb 10,
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.
Main Menu Main Menu (Click on the topics below) Combinatorics Introduction Equally likely Probability Formula Counting elements of a list Counting elements.
Chapter 8: Relations. 8.1 Relations and Their Properties Binary relations: Let A and B be any two sets. A binary relation R from A to B, written R : A.
Independence and Dependence 1 Krishna.V.Palem Kenneth and Audrey Kennedy Professor of Computing Department of Computer Science, Rice University.
Zero-sum Games The Essentials of a Game Extensive Game Matrix Game Dominant Strategies Prudent Strategies Solving the Zero-sum Game The Minimax Theorem.
Lecture 04: Theory of Automata:08 Transition Graphs.
Dr. Naveed Riaz Design and Analysis of Algorithms 1 1 Formal Methods in Software Engineering Lecture # 26.
Copyright © Cengage Learning. All rights reserved. CHAPTER 8 RELATIONS.
The Lovely Game of NIM. Version 1 - Classic NIM You will need seven objects, such as counters or blocks. It is a game for two players. Place the 7 counters.
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.
Explorations in Artificial Intelligence Prof. Carla P. Gomes Module 5 Adversarial Search (Thanks Meinolf Sellman!)
Lecture 09: Theory of Automata:2014 Asif NawazUIIT, PMAS-Arid Agriclture University Rawalpindi. Kleene’s Theorem and NFA.
Content Game of Nim Impartial Games Sprague-Grundy theorem
Copyright © Cengage Learning. All rights reserved. 4 Integrals.
Algebra 2 Properties of Real Numbers Lesson 1-2 Goals Goal To graph and order real numbers. To Identity properties of real numbers. Rubric Level 1 –
Great Theoretical Ideas in Computer Science
NIM - a two person game n objects are in one pile
Unit II Game Playing.
Presentation transcript:

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 ideas. Show see. Mention coursework.

Sums of games Previously we looked at a matchstick game, using one pile of matches. We can 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. This particular way of combining games is called summing games. There are other ways.

In General 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 right game. A move in the sum game is a move in one of the left or right games.

Example – A graph The single game. Show figure 4.4 page 53 Each graph represents a game. The positions are represented by nodes. The moves are represented by edges. Imagine a coin placed on a node. (CAPITAL LETTER, lower case letter) e.g. (X, y)

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. Are we looking at a state transition diagram? Why/why not?

Labelling Positions in Sum Games 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?

Computational Effort. There are positions. 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.

A simple sum game, Matchsticks. 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.

The single matchstick game. 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.

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

Strategy 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.

Initial Property 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.

More Simple Sum Games 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.

Symmetry Restrictions 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. E.g. M and N (N!=M) Or the left and right games may be completely different!!! E.g. matchstick game and daisy game.

One Pile game with K With one pile of matches, where M matches at most can be removed, 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.

Two Pile Game The one player game suggests the symmetry as m mod (M+1) == n mod (N+1) In the final position (0,0), this property is satisfied.

The MEX function p57 Consider the sum of two games. The position in the sum game is (l, r). A move affects one component Assignments are l := l’ or r :=r’ (i.e. the left or right component is affected) Define two functions L and R on the left and right positions such that, (l, r) is a losing position exactly when L(l) = R(r).

Analysis L and R must have equal values on end positions. Every move from a losing position (l,r) should result in a winning position satisfying L(l) !=R( r) Applying the winning strategy from a winning position, should result in a losing position. i.e. start with We require that: For end positions L.l=R.r=0 For every l’ such that there is a move from l to l’ L.l != L.l’ For any number m < R.r, it is possible to move from r to r’ such that R.r’=m (similar for left).

Definition of Mex Function Let p be a position in a game. The mex value of p (mex.p), is defined as the smallest natural number, n, such that There is no move in the game from p to position q satisfying mex.q=n For m < n, there is a move from p to q satisfying mex.q=m. Informally, mex.p is the minimum number that is excluded from the mex numbers of positions q to which a move can be made from p (i.e. q is a successor of p). This is a recursive definition.

Using the MEX function Show figure 4.4, and 4.6 page 60. DAG The graph do not have regular structure, so the mex numbers must be calculated by hand. End positions have a mex number of 0, A mex number can be give to a node when all its successors have been assigned a mex number. The number is the smallest number that is not included in the mex numbers of its successors.

Playing the game Suppose we start with “Ok” (O,k) as our position. This is a winning position because the mex numbers are different. The winning strategy is to move the right graph to node i which has the same mex number as “O”. i.e. we are restoring the balance (making R.r = L.l) The opponent will then disrupt the balance (making this an inequality). The first player the repeats the strategy of making the mex numbers equal, until the opponent can move no further.

Lack of Structure Note that due to the lack of structure, the mex number of the 15 left and 11 right positions were calculated individually. In total we did calculations, and not 15*11 (=165) calculations.

Tetrominoes Problem statement: Suppose a rectangular (n x m) board is covered with T Tetrominoes, show that the number of squares is a multiple of 8 Clearly it must be a multiple of 4. Placing a tetrominoe on the board is modelled by the assignment c := c+4 c is the number of squares covered. Initially c = 0 Thus c mod 4 is invariant. In words we say c is a multiple of 4 c = n.m and is a multiple of 4. Therefore either n or m or both are a multiple of 2.

Light and Dark We introduce two type of T Tetrominoes. (show colouring on board) B counts the number of black squares covered and w white. Placing a dark T is modelled by d, b, w := d+1, b+3, w+1 Placing a light T is modelled by l, b, w := l +1, b+1, w+3

Invariants An invariant of both assignments is b – 3d –l (prove on board for both assignments, p18) Similarly, w – 3l –d

Glass Chessmen There is a 100-floor building. We have two glass chessmen. We should use these two glass chessmen to test the lowest floor that the glass chessman would broken if they drop from this floor. If two glass chess men are both broken, it's failed. There are many methods. But the problem is ask us to give the optimum measuring method. It means that the times of dropping should be as fewer as possible considering the worst possibility. For instance, if we drop floor by floor, it maybe 1 times or 100 times, it is the worst method.