1 / 57

Easy, Hard, and Impossible

Easy, Hard, and Impossible. Elaine Rich. Easy. Tic Tac Toe. Hard. Chess. The Turk. Unveiled in 1770. Searching for the Best Move. A B C D E F G H I J K L M

aeric
Download Presentation

Easy, Hard, and Impossible

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Easy, Hard, and Impossible Elaine Rich

  2. Easy

  3. Tic Tac Toe

  4. Hard

  5. Chess

  6. The Turk Unveiled in 1770.

  7. Searching for the Best Move A B C D E F G H I J K L M (8) (-6) (0) (0) (2) (5) (-4) (10) (5)

  8. How Much Computation Does it Take? • Middle game branching factor  35 • Lookahead required to play master level chess  8 • 358

  9. How Much Computation Does it Take? • Middle game branching factor  35 • Lookahead required to play master level chess  8 • 358 2,000,000,000,000 • Seconds in a year 

  10. How Much Computation Does it Take? • Middle game branching factor  35 • Lookahead required to play master level chess  8 • 358 2,000,000,000,000 • Seconds in a year  31,536,000 • Seconds since Big Bang  300,000,000,000,000,000

  11. The Turk Still fascinates people.

  12. How Did It Work?

  13. A Modern Reconstruction Built by John Gaughan. First displayed in 1989. Controlled by a computer. Uses the Turk’s original chess board.

  14. Chess Today In 1997, Deep Blue beat Garry Kasparov.

  15. Seems Hard But Really Easy

  16. Nim At your turn, you must choose a pile, then remove as many sticks from the pile as you like. The player who takes the last stick(s) wins.

  17. Nim Now let’s try:

  18. Nim Now let’s try: Oops, now there are a lot of possibilities to try.

  19. Nim http://www.gamedesign.jp/flash/nim/nim.html

  20. Binary Numbers

  21. Nim My turn: 10 (2) 10 (2) 11(3) 11 To form the last row: XOR each column. XOR: if number of 1’s is even: 0 if number of 1’s is odd: 1

  22. Nim My turn: 10 (2) 10 (2) 11(3) 11 For the current player: • Guaranteed loss if last row is all 0’s. • Guaranteed win otherwise.

  23. Nim My turn: 100 (4) 010 (2) 101 (5) 011 For the current player: • Guaranteed loss if last row is all 0’s. • Guaranteed win otherwise.

  24. Nim Your turn: 100 (4) 001 (1) 101 (5) 000 For the current player: • Guaranteed loss if last row is all 0’s. • Guaranteed win otherwise.

  25. Following Paths

  26. Seven Bridges of Königsberg

  27. Seven Bridges of Königsberg Seven Bridges of Königsberg: 1 3 4 2

  28. Seven Bridges of Königsberg Seven Bridges of Königsberg: 1 3 4 2 As a graph:

  29. Eulerian Paths and Circuits Cross every edge exactly once. Leonhard Euler 1707 - 1783

  30. Eulerian Paths and Circuits Cross every edge exactly once. Leonhard Euler 1707 - 1783 There is a circuit if every node touches an even number of edges.

  31. So, Can We Do It? 1 3 4 2 As a graph:

  32. Unfortuntately, There Isn’t Always a Trick Suppose we need to visit every node exactly once.

  33. The Traveling Salesman Problem 15 25 10 28 20 4 8 40 9 7 3 23 Find the shortest circuit that visits every city exactly once.

  34. Visting Nodes Rather Than Edges ● A Hamiltonian path: visit every node exactly once. ● A Hamiltonian circuit: visit every node exactly once and end up where you started. All these people care: • Salesmen, • Farm inspectors, • Network analysts

  35. The Traveling Salesman Problem 15 25 10 28 20 4 8 40 9 7 3 23 Given n cities: Choose a first city n Choose a second n-1 Choose a third n-2 … n!

  36. The Traveling Salesman Problem Can we do better than n! ● First city doesn’t matter. ● Order doesn’t matter. So we get (n-1!)/2.

  37. The Growth Rate of n!

  38. Putting it into Perspective

  39. Is This The Best We Can Do? Probably. Would you like to win $1M? The Millenium Prize

  40. Impossible

  41. An Interesting Puzzle 2 List 1 b a b b b List 2 b a

  42. An Interesting Puzzle 2 1 List 1 b a b b b b List 2 b a b b b

  43. An Interesting Puzzle 2 1 1 List 1 b a b b b b b List 2 b a b b b b b b

  44. An Interesting Puzzle 2 1 1 3 List 1 b a b b b b b b a List 2 b a b b b b b b a

  45. The Post Correspondence Problem

  46. The Post Correspondence Problem

  47. The Post Correspondence Problem

  48. Can A Program Do This? Can we write a program to answer the following question: Given a PCP problem, decide whether or not it has a solution. Return: True if it does. False if it does not.

  49. The Post Correspondence Problem A program to solve this problem: Until a solution or a dead end is found do: If dead end, halt and report no. Generate the next candidate solution. Test it. If it is a solution, halt and report yes. So, if there are say 4 rows in the table, we’ll try: 1 2 3 4 1,1 1,2 1,3 1,4 1,5 2,1 …… 1,1,1 ….

  50. Will This Work? • If there is a solution: • If there is no solution:

More Related