6
6 Why Theory of Computation? 1.A real computer can be modelled by a mathematical object: a theoretical computer. 2.A formal language is a set of strings, and can represent a computational problem. 3.A formal language can be described in many different ways that ultimately prove to be identical. 4.Simulation: the relative power of computing models can be based on the ease with which one model can simulate another.

7
7 5. Robustness of a computational model. 6. The Church-Turing thesis: anything that can be computed can be computed by a Turing machine. 7. Nondeterminism: languages can be described by the existence or nonexistence of computational paths. 8. Unsolvability: for some computational problems there is no corresponding algorithm that will unerringly solve them.

9
9 History Euclid's attempt to axiomatize geometry (Archimedes realized, during his own efforts to define the area of a planar figure, that Euclid's attempt had failed and that additional postulates were needed. ) Leibniz's dream of a symbolic logic de Morgan, Boole, Frege, Russell, Whitehead: Mathematics as branch of symbolic logic!

11
11 Every mathematical truth expressed in a formal language consisting of a fixed alphabet of admissible symbols, and explicit rules of syntax for combining those symbols into meaningful words and sentences

12
12 Turing used a Universal Turing machine (UTM) to prove an even more powerful incompleteness theorem because it destroyed not one but two of Hilbert's dreams: 1.finding a finite list of axioms from which all mathematical truths can be deduced 2.Solving the entscheidungsproblem, ("decision problem“) by producing a "fully automatic procedure" for deciding whether a given proposition (sentence) is true or false.

47
47 Countable set There is a one to one correspondence between elements of the set and natural numbers

48
48 We started with the natural numbers, then add infinitely many negative whole numbers to get the integers, then add infinitely many rational fractions to get the rationals, then added infinitely many irrational fractions to get the reals. Each infinite addition seem to increase cardinality: |N| < |Z| < |Q| < |R| But is this true? NO!

49
49 Example Integers: The set of integers is countable Correspondence: Natural numbers:

50
50 Example The set of rational numbers is countable Positive Rational numbers:

66
66 Theorem The set of all infinite strings is uncountable We assume we have an enumeration procedure for the set of infinite strings Proof(by contradiction)

67
67 Infinite string Encoding... = = = Cantor’s diagonal argument...

68
68 Cantor’s diagonal argument We can construct a new string that is missing in our enumeration! The set of all infinite strings is uncountable! Conclusion

69
69 There are some integer functions that that cannot be described by finite strings (programs/algorithms). Conclusion An infinite string can be seen as FUNCTION  (n:th output is n:th bit in the string)

70
70 Theorem Let be an infinite countable set The powerset of is uncountable Example of uncountable infinite sets

71
71 Proof Since is countable, we can write

72
72 Elements of the powerset have the form: ……

73
73 We encode each element of the power set with a binary string of 0’s and 1’s Powerset element Encoding...

74
74 Let’s assume (for contradiction) that the powerset is countable. we can enumerate the elements of the powerset Then:

75
75 Powerset element Encoding...

76
76 Take the powerset element whose bits are the complements in the diagonal

77
77 New element: (binary complement of diagonal)...

78
78 The new element must be some of the powerset However, that’s impossible: the i-th bit of must be the complement of itself from definition of Contradiction!

79
79 Since we have a contradiction: The powerset of is uncountable END OF PROOF

80
80 Example Alphabet : The set of all finite strings: infinite and countable uncountable infinite The powerset of contains all languages: An Application: Languages

81
81 Finite strings (algorithms): countable Languages (power set of strings): uncountable There are infinitely many more languages than finite strings.

82
82 There are some languages that cannot be described by finite strings (algorithms). Conclusion

123
123 One or more. Since a* means "zero or more a's", you can use aa* (or equivalently, a*a) to mean "one or more a's.“ Similarly, to describe "one or more ab's," that is, {ab, abab, ababab,...}, you can use ab(ab)*. Building Regular Expressions

124
124 Any string at all. To describe any string at all (with = {a, b, c}), you can use (a+b+c)*. Any nonempty string. This can be written as any character from followed by any string at all: (a+b+c)(a+b+c)*. Building Regular Expressions

125
125 Any string not containing.... To describe any string at all that doesn't contain an a (with = {a, b, c}), you can use (b+c)*. Any string containing exactly one... To describe any string that contains exactly one a, put "any string not containing an a," on either side of the a, like this: (b+c)*a(b+c)*. Building Regular Expressions

134
134 Example = { all strings without two consecutive 0 } (In order not to get 00 in a string, after each 0 there must be an 1, which means that strings of the form are repeated. That is the first parenthesis. To take into account strings that end with 0, and those consisting of 1’s solely, the rest of the expression is added.) Equivalent solution: