1 / 14

Computer Science 101

Computer Science 101. More Theory of Computing. Another Example: Odd Parity. A parity bit is added to the right end of a string of bits if it makes the total number of 1’s odd; otherwise, add a 0 100011 -> 100010 -> 000000 ->. Design Strategy. Three states

thor
Download Presentation

Computer Science 101

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. Computer Science 101 More Theory of Computing

  2. Another Example: Odd Parity • A parity bit is added to the right end of a string of bits if it makes the total number of 1’s odd; otherwise, add a 0 • 100011 -> • 100010 -> • 000000 ->

  3. Design Strategy • Three states • Even parity: if we read a blank here, we have an even number of 1s, so we write a 1 and goto the halt state • Odd parity: if we read a blank here, we have an odd number of 1s, so we write a 0 and goto the halt state • Halt

  4. Design Strategy • Even parity • We stay here while we keep reading 0s • Otherwise, we goto odd parity • Odd parity • We stay here while we keep reading 0s • Otherwise, we goto even parity

  5. State Diagram for Odd Parity TM Evenparity Odd parity Halt

  6. Tuples for Transitions • The Turing machine program • (1,1,1,2,R) Even parity state reading 1, change state • (1,0,0,1,R) Even parity state reading 0, don’t change state • (2,1,1,1,R) Odd parity state reading 1, change state • (2,0,0,2,R) Odd parity state reading 0, don’t change state • (1,b,1,3,R) End of string in even parity state, write 1 and go to state 3 • (2,b,0,3,R) End of string in odd parity state, write 0 and go to state 3

  7. The Church-Turing Thesis • Church-Turing Thesis • If there exists an algorithm to do a symbol manipulation task, then there exists a Turing machine to do that task • Thesis • Statement advanced for consideration and maintained by argument • Theorem • Ideas that can be proved in a formal, mathematical way

  8. Emulating an Algorithm on a TM

  9. A Universal TM • Represent the algorithm as symbols on the tape • Put the algorithm’s inputs on the tape as well • Run the universal TM to run the algorithm • The universal TM is like a stored program computer (von Neumann machine)

  10. Unsolvable Problems • Problem to investigate Decide, given any collection of Turing machine instructions together with any initial tape contents, whether that Turing machine will ever halt if started on that tape

  11. The Proposed Solution T* = TM being tested t = T’s input P = The testing TM

  12. A Proposed Counterexample T* = TM being tested t = T’s input Q = The testing TM

  13. An Actual Counterexample S* = TM being tested S*bS* = S’s input S = The testing TM

  14. Other Unsolvable Problems • Unsolvable problems, related to the halting problem, have the following consequences • No program can be written to decide whether any given program always stops eventually, no matter what the input • No program can be written to decide whether any two programs are equivalent • No program can be written to decide whether any given program run on any given input will ever produce some specific output

More Related