CSCE4115 Final Flashcards

1
Q

Let A = { | R and S are regular expressions and L(R) ⊆ L(S)}. Show that A is decidable.
Step 1.

A

X = “On input :

1. Construct DFA E such that L(E) = notL(S) ∩ L(R)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Let A = { | R and S are regular expressions and L(R) ⊆ L(S)}. Show that A is decidable.
Step 2.

A
  1. Run TM T on
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Let A = { | R and S are regular expressions and L(R) ⊆ L(S)}. Show that A is decidable.
Step 3.

A
  1. If T accepts, accept. If T rejects, reject
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Show that A is Turing-recognizable iff A ≤m ATM.

Step 1

A

If A <=m Atm then A is Turing recognizable

-Use theorem 5.28

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Show that A is Turing-recognizable iff A ≤m ATM.

Step 2

A

If A is Turing recognizable then A<=m Atm

1.Let M∈TM recognizes A [given that A is TM Recognizable]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Show that A is Turing-recognizable iff A ≤m ATM.

Step 3

A

Atm = { | M∈TM ∧ M~w}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Show that A is Turing-recognizable iff A ≤m ATM.

Step 4

A

Therefore x ∈ A <=> ∈ Atm is a mapping reduction from A to Atm

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Is the following formula satisfiable? (𝑥 ∨ 𝑦) ∧ (𝑥 ∨ not𝑦) ∧ (not𝑥 ∨ 𝑦) ∧ (not𝑥 ∨ not𝑦)

A

(x,y) may have only 4 values, (0,0), (0,1), (1,0), and (1,1) None satisfy the formula the formula is not satisfiable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Show that P is closed under union and NP is closed under union.
paragraph

A

P is closed under union.
For any two P languages, L1 and L2.
Let M1 and M2 be the TMs that decide them in polynomial time.
We construct a TM, m’, that decides L1 U L2 in polynomial time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Show that P is closed under union and NP is closed under union.
Step 1

A

M’ = “On input :

1. Run M1 on w. if it accepts, accept

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Show that P is closed under union and NP is closed under union.
Step 2

A
  1. Run M2 on w. if it accepts, accept.

if it rejects, reject

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

DOMINATING-SET = { | has a dominating set with k vertices}.
Show that it is NP-complete by giving a reduction from VERTEX-COVER.
Step 1

A

VC <=pDS

Let G= (V,E) be a connected graph. Construct G’=(V’E’) by creating for each e∈G one new vertex and two new edges

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Show that it is NP-complete by giving a reduction from VERTEX-COVER.
Step 1.a

A

We must show that if G has a vertex cover of size K then G’ has a dominating set a size K and viceversa

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Show that it is NP-complete by giving a reduction from VERTEX-COVER.
Step 2

A

D -> S
Let D subset V
Let (u,v) ∈ E be any edge in E
Either u or v or both must be a number of D
Thus (u,v) touches a member of D and S = D is a vertex cover of G

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Show that it is NP-complete by giving a reduction from VERTEX-COVER.
Step 3

A

S -> D

Every triangle of G’ has at least one vertex in S. Thus D = S is a dominating set of G’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

2n = O(n)

A

true

c = 2

17
Q

n^2 = O(n)

A

false

18
Q

n^2 = O(n ln^2 n)

A

false

1/(2/n) = infiniti

19
Q

n ln n = O(n^2)

A

false

1/n = 0

20
Q

Prove 3SAT is NPC

Step 1.

A

Choose SAT and show SAT <=p 3SAT

21
Q

Prove 3SAT is NPC

Step 2.

A

3SAT ∈ NP

Given a potential 3Sat solution, one literal in each clause must be true. This is in polynomial time

22
Q

Prove 3SAT is NPC

Step 3.

A

SAT <=p 3SAT
Input phi and restrict phi to phi ∈ CNF
In genral a clause a1 V a2 V … V ak is transformed to yeild k-2 clauses in trident(phi) with k-3 link variables fish,B,… this is in polynomial time

23
Q

Prove 3SAT in NPC

Step 4.

A

phi trident
Any assignment of value to clause C causing C to be true (or false) can be extended to cause Dc to be true(or false)
f^-1(trident) is not satisfiable only if phi is not satisfiable