INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011
Dr. Nick COURSE STAFF Nick Hopper Sean Kim Saloni Srivastava
This class uses mathematical models to think about the limitations of computers
WHY SHOULD I CARE? THIS STUFF IS USEFUL PART 1 Automata and Languages PART 2 Computability Theory PART 3 Complexity Theory
cs4011.org
GRADING HOMEWORKS – 20% GROUP WORK – 5% QUIZZES – 25% MIDTERM I – 15% MIDTERM II – 15% FINAL – 20%
HOMEWORK Every Tuesday: Homework will be due at the start of lecture. New Homework will be posted on the web. You must list all references used in every homework assignment Each Homework is 3 questions. Extra Credit only counts if score ≥ 7/10 Lowest HW score dropped.
GROUP WORK Each group will complete a problem set in recitation. All group members should contribute to the solution.
QUIZZES 6 QUIZZES: In Friday Sections Graded out of 10, lowest score dropped. MUST SCORE 30/50 TO PASS!
This class will emphasize PROOFS A good proof should be: Easy to understand Correct
We expect your proofs to have three levels: The first level should be a one-word or one- phrase “hint” of the proof (e.g. “Proof by contradiction,” “Follows from the pigeonhole principle”) The second level should be a short one- paragraph description or “longer hint” The third level should be the full proof
DETERMINISTIC FINITE AUTOMATA
0 0, The program accepts a string if the process ends in a double circle
0 0, The program accepts a string if the process ends in a double circle ANATOMY OF A DETERMINISTIC FINITE AUTOMATON states q0q0 q1q1 q2q2 q3q3 start state (q 0 ) accept states (F)
An alphabet Σ is a finite set (e.g., Σ = {0,1}) A string over Σ is a finite-length sequence of elements of Σ For x a string, |x| isthe length of x The unique string of length 0 will be denoted by ε and will be called the empty or null string NOTATION A language over Σ is a set of strings over Σ
COMPUTING OUTPUT FROM INPUT CALCULATING A FUNCTION OF A STRING DECIDING IF A STRING IS IN A SET ⇔ ⇔
Q is the set of states Σ is the alphabet : Q Σ → Q is the transition function q 0 Q is the start state F Q is the set of accept states A finite automaton is a 5-tuple M = (Q, Σ, , q 0, F) L(M)= the language of machine M = set of all strings machine M accepts We say M recognizes the language L(M).
0,1 q0q0 L(M) = {w | w is a string} q0q0 L(M) ={ε}{ε} 0,1 q1q1
q0q0 q1q L(M) = { w | w has an even number of 1s}
qq q0q0 q ,1 Build an automaton that accepts all and only those strings that contain 001
A language is regular if it is recognized by a deterministic finite automaton L = { w | w contains 001} is regular L = { w | w has an even number of 1s} is regular
Many interesting programs accept regular languages NETWORK PROTOCOLS COMPILERS GENETIC TESTING ARITHMETIC
INTERNET TRANSMISSION CONTROL PROTOCOL Let TCPS = { w | w is a complete TCP Session} Theorem. TCPS is regular
COMPILERS COMMENTS : Are delimited by /* */ Cannot have NESTED /* */ Must be CLOSED by */ */ is ILLEGAL outside a comment COMMENTS = {strings with legal comments} Theorem. COMMENTS is regular.
GENETIC TESTING DNA SEQUENCES are strings over the alphabet {A,C,G,T} GENES are special substrings A GENETIC TEST searches a DNA SEQUENCE for a GENE Theorem. Every GENETIC TEST is regular.
ARITHMETIC Let 3 = A string over 3 has three ROWS Each ROW b 0 b 1 b 2 …b N represents the integer b 0 + 2b 1 + … + 2 N b N. Let ADD = {S | ROW 3 = ROW 1 + ROW 2 } Theorem. ADD is regular. { [ ], [ ], [ ], [ ], [ ], [ ], [ ], [ ]}
cs4011.org