This preview shows pages 1–12. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: 1 Undecidability Everything is an Integer Countable and Uncountable Sets Turing Machines Recursive and Recursively Enumerable Languages 2 Integers, Strings, and Other Things ◆ Data types have become very important as a programming tool. ◆ But at another level, there is only one type, which you may think of as integers or strings. ◆ Key point : Strings that are programs are just another way to think about the same one data type. 3 Example : Text ◆ Strings of ASCII or Unicode characters can be thought of as binary strings, with 8 or 16 bits/character. ◆ Binary strings can be thought of as integers. ◆ It makes sense to talk about “the ith string.” 4 Binary Strings to Integers ◆ There’s a small glitch: ◗ If you think simply of binary integers, then strings like 101, 0101, 00101,… all appear to be “the fifth string.” ◆ Fix by prepending a “1” to the string before converting to an integer. ◗ Thus, 101, 0101, and 00101 are the 13 th , 21 st , and 37 th strings, respectively. 5 Example : Images ◆ Represent an image in (say) GIF. ◆ The GIF file is an ASCII string. ◆ Convert string to binary. ◆ Convert binary string to integer. ◆ Now we have a notion of “the ith image.” 6 Example : Proofs ◆ A formal proof is a sequence of logical expressions, each of which follows from the ones before it. ◆ Encode mathematical expressions of any kind in Unicode. ◆ Convert expression to a binary string and then an integer. 7 Proofs – (2) ◆ But a proof is a sequence of expressions, so we need a way to separate them. ◆ Also, we need to indicate which expressions are given. 8 Proofs – (3) ◆ Quickanddirty way to introduce new symbols into binary strings: 1. Given a binary string, precede each bit by 0. ◆ Example : 101 becomes 010001. 1. Use strings of two or more 1’s as the special symbols. ◆ Example : 111 = “the following expression is given”; 11 = “end of expression.” 9 Example : Encoding Proofs 1110100011111100000101110101 … A given expression follows An expression End of expression Notice this 1 could not be part of the “end” A given expression follows Expression End 10 Example : Programs ◆ Programs are just another kind of data. ◆ Represent a program in ASCII. ◆ Convert to a binary string, then to an integer. ◆ Thus, it makes sense to talk about “the ith program.” ◆ Hmm…There aren’t all that many programs. 11 Finite Sets ◆ Intuitively, a finite set is a set for which there is a particular integer that is the count of the number of members....
View
Full
Document
This note was uploaded on 03/30/2012 for the course CS 154 taught by Professor Motwani,r during the Spring '08 term at Stanford.
 Spring '08
 Motwani,R

Click to edit the document details