100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
CS3052 Computational Complexity FULL COURSE £17.49   Add to cart

Lecture notes

CS3052 Computational Complexity FULL COURSE

 8 views  0 purchase

Personal revision notes

Preview 4 out of 35  pages

  • August 6, 2022
  • 35
  • 2021/2022
  • Lecture notes
  • --
  • All classes
All documents for this subject (1)
avatar-seller
WinterBerry
CS3052 Bible

Notes for CS3052: Computational Complexity

S2 - 2021/2022


Contents
1 Finite State Automata 3
1.1 Deterministic Finite State Automaton (DFA) . . . . . . . . . . . . . . . . . . . . . 3
1.2 Regular Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3 Non-deterministic Finite State Automaton (NFA) . . . . . . . . . . . . . . . . . . . 4
1.4 NFA to DFA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.5 Regular Expressions and Regular Languages . . . . . . . . . . . . . . . . . . . . . . 7
1.6 From RegEx to NFA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.7 From NFAs to RegEx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.8 The Pumping Lemma . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

2 Context-Free Languages and Pushdown Automata 10
2.1 Pushdown Automata (PDA) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.2 Context-free languages (CFL) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.3 CFG to PDA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.4 Pumping Lemma for CFL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

3 Turing Machines (TM) 14
3.1 TM Configurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.2 Turing Recognisable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.3 Variants of Turing Machines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.4 Multitape TM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.5 Non-deterministic TM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.6 Certificate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

4 Limits of Computation 17
4.1 Church-Turing Thesis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.2 Turing-completeness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.3 Decidability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.3.1 Turing Decidable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.4 Acceptance Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.5 Halting Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4.6 Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4.6.1 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4.7 Rice’s Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.8 Infinity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.9 Hierarchy of Languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19


1

,5 Complexity 20
5.1 Running time/Time complexity/Complexity . . . . . . . . . . . . . . . . . . . . . . 20
5.2 Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
5.3 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
5.4 Complexity Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
5.5 Formal definitions of Poly and Expo . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

6 Recursive Algorithms 22
6.1 The Master Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

7 Non-deterministic Complexity Classes 23
7.1 Verifier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
7.2 Polytime Verifier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
7.3 PolyCheck . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
7.4 NPoly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
7.5 PolyCheck, NPoly, Expo, Poly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

8 Decision Problems 26
8.1 P vs NP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
8.2 Polyreductions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
8.3 NP-Completeness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
8.4 Polyequivalence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
8.4.1 UHC ≤P DHC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
8.4.2 DHC ≤P UHC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
8.5 NP-hard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
8.6 Formal Definitions of Satisfiability Problems . . . . . . . . . . . . . . . . . . . . . . 29
8.6.1 CircuitSAT ≤P SAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
8.6.2 SAT ≤P CircuitSAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
8.6.3 3-SAT ≤P SAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
8.6.4 SAT ≤P 3-SAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
8.7 CircuitSAT is NP-complete . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
8.7.1 Sketch of proof . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
8.8 Proof Techniques for NP-completeness . . . . . . . . . . . . . . . . . . . . . . . . . 31

9 Summary 32
9.1 Space Complexity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

10 Amortised Complexity 35




2

,1 Finite State Automata
Definitions:
• Alphabet: finite set A of symbols
• Elements of A are letters.
• A word (or string) over A is a finite sequence of letters, written w = a1 a2 ...an , where each
ai ∈ A.
• The length of a word is n (the number of letters).
• The empty word is written as ε (has length 0 and consists of no letters).
• Concatenation is writing one word after another to make a longer word.
– Note: εw = wε = w
• A∗ denotes the set of all words over A and includes ε. A language is a subset of A∗ .

1.1 Deterministic Finite State Automaton (DFA)
A deterministic finite state automaton (DFA) M is a 5-tuple consisting of:
1. Alphabet A (a finite set).
2. Finite set of states, S.
3. Transition function F : A × S → S with input: (letter, state), output: (state).
4. A state s0 ∈ S called the initial or start state.
5. A subset T ⊆ S containing the accept states or terminals.
Write M = (A, S, F, s0 , T ), which starts in state s0 and reads a word w = a1 a2 ...an (where w ∈ A∗ )
one letter at a time from left to right.
If M is in state s ∈ S and reads letter a, then it moves to state F (a, s).
M accepts the word w if after reading letter an it is in an accept state t (t ∈ T ).
M rejects the word w if after reading letter an it is in a state S \ T (a reject state).


Example
M = (A = {a, b}, S = {s0 , s1 , s2 }, F, s0 , T = {s2 }) where F is the state-transition function described
below:

F s0 s1 s2
a s1 s1 s1
b s2 s2 s1




3

, 1.2 Regular Language
Let M = (A, S, F, s0 , T ) be a DFA. The language L(M ) defined by M (also say accepted by M ) is
the set of all words from A∗ which bring M from s0 into an accept state .


A language L is regular if there exists a DFA M with L = L(M ).
Lemma: If L is a finite language, then L is regular.

1.3 Non-deterministic Finite State Automaton (NFA)
A non-deterministic finite state automaton (NFA) is a 5-tuple (A, S, F, s0 , T ) where A, S, s0 and T
are the same as for a DFA (Section 1.1), but now F is a function from (A ∪ {ε}) × S to P(S). The
power set of S is the set of all subsets of S.


It is allowed for an NFA to have:
• F (a, s) = ∅ to be the empty set, so no arrows are leaving the state s when a is read.
• F (a, s) = {s′ , s′′ } so from state s there can be more than one state transition when a is read.
• F (ε, s) = s′ empty transitions that do not require the NFA to read any symbols to move.
An NFA N accepts a word w if there exists a directed path from s0 to an accept state whose labels
concatenate to give w (i.e. the letters of w appear in order but there may be one or more ε before
or after each letter).
The language L(N ) defined by N is the set of all words that N accepts.


Can think of an NFA as computing in parallel on the word w, where more than one branch of com-
putation is ”alive” at the same time. It accepts if any of the branches of computations accepts .


Example:
N = (A = {a, b}, S = {s0 , s1 , s2 , s3 , s4 }, F, s0 , T = {s4 })


4

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller WinterBerry. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for £17.49. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

76799 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy revision notes and other study material for 14 years now

Start selling
£17.49
  • (0)
  Add to cart