Title: Algorithms
1Algorithms
- The Notion of a Finite or Effective Procedure
- Like a Recipe
1. Input (x,y) Coordinates 2. For each (x,y)
compute c 3. If c is even, plot black dot 4.
Repeat
2The Limits of Mathematics
- Is mathematics both consistent and complete?
- Complete One can obtain mechanically a proof of
any true formula - Consistent There are no formulas that are both
true and false - There are true statements that cannot be proven.
- This statement is true I am a liar.
3Finite Automata
- A Finite Collection of States Q
- A finite alphabet E of input signals
- A function d which for every possible combination
of current state and input determines a new
state. - Two special states, Initial and Final or
Accepting state.
4- The FA accepts any sequence of symbols that puts
it in an accepting state - The set of all such sequences is the language of
the automaton
Input
Accept
Reset
5State Transition Diagram
?
?
?
?
0
0
1
1
4
1
0
1
2
3
0
1
0
1
0
?
1
5
0
?
6Regular Expressions
- 01(001)01
- Language accepted by a FA
- Pumping Lemma If L is a regular language, then
there is a constant n such that for each word W
in L with length gt n, there are words X, Y, Z
such that WXYZ, length of XY lt n, length of Y
gt1, and XYkZ is in L for k integer.
7Used to tell when a language is not in a
particular class Let L be language of all
palindromes over a,b. Abbababba (symmetric
about midpoint) Is L regular? W anban
(definition of palindrome) WXYZ, XY an,
Zban WXY2Zamban in L by pumping lemma, mgtn W
not in L, not a palindrome, L not regular
8Chomsky Hierarchy
9Turing Machine
Read/Write
01001011101101101010100011110101011010001011101001
0101010111101010001010101101
Start
Reset
10- Turing machine M
- x is a string over Ms alphabet E
- R/W head over leftmost symbol in x, M in start
state - R/W communicates symbol on tape to control
mechnisim in box - M can read symbol, replace symbol, move tape to
right or left onecell at a time - If M halts (final state), string y on the tape
is Ms output corresponding to input x - Doesnt necessarily halt for every x
- Computes partial function f E----gtE
- M is same thing as its program, which is a set
of quintuples - (q, s, q, s, d) where q is current state, s is
current symbol, qis next state, s is symbol to
be written, and d is direction to move - Ms compute a particular class of functions over
intergers called partial recursive functions
11Church-Turing Thesis
- All notions of effective computability are
equivalent. - Therefore, all computers are created equal.
- Other schemes Lambda calculus, General Recursive
Functions, etc...
12Universal Turing Machine
- Fixed Program in Finite Control
- Program reads description of Turing Machine from
one tape and simulates its behavior on another
tape (two tapes) - Universal Machine U, Machine to be simulate T
13- Fixed program for U is like an interpreter
- Tape 1 contains quintuples defining T
- Tape 2 intially blank. Same output as T here
- Given Ts current state and input symbol, find
thequintuple (q, s, q, s, d) in the
description of T that applies - Record the new state q, write the new symbol s
ontape 2, move in direction d, read new symbol
on tape 2, andrecord it beside q
14Halting Problem
- What is not effectively computable?
- It the a TM, M, that does the following
- Given an arbitrary TM, T, as input, and an
equally arbitrary tape, t, decide whether T halts
on t - Equivalent to does T accept t
- Undecidable
15Diagonalization
16Diagonal Set _ X X _ X _ Its Complement X _ _ X
_ X The complement of the diagonal is different
for every row. Can be extended to infinite
sets. Used to show that there are languages that
are not acceptable by TM. Therefore, there can
be no TM that decides that decides whether
arbitrary strings are accepted by arbitrary
Turing Machines. Since we canrepresent TM by
strings, after some work, it follows that there
can be no TM that decides halting
problems. Therefore, there are problems that
admit no algorithmic solution.