CSci 4011, Spring 2013
Homework 5
due: March 5, 2013
1. Let M be the TM for the add language that was discussed in Tuesdays discussion.
Give the complete sequence of congurations that M goes through w
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
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
CSci 4011, Spring 2013
Homework 11
due: April 30, 2013
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
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.
P
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.
P
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 len
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 =
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 langua
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
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) i
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 enc
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 =
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 acce
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),
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 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 i
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 T
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 h
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 !
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.
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:
QUIZ 2
CSci 4011
INHERENT LIMITATIONS
OF COMPUTER PROGAMS
What are practical uses for PDAs?
Why are pumping lemmas annoying?
Buddhist temple, CFG, levitating during meditation?
What will be on the upc
string
CSci 4011
uVw yields uvw if (V v) 2 R.
A derives 00#11 in 4 steps.
0, 0
1,0
,$
1,0
PARSE TREES
A
A
A 0A1
AB
B#
A 0A1 00A11 00B11 00#11
push
, $
INHERENT LIMITATIONS
OF COMPUTER PROGRAMS
CONT
string
CSci 4011
INHERENT LIMITATIONS
OF COMPUTER PROGAMS
pop
push
, $
0, 0
1,0
,$
1,0
The language of P is the set of strings it accepts.
CONTEXT-FREE GRAMMARS
A 0A1
AB
B#
A 0A1 00A11 00B11 00#11
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 h
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