Assignment 1 for COMP9601
Zhichao Zhao
October 9, 2012
1
Q1
1.1
Qa
L1 is Regular Language.
Proof. Since L is regular language, L can be accepted by a DFA(called M). We
construct a NFA with -move(called P) and aruge that this NFA accepts L1.
We call the st
Satisfiability
A formula F is satisfiable if there exists an assignment to its
Boolean variables such that F becomes true.
E.g., x1 x2 is satisfiable;
(x1 x2) (~ x2) is satisfiable;
x2 (~ x2) is not satisfiable.
The Satisfiability problem (SAT): Given a f
Satisfiability
A formula F is satisfiable if there exists an assignment to its
Boolean variables such that F becomes true.
E.g., x1 x2 is satisfiable;
(x1 x2) (~ x2) is satisfiable;
x2 (~ x2) is not satisfiable.
The Satisfiability problem (SAT): Given a f
Space Complexity
Reading
Space: a measure of the working storage (memory) used by
Turing machines.
Sipser: Chapter 8; or
Hopcroft et al.: 11.2, 11.3
A simple definition: A Turing machine M operates within
space bound f(n) if for any input x of length n, M
CS 9601
T W Lam
Theory of Computation
Automata, languages & complexity
~50%
Advanced undergraduate/first-year graduate level
Recommended reference: Sipsers book
Advanced algorithms
Online algorithms, online scheduling
Data structures for text indexi
NFA with moves
Let denote the null string.
Extend the transition function f: Q x ( U cfw_) P(Q)
E.g., f(a) = cfw_q1, q2; f() = cfw_q2, q3
a
a,
Are NFA with moves more powerful than NFA and
DNA? No.
Lemma. Given an NFA M with moves, we can construct
a
Reading for pda & cfg
Sipser: Chapter 2
Hopcroft et al.: 5.1, 6.1-3
Assignment 1: Moodle 5 pm
Seek help from the tutor, if necessary.
Languages
Let L be a language over a certain alphabet.
L is said to be a context free language if L = L(G) for
some co
Models of computation
The following models attempt to model computers running
certain programs/algorithms.
Finite State Automata: no memory
Pushdown Automata: memory in the form
of a stack
Too
restricted
Turing Machines: arbitrarily read/write memory
A
Grammar & Pushdown automata
Grammars
Pushdown automata (pda): nfa + stack
one-state pda
context free grammar has the power as pda.
Grammars
V = cfw_ S , = cfw_ 0,1
S 0S1
S 01
Language:
cfw_ 01, 0011, 000111,
A grammar G is a 4-tuple (V, , R, S), where
V
More undecidable languages
Last lecture
K = cfw_ M | M is a TM and M accepts M is
undecidable (Turing-undecidable, non-recursive).
ATM = cfw_ M,x | M is a TM and M accepts x
Today
HaltTM = cfw_ M,x | M is a TM and M halts on input x
ETM = cfw_ M |
Agenda for today
Homework questions
Sux Trees
Introduction and denitions
Linear-time construction
Deterministic exact string matching
Time permitting, further related topics
Sux automata
Sux arrays
1
Sux Trees
Given a string S of length m, a sufx
CSIS 9601 Theory of Computation and Algorithms Design
Assignment 1
Due on Sep 30, 2011
Warm-up. A language is said to be regular if it can be accepted by a DFA. Consider any
two regular languages L1 and L2 . Prove or disprove the following statements. (i)
Prerequisite
CS 9601 T W Lam
Theory of Computation
Automata, languages & complexity
~50%
Advanced undergraduate/first-year graduate level
Recommended reference: Sipsers book
undergraduate-level discrete math, data structures &
algorithms
Examples
NFA with moves
Let denote the null string.
Extend the transition function f: Q x ( U cfw_) P(Q)
E.g., f(a) = cfw_q1, q2; f() = cfw_q2, q3
a
a,
Are NFA with moves more powerful than NFA and
DNA? No.
Lemma. Given an NFA M with moves, we can construct
a
Grammar & Pushdown automata
Grammars
Pushdown automata (pda): nfa + stack
one-state pda
context free grammar has the power as pda.
Grammars
V = cfw_ S , = cfw_ 0,1
S 0S1
S 01
Language:
cfw_ 01, 0011, 000111,
A grammar G is a 4-tuple (V, , R, S), where
V
Models of computation
The following models attempt to model computers running
certain programs/algorithms.
Finite State Automata: no memory
Pushdown Automata: memory in the form
of a stack
Too
restricted
Turing Machines: arbitrarily read/write memory
A
Suffix Arrays Manber & Myers 1993
Space: n words
Let T[1.n] be a string of n characters. The suffix
array of T is an array, denoted SA[1.n], of n integers.
SA[i] = j means that
the suffix T[j.n] is (lexicographically) the i-th
smallest suffix, or equi
CSIS9601 Theory of Computation and Algorithms Design
1st semester, 20112012
Sample Solution to Assignment One
Warm-up. Let A and B be DFAs accepting L1 and L2 respectively.
(i) True. We construct an NFA accepting L1 L2 as follows. Create a new start state
Complexity classes
Undecidable
languages
Decidable languages
In the rest of this course, we focus on languages (decision
problems) that are decidable.
We want to know why some decidable languages are more
difficult than the others.
1
Resources
We classi
Warm up
Find the longest common substring of two or more
strings.
n
q
q
O(n3) time, O(n2) time where n is the total length.
A few decades ago, Knuth conjectured that a
linear time algorithm for this problem was
impossible.
Full-text Indexing
n
n
n
n
Bioin
Reading for pda & cfg
Sipser: Chapter 2
Hopcroft et al.: 5.1, 6.1-3
Assignment 1: available no later than Friday; due on Oct
10 Wed mid-night
Seek help from the tutor (CX Liu) ? Wednesday
Languages
Let L be a language over a certain alphabet.
L is said
Are Turing machines too primitive?
The answer is NO. It is believed that Turing machines
are as powerful as any computational models.
Todays lecture: Turing machines are powerful enough
to simulate two other computation models.
1
2-tape Turing machines