1 Basic Complexity Theory

Definition: P = the set of all languages L that have a deterministic worst case polynomial time algorithm, A such that for all x ∈ Σ^{∗}:

• if x ∈ L, A(x) accepts

• if x ∈ L̄, A(x) rejects Definition: NP = set of all languages L that have a deterministic worst case polynomial time

algorithm, A, such that for all x ∈ Σ^{∗}:

• if x ∈ L, there exists a string y such that A(x, y) accepts and |y| is bounded by a polynomial in |x|

• if x ∈ L̄, for any string y ∈ Σ^{∗}, A(x, y) rejects Definition For any complexity class C, we define Co − C = {L|L̄ ∈ C}

1.1 co-C Examples

Definition: co-P = the set of all languages L such that there exists a deterministic algorithm, A running in worst case polynomial time such that for all x ∈ Σ^{∗}:

• if x ∈ L̄, A(x) accepts

• if x ∈ L, A(x) rejects Note that P = co − P Definition: co-NP = the set of all languages L such that there exists a deterministic algorithm,

A running in worst case polynomial time such that for all x ∈ Σ^{∗}:

• if x ∈ L̄, there exists a string y such that A(x, y) accepts and |y| is bounded by a polynomial in |x|

• if x ∈ L, for any string y ∈ Σ^{∗}, A(x, y) rejects

1.2 Language Examples

• Let L_{1} include only those strings (G, x) where the minimum cut size of G is x

• Let L_{2} include only those strings (G, x) where G has a TSP tour of length x

• Let L_{3} include only those strings (G, x) where G has no TSP tour of length x • L_{1} ∈ P

• L_{2} ∈ NP

• L_{3} ∈ co − NP

Questions:

• L_{1} ∈ NP?

• L_{1} ∈ co − NP?

• L_{2} ∈ P?

• L_{3} ∈ P?

2 Randomized Complexity Theory

2.1 RP and ZPP

Definition: RP = the set of all languages L that have a worst case polynomial time randomized algorithm, A, such that for all x ∈ Σ^{∗}:

• if x ∈ L, A(x) accepts with probability at least 1/2

• if x ∈ L̄, A(x) rejects

Definition: co-RP = the set of all languages L that have a worst case polynomial time randomized algorithm, A, such that for all x ∈ Σ^{∗}:

• if x ∈ L̄, A(x) accepts with probability at least 1/2

• if x ∈ L, A(x) rejects

Definition: ZPP = the set of all languages L that have an expected polynomial time algorithm, A, such that for all x ∈ Σ^{∗}:

• if x ∈ L, A(x) accepts

• if x ∈ L̄, A(x) rejects

Question: Does ZPP = co-ZPP? Claim: ZP P = RP ⋂ co-RP Question: How to show this?

2.2 BPP

Definition: PP = the set of all languages L that have a worst case randomized polynomial time algorithm, A, such that for all x ∈ Σ^{∗}:

• if x ∈ L, A(x) accepts with probability greater than 1/2

• if x ∈ L̄, A(x) accepts with probability less than 1/2

Note: this class is weak: we can not easily reduce the error probability with repetitions of the algorithm. The following class is more useful.

Definition: BPP = the set of all languages L that have a worst case randomized polynomial time algorithm, A, such that for all x ∈ Σ^{∗}:

• if x ∈ L, A(x) accepts with probability at least 3/4

• if x ∈ L̄, A(x) accepts with probability no more than 1/4