Shared Flashcard Set

Details

CSCI 3313
Final
100
Computer Science
Undergraduate 3
12/12/2017

Additional Computer Science Flashcards

 


 

Cards

Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {anbn | n > 0}

Definition
B
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L1 ∪ L2 where L1 = {w | w has even number of 1's} and L2 = {w | w contains 001 as a substring}

Definition
A
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {0n1n | n ≥ 1}

Definition
B
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {w ∈ {a, b} | na(w) > nb(w)}

Definition
B
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {w ∈ {a, b} | na(w) ≠ nb(w)}

Definition
B
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {w | w has equal number of 0's and 1's}

Definition
B
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {an^2 | n ≥ 1}

Definition
C
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {a2^n | n ≥ 1}

Definition
C
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {an | n = r + 2q, where r and q are both prime numbers}

Definition
C
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {anbn | n ≥ 0}

Definition
B
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {apbq | p and q are prime numbers}

Definition
C
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {an^2bm^2 | n, m ≥ 1}

Definition
C
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {w ∈ {a, b} | na(w) and nb(w) both are prime numbers}

Definition
C
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {an!bm! | n, m ≥ 1}

Definition
C
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {an! | n ≥ 0}

Definition
C
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {anbj | n = j2}

Definition
C
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {an | n is a prime number}

Definition
C
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {w | |w| is a multiple of three}

Definition
A
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {<M, w> | M is a Turing machine that accepts a string w}

Definition
D
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {<M, w> | M is a Turing machine that does not accept a string w}

Definition
E
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {anbm | n, m ≥ 1, n ≠ m}

Definition
B
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {anbncn | n ≥ 1}

Definition
C
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {0n1n | n ≥ 0}

Definition
B
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {aibjck | i = j or i = k, where i, j, k ≥ 0}

Definition
B
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {w ∈ {a, b} | na(w) = nb(w)}

Definition
B
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {w ∈ {a, b} | na(w) = nb(w)}

Definition
B
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {w ∈ {a, b, c} | na(w) + nb(w) ≠ nc(w)}

Definition
B
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {aq | q is a prime number}

Definition
C
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {an! | n ≥ 1}

Definition
C
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {ambn | m > n}

Definition
B
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {w ∈ {a, b, c} | na(w) + nb(w) = nc(w)}

Definition
B
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {w ∈ {a, b, c} | na(w) + nb(w) > nc(w)}

Definition
B
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {w | w has an equal number of occurrences of a's and b's}

Definition
B
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {w | w has an equal number of occurrences of 01 and 10 as substrings}

Definition
A
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

{anbamban+m | n, m ≥ 1}

Definition
B
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {ambn | m < n}

Definition
B
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {w ∈ {a, b} | na(w) = nb(w)}

Definition
B
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {wwR | w ∈ {a, b}}

Definition
B
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {anb2n | n ≥ 0}

Definition
B
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {wcwR | w ∈ {a, b}}

Definition
B
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {anbmcn+m | n, m ≥ 0}

Definition
B
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {anbm | n ≤ m ≤ 3n}

Definition
B
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {anbncn | n ≥ 0}

Definition
C
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {ww | w ∈ {0, 1}}

Definition
C
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {aibjck | 0 ≤ i ≤ j ≤ k ≤ n}

Definition
C
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {ww | w ∈ {a, b}}

Definition
C
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {a2^n | n ≥ 1}

Definition
C
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {ambn | m > n}

Definition
B
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {ambn | m < n}

Definition
B
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {ambn | m ≠ n}

Definition
B
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {w ∈ {a, b} | na(w) ≠ nb(w)}

Definition
B
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {an^2 | n ≥ 1}

Definition
C
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {aibjck | i · j = k}

Definition
C
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {an | n is a prime number}

Definition
C
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {P | P is a polynomial with an integral root}

Definition
D
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {w ∈ {a, b, c} | na(w) + nb(w) > 2nc(w)}

Definition
B
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {w ∈ {a, b, c} | na(w) + nb(w) ≠ 2nc(w)}

Definition
B
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {<M, w> | M is a NFA that does not accept a string w}

Definition
C
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {<M, w> | M is a non-deterministic PDA that does not accept a string w}

Definition
C
Term

A. Regular language.

B. Context-free language but not regular language.

C. Turing-decidable language but not context-free language.

D. Turing-recognizable language but not Turing-decidable language.

E. language that is not Turing-recognizable

L = {<M, w> | M is a non-deterministic TM that does not accept a string w}

Definition
E
Term

Is this language Turing-decideable?

ADFA = {<B, w> | B is a DFA that accepts input string w}

Definition
Y
Term

Is this language Turing-decideable?

ANFA = {<B, w> | B is a NFA that accepts input string w}

Definition
Y
Term

Is this language Turing-decideable?

AREX = {<R, w> | R is a regular expression that generates input string w}

Definition
Y
Term

Is this language Turing-decideable?

ACFG = {<G, w> | G is a CFG that generates input string w}

Definition
Y
Term

Is this language Turing-decideable?

HADFA = {<B, w> | B is a DFA that halts on input string w and reports accept or reject}

Definition
Y
Term

Is this language Turing-decideable?

HANFA = {<B, w> | B is a NFA that halts on input string w and reports accept or reject}

Definition
Y
Term

Is this language Turing-decideable?

AREX = {<R, w> | R is a regular expression that generates input string w}

Definition
Y
Term

Is this language Turing-decideable?

HATM = {<M, w> | M is a TM that halts on input string w and reports accept or reject}

Definition
N
Term

Is this language Turing-decideable?

ACFG = {<G, w> | G is a CFG that generates input string w}

Definition
Y
Term

Is this language Turing-decideable?

Complement(ATM), where ATM = {<M, w> | M is a TM that accepts string w}

Definition
N
Term

Is this language Turing-decideable?

EDFA = {<A> | A is a DFA and L(A) = ∅}

Definition
Y
Term

Is this language Turing-decideable?

ECFG = {<G> | G is a CFG and and L(G) = ∅}

Definition
Y
Term

Is this language Turing-decideable?

EQDFA = {<A, B> | A and B are DFAs and L(A) = L(B)}

Definition
Y
Term

Is this language Turing-decideable?

EQCFG = {<G1, G2> | G1 and G2 are context-free grammars and L(G1) = L(G2)}

Definition
Y
Term

Is this language Turing-decideable?

EQTM = {<A, B> | A and B are Turing machines and L(A) = L(B)}

Definition
N
Term

Is this language Turing-decideable?

HALTNFA = {<M, w> | M is an NFA that halts on input string w}

Definition
Y
Term

Is this language Turing-decideable?

HALTTM = {<M, w> | M is a TM that halts on input string w}

Definition
N
Term

Is this language Turing-decideable?

NEDFA = {<A> | A is a DFA and L(A) ≠ ∅}

Definition
Y
Term

Is this language Turing-decideable?

NECFG = {<G> | G is a CFG and and L(G) ≠ ∅}

Definition
Y
Term

Is this language Turing-decideable?

NETM = {<M> | M is a TM and L(M) ≠ ∅}

Definition
N
Term

Is this language Turing-decideable?

NEQDFA = {>A, B> | A and B are DFAs and L(A) ≠ L(B)}

Definition
Y
Term

Is this language Turing-decideable?

NEQCFG = {<G, H> | G and H are CFGs and L(G) ≠ L(H)}

Definition
Y
Term

Is this language Turing-decideable?

NEQTM = {<M1, M2> | M1 and M2 are TMs and L(M1) ≠ L(M2)}

Definition
N
Term

Is this language Turing-decideable?

AMBCFG = {G | G is a CFG and G is ambiguous}

Definition
N
Term
Let L1 be the set of languages that can be decided by a deterministic Turing machines, and L2 be the set of languages that can be recognized by non-deterministic pushdown automata. Is it true that L2 ⊆ L1? Justify your answer.
Definition

It is true; since the set of languages that are recognized by a pushdown automata (deterministic or not), or Context-Free Languages, is a subset of the set of languages that are decidable by a Turing machine (deterministic or not), it follows automatically that L2 ⊆ L1.

(Note: DTM = NTM; whereas DPDA ⊂ NPDA.)

Term

Justify that there exists a language that cannot be recognized by a Turing machine by proving the following two statements:

(i) The set of all Turing machines are countable.

(ii) The set of all languages over a given alphabet Σ is uncountable.

Definition

(i) The set of all Turing machines are countable.

Proof.

(From TEXTBOOK, Cor. 4.18) "The set of all Turing machines is countable because each Turing machine M has an encoding into a string <M>. If we simply omit those strings that are not legal encodings of Turing machines, we can obtain a list of all Turing machines."

The encoding of the TM's is as follow:

Let δ(qi , xj) = (qk, xl, ym) ⇒ 10i10j10k10l10m1 (use 1's as delimiters); and let 10i10j10k10l10m be called "code-1", excluding the last 1-bit of the string; & etc; and "code-last" be the empty string.

Let, the encoding, be

<M> = 111"code-1"11"code-2"11...11"code-last"111

since <M> is a binary sequence with a fixed length (since M is represented with finite amount of information), so we can list all TM’s using the encoding stated above.

Therefore, the set of all Turing machines are countable.

(ii) The set of all languages over a given alphabet Σ is uncountable.

Proof.

The set of all strings over Σ is Σ = {s1, s2, ...}, which is countable.

The set of all languages over Σ would then be P = 2Σ∗, the power set where each element of it is a combination of some of the strings from Σ. Hence, we want to show that P is uncountable.

In order to do so, we would apply the characteristic sequence method onto P; i.e., χ(P), which has entries χi ∈ {0, 1}, indicating whether a string in Σ is being included in P at that corresponding location ∀i, with infinitely many such i’s. Therefore, χ(P) is the collection of all infinite binary sequences.

By Cor. 4.18, χ(P) is not countable; thus, the set of all languages over Σ is uncountable. 

Term
Write Y (yes) or N (no) in the entries of the table above to indicate which classes of languages are closed under which operations: Regular Languages, CFLs, Turing-Decidable languages, and Turing-Recognizable Languages. Union, Intersection, Complementation
Definition

Union: YYYY

Intersection: YNYY

Complementation: YNYN

Term
Define P
Definition
Set of problems that can be decided in polynomial time deterministically
Term
Define NP
Definition
Set of problems that can be decided in polynomial time non-deterministically
Term
Define 3SAT problem
Definition
Given a well-formed logical (boolean) expression in Conjunctive Normal Form (CNF), where each clause has exactly 3 literals, the objective is to decide whether there exists a truth assignment to each of the variables such that the whole expression is evaluated to TRUE.
Term
Define NP-complete class
Definition
A problem B is NP-C if: (i) B ∈ NP, and (ii) every problem in NP can be transformed to B in polynomial time deterministically
Term
Give a precise description of Cook’s Theorem.
Definition
Any problem in NP can be transformed into a SAT problem in polynomial time deterministically
Term
Prove the following theorem: P = NP if and only if there exists a problem, say B, such that B ∈ NPC ∩ P.
Definition

Proof. (Class note, bottom of p. 48)

If P = NP, it is clear that every problem in NPC belongs to P. Now assume that there is a problem B ∈ NPC that can be solved in polynomial time deterministically. Then by definition of B ∈ NPC, any problem in NP can be transformed to B in polynomial time deterministically, which can then be solved in polynomial time deterministically using the algorithm for B. Hence, NP ⊆ P. Since P ⊆ NP, we conclude that P = NP, which completes the proof.

Term
Precisely describe a polynomial time transformation from Hamiltonian path problem to Hamiltonian cycle problem.
Definition

Let G be an arbitrary graph as an input to Hamiltonian Path (HP) problem.

We then construct a graph G' as an input to the Hamiltonian Cycle (HC ) problem as follow:

Given V(G) = {v1, ..., vn}, the vertex set, and E(G), the edge set; then, V(G') = V(G) ∪ {v0}; and E(G') = E(G) ∪ {(v0, vi) | i = 1, ..., n};

i.e., in G' , add a new vertex v0 that is connected to every vertex that is also in V(G). 

Claim: G has a HP iff G' has a HC.

Proof.

Suppose G has a HP starting with vi and end with vj, not necessarily the same vertex. Then, G' has a HC, namely (v0, vi, ..., vj, v0). Conversely, suppose G' has a HC with two edges (v0, va) & (vb , v0) in the cycle. Then, G has a HP, namely (va, ..., vb). Therefore, HP ≤P HC; thus, HC problems are as hard as HP problems

Term
The set of rational numbers are _____
Definition
countable
Term
The set of real numbers are _____
Definition
uncountable
Term
The set of all strings over Σ is _____
Definition
countable
Term
The set of all TMs is _____
Definition
countable
Term
The set of all binary sequences of infinite length is _____
Definition
uncountable
Term
The set of all languages over Σ is _____
Definition
uncountable
Supporting users have an ad free experience!