Everything is an Integer Countable and Uncountable Sets

Slides:



Advertisements
Similar presentations
Copyright © Cengage Learning. All rights reserved.
Advertisements

1 COMP 382: Reasoning about algorithms Unit 9: Undecidability [Slides adapted from Amos Israeli’s]
1 Diagonalization Fact: Many books exist. Fact: Some books contain the titles of other books within them. Fact: Some books contain their own titles within.
1 Undecidability Andreas Klappenecker [based on slides by Prof. Welch]
Introduction to Computability Theory
Courtesy Costas Busch - RPI1 A Universal Turing Machine.
CPSC 411, Fall 2008: Set 12 1 CPSC 411 Design and Analysis of Algorithms Set 12: Undecidability Prof. Jennifer Welch Fall 2008.
1 Linear Bounded Automata LBAs. 2 Linear Bounded Automata are like Turing Machines with a restriction: The working space of the tape is the space of the.
1 Undecidability Andreas Klappenecker [based on slides by Prof. Welch]
CHAPTER 4 Decidability Contents Decidable Languages
Fall 2004COMP 3351 A Universal Turing Machine. Fall 2004COMP 3352 Turing Machines are “hardwired” they execute only one program A limitation of Turing.
Lecture ,3.3 Sequences & Summations Proof by Induction.
1 Introduction to Computability Theory Lecture11: The Halting Problem Prof. Amos Israeli.
1 Lecture 6 Topics –Proof of the existence of unsolvable problems Problems/languages not in REC Proof Technique –There are more problems/languages than.
Cardinality of Sets Section 2.5.
THE NATURE OF SETS Copyright © Cengage Learning. All rights reserved. 2.
Undecidability Everything is an Integer Countable and Uncountable Sets
Sequences and Summations
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
The Halting Problem – Undecidable Languages Lecture 31 Section 4.2 Wed, Oct 31, 2007.
1 Undecidability Reading: Chapter 8 & 9. 2 Decidability vs. Undecidability There are two types of TMs (based on halting): (Recursive) TMs that always.
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 15-1 Mälardalen University 2012.
Copyright © Cengage Learning. All rights reserved. CHAPTER 7 FUNCTIONS.
Basic Structures: Sets, Functions, Sequences, and Sums CSC-2259 Discrete Structures Konstantin Busch - LSU1.
A Universal Turing Machine
Relations, Functions, and Countability
Fall 2015 COMP 2300 Discrete Structures for Computation Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1.
1 Linear Bounded Automata LBAs. 2 Linear Bounded Automata (LBAs) are the same as Turing Machines with one difference: The input string tape space is the.
Cardinality with Applications to Computability Lecture 33 Section 7.5 Wed, Apr 12, 2006.
1 Turing’s Thesis. 2 Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine (1930)
1 Undecidability Everything is an Integer Countable and Uncountable Sets Turing Machines Recursive and Recursively Enumerable Languages.
CompSci 102 Discrete Math for Computer Science February 7, 2012 Prof. Rodger Slides modified from Rosen.
Classifications LanguageGrammarAutomaton Regular, right- linear Right-linear, left-linear DFA, NFA Context-free PDA Context- sensitive LBA Recursively.
1 Melikyan/DM/Fall09 Discrete Mathematics Ch. 7 Functions Instructor: Hayk Melikyan Today we will review sections 7.3, 7.4 and 7.5.
Section 3.2: Sequences and Summations. Def: A sequence is a function from a subset of the set of integers (usually the set of natural numbers) to a set.
CS 285- Discrete Mathematics
1 Undecidability Andreas Klappenecker [based on slides by Prof. Welch]
Section 2.5. Cardinality Definition: A set that is either finite or has the same cardinality as the set of positive integers (Z + ) is called countable.
1 Chapter 9 Undecidability  Turing Machines Coded as Binary Strings  Universal Turing machine  Diagonalizing over Turing Machines  Problems as Languages.
1 A Universal Turing Machine. 2 Turing Machines are “hardwired” they execute only one program A limitation of Turing Machines: Real Computers are re-programmable.
Sequences Lecture 11. L62 Sequences Sequences are a way of ordering lists of objects. Java arrays are a type of sequence of finite size. Usually, mathematical.
One of Cantor's basic concepts was the notion of the size or cardinality of a set M, denoted by |M|  M - finite sets M is an n-set or has size n, if.
Nonregular Languages Section 2.4 Wed, Oct 5, 2005.
1-1 Copyright © 2013, 2005, 2001 Pearson Education, Inc. Section 2.4, Slide 1 Chapter 2 Sets and Functions.
Cardinality with Applications to Computability
Chapter 2 Sets and Functions.
The Acceptance Problem for TMs
Discrete Mathematics CS 2610
A Universal Turing Machine
Lecture12 The Halting Problem
2.4 Sequences and Summations
Counting Sets.
Cardinality of Sets Section 2.5.
Discrete Structures for Computer Science
Andreas Klappenecker [based on slides by Prof. Welch]
CSCE 411 Design and Analysis of Algorithms
Decidability Turing Machines Coded as Binary Strings
Module #4.5, Topic #∞: Cardinality & Infinite Sets
Discrete Mathematics and its Applications
Decidability Turing Machines Coded as Binary Strings
Introduction to Finite Automata
Formal Languages, Automata and Models of Computation
SE-561 Math Foundations of Software Engineering VIII. Functions
Module #4.5, Topic #∞: Cardinality & Infinite Sets
Subject Name: FORMAL LANGUAGES AND AUTOMATA THEORY
Cardinality Definition: The cardinality of a set A is equal to the cardinality of a set B, denoted |A| = |B|, if and only if there is a one-to-one correspondence.
Cpt S 317: Spring 2009 Reading: Chapter 8 & 9
Instructor: Aaron Roth
Turing Machines Everything is an Integer
Presentation transcript:

Everything is an Integer Countable and Uncountable Sets

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.

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 i-th string.”

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 13th, 21st, and 37th strings, respectively.

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 i-th image.”

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.

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.

Proofs – (3) Quick-and-dirty way to introduce new symbols into binary strings: Given a binary string, precede each bit by 0. Example: 101 becomes 010001. Use strings of two or more 1’s as the special symbols. Example: 111 = “the following expression is given”; 11 = “end of expression.”

Example: Encoding Proofs 1110100011111100000101110101… A given expression follows An ex- pression End of expression A given expression follows Expression End Notice this 1 could not be part of the “end”

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 i-th program.” Hmm…There aren’t all that many programs.

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. Example: {a, b, c} is a finite set; its cardinality is 3. It is impossible to find a 1-1 mapping between a finite set and a proper subset of itself.

Infinite Sets Formally, an infinite set is a set for which there is a 1-1 correspondence between itself and a proper subset of itself. Example: the positive integers {1, 2, 3,…} is an infinite set. There is a 1-1 correspondence 1<->2, 2<->4, 3<->6,… between this set and a proper subset (the set of even integers).

Countable Sets A countable set is a set with a 1-1 correspondence with the positive integers. Hence, all countable sets are infinite. Example: All integers. 0<->1; -i <-> 2i; +i <-> 2i+1. Thus, order is 0, -1, 1, -2, 2, -3, 3,… Examples: set of binary strings, set of Java programs.

Example: Pairs of Integers Order the pairs of positive integers first by sum, then by first component: [1,1], [2,1], [1,2], [3,1], [2,2], [1,3], [4,1], [3,2],…, [1,4], [5,1],… This means that the set of all rational numbers also is countable

Enumerations An enumeration of a set is a 1-1 correspondence between the set and the positive integers. Thus, we have seen enumerations for strings, programs, proofs, and pairs of integers.

How Many Languages? Are the languages over {0,1}* countable? No; here’s a proof. Suppose we could enumerate all languages over {0,1}* and talk about “the i-th language.” Consider the language L = { w | w is the i-th binary string and w is not in the i-th language}.

Proof – Continued Clearly, L is a language over {0,1}*. Thus, it is the j-th language for some particular j. Let x be the j-th string. Is x in L? If so, x is not in L by definition of L. If not, then x is in L by definition of L.

Diagonalization Picture Strings 1 2 3 4 5 … … 1 1 1 1 2 1 Languages 3 4 1 5 … …

Diagonalization Picture Can’t be a row – it disagrees in an entry of each row. Strings Flip each diagonal entry 1 2 3 4 5 … … 1 1 1 2 Languages 3 1 4 1 5 … …

Proof – Concluded We have a contradiction: x is neither in L nor not in L, so our sole assumption (that there was an enumeration of the languages) is wrong. Comment: This is really bad; there are more languages than programs. E.g., there are languages with no membership algorithm.

Hungarian Arguments We have shown the existence of a language with no algorithm to test for membership, but we have no way to exhibit a particular language with that property. A proof by counting the things that fail and claiming they are fewer than all things is called a Hungarian argument.