academic legend

studied byStudied by 0 people
0.0(0)
learn
LearnA personalized and smart learning plan
exam
Practice TestTake a test on your terms and definitions
spaced repetition
Spaced RepetitionScientifically backed study method
heart puzzle
Matching GameHow quick can you match all your cards?
flashcards
FlashcardsStudy terms and definitions

1 / 90

encourage image

There's no tags or description

Looks like no one added any tags here yet for you.

91 Terms

1

How are the cardinalities of the sets N of natural numbers, Q of rational numbers, and R of real numbers related to eachother?

|N| = |Q| < |R|

New cards
2

Which statement about the cardinalities of the set N of natural numbers and the set 2N of even natural numbers is correct?

|N| = |2N|

New cards
3

Which statement about the cardinalities of set A and its power set P(A) is correct?

|A| < |P(A)|

New cards
4

Recall our first proof of the theorem that regular languages are closed under intersection and union: We constructed a new DFA M based on the two DFAs M1 and M2. The new DFA M used pairs of states M1 and M2. Given that M1 and M2 have k1 and k2 states respectively. How many states does M have?

k1 * k2

New cards
5

What does NFA N1 do on input aab?

Accept

<p>Accept</p>
New cards
6

In the proof of the theorem that languages recognized by NFAs are regular we constructed DFA M' based on an NFA M using the power-set of the states of M as the states of M'. If M has k states, how many states does M' have?

2^k

New cards
7

The proof of the pumping lemma for regular languages uses the fact that if DFA M has p states and it runs for more than p steps then this M will enter some state at least twice. We call this fact:

The Pigeonhole Principle

New cards
8

We used the Pumping Lemma to show that D = {0^k 1^k | k ≥ 0} is not regular. How can we show that B = {w | w has equal numbers of 0s and 1s} is not regular?

We know that 0*1* IS regular. If we assume that B is regular then 0*1* ∩ B = D should be regular as well.

New cards
9

Match the recognizer with the generator: DFA

regular expression

New cards
10

Match the recognizer with the generator: NFA

regular expression

New cards
11

Match the recognizer with the generator: PDA

context free grammar

New cards
12

Write the language of all sequences of characters from Σ = {0,1} that contain two consecutive 1s as a regular expression.

(0 U 1) o 1 o 1 o (0 U 1)

New cards
13

Regular languages are closed under intersection. (True/False)

True

New cards
14

Regular languages are closed under union. (True/False)

True

New cards
15

Regular languages are closed under concatenation. (True/False)

True

New cards
16

Which of the following is an application of the pumping lemma for regular languages?

Proving that a given language is not regular.

New cards
17

Context free languages are closed under union. (True/False)

True

New cards
18

Context free languages are closed under concatenation. (True/False)

True

New cards
19

Context free languages are closed under Kleene*. (True/False)

True

New cards
20

Regular languages are closed under complement. (True/False)

True

New cards
21

Which DFA accepts the string aabb?

M2 but not M1

<p>M2 but not M1</p>
New cards
22

Can you show that every NFA can be converted to an equivalent one that has a single accept state?

Yes, by adding a new state q and then adding ε-transitions from each accept state to q. The new state q will be the single accept state of the new NFA.

New cards
23

Regular languages are closed under Kleene*. (True/False)

True

New cards
24

Find a regular expression that generates the language recognized by the following DFA.

b(bb)(aa)

<p>b(bb)(aa)</p>
New cards
25

Swapping the accepting and non-accepting states of a DFA shows that regular languages are closed under complement. However, swapping the accepting and non-accepting states of an NFA doesn't necessarily yield an NFA that recognizes the complement. Does that indicate that the class of languages recognized by NFAs is not closed under complement?

No, since NFAs and DFAs recognize the same class of languages.

New cards
26

Translate the following NFA into a regular expression.

aa* ∪ ab(ab)*

<p>aa* ∪ ab(ab)*</p>
New cards
27

What is the definition of an alphabet Σ?

Σ is an non-empty, finite set.

New cards
28

Which of the following is a property of a DFA?

It can accept ε (the empty string).

New cards
29

Select all of the strings that are in L(G). Select all that apply.

ε

001101

000111

<p>ε</p><p>001101</p><p>000111</p>
New cards
30

Which of the following is a difference between a DFA and a NFA? (2 answers)

An NFA can allow ε-transitions, a DFA does not.

A DFA has one state transition for each input symbol, but an NFA can have zero or many transitions per input symbol.

New cards
31

Which of the following is an advantage of using an NFA instead of a DFA?

NFAs are simpler to combine (e.g. union, concatenation, Kleene*) than DFAs.

New cards
32

What is a formal language?

A set of strings over a finite alphabet.

New cards
33

Which of the following is a property of deterministic finite automata (DFA)?

It cannot perform ε-transitions.

New cards
34

What characterizes a context-free grammar?

Production rules with a single non-terminal on the left hand side.

New cards
35

Which of the following languages is not recognized by deterministic finite automaton (DFA)?

{a^n b^n | n ≥ 0}

New cards
36

Which of the following best describes a pushdown automaton (PDA)?

A computational model that uses a stack to keep track of symbols.

New cards
37

What is the pumping lemma for regular languages used to prove?

That a given language is not regular

New cards
38

What is a Deterministic Finite Automaton (DFA) used for?

To recognize regular languages

New cards
39

What is the role of the stack in a pushdown automaton?

To store intermediate results during computation

New cards
40

Which of the following best describes a Non-deterministic Finite Automaton (NFA)?

An automaton where multiple transitions are possible from a single state for the same input symbol

New cards
41

What is the difference between DFAs and NFAs?

NFAs can have multiple transitions for the same input symbol and state

New cards
42

Which of the following classes of languages can be recognized by a pushdown automata (PDA)? (Two answers)

Context-free languages

Regular languages

New cards
43

What is the primary function of a context-free grammar (CFG)?

To generate strings in a context-free language.

New cards
44

Which of the following is a characteristic of context-free languages?

They can be recognized by pushdown automata

New cards
45

What is the primary role of transitions in a finite automaton?

To define the movement between the states based on input symbols

New cards
46

Which of the following statements is true about the Pumping Lemma?

It can be used to prove a language is not regular.

New cards
47

Which of the following is not a component of a pushdown automaton?

Tape

New cards
48

What is the distinguishing feature of a regular language?

It can be recognized by a deterministic finite automaton

New cards
49

Which of the following automata is the most powerful in terms of language recognition?

Pushdown automaton

New cards
50

What is the purpose of the transition function in a finite automaton?

To define the movement between states based on input symbols

New cards
51

Which of the following statements is FALSE regarding the conversion of a non-deterministic automaton (NFA) to a deterministic finite automaton (DFA)?

NFAs are more expressive than DFAs.

New cards
52

Which of the following languages is not context-free?

{a^n b^n c^n | n ≥ 0}

New cards
53

In context-free grammars, what are terminals? (2 answers)

Symbols that cannot be replaces by production rules

Symbols from the output alphabet

New cards
54

Which of the following is NOT a valid context-free grammar?

Sb -> aSbS | ε

New cards
55

Which of the following statements is true about regular expressions?

They can express any regular language

New cards
56

Which of the following is an example of a NON-regular language?

{w | w contains an equal number of 0s and 1s}

New cards
57

What is the main purpose of a start symbol in a context-free grammar?

To represent the starting point of a derivation

New cards
58

In a pushdown automaton, what does the top of the stack represent?

The most recently pushed symbol

New cards
59

Match the Bachmann-Landau asymptotic notation with the correct definition:

1. ∃ k > 0 ∃ n0 ∀ n > n0 : |f(n)| ≤ k g(n)

2. ∃ k > 0 ∃ n0 ∀ n > n0 : f(n) ≥ k g(n)

3. ∀ k > 0 ∃ n0 ∀ n > n0 : |f(n)| < k g(n)

4. ∃ k1 > 0 ∃ k2 > 0 ∃ n0 ∀ n > n0 : k1 g(n) ≤ f(n) ≤ k2 g(n)

a. f(n) ∈ O(g(n)) WORST CASE

b. f(n) ∈ Θ(g(n)) AVERAGE CASE

c. f(n) ∈ Ω(g(n)) BEST CASE

d. f(n) ∈ o(g(n)) LOOSE UPPER BOUND

1 -> a

2 -> c

3 -> d

4 -> b

<p>1 -&gt; a</p><p>2 -&gt; c</p><p>3 -&gt; d</p><p>4 -&gt; b</p>
New cards
60

What is the known relationship between the complexity classes N and NP?

P ⊆ NP

New cards
61

A language A ⊆ Σ* is polynomial time/mapping reducible to a language B ⊆ Γ* and we write A ≤ mB

if there is a computable function f: Σ -> Γ in such that w ∈ A <=> f(w) ∈ B

New cards
62

Is it true that TIME(t(n)) SPACE(t(n))?

Yes, because we need at least one computational step to write into a new memory cell

New cards
63

A language B is NP Complete iff

B is in NP and any language A in NP can be polynomially reduced to B.

New cards
64

Which of these languages are NP-Complete? (2 answers)

SAT (Boolean Satisfiability)

3-SAT (3-CNF Boolean Satisfiability)

New cards
65

If we could find a proof that SAT ∊ P then this would imply that

P = NP

New cards
66

Are all regular languages in the complexity class P?

Yes, because a DFA reads one input symbol per state transition.

New cards
67

How can we describe the complexity classes P and NP informally?

NP = all languages we can verify membership quickly

P = all languages where we can test membership quickly

New cards
68

Which of the following boolean expressions are in 3-CNF? (2 answers)

1. (x ^ ȳ ^ z) V (x ^ y ^ z) V ( x ^ ȳ ^ z̄ )

2. (ū ^ ȳ ^ z) V (x ^ v ^ z) V (x ^ ȳ ^ wˉ)

3. (u ^ ȳ ^ z) ^ (x ^ v ^ z) V (x V ȳ V wˉ)

4. (x ^ ȳ ^ z) ^ (x ^ y ^ z) V (x V ȳ V wˉ)

2 - ū ^ ȳ ^ z) V (x ^ v ^ z) V (x ^ ȳ ^ wˉ)

4 - (u ^ ȳ ^ z) ^ (x ^ y ^ z) V (x V ȳ V wˉ)

New cards
69

Is SAT in NP? (Yes/No)

Yes.

New cards
70

Two models of computation are polynomial related if each can simulate the other, i.e., if the computation takes t(n) time on one model, it make take t^k (n) time on the other model, for some k.

Which of the following are polynomially related to 1-tape Turing Machine? (4 answers)

multi-tape TMs

multi-dimensional Turing Machines

random access machines (RAM)

cellular automata

New cards
71

Alan Turing proved the undecidability of the halting problem. Which proof technique from set theory did inspire Turing?

Cantor's diagonal argument

New cards
72

Which of the following languages are decidable? (3 answers)

1. Acceptance problem for NFAs (A NFA) = {

2. Acceptance problem for DFAs (A DFA) = {

3. Equivalence problem for DFAs (EQ DFA) = {

4. Acceptance problem for TMs (A TM) = {

1 - Acceptance problem for NFAs (A NFA) = {

2 - Acceptance problem for DFAs (A DFA) = {

3 - Equivalence problem for DFAs (EQ DFA) = {

New cards
73

What does the Church-Turing-Thesis claim?

Any real-world computation can be translated into an equivalent computation performed by a Turing machine.

New cards
74

Decidability of languages does not depend on the model of computation. (True/False)

True

New cards
75

Languages in P can be efficiently decided.

Not necessarily. The time complexity might be O(n^k) with a very large value for k

New cards
76

Which of the following statements are correct: (3 answers)

1. All regular languages are in the complexity class P.

2. All decidable languages are in the complexity class P.

3. All languages in P are T-recognizable.

4. All languages in P are decidable.

1 - All regular languages are in the complexity class P.

3 - All languages in P are T-recognizable.

4 - All languages in P are decidable.

New cards
77

Is the complexity class P closed under union, i.e. does L1 ∈ P and L2 ∈ P imply L1 ∪ L2 ∈ P?

Yes.

New cards
78

Is the following formula satisfiable? (Yes/No)

(x V y) ^ (x V ȳ) ^ (x̄ V y) ^ (x̄ ^ ȳ)

No

New cards
79

Which of the following are true? (3 answers)

1. 3^n ∈ 2^(O(n))

2. n log n ∈ O(n^2)

3. n^2 ∈ O(n)

4. 2n ∈ O(n)

1 - 3^n ∈ 2^(O(n))

2 - n log n ∈ O(n^2)

4 - 2n ∈ O(n)

New cards
80

Is SPACE(t(n)) ⊆ TIME(2^O(t(n)))?

Yes, because a TM that uses t(n) tape cells cannot use more than 2 ^ O(t(n)) time without repeating a configuration and thus looping and not halting.

New cards
81

What is the output (on the tape) of the Turing Machine M on input 10010111 where M = (Q, Σ, Γ, δ, q_0, q_acc, q_rej)

states Q = {right, carry, done}

input alphabet Σ = {0, 1}

tape alphabet Γ = {1, 0, ' '}

start state q0 = right

accept state q_acc = done

and transition function δ : Q x Γ -> Γ x {L, R} x Q defined by

δ(right, 1) = (1, R, right)

δ(right, 0) = (0, R, right)

δ(right, ' ') = (' ', L, carry)

δ(carry, 1) = (1, L, carry)

δ(carry, 0) = (0, L, done)

δ(carry, ' ') = (' ', L, done)

10011000

New cards
82

Recall the Pumping Lemma for CFLs:

Let Σ = {0, 1} and F = {ww | w ∈ Σ*}

In order to show that F is not context free, which value should we use for the string S to find a contradiction?

s_2 = 0^p 1^p 0^p 1^p ∈ F

<p>s_2 = 0^p 1^p 0^p 1^p ∈ F</p>
New cards
83

Let A1 = {0^k 1^k 2^L | k, l ≥ 0} (equal #s of 0s and 1s).

Let A2 = {0^L 1^k 2^k | k, l ≥ 0} (equal #s of 1s and 2s).

Observe that both A1 and A2 are CFLs. What can we now conclude?

The class of CFLs is not closed under intersection

New cards
84

Context free languages are closed under intersection. (True/False)

False

New cards
85

Match the language with the smallest class that its contained in:

1. E = Ø

2. S = {ε}

3. A_TM = {

4. L1 = {a^k | k ∈ N0}

5. L2 = {a^k b^k | k ∈ N0}

6. L3 = {a^k b^k c^k | k ∈ N0}

a. context free

b. decidable

c. regular

d. finite

e. empty

f. t-recognizable

1 - empty (e)

2 - finite (d)

3 - t-recognizable (f)

4 - regular (c)

5 - context free (a)

6 - decidable (b)

New cards
86

All languages are regular. (Yes/No)

No

New cards
87

Regular languages are closed under union and intersection. (True/False)

True

New cards
88

GNFAs, NFAs, and DFAs are all equivalent, i.e. they all recognize the same class of languages.

Yes, they all recognize regular languages.

New cards
89

Are all context-free grammars regular? (Yes/No)

No

New cards
90

The complexity class P does depend on the model of computation

Yes, but it is equivalent for all reasonable deterministic models of computation.

New cards
91

In our proof of the theorem that languages recognized by NFAs are regular we constructed a DFA M' based on an NFA M using the powerset of the states of M. If M has n states, how many states does M' have by this construction?

2^n

New cards
robot