CSE 355 - All Quizzes, and more!

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

Any language over a unary alphabet is regular

false

If L1 U L2 U ... U Ln is a regular language, none of L1, L2, ... , Ln can be non regular

false

In an NFA, suppose that q and r are two states, and that there is an ε transition from q to r. T/F: It must be the case that E({r}) contains E({q})

false

The grammar: S -> TaT T -> TT | aTb | bTa | a | ε generates the language L = {w ∈ {a,b}* : #a(w) >= #b(w)}

false

The pumping lemma can be used to demonstrate that a language is regular

false

To show the language {0^n 1^n | n >= 0} is not regular, you could use the string 0^p1^p

true

Consider the CFG with start variable S and the rules: S -> aSa S -> bSb S -> a S -> b T/F: this can generate every palindrome in {a,b}*

false

Consider the language of all binary strings of length at most 10. because this language is finite, it is regular. because it is regular, the pumping lemma holds. T/F: 1 could be a pumping length for this language in the pumping lemma

false

Consider Σ = {a U b} T/F: (ab)** = Σ**

false

Let the CFG, with start variable S, be defined as: S -> S | T T -> T | U | 00 U -> 0U0 | ε T/F: S => S => S and S => T => U are valid derivations

false

The number of computations of a DPDA on an input string w can be

only 0 or 1

CFGs can be converted to PDAs and vice versa

true

In a CFG in CNF with start variable S, which rule could not arise?

B → Bc

In converting a regular grammar to CNF, which step is not required?

Break up long right hand sides.

T/F: Given a finite language L it follows that Σ* \ L is finite

False

Suppose that M = (Q, Σ, Γ, δ, q0, F) is a PDA. Which of the following must be false?

Q is empty.

Given finite language L and a finite language K such that L ⊆ K it follows that K \ L is finite

True

T/F: Finite Languages are closed under union

True

T/F: Given a regular language L, a regular language K, and L ⊆ K it follows that K \ L is a regular language

True

T/F: Regular languages are closed under complement with respect to Σ*

True

T/F: Regular languages are closed under intersection

True

A class of languages is closed under reversal if whenever L is in the class, reverse(L) is also in the class. Among the context-free, regular, and finite languages, the classes that are closed under reversal are:

all of context-free, regular, and finite

A class of languages is closed under subsequences if whenever L is in the class, subseq(L) is also in the class. Among the context-free, regular, and finite languages, the classes that are closed under subsequences are:

all of context-free, regular, and finite.

A derivation of a string w of length n in a context-free grammar

can involve any positive integer number of rules

An NFA N produced by converting a regex to an NFA (as described by Sipser) will result in an NFA that recognizes the language described by the regex. T/F: any other NFA that recognizes the same language has at least as many states as N

false

Any NFA transition diagram can be converted to an equivalent DPDA transition diagram by rewriting every transition labelled with some character a to instead be labelled as a, ε -> ε

false

Consider a CFG G with start variable S such that G only contains the rule S->S T/F: L(G) = ε

false

Consider a CFG G with start variable S such that G only contains the rule S->S T/F: This is not a valid grammar

false

Consider the language of all binary strings of length at most 10. because this language is finite, it is regular. because it is regular, the pumping lemma holds. T/F: 10 could be a pumping length for this language in the pumping lemma

false

I have a DFA M with m states that recognizes language K and a DFA N with n states that recognizes language L. T/F: There exists a DFA D that recognizes L U K and D has *at most* m*n states

false

I have a DFA M with m states that recognizes language K and a DFA N with n states that recognizes language L. T/F: There exists a DFA that recognizes L U K and it must be that this DFA has *at least* m*n states

false

I have a PDA in which no transition pops the stack. The class of languages such a PDA recognizes is Context Free Languages

false

I have a PDA in which no transition pushes the stack. The class of languages such a PDA con recognize is {ε} or ∅

false

I was given the formal description of a DFA over the alphabet Σ = {0,1} and changed the alphabet to be Σ = {0,1,2} but left everything else exactly the same. T/F: Formally this new machine is a DFA

false

I was given the formal description of a DFA over the alphabet Σ = {0,1} and changed the alphabet to be Σ = {0,1,2} but left everything else exactly the same. T/F: Formally this new machine is an NFA

false

In an NFA, suppose that q and r are two states, and that there is an ε transition from q to r. T/F: It must be the case that E({q}) contains r but not every state in E({r})

false

In converting an NFA N = (Q,Σ,δ,q0,F) to a DFA using the powerset method, generating states only as needed, we first compute the ε closures. Suppose that every state belongs to the ε closure of every other state. T/F: There must be at least two states in the new DFA

false

In converting an NFA N = (Q,Σ,δ,q0,F) to a DFA using the powerset method, generating states only as needed, we first compute the ε closures. Suppose that every state belongs to the ε closure of every other state. T/F: There will always only be 1 state in the new DFA

false

It must always be the case that the input alphabet is a subset of the stack alphabet for CFLs

false

Language L = complement({0^n 1^n : n >= 0}) is a regular language

false

Let D = (Q,Σ,δ,q0,F) be a DFA. Recall a computation on w, call it Sw, is a sequence of states. T/F: The length of w needs to be at least |Q| in order to guarantee Sw has at least one duplicate value

false

Let D = (Q,Σ,δ,q0,F) be a DFA. Recall a computation on w, call it Sw, is a sequence of states. T/F: The length of w needs to be at least |Σ| + 1 in order to guarantee Sw has at least one duplicate value

false

Let R be a regular language and L be a language. Suppose L U R is not regular. T/F: L is regular

false

Let R be a regular language and L be a language. Suppose L ∩ R is not regular. T/F: L is regular

false

Recall that a sequence w' is an extension of string w if after removing all the ε in w', w' = w. Suppose that the NFA N accepts some string w. T/F: There could be 0 extensions in accepting computations on string w

false

Say that we have pumping length p for some language and we have a string s, and |s| >= p. suppose that i write s = xyz and show that xz is not in the language. T/F: this is enough to show the language is not regular

false

T/F: Converting an NFA to DFA, generating all possible states of the DFA (described in class) the DFA must have at least as many states as the original NFA

false

T/F: Given a DFA D that recognizes the language L, there is precisely one DFA that recognizes Σ*\L

false

The grammar: S -> TaT T -> TT | aTb | bTa | a | ε generates the language L = {w ∈ {a,b}* : #a(w) < #b(w)}

false

The grammar: S -> TaT T -> TT | aTb | bTa | a | ε generates the language L = {w ∈ {a,b}* : #a(w) <= #b(w)}

false

The regex produced by ripping states in a GNFA always results in the same regex, regardless of the order in which states are ripped

false

To show the language {0^n 1^n | n >= 0} is not regular, you could use the string 0^(p+1)1^(p)

false

Using the powerset method, you convert an NFA N to a DFA D. Now you convert the DFA D to an NFA N'. Then you convert N' to a DFA D' using the powerset method. Say Q = {q1,q2,q3...qn}. T/F: {q1,q3,q5,q7} could be a state of D'

false

if L is not regular, must L U 0**1** not be regular

false

To show that a language is context-free, one could give a PDA for it. One could also

give a context-free grammar for it, or use closure properties

Whenever each transition of PDA M either pops or pushes, but not both, the language of M

must be context-free but need not be regular.

Whenever each transition of a PDA M pops a symbol, the language of M

must be finite but need not be empty

Whenever each transition of a PDA M does not pop a symbol, the language of M

must be regular but need not be finite

Whenever each transition of a PDA M that pushes also pops, the language of M

must be regular but need not be finite.

A derivation of a string w of length n in a context-free grammar in Chomsky normal form

must involve exactly 2n − 1 applications of rules, except possibly when n ≤ 5

A class of languages is closed under subsets if whenever L is in the class and L' ⊆ L, L' is also in the class. Among the context-free, regular, and finite languages, the classes that are closed under subsets are:

only finite

A context-free grammar G is ambiguous if

some string w ∈ L(G) has at least two different parse trees

Any DFA transition diagram can be converted to an equivalent DPDA transition diagram by rewriting every transition labelled with some character a to instead be labelled as a, ε -> ε

true

Call the number of DFAs with n states d(n). T/F: For any choice of n, d(n) must be divisible by 2

true

Call the number of NFAs with n states d(n). T/F: For any choice of n, d(n) must be divisible by 2

true

Consider a CFG G with start variable S such that G only contains the rule S->S T/F: L(G) = ∅

true

Consider the CFG with start variable S and the rules: S -> aSa S -> bSb S -> a S -> b S -> ε T/F: this can generate every palindrome in {a,b}*

true

Consider the CFGs G1 and G2 with the rules: S1 -> a S1 b | Ac | ε A -> A | ε S2 -> a S2 b | c | ε T/F: L(G1) = L(G2)

true

Consider the grammar defined as S -> 0S0 | 1S1 | S | ε An infinite number of parse trees exist for the string 11 exist using this grammar

true

Consider the language of all binary strings of length at most 10. because this language is finite, it is regular. because it is regular, the pumping lemma holds. T/F: 11 could be a pumping length for this language in the pumping lemma

true

Consider Σ = {a,b} T/F: (a U b)** = Σ**

true

Given two regular grammars I can always form a regular grammar for the intersection of their languages

true

I have a DFA M with m states that recognizes language K and a DFA N with n states that recognizes language L. T/F: There exists a DFA that recognizes L U K with m*n states

true

I have a PDA in which no transition pops the stack. The class of languages such a PDA recognizes is Regular Languages

true

I have a PDA in which no transition pushes the stack. The class of languages such a PDA con recognize is Regular languages

true

If L is not regular, Σ* \ L is not regular

true

If L1 U L2 U ... U Ln is a regular language, all of L1, L2, ... , Ln could be non regular

true

If we want to show that L is not regular, it suffices to show that L U 0**1** is not regular

true

If we want to show that L is not regular, it suffices to show that L ∩ 0**1** is not regular

true

In an NFA, suppose that q and r are two states, and that there is an ε transition from q to r. T/F: It must be the case that E({q}) contains E({r})

true

In converting an NFA N = (Q,Σ,δ,q0,F) to a DFA using the powerset method, generating states only as needed, we first compute the ε closures. Suppose that every state belongs to the ε closure of every other state. T/F: There must be at least one state in the new DFA

true

In order for a PDA to be converted to a CFG, the PDA should be modified so that every transition either pops or pushes but not both

true

In order to convert a PDA P to a CFG we first transform the PDA so that all w ∈ L(P) have an accepting computation that leaves the stack empty at the end of the computation

true

Let D = (Q,Σ,δ,q0,F) be a DFA. Recall a computation on w, call it Sw, is a sequence of states. T/F: The length of w needs to be at least |Q| + 1 in order to guarantee Sw has at least one duplicate value

true

Let the CFG, with start variable S, be defined as: S -> S | T T -> T | U | 00 U -> 0U0 | ε T/F: S => T => U => ε and S => T => T => U => ε are valid derivations

true

Recall that a sequence w' is an extension of string w if after removing all the ε in w', w' = w. Suppose that the NFA N accepts some string w. T/F: There are always at least 1 extensions in accepting computations on string w

true

Recall that a sequence w' is an extension of string w if after removing all the ε in w', w' = w. T/F: there are 6 extensions of length 4 of the string 00.

true

Suppose you have an NFA that has more that one final state. T/F: It is always possible to convert it to an NFA that recognizes the same language but has precisely one accept state

true

T/F: Converting an NFA to DFA, generating all possible states of the DFA (described in Sipser) the DFA must have at least as many states as the original NFA

true

T/F: Given a DFA D that recognizes the language L, there is at least one DFA that recognizes Σ*\L.

true

T/F: a DFA must perform precisely one computation on a given string

true

The GNFA method is used to convert an NFA to a regex R. T/F: There can be another regex that describes the same language but has fewer operations than R

true

The grammar: S -> TaT T -> TT | aTb | bTa | a | ε generates the language L = {w ∈ {a,b}* : #a(w) > #b(w)}

true

The language L = {0^n 1^n : n >= 0} U Σ* is a regular language

true

The regular languages closed under subset (if a language L is a subset of a language K, and K is regular, then L is regular)

true

To show the language {0^n 1^n | n >= 0} is not regular, you could use the string 0^(2p)1^(2p)

true

Using the powerset method, you convert an NFA N to a DFA D. Now you convert the DFA D to an NFA N'. Then you convert N' to a DFA D' using the powerset method. Say Q = {q1,q2,q3...qn}. T/F: {∅} could be a state of D'

true

the class of PDAs which do not utilize the stack recognize precisely the regular languages

true

In order to recognize some languages that are not CFLs, we can modify PDAs to

use more stacks

To show that a language is not context-free, one could

use the pumping lemma for context-free languages, or use closure properties


Ensembles d'études connexes

IP Address Classes & subnet Masks

View Set

WH 25-3 Industrialization spreads

View Set

INTRODUCTION TO ENGINEERING MANAGEMENT

View Set

vocabulaire c: Ça fait combien ? (Voces Français 1 Chap6.1)

View Set

Chapter 11 & 12: Procedural & Diagnostic Coding

View Set

Principles Of Biology 1 (Module 3 Energy Drinks)

View Set

national government chapter civil liberties

View Set

Unit: 2. FRACTIONS Assignment: 1. Fractions and Mixed Numbers

View Set