games and strategies
play

Games and Strategies Vedran Kasalica Last time Proofs by induction - PowerPoint PPT Presentation

Games and Strategies Vedran Kasalica Last time Proofs by induction This lecture Games and Strategies Modelling Computing Systems The book is called Modelling Computing Systems - but so far we have studied: sets functions


  1. Games and Strategies Vedran Kasalica

  2. Last time Proofs by induction

  3. This lecture Games and Strategies

  4. Modelling Computing Systems The book is called Modelling Computing Systems - but so far we have studied: sets • functions • relations • propositional and predicate logic • induction • ... but these are all very static concepts. There's hardly any computation or interaction.

  5. Games Today we will study how to apply these ideas to model a series of interactions. Interactions can be: computers interacting • brokers buying/selling shares, etc. • We focus on a more restricted form of interactions, namely games .

  6. Games Not computer games. Instead focus on well-specified interactions between players . The players can: win the game • lose the game • potentially draw the game •

  7. Chance in games We can distinguish between different kinds of games: Games of chance - like roulette - where there is no good strategy • for winning. Games of no chance - like tic-tac-toe - where it is clear how to win. • These are two extremes: the most fun games have some element of luck (e.g. monopoly).

  8. Games of no chance We'll study the games without any chance element. Furthermore, we focus on games of perfect information (e.g. chess). Finite games - if the game could continue indefinitely call it e.g. “a draw” Rules according to which the player makes a move on each turn make a strategy.

  9. Strategies Winning strategy - guarantees a victory regardless the moves of the opponent Drawing strategy - guarantees that the opponent will not win regardless the moves of the opponent A position in a game can be: winning - there is a winning strategy for the current player • losing - there is a winning strategy for the non-current player • drawing - neither player has a winning strategy •

  10. Example: Tic Tac Toe Drawing position

  11. Example: Tic Tac Toe Losing position

  12. Strategies Theorem In a two-player game-of-no-chance of perfect information, either one the two players has a winning strategy, or they both have drawing strategies.

  13. Proof Case 1 : Player X has a winning strategy Claim : The other one cannot have a winning strategy If we fix the two strategies only one player will win and only the strategy of that player was the winning one

  14. Proof Case 2 : Neither player has a winning strategy Claim : Both players have a drawing strategy First player (X) doesn’t have a winning strategy, so player O can always respond in order to win or draw. Ensuring that player X doesn’t win. Similarly, player X can ensure that the player O doesn’t win. Thus, they both have a drawing strategies .

  15. Proof Case 2 : Neither player has a winning strategy Claim : Both players have a drawing strategy First player (X) doesn’t have a winning strategy, so player O can always respond in order to win or draw. Ensuring that player X doesn’t win. Similarly, player X can ensure that the player O doesn’t win. Thus, they both have a drawing strategies .

  16. Strategies Theorem In a two-player game-of-no-chance of perfect information, either of the players has a winning strategy or they both have drawing strategies. Corollary If a game cannot end in a draw, one of the two players has a winning strategy.

  17. Example game Game: Starting with a pile of 10 coins, 2 players take turns removing either 2 or 3 coins from the pile. The winner is the one that takes the last pile; if one coin remains, then the game is a draw.

  18. Example game Game: Starting with a pile of 10 coins, 2 players take turns removing either 2 or 3 coins from the pile. The winner is the one that takes the last pile; if one coin remains, then the game is a draw.

  19. Game tree each node is a position • circle (W) • square (L) • blank (D) • edge represents a move •

  20. Game tree: Tic Tac Toe W/D/L labels are omitted ...

  21. Nim

  22. Nim Game: Board consists of an arbitrary number of piles, where each has • arbitrary number of coins 2 players take turns removing each time 1 or more coins from • exactly one pile Goal is to take the last coin •

  23. Nim Game: Board consists of an arbitrary number of piles, where each has • arbitrary number of coins 2 players take turns removing each time 1 or more coins from • exactly one pile Goal is to take the last coin •

  24. Nim Game: Board consists of an arbitrary number of piles, where each has • arbitrary number of coins 2 players take turns removing each time 1 or more coins from • exactly one pile Goal is to take the last coin •

  25. Nim Game: Board consists of an arbitrary number of piles, where each has • arbitrary number of coins 2 players take turns removing each time 1 or more coins from • exactly one pile Goal is to take the last coin •

  26. Nim Game: Board consists of an arbitrary number of piles, where each has • arbitrary number of coins 2 players take turns removing each time 1 or more coins from • exactly one pile Goal is to take the last coin •

  27. Nim Game: Board consists of an arbitrary number of piles, where each has • arbitrary number of coins 2 players take turns removing each time 1 or more coins from • exactly one pile Goal is to take the last coin •

  28. Nim Winning strategies 1 pile game •

  29. Nim Winning strategies 1 pile game •

  30. Nim Winning strategies 1 pile game (W) •

  31. Nim Winning strategies 1 pile game (W) • 2 pile game •

  32. Nim Winning strategies 1 pile game (W) • 2 pile game • • piles are equal

  33. Nim Winning strategies 1 pile game (W) • 2 pile game • • piles are equal (L)

  34. Nim Winning strategies 1 pile game (W) • 2 pile game • • piles are equal (L) piles are not equal •

  35. Nim Winning strategies 1 pile game (W) • 2 pile game • • piles are equal (L) piles are not equal (W) •

  36. Nim Winning strategies 1 pile game (W) • 2 pile game • piles are equal (L) • piles are not equal (W) • 3 pile game • 2 piles are equal •

  37. Nim Winning strategies 1 pile game (W) • 2 pile game • piles are equal (L) • piles are not equal (W) • 3 pile game • 2 piles are equal (W) •

  38. Nim Winning strategies 1 pile game (W) • 2 pile game • piles are equal (L) • piles are not equal (W) • 3 pile game • 2 piles are equal (W) • • piles contain 1, 2 and 3 coins

  39. Nim Winning strategies 1 pile game (W) • 2 pile game • piles are equal (L) • piles are not equal (W) • 3 pile game • 2 piles are equal (W) • • piles contain 1, 2 and 3 coins

  40. Nim Winning strategies 1 pile game (W) • 2 pile game • piles are equal (L) • piles are not equal (W) • 3 pile game • 2 piles are equal (W) • • piles contain 1, 2 and 3 coins

  41. Nim Winning strategies 1 pile game (W) • 2 pile game • piles are equal (L) • piles are not equal (W) • 3 pile game • 2 piles are equal (W) • • piles contain 1, 2 and 3 coins

  42. Nim Winning strategies 1 pile game (W) • 2 pile game • piles are equal (L) • piles are not equal (W) • 3 pile game • 2 piles are equal (W) • • piles contain 1, 2 and 3 coins

  43. Nim Winning strategies 1 pile game (W) • 2 pile game • piles are equal (L) • piles are not equal (W) • 3 pile game • 2 piles are equal (W) • • piles contain 1, 2 and 3 coins

  44. Nim Winning strategies 1 pile game (W) • 2 pile game • piles are equal (L) • piles are not equal (W) • 3 pile game • 2 piles are equal (W) • • piles contain 1, 2 and 3 coins (L)

  45. Nim Winning strategies 1 pile game (W) • 2 pile game • piles are equal (L) • piles are not equal (W) • 3 pile game • 2 piles are equal (W) • • piles contain 1, 2 and 3 coins (L) arbitrary number of coins (?) •

  46. Nim Winning strategies 1 pile game (W) • 2 pile game • piles are equal (L) • piles are not equal (W) • 3 pile game • 2 piles are equal (W) • • piles contain 1, 2 and 3 coins (L) arbitrary number of coins (?) •

  47. Nim Universal winning strategy: 1) Write out number of coins in piles in binary representation

  48. Nim Universal winning strategy: 2) Add up the columns module 2

  49. Nim Universal winning strategy: If all of the columns have even parity, the position is balanced, otherwise it’s unbalanced

  50. Nim Observation: If the position is balanced , then every move will lead to an 1. unbalanced position If the position is unbalanced , then there exists a move that will 2. lead to a balanced position Empty board is a balanced position 3.

  51. Nim Universal winning strategy: 3) If the position is unbalanced (W), player should make a move to make it balanced each time and he is insured to win

  52. Nim Universal winning strategy: 4) If the position is balanced (L), the opponent has a chance to use the same strategy to win

  53. Chomp

  54. Chomp Game: we have a n x m bar where leftmost-topmost square is poisonous • two players take turns to bite of the bar, where each player has to • choose a remaining square and eat all the squares below it and to the right from it the player that eats the poisonous square lost the game •

Recommend


More recommend