Let M be a nondeterministic machine that always halts and runs in space ,S(n). Then, M runs in at most T : qngs(n) steps for q states and g svmbols in the tape alphabet. Now, if necessary,reprogram M to erase the work tape and end in a particular state wh
CSC544 Spring 2011
Midterm
Take-Home Exam
due in class Tuesday 3/29/11
Note: All work has to be your own, no team work allowed.
Part A, short answers, 40 points.
1. (5 points) Why do we think of decidable language as representing algorithms?
2. (5 points)
CSC544 Spring 2011
Midterm
Take-Home Exam
Version 1.1
due in class Tuesday 3/29/11
Note: All work has to be your own, no team work allowed.
Part A, short answers, 40 points.
1. (5 points) Why do we think of decidable language as representing algorithms?
2
A Tutorial Introduction to the Lambda Calculus
Ral Rojas u FU Berlin, WS-97/98
Abstract This paper is a short and painless introduction to the calculus. Originally developed in order to study some mathematical properties of eectively computable functions,
CSC544 Spring 2011
Final
Due Wednesday 5/11 @ noon in my oce
NAME:
Part I: short answers (40 points).
1. (5 points) What is the the Church-Turing thesis?
2. (5 points) True or false: if L is an NP-complete language and M is polynomial-time reducible to L,
CSC544 Assignment #5
due Thursday 4/21 in class
version 1.0
Problems
1. Show that the complexity classes P and N P are closed under concatenation and union.
2. A triangle in an undirected graph is a 3-clique. Show that T RIAN GLE
P , where
T RIAN GLE = c
CSC544 Assignment #4
due Tuesday 4/5 in class
version 1.0
Problems
1. Let g (x, y, z ) be a primitive recursive function. Show that the following
functions are primitive recursive,
(a) f (x, y ) = g (x, y, x)
(b) f (x, y, z, w) = g (x, y, x)
(c) f (x) = g
CSC544 Assignment #3
due Thursday 3/10 in class
version 1.0
Problems
1. A Turing machine with a doubly innite tape is similar to an ordinary
Turing machines, but its tape is innite to the left as well as to the right.
The tape is initially lled with blank
CSC544 Assignment #2
due Tuesday 3/1 in class
Problems
Given the language
L = cfw_an bn (ab)n ,
do the following:
1. Prove that the language is not context-free.
2. Prove that the language is Turing-recognizable.
1
CSC544 Assignment #1
due Tuesday 2/15 in class
Problems
1. Give the state diagrams of FAs recognizing the following languages (assume = cfw_0, 1):
(a) cfw_w | w begins with a 1 and ends with a 0
(b) cfw_w | w contains at least three 1s
(c) cfw_w | w does
Approximations to
N P Solutions
If we are faced with an N P or N P -complete problem the best we can do on a
deterministic computer is a solution in exponential time.
Since exponential time solutions are impractical for obvious reasons we could consider
a
Space Complexity
Time and space are two of the most important considerations when we seek
practical solutions to computational problems.
Space complexity shares many of the same features of time complexity
Therefore, space complexity serves as a further w
Cook-Levin Theorem
In the 1970s Stephen Cook and Leonid Levin independently discovered that there are
problems in N P whose complexity are related to all other problems in N P these
problems are called N P -complete problems.
As we have seen, N P -complet
P and N P
P is the class of languages that are decidable in polynomial
time on a deterministic Turing machine,
[
P=
T IM E (nk ), for k 0.
Denition:
k
Denition:
NP =
[
N T IM E (nk ), for k 0.
k
In order to prove that a language is a member of a particula
Nondeterministic
Time Complexity
Let N be a nondeterministic Turing machine that is a decider.
The running time of N is the function f : N N, where f (n) is the
maximum number of steps that N uses on any branch of its computation
on any input of length n.
Complexity Theory
Up to now we investigated whether a problem is in principle solvable algorithmically, that is, we asked the question whether a particular language is,
Decidable:
machine halts on all inputs (total computable functions) machine loops fore
Algorithmic
Information Theory
Consider the following Strings:
0101010101010101010101010101010101010101010101010101010101010101
1100100001100001110111101110110011111010010000100101011110010110
How much information is in each of the strings?
Intuitively, v
First Order Logic
A logic is a formal language with strings over the alphabet :
= cfw_, , , (, ), , , x, R1 , . . . , Rk
A well-formed formula (WFF) is a string over this alphabet and can be dened inductively
as follows. A string is a WFF if it
is an at
The Mathematics of
Functions
The -calculus is very low level. Here we investigate functions in a more abstract setting.
This is very similar to writing algorithms in English prose rather than writing actual
machine code for the Turing machines.
p. 1/
The
-Recursive
Functions
Here we investigate the relationship between Turing machines and computable functions.
For convenience we will restrict ourselves to only look at numeric computations, this does not reect
any loss of generality since all computational
The Other Model: Calculus
So far we have only looked at Turing machines as our model.
Question:
Answer:
Where does the Church in the Church-Turing thesis come from?
Alonzo Church invented the calculus to model computing with functions.
Turns out the calcu
Reducibility
We say that a problem Q reduces to problem P if we can use P to solve Q.
In the context of decidability we have the following templates:
If A reduces to B and B is decidable, then so is A.
(1)
If A reduces to B and A is undecidable, then so i
Another Proof
We just saw a proof that languages that are not Turing-recognizable exist based on the
fact that a decider for AT M cannot exist
Lets look at another proof that shows that some languages are not algorithmic.
The proof proceeds by showing tha
Proofs using
Deciders
Let L1 and L2 be decidable languages, then the concatenation L = L1 L2
is also decidable.
Proposition:
We show decidability of L by constructing a decider for it. Let M1 and M2 be
deciders for L1 and L2 , respectively, then we can co
Alternate Denition
A Turing-recognizable language is a formal language for which
there exists a Turing machine that will halt and accept when presented
with any string in the language as input but may either halt and reject or
loop forever when presented
Turing Machines
A Turing machine is a FA with an innite tape as memory.
Initially, the tape contains the input to the Turing machine.
p. 1/1
Church-Turing Thesis
Why do we study Turing machines?
Intuitive Notion of Algorithms
equals
Turing Machine Algori
Context-Free
Languages
As pointed out before, the prototypical context-free language is
L = cfw_an bn | a, b and n 0
In order to accept strings in this language a machine has to remember how many as it
has seen so that it can match the number bs with the
Generators vs.
Recognizers
Up to now we have only described languages in terms of machines that recognize a
particular language.
But we could also imagine describing a language by a system that is able to generate all
the strings in a language.
p. 1/3
Re
Regular Languages
Denition:
A language is called a regular language if some nite automaton recognizes it
p. 1/2
Regular Operations
Denition:
Union:
Let A and B be regular languages, we dene the following operations:
A B = cfw_x | x A or x B .
Concatenati
Strings & Languages
Sequences or strings of symbols and characters are fundamental in computer science.
We use strings of symbols to represent data and most importantly we use them to
represent algorithms.
We formalize these structures as follows:
An alph