TCS L1
Notations and Terminologies
Set and element
- Set: collection of objects.
- is empty: contains no ele.
- is a singleton 单集: contains only 1 ele.
- is finite: contains finite number of eles.
- is infinite: contains infinite number of eles.
- element / member: Objects in
set
.- if is an element of the set ; otherwise.
- subset: if
- proper subset: and
- Set Operations
- Union / Intersection
- Complement
- Powersets
- Cartesian production:
Sequence
- sequence: a list of objects in some order.
- tuple: a finite sequence / k-tuple: a sequence of eles / ordered pair: 2-tuple
Relation
- relation on sets (): a subset of
- binary relation on is
- reflexive if
- symmetric if
- transitive if
- an equivalence relation: if is reflexive, symmetric and transitive.
Function
- domain / image / range
- function is
- one-to-one / injective if
- onto / surjective if
- bijective if is one-to-one and onto.
Overview
-
complexity theory: Hardness / complexity class
-
automata theory: definition of problems and computing models
-
finite automata
-
pushdown automata
-
Turing automata
church-turing thesis
-
-
computability theory: (using turing machine)
Automata theory
Problems
Take Minimum spanning tree, MST
as instance.
- Optimization problem: Given , find out
MST
. - Search problem: Given , find out 1
MST
whose weight-sum is smaller than . - Decision problem: Given , find out whether there is a
MST
whose weight-sum is smaller than . - Counting problem: Given , find out the number of
MSTs
whose weight-sums are smaller than .
It’s obvious that
Optimization / Search / Counting problem
is harder thanDecision problem
.That’s say, if
Decision
is hard, then the other three is also hard.
Take Decision problem
to be considered.
- problem - instance
- yes-instance
- no-instance
For our machine, the input is encoded. Then the problem could be abstracted into
Given the encodings of , whether the code is an element of the set of the
yes-instance
?
A problem is uniquely decided by the set of the yes-instance
, which is a Language
.
- $\mathrm{Language} \Rightarrow \mathrm{Decision\ Problem}:\small Given\ string\ w, is\ w \in L? $
Language 是 decision problem 的数学抽象。
Language
- alphabet : a finite set of symbols.
e.g
- string : a finite sequence of symbols from . (duplication is allowed)
- length of :
- empty string : ( is preserved)
- sets of string:
string operation
-
concatenation:
-
exponentiation:
-
reversal:
Language
- a language over is a subset .
- for are
languages
.
- for are
Finite Automata
states
- initial state :
>o
, unique - final state:
◎
, serval
Strict definition
A finite automata .
-
: a finite set of states
-
: input
alphabet
-
: initial state
-
: final states
-
transition function:
\delta: &K\times&\Sigma \rightarrow &K\\ &\small\small\mathrm{current\ state}&\small\small\mathrm{symbol}&\small\small\mathrm{next\ state}
a transition function could be defined by lists. It would be better using state diagram.
configuration
A configuration is an element of , a tuple
of current state and unread input symbol.
- the string read before resulted in the current state.
- the transition is decided by the current state and the symbol to read.
yields in one step
Given configuration
is yielded in one step if