360 likes | 810 Vues
GAMES AND COMPUTER SCIENCE Theoretical Models 1999 Peter van Emde Boas References available at: http://turing.wins.uva.nl/~peter/teaching/thmod99.html Most Papers will be made available in Library Games in Computer Science Information & Uncertainty (Traub ea. - 80+)
E N D
GAMES AND COMPUTER SCIENCE Theoretical Models 1999 Peter van Emde Boas References available at: http://turing.wins.uva.nl/~peter/teaching/thmod99.html Most Papers will be made available in Library
Games in Computer Science • Information & Uncertainty (Traub ea. - 80+) • Pebble Game (Register Allocation, Theory) • Tiling Game (Reduction Theory) • Alternating Computation Model and / or trees • Interactive Proofs • Arthur Merlin Games • Zero Knowledge
Game Theory • Theory of Strategic Interaction • Attributes • Discrete vs. Continuous • Cooperative vs. Non-Cooperative • Full Information vs. Incomplete Information (Knowledge Theory)
Discrete / Continuous Combinatorial Analysis Backward Induction Number Theory (Conway Guy Berlekamp) Equilibria theory (Nash) Stochasitic Features Optimization Other names of importance: Von Neumann & Morgenstern Aumann Shapley Harsanyi
OTHER ASPECTS • Single player - no choices • Single player - random moves • Single player - choices : Solitaire • Two players - choices • Two players - choices and random moves • Two players - concurrent moves
Computer Science • Computation Theory • Complexity Theory • Machine Models • Algorithms • Knowledge Theory • Information Theory
COMPUTATION • Deterministic • Nondeterministic • Probabilistic • Alternating • Interactive protocols • Concurrency
COMPUTATION • Notion of Configurations: Nodes • Notion of Transitions: Edges • Non-uniqueness of transition: Out-degree > 1 • Initial Configuration : Root • Terminal Configuration : Leaf • Computation : Branch Tree • Acceptance Condition: Property of trees
Introducing the Opponents © Games Workshop © Games Workshop URGAT THORGRIM
A Game Starting with 15 matches players alternatively take 1, 2 or 3 matches away until none remain. The player ending up with an odd number of matches wins the game © Donald Duck 1999 # 35
Questions about this Game • What if the number of matches is even? • Can any of the two players force a win by clever playing? • How does the winner depend on the number of matches • Is this dependency periodic? If so WHY?
Games as Recognizers • Construct a map G : S* --> Games (simply computable; Poly-time, Logspace or NC, ….) • Set recognized := {w | G(w) is won (by the first player) } • How does this relate to conventional ways of recognizing languages ?
Games as Recognizers • Construct a map G : S* --> Games (simply computable; Poly-time, Logspace or NC, ….) • G(w) is guaranteed to be proper • Set recognized := {w | G(w) is won (by the first player) } • Properness conditions frequently involve probabilistic aspects
Game Trees Thorgrim’s turn Terminal node: Urgat looses Urgat’s turn Terminal node: Thorgrim looses Standard Interpretation: Player unable to move looses the game Root
Game Trees Thorgrim’s turn T U Terminal node: Urgat’s turn T T U U T Terminal node: Free Interpretation: Winner explicitly designated at terminal node Root
Game Trees Thorgrim’s turn 2/0 -1/ 4 Terminal node: Urgat’s turn 3/1 1/-1 -3/ 2 1/ 4 5/-7 Terminal node: Non Zero-Sum Game: Payoffs explicitly designated at terminal node Root
Game Trees SUB-GAME Thorgrim’s turn T U Terminal node: Urgat’s turn T T U U T Terminal node: Free Interpretation: Winner explicitly designated at terminal node Root
Backward Induction Thorgrim’s turn T U Terminal node: Urgat’s turn T T T U U T T Terminal node: U U Free Interpretation: Winner explicitly designated at terminal node U Root
Backward Induction Thorgrim’s turn 2/0 -1/ 4 Terminal node: Urgat’s turn 3/1 2/0 1/-1 -3/ 2 1/ 4 5/-7 3/1 Terminal node: -3/ 2 1/ 4 Non Zero-Sum Game: Payoffs explicitly designated at terminal node 1/ 4 Root
Backward Induction T U 2/0 -1/ 4 T 3/1 T 2/0 U T U T 1/-1 -3/ 2 1/ 4 5/-7 T 3/1 U U -3/ 2 1/ 4 U 1/ 4 At terminal nodes: Pay-off as explicitly given At Thorgrim’s nodes: Pay-off inherited from Thorgrim’s optimal choice At Urgat’s nodes: Pay-off inherited from Urgat’s optimal choice For strictly competetive games this is the Max-Min rule
Analysis of the DD game Extension used: Thorgrim wins if he has an odd number when the game terminates. This allows for even n . Relevant feature: parity of number of matches collected so far (not the number itself!) Four types of configurations remain: T/E : Thorgrim has to play and has an even number T/O : Thorgrim has to play and has an odd number U/E : Urgat plays, while Thorgrim has an even number U/O : Urgat plays, while Thorgrim has an odd number
Backward Induction Table nU / EU / OT / ET / O 18UUT / 1T / 2 17 U T T / 1 U 16 U T U T / 3 15 U U T / 2T / 3 14 U U T / 2T / 1 13 TU U T / 1 12 TU T / 3 U 11 U U T / 3 T / 2 10UUT / 1T / 2 9 U T T / 1 U 8 U T U T / 3 7 U U T / 2T / 3 6 U U T / 2T / 1 5 TU U T / 1 4 TU T / 3 U 3 U U T / 3 T / 2 2UUT / 1T / 2 1 U T T / 1 U 0 U T U T
What is the Strategy? • Play to number 0 or 1 (mod4) • Switch your parity on every turn • Start right: to even if n mod 8 {5,6,7,0} and to odd if n mod 8 {1,2,3,4} • Question: explain the correctness of this strategy, otherwise than by inspecting the table.....
Alternating Computation Configuration Type Existential Universal Negating + - + Accepting - - + + - + - Rejecting Computation Tree
Alternating Computation + Configuration Type + - - + + Existential + - Universal + + + - - - Negating - + - + + - + Accepting - - + + - + - Rejecting Evaluation Full Computation Tree This Tree Accepts
Alternating Computation Infinite Branches ? Requires third quality :Indeterminatenodes Universalnode isindeterminateiff it has no rejecting son and at least oneindeterminateson Existentialnode isindeterminateiff it has noaccepting son and at least oneindeterminateone Negatingnode isindeterminateiff its son is
Alternating Computation Infinite Branches ? Universalnode isacceptingiff it has no rejecting son and noindeterminateson (all sons are accepting) Existentialnode isacceptingiff it has oneaccepting Son; indeterminateand rejecting sons don’t matter Negatingnode isacceptingiff its son is rejecting Requires RecursiveEvaluation of computation tree !
RECURSIVE EVALUATION + - ^ The proper way of Recursive evaluation ??? + - ^ ^ + - + - ^ + - ^ …. …. …. Indeterminate : ^
RECURSIVE EVALUATION + - ^ Recursive evaluation == Solving LEAST FIXEDPOINT EQUATION ! + - ^ + - Partial order ≤ of definedness Extends to functions defined on the tree: F ≤ G iff "x[F(x) ≤ G(x)] ^ + - ^ + - ^ + - ^ …. …. …. OK NOK
The Knaster Tarski Theorem SET U with partial order ≤ and least element ^ Countable chains have least upper bounds DOMAIN := x0≤ x1 ≤ x2 ≤ ….. ≤ xn ≤ xn+1 ≤ …. ---> xw=:i xi "i[xi ≤ xw] and "i[xi ≤ y] ==> xw ≤ y FUNCTION F which is: MONOTONE: x ≤ y ==> F(x) ≤ F(y) CONTINUOUS: F( i xi ) = iF(xi) OPERATOR :=
The Knaster Tarski Theorem THEOREM: If F is an operator defined over domain U then the equation X = F( X ) has a least solution W . This solution is obtained as the limit of the sequence of iterates: ^ ≤ F( ^ ) ≤ F(F( ^ )) ≤ …. W = iFi ( ^ ) APPLICATION: U := domain of evaluations of tree F := single application of recursive rule
Back to Alternation • For an accepting tree there exists a witness subtree for acceptance (and similar for rejection) • Witness subtree contains a single accepting son for every accepting node, and a single rejecting son for every rejecting node • A witness subtree is finite, even when the tree itself is infinite! • Infinite branches are irrelevant!
Negating Nodes ? • Create for every node its dual node which yields the “same” transitions • Dual of accepting node is rejecting • Dual of rejecting node is accepting • Dual of universal node is existential • Dual of existential node is universal • Dual of Dual is identity • Replace every negating node by an existential one, dualizing the entire subtree below it (think de Morgan!)
Eliminating Negating Nodes + + + - - + - - + + + - + + - - + + + - - - + + + - - - - + - + + - - + - + + + - - + + - + - - + - + - + - - Dualized nodes -