Computer Science 101 More Theory of Computing. Another Example: Odd Parity A parity bit is added to...
-
Upload
phebe-short -
Category
Documents
-
view
215 -
download
3
Transcript of Computer Science 101 More Theory of Computing. Another Example: Odd Parity A parity bit is added to...
![Page 1: 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.](https://reader036.fdocuments.us/reader036/viewer/2022083007/56649e1a5503460f94b08473/html5/thumbnails/1.jpg)
Computer Science 101
More Theory of Computing
![Page 2: 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.](https://reader036.fdocuments.us/reader036/viewer/2022083007/56649e1a5503460f94b08473/html5/thumbnails/2.jpg)
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 ->
![Page 3: 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.](https://reader036.fdocuments.us/reader036/viewer/2022083007/56649e1a5503460f94b08473/html5/thumbnails/3.jpg)
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
![Page 4: 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.](https://reader036.fdocuments.us/reader036/viewer/2022083007/56649e1a5503460f94b08473/html5/thumbnails/4.jpg)
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
![Page 5: 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.](https://reader036.fdocuments.us/reader036/viewer/2022083007/56649e1a5503460f94b08473/html5/thumbnails/5.jpg)
State Diagram for Odd Parity TM
Even parity Odd parity
Halt
![Page 6: 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.](https://reader036.fdocuments.us/reader036/viewer/2022083007/56649e1a5503460f94b08473/html5/thumbnails/6.jpg)
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
![Page 7: 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.](https://reader036.fdocuments.us/reader036/viewer/2022083007/56649e1a5503460f94b08473/html5/thumbnails/7.jpg)
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
![Page 8: 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.](https://reader036.fdocuments.us/reader036/viewer/2022083007/56649e1a5503460f94b08473/html5/thumbnails/8.jpg)
Emulating an Algorithm on a TM
![Page 9: 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.](https://reader036.fdocuments.us/reader036/viewer/2022083007/56649e1a5503460f94b08473/html5/thumbnails/9.jpg)
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)
![Page 10: 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.](https://reader036.fdocuments.us/reader036/viewer/2022083007/56649e1a5503460f94b08473/html5/thumbnails/10.jpg)
Unsolvable Problems
• Problem to investigateDecide, 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
![Page 11: 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.](https://reader036.fdocuments.us/reader036/viewer/2022083007/56649e1a5503460f94b08473/html5/thumbnails/11.jpg)
The Proposed Solution
T* = TM being testedt = T’s inputP = The testing TM
![Page 12: 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.](https://reader036.fdocuments.us/reader036/viewer/2022083007/56649e1a5503460f94b08473/html5/thumbnails/12.jpg)
A Proposed Counterexample
T* = TM being testedt = T’s inputQ = The testing TM
![Page 13: 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.](https://reader036.fdocuments.us/reader036/viewer/2022083007/56649e1a5503460f94b08473/html5/thumbnails/13.jpg)
An Actual Counterexample
S* = TM being testedS*bS* = S’s inputS = The testing TM
![Page 14: 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.](https://reader036.fdocuments.us/reader036/viewer/2022083007/56649e1a5503460f94b08473/html5/thumbnails/14.jpg)
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