COURSE STAFF
CSci 4011
INHERENT LIMITATIONS
OF COMPUTER PROGRAMS
Nick Hopper
Dr. Nick
Sean KIm
Akash Agrawal
WHY SHOULD I CARE?
THIS STUFF IS USEFUL
This class uses
mathematical models
to think about the
limitations of computers
PART 1
Automata and Langua
CSCI 4011 - Homework 10 Solution
1. This is a problem about 3SAT.
(a) Find a satisfying assignment to the formula a = (x1 x2 x3 ) (x1 x2 x3 )
(x1 x2 x3 )
Let x1 = 1, x2 = 0, and x3 = 0 or 1.
(b) Find a satisfying assignment to the formula b = (x1 x3 x2 )
CSCI 4011 - Homework 2 Solution
February 2, 2013
1. Using the alphabet 1 = cfw_a, b, design NFAs for each of the following languages:
(a) L1 = cfw_w | 2 |w| 3
In this problem, we need to check the length of the string. The automata needs to remember the l
Spring 10: CSci 4011Formal Languages and Automata Theory
40 points
Homework 6
Out Fri., 3/05
Due Fri., 3/12
Please review the instructions given with Homework 1, as they apply to this homework, too.
Please hand in your answers to the following.
Note: All
CSci 4011 - Homework 11 Solution
1. A graph is k -colorable if the nodes of the graph can each be assigned one of k colors so
that there is no edge between two nodes of the same color. Let k -COLOR = cfw_ G | G is
a k -colorable undirected graph . Prove t
Spring 10: CSci 4011Formal Languages and Automata Theory
40 points
Homework 5
Out Fri., 2/26
Due Fri., 3/05
Please review the instructions given with Homework 1, as they apply to this homework, too.
Please hand in your answers to the following.
Note: All
CSCI 4011 - Homework 4 Solution
February 15, 2013
1. Let G = (V, , R, S ) where V = cfw_A, B, S, C , = cfw_a, b, R = cfw_S AB |BA, B
CBC |b, A CAC |a, C a|b.
(a) What is the language L(G)? The language L(G) is the set of strings cfw_xy : x, y
and |x| =
THE 4011
CSci 4011
INHERENT LIMITATIONS
OF COMPUTER PROGRAMS
First model of a program: DFA / Regexp
Solvable Problems: Regular Languages
Unsolvable Problems: cfw_ 0n1n | n 0
Next model of a program: PDA / CFG
Solvable Problems: Context-Free Languages
Uns
CSci 4011
INHERENT LIMITATIONS
OF COMPUTER PROGRAMS
HARDEST PROBLEMS IN NP
Definition: A language B is NP-complete if:
1. B NP
2. Every A in NP is poly-time reducible to B
(i.e. B is NP-hard)
If B is NP-Complete and P NP, then
There is no fast algorithm f
QUIZ 5
CSci 4011
INHERENT LIMITATIONS
OF COMPUTER PROGRAMS
QUIZ 5
The language L
TIME(t(n) if:
L can be decided by a TM in time O(t(n)
The language L
NP if:
L can be decided by a NTM in time O(nc)
L has a polynomial time verifier
3SAT is the language:
cfw
TIME COMPLEXITY
CSci 4011
INHERENT LIMITATIONS
OF COMPUTER PROGRAMS
Definition: Let M be a TM that halts on all
inputs. The running time or time-complexity of
M is the function f : N N, where f(n) is the
maximum number of steps that M uses on any
input of
CSci 4011
INHERENT LIMITATIONS
OF COMPUTER PROGRAMS
HARDEST PROBLEMS IN NP
Definition: A language B is NP-complete if:
1. B NP
2. Every A in NP is poly-time reducible to B
(i.e. B is NP-hard)
If B is NP-Complete and P NP, then
There is no fast algorithm f
TIME COMPLEXITY
CSci 4011
INHERENT LIMITATIONS
OF COMPUTER PROGRAMS
Definition: Let M be a TM that halts on all
inputs. The running time or time-complexity of
M is the function f : N N, where f(n) is the
maximum number of steps that M uses on any
input of
CSci 4011
INHERENT LIMITATIONS OF
COMPUTER PROGRAMS
QUIZ 4
(a) If A and B are languages, then A is mapping
reducible to B, or A m B, if there is a computable
function such that:
w A (w) B
(b) The acceptance problem ATM is the language:
cfw_ ? M,w ? | M is
TIME COMPLEXITY
CSci 4011
INHERENT LIMITATIONS
OF COMPUTER PROGRAMS
Definition: Let M be a TM that halts on all
inputs. The running time or time-complexity of
M is the function f : N ! N, where f(n) is the
maximum number of steps that M uses on any
input
A CIRCUIT
CSci 4011
INHERENT LIMITATIONS
OF COMPUTER PROGRAMS
x0
x1
x2
is a collection of gates and
inputs connected by wires.
is satisfiable if some setting
of inputs makes it output 1.
can be encoded as a string
CIRCUIT-SAT = cfw_C : C is a satisfiab
ENCODING CHESS
CSci 4011
A 88 chess board has 64 squares and 32 pieces:
INHERENT LIMITATIONS
OF COMPUTER PROGRAMS
Each square can have one of 13 values: 4 bits
+1 bit encodes turn information.
CHESS = cfw_ B | B is a chess board and
white can force a win.
TURING MACHINE
CSci 4011
INHERENT LIMITATIONS
OF COMPUTER PROGRAMS
FINITE
STATE
q1
0
CONTROL
I
A
N
P
U
T
INFINITE TAPE
A TM recognizes a language if it accepts all
(and only) strings in the language.
A TM decides a language if it accepts all
strings in th
CSci 4011
INHERENT LIMITATIONS
OF COMPUTER PROGRAMS
Definition: A Turing Machine is a 7-tuple
T = (Q, , , , q0, qaccept, qreject), where:
Q is a finite set of states
is the input alphabet, where !
is the tape alphabet, where ! and
: Q Q cfw_L,R
q0 Q
SET THEORY 101
CSci 4011
INHERENT LIMITATIONS
OF COMPUTER PROGRAMS
A function : A ! B is:
1-1 (or injective) if (x)=(y)
onto (or surjective) if
x=y
y x: y = (x)
bijective if it is 1-1 and onto.
can help us count. If is:
1-1 then |A| |B|
onto then |A| |B|
QUIZ 3
The Turing Machine M decides the language L if:
CSci 4011
M accepts all w
L and rejects all w
L.
The language L is Turing-recognizable if:
INHERENT LIMITATIONS
OF COMPUTER PROGRAMS
There is a TM that recognizes L
(accepts all and only the strings i
UNDECIDABILITY
CSci 4011
INHERENT LIMITATIONS
OF COMPUTER PROGRAMS
A language is a set of strings. It is a mathematical
way of expressing a problem: given an input, is it
in the set L?
If a language is decidable, there is a computer
program (TM) that can
UNDECIDABILITY
CSci 4011
INHERENT LIMITATIONS
OF COMPUTER PROGRAMS
A language is a set of strings. It is a mathematical
way of expressing a problem: given an input, is it
in the set L?
If a language is decidable, there is a computer
program (TM) that can
RICES THEOREM
CSci 4011
INHERENT LIMITATIONS
OF COMPUTER PROGRAMS
Let P be a language of Turing machine encodings.
IF P satisfies the following properties:
For all TMs M1 and M2, where L(M1) = L(M2),
M1 P if and only if M2 P
There exist TMs MIN P and MOUT
CSci 4011
INHERENT LIMITATIONS
OF COMPUTER PROGRAMS
QUIZ 4
(a) If A and B are languages, then A is mapping
reducible to B, or A m B, if there is a computable
function such that:
w A (w) B
(b) The acceptance problem ATM is the language:
cfw_ M,w | M is a T