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.
    • aAa \in A if aa is an element of the set AA; a∉Aa \not \in A otherwise.
  • subset: ABA \sube B if aA,aB\forall a \in A, a \in B
    • proper subset: ABA \sube B and ABA \not = B
  • Set Operations
    • Union ABA \cup B / Intersection ABA \cap B
    • Complement A\overline A
    • Powersets 2A={SSA}2^A = \{S|S \sube A\}
  • Cartesian production:
    • A×B={(a,b)aA and bB}A \times B = \{(a,b)|a \in A\ and\ b \in B\}
    • A1×A2××Ak={(a1,a2,,ak)aiAi}A_1 \times A_2\times \cdots\times A_k = \{(a_1,a_2,\cdots,a_k)|a_i \in A_i\}

Sequence

  • sequence: a list of objects in some order.
  • tuple: a finite sequence / k-tuple: a sequence of kk eles / ordered pair: 2-tuple

Relation

  • relation on kk sets (A1,A2,,AkA_1,A_2,\cdots,A_k): a subset of A1×A2××AkA_1 \times A_2\times \cdots\times A_k
  • binary relation RR on A×AA\times A is
    • reflexive if aA,(a,a)R\forall a \in A, (a,a) \in R
    • symmetric if (a,b)A×A,if(a,b)R ,then (b,a)R\forall (a,b) \in A\times A, \mathrm{if} (a,b) \in R\ ,\mathrm{then}\ (b,a) \in R
    • transitive if (a,b)(b,c)A×A,if(a,b)R and (b,c)R ,then (b,a)R\forall (a,b)(b,c) \in A\times A, \mathrm{if} (a,b) \in R\ \mathrm{and}\ (b,c) \in R\ ,\mathrm{then}\ (b,a) \in R
    • an equivalence relation: if RR is reflexive, symmetric and transitive.

Function

  • domain AA / image f(a)f(a) / range f(A)f(A)
  • function f:ABf:A \rightarrow B aA,uinique f(a)B\forall a \in A, \mathrm{uinique}\ f(a)\in B is
    • one-to-one / injective if aa,f(a)f(a)\forall a \not = a', f(a) \not = f(a')
    • onto / surjective if f(A)=Bf(A) = B
    • bijective if ff 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 G=(V,E,W)G = (V,E,W), find out MST.
  • Search problem: Given G=(V,E,W),kZ+G = (V,E,W), k\in \mathbb{Z}+, find out 1 MST whose weight-sum is smaller than kk.
  • Decision problem: Given G=(V,E,W),kZ+G = (V,E,W),k \in \mathbb{Z}+, find out whether there is a MST whose weight-sum is smaller than kk.
  • Counting problem: Given G=(V,E,W),kZ+G = (V,E,W),k \in \mathbb{Z}+, find out the number of MSTs whose weight-sums are smaller than kk.

It’s obvious that Optimization / Search / Counting problem is harder than Decision 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 G,kG,k is encoded. Then the problem could be abstracted into

Given the encodings of G,KG,K, 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.

Decision ProblemLanguage\mathrm{Decision\ Problem} \Leftrightarrow \mathrm{Language}

  1. Decision Problemencodings of yesinstancesLanguage\mathrm{Decision\ Problem} \Rightarrow \mathrm{encodings\ of\ yes-instances}\Rightarrow\mathrm{Language}
  2. $\mathrm{Language} \Rightarrow \mathrm{Decision\ Problem}:\small Given\ string\ w, is\ w \in L? $

Language 是 decision problem 的数学抽象。

Language

  • alphabet Σ\Sigma: a finite set of symbols. e.g {0,1},{}\{0,1\}, \{\}
  • string ww: a finite sequence of symbols from Σ\Sigma. (duplication is allowed)
    • length of ww: w=#symbols in w|w| = \#symbols\ in\ w
    • empty string ee: e=0|e| = 0 (ee is preserved)
  • sets of string:
    • Σi={w:w=i}\Sigma^i = \{w: |w| = i\}
    • Σ=i>=0Σi\Sigma^* = \cup_{i>=0}\Sigma^i
    • Σ+=i>0Σi\Sigma^+ = \cup_{i>0}\Sigma^i

string operation

  • concatenation:

    u=123,v=456,uv=123456u = 123, v = 456, uv = 123456

  • exponentiation:
    wi=www,w0=ew^i = ww\cdots w, w^0 = e

  • reversal:

    w=a1a2cn,wR=ana2a1w = a_1a_2\cdots c_n,w^R = a_n\cdots a_2a_1

Language

  • a language over Σ\Sigma is a subset LΣL \sube \Sigma^*.
    • for Σ={0,1},,Σ,{0n1n:n0}\Sigma = \{0,1\}, \empty,\Sigma^*,\{0^n1^n:n\ge 0\} are languages.

Finite Automata

states

  • initial state ss: >o, unique
  • final state: , serval

Strict definition

A finite automata M=(K,Σ,δ,s,F)M = (K,\Sigma,\delta,s,F).

  • KK: a finite set of states

  • Σ\Sigma: input alphabet

  • s,sKs,s \in K: initial state

  • F,FKF, F\sube K: final states

  • δ\delta 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 K×ΣK\times\Sigma^*, 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 (q,w),(q,w)(q,w),(q',w') is yielded in one step if

aΣ,w=aw and δ(q,a)=q\exist a \in \Sigma, w = aw'\ \mathrm{and}\ \delta(q,a) = q'


TCS L1
http://example.com/2023/09/20/TCS-01/
Author
Tekhne Chen
Posted on
September 20, 2023
Licensed under