1 / 78

Computation

Computation. Binary Numbers. Decimal numbers Binary numbers. http://faculty.mc3.edu/pvetere/Applets/APPLETS/NUMSYS/applet_frame.htm. Representing Text. Decide how many characters we need to represent. Determine the required number of bits.

Télécharger la présentation

Computation

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

  2. Binary Numbers • Decimal numbers • Binary numbers http://faculty.mc3.edu/pvetere/Applets/APPLETS/NUMSYS/applet_frame.htm

  3. Representing Text • Decide how many characters we need to represent. • Determine the required number of bits. • Ascii: 7 bits. Can encode 27 = 128 different symbols.

  4. Ascii http://www.krisl.net/cgi-bin/ascbin.pl

  5. Representing Text Four … 01000110 01101111 01110101 01110010

  6. When We Need More Characters What about things like: 简体字

  7. When We Need More Characters What about things like: 简体字 Answer: Unicode: 32 bits. Over 4 million characters. http://www.unicode.org/charts/

  8. Digital Images

  9. RGB The red channel

  10. RGB The green channel

  11. RGB Red Green Blue

  12. Representing Pictures

  13. Representing Sounds

  14. Representing Programs public static TreeMap<String, Integer> create() throws IOException public static TreeMap<String, Integer> create() throws IOException { Integer freq; String word; TreeMap<String, Integer> result = new TreeMap<String, Integer>(); JFileChooser c = new JFileChooser(); int retval = c.showOpenDialog(null); if (retval == JFileChooser.APPROVE_OPTION) { Scanner s = new Scanner( c.getSelectedFile()); while( s.hasNext() ) { word = s.next().toLowerCase(); freq = result.get(word); result.put(word, (freq == null ? 1 : freq + 1)); } } return result; } }

  15. The Roots of Modern Technology 5thc B.C. Aristotelian logic invented 1642 Pascal built an adding machine 1694 Leibnitz reckoning machine

  16. The Roots, continued 1834 Charles Babbage’s Analytical Engine Ada writes of the engine, “The Analytical Engine has no pretensions whatever to originate anything. It can do whatever we know how to order it to perform.” The picture is of a model built in the late 1800s by Babbage’s son from Babbage’s drawings.

  17. The Roots: Logic 1848 George Boole The Calculus of Logic chocolate and  nuts and mint chocolate nuts mint

  18. Boolean Logic

  19. Using Boolean Logic

  20. How Big Are the Truth Tables?

  21. 2n

  22. Increased Power of Quantified Logic • TaiShanHasTail • SmokyHasTail • PuffyHasTail • ChumpyHasTail • SnowflakeHasTail

  23. Increased Power of Quantified Logic • Panda(TaiShan). • Bear(Smoky). • x (Panda(x) Bear(x, Tail)). • x (Bear(x) HasPart(x)). • x (Bear(x) Animal(x)). • x (Animal(x) Bear(x)). • x (Animal(x) y (Mother-of(y, x))). • x ((Animal(x) Dead(x)) Alive(x)).

  24. Using Quantified Logic (FOL) We can represent what we know as a set of logical formulas and then manipulate them.

  25. Using Quantified Logic • Panda(TaiShan). • Bear(Smoky). • x (Panda(x) Bear(x, Tail)). • x (Bear(x) HasPart(x, Tail)). • x (Bear(x) Animal(x)). • x (Animal(x) y (Mother-of(y, x))). • x ((Animal(x) Dead(x)) Alive(x)).

  26. Search

  27. Breadth-First Search Is this a good idea?

  28. Depth-First Search

  29. Scalability Solving hard problems requires search in a large space. To play master-level chess requires searching about 8 ply deep. So about 358 or 21012 nodes must be examined.

  30. Growth Rates of Functions

  31. Scalability

  32. The Advent of the Computer 1945 ENIAC The first electronic digital computer

  33. 1949 EDVAC The first stored program computer

  34. Programs Are Just Strings (Bits) public static TreeMap<String, Integer> create() throws IOException public static TreeMap<String, Integer> create() throws IOException { Integer freq; String word; TreeMap<String, Integer> result = new TreeMap<String, Integer>(); JFileChooser c = new JFileChooser(); int retval = c.showOpenDialog(null); if (retval == JFileChooser.APPROVE_OPTION) { Scanner s = new Scanner( c.getSelectedFile()); while( s.hasNext() ) { word = s.next().toLowerCase(); freq = result.get(word); result.put(word, (freq == null ? 1 : freq + 1)); } } return result; } }

  35. Moore’s Law http://www.intel.com/technology/mooreslaw/

  36. How It Has Happened

  37. How Much Computer Power Might It Take? http://www.frc.ri.cmu.edu/~hpm/book97/ch3/index.html

  38. How Much Compute Power is There? From Hans Moravec, Robot Mere Machine to Transcendent Mind 1998.

  39. Kurweil’s Vision http://www.pocket-lint.co.uk/news/news.phtml/12920/13944/Computers-match-humans-by-2030.phtml

  40. Limits to What We Can Compute • Are there fundamentally uncomputable things? • Does God exist? • What’s the best way to run a country? • Does this puzzle have a solution?

  41. Mathematics in the Early 20th Century 1900 Hilbert’s program and the effort to formalize mathematics 1931 Kurt Gödel’s paper, On Formally Undecidable Propositions 1937 Alan Turing’s paper, On Computable Numbers with an application to the Entscheidungs problem

  42. What Can We Do? • Can we make all true statements theorems? • Can we decide whether a statement is a theorem?

  43. Gödel’s Incompleteness Theorem Kurt Gödel showed, in the proof of his Incompleteness Theorem [Gödel 1931], that the answer to question 1 is no. In particular, he showed that there exists no decidable axiomatization of Peano arithmetic that is both consistent and complete.

  44. The Entscheidungsproblem • Does there exist an algorithm to decide, given an arbitrary sentence w in first order logic, whether w is valid (i.e.,must be true)?

  45. Turing Machines • At each step, the machine must: • ● choose its next state, • ● write on the current square, and • ● move left or right.

  46. An Example

  47. The Church-Turing Thesis All formalisms powerful enough to describe everything we think of as a computational algorithm are equivalent. • Turing machines • Lambda calculus • Standard programming languages like Java • Conway’s game of life • DNA computing

  48. The Game of Life Playing the game The rules: ● A dead cell with exactly three live neighbors becomes a live cell (birth). ● A live cell with two or three live neighbors stays alive (survival). ● In all other cases, a cell dies or remains dead (overcrowding or loneliness). A game halts iff it reaches some stable configuration.

  49. Back to the Entscheidungsproblem Theorem: The Entscheidungsproblem is unsolvable. Proof: (A variant of Turing’s proof) • Given a Turing machine M, we can construct a logical formula F that is true iff M ever halts. • If there were a solution to the Entscheidungsproblem, then we could determine the truth of F and thus be able to decide whether M ever halts. • But there is no procedure for determining (in the general case) whether M halts. • So there is no solution to the Entscheidungsproblem.

  50. The Halting Problem Turing machine, M input string, w Does M halt on w? Accept Reject

More Related