1vs.
Boolean Games
turn based, one on one
Exercise 51
Players take turns
Exercise 51
Players take turns
4 connected win
Exercise 51
Players take turns
4 connected win
Exercise 51
have Fun
Players take turns
4 connected win
Exercise 51
1
0
1
0
1
0
1
0
1
0
1
0
0 starts
1
0
1
0
1
0
1
0
1
0
1
0 00 starts
1
0
1
0
1
0
1
0
1
0
1
0 0
1 starts
0 starts
1
0
1
0
1
0
1
0
1
0
1
0 0
1
0
1
0
1
0 11 starts
0 starts
1
0
1
0
1
0
1
0
1
0
1
0 0
1
0
1
0
1
0 1
1
0
1
0
1
0 101 starts
0 starts
Task: construct a set of Horn clauses that
describe if a player has already won
or lost.
1
0
1
0
1
0
1
0
1
0
1
0 0
1
0
1
0
1
0 1
1
0
1
0
1
0 101 starts
0 starts
1
0
1
0
1
0
1
0
1
0
1
0 0
1
0
1
0
1
0 1
1
0
1
0
1
0 101 starts
0 starts
0
1
0
1
0
1
0
1
0
1
0
1
0 0
1
0
1
0
1
0 1
1
0
1
0
1
0 101 starts
0 starts
0
0
1
0
1
0
1
0
1
0
1
0
1
0 1
1
0
1
0
1
0 10
1 starts
0
1
0
1
0
1
0
1
0
1
0
1
0 1
1
0
1
0
1
0 10
1 starts
0
1
0
1
0
1
0
1
0
1
0
1
0 1
1
0
1
0
1
0 10
1 starts
0
1
0
1
0
1
0
1
0
1
0
1
0 1
1
0
1
0
1
0 10
1 starts
0
How can we generalize?
1
0
1
0
1
0
1
0
1
0
1
0 1
1
0
1
0
1
0 10
0
1
0
1
0
1
0
1
0
1
0
1
0 1
1
0
1
0
1
0 10
0
1
0
1
0
1
0
1
0
1
0
1
0 1
1
0
1
0
1
0 10
0
if a draw is
not possible
00001110001000110000111000001100011100001110000001
10001000011000110000110000011000001000110000001000
00111000000111000100...
construct game graph
animate
x2
start
construct game graph
animate
x2
x1
start
construct game graph
animate
x2
x1
x4
start
construct game graph
animate
x2
x3 x5 x7
x6 x8
x9x1
x4
start
x1 x3 x5 x7
x6x4 x8
x9
1
some example steps
- max 4 possible moves
-
start
x1 x3 x5 x7
x6 x8
x9
1 0
some example steps
- max 4 possible moves
-
start
x1 x5 x7
x6 x8
x9
1 0
1
some example steps
- max 4 possible moves
-
start
x1 x5 x7
x6 x8
x9
0
1
0
some example steps
- max 4 possible moves
-
start
x1
x2
x1
x2
(a) f(x[1:n]) = x[1:n] < x[n:1]╓
╙
╓
╙
x1
x2
xx
(a) f(x[1:n]) = x[1:n] < x[n:1]╓
╙
╓
╙
x1
x2
xx
x0
x1
(a) f(x[1:n]) = x[1:n] < x[n:1]╓
╙
╓
╙
x1
x2
xx
x0
x1
00
10
01
11
(a) f(x[1:n]) = x[1:n] < x[n:1]╓
╙
╓
╙
x1
x2
xx
x0
x1
0
0
0
1
(a) f(x[1:n]) = x[1:n] < x[n:1]╓
╙
╓
╙
x1
x2
xx
x1
0
0
0
1
0
(a) f(x[1:n]) = x[1:n] < x[n:1]╓
╙
╓
╙
Algorithm C
n (a)
2 0 wins
3 0 wins
4 first wins
5 second wins
6 second wins
7 1 loses if first
8 draw
9 draw
(a) f(x[1:n]) = x[1:n] < x...
n (b)
2 second wins
3 first wins
4 first wins
5 draw
6 second wins
7 second wins
8 draw
9 draw
(b) f(x[1:n]) = xi⊕i
n (c)
2 1 wins
3 first wins
4 first wins
5 draw
6 1 loses if first
7 1 loses if first
8 draw
9 draw
(c) f(x[1:n]) = x[1:n] con...
n (d)
2 second wins
3 first wins
4 first wins
5 1 loses if first
6 1 loses if first
7 1 loses if first
8 1 loses if first
9 1 lo...
Questions?
Boolean Games
Upcoming SlideShare
Loading in...5
×

Boolean Games

298

Published on

Published in: Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
298
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Boolean Games

  1. 1. 1vs. Boolean Games turn based, one on one
  2. 2. Exercise 51
  3. 3. Players take turns Exercise 51
  4. 4. Players take turns 4 connected win Exercise 51
  5. 5. Players take turns 4 connected win Exercise 51
  6. 6. have Fun Players take turns 4 connected win Exercise 51
  7. 7. 1 0 1 0 1 0
  8. 8. 1 0 1 0 1 0 0 starts
  9. 9. 1 0 1 0 1 0 1 0 1 0 1 0 00 starts
  10. 10. 1 0 1 0 1 0 1 0 1 0 1 0 0 1 starts 0 starts
  11. 11. 1 0 1 0 1 0 1 0 1 0 1 0 0 1 0 1 0 1 0 11 starts 0 starts
  12. 12. 1 0 1 0 1 0 1 0 1 0 1 0 0 1 0 1 0 1 0 1 1 0 1 0 1 0 101 starts 0 starts
  13. 13. Task: construct a set of Horn clauses that describe if a player has already won or lost.
  14. 14. 1 0 1 0 1 0 1 0 1 0 1 0 0 1 0 1 0 1 0 1 1 0 1 0 1 0 101 starts 0 starts
  15. 15. 1 0 1 0 1 0 1 0 1 0 1 0 0 1 0 1 0 1 0 1 1 0 1 0 1 0 101 starts 0 starts 0
  16. 16. 1 0 1 0 1 0 1 0 1 0 1 0 0 1 0 1 0 1 0 1 1 0 1 0 1 0 101 starts 0 starts 0 0
  17. 17. 1 0 1 0 1 0 1 0 1 0 1 0 1 1 0 1 0 1 0 10 1 starts 0
  18. 18. 1 0 1 0 1 0 1 0 1 0 1 0 1 1 0 1 0 1 0 10 1 starts 0
  19. 19. 1 0 1 0 1 0 1 0 1 0 1 0 1 1 0 1 0 1 0 10 1 starts 0
  20. 20. 1 0 1 0 1 0 1 0 1 0 1 0 1 1 0 1 0 1 0 10 1 starts 0
  21. 21. How can we generalize?
  22. 22. 1 0 1 0 1 0 1 0 1 0 1 0 1 1 0 1 0 1 0 10 0
  23. 23. 1 0 1 0 1 0 1 0 1 0 1 0 1 1 0 1 0 1 0 10 0
  24. 24. 1 0 1 0 1 0 1 0 1 0 1 0 1 1 0 1 0 1 0 10 0 if a draw is not possible
  25. 25. 00001110001000110000111000001100011100001110000001 10001000011000110000110000011000001000110000001000 00111000000111000100011000011100000110001110000111 00000011000100001100011000011000001100000100011000 00010000011100000011100010001100001110000011000111 00001110001000110001000011000110000110000011000001 00011000000100000111000000111000100011000011100000 11000111000011100000011000100001100011000011000001 10000010001100000010000011100000011100010001100001 11000001100011100001110000001100010000110001100001 10000011000001000110000001000001110000001110001000 11000011100000110001110000111000000110001000011000 11000011001000110000010001100002001000001110000001 11000100011000011100000110001110000111000000110001 00001100011000011000001100000100011000000100000111 00000011100010001100001110000011000111000011100000 “Any Boolean function leads to a Game ...” Donald E. Knuth Exercise 52
  26. 26. construct game graph animate x2 start
  27. 27. construct game graph animate x2 x1 start
  28. 28. construct game graph animate x2 x1 x4 start
  29. 29. construct game graph animate x2 x3 x5 x7 x6 x8 x9x1 x4 start
  30. 30. x1 x3 x5 x7 x6x4 x8 x9 1 some example steps - max 4 possible moves - start
  31. 31. x1 x3 x5 x7 x6 x8 x9 1 0 some example steps - max 4 possible moves - start
  32. 32. x1 x5 x7 x6 x8 x9 1 0 1 some example steps - max 4 possible moves - start
  33. 33. x1 x5 x7 x6 x8 x9 0 1 0 some example steps - max 4 possible moves - start
  34. 34. x1 x2
  35. 35. x1 x2 (a) f(x[1:n]) = x[1:n] < x[n:1]╓ ╙ ╓ ╙
  36. 36. x1 x2 xx (a) f(x[1:n]) = x[1:n] < x[n:1]╓ ╙ ╓ ╙
  37. 37. x1 x2 xx x0 x1 (a) f(x[1:n]) = x[1:n] < x[n:1]╓ ╙ ╓ ╙
  38. 38. x1 x2 xx x0 x1 00 10 01 11 (a) f(x[1:n]) = x[1:n] < x[n:1]╓ ╙ ╓ ╙
  39. 39. x1 x2 xx x0 x1 0 0 0 1 (a) f(x[1:n]) = x[1:n] < x[n:1]╓ ╙ ╓ ╙
  40. 40. x1 x2 xx x1 0 0 0 1 0 (a) f(x[1:n]) = x[1:n] < x[n:1]╓ ╙ ╓ ╙
  41. 41. Algorithm C
  42. 42. n (a) 2 0 wins 3 0 wins 4 first wins 5 second wins 6 second wins 7 1 loses if first 8 draw 9 draw (a) f(x[1:n]) = x[1:n] < x[n:1]╓ ╙ ╓ ╙
  43. 43. n (b) 2 second wins 3 first wins 4 first wins 5 draw 6 second wins 7 second wins 8 draw 9 draw (b) f(x[1:n]) = xi⊕i
  44. 44. n (c) 2 1 wins 3 first wins 4 first wins 5 draw 6 1 loses if first 7 1 loses if first 8 draw 9 draw (c) f(x[1:n]) = x[1:n] contains no two consecutive 1’s ╓ ╙ ╓ ╙
  45. 45. n (d) 2 second wins 3 first wins 4 first wins 5 1 loses if first 6 1 loses if first 7 1 loses if first 8 1 loses if first 9 1 loses if first (d) f(x[1:n]) = (x[1:n])2 is prime╓ ╙ ╓ ╙
  46. 46. Questions?
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×