CSE355

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

For any regular language L, there is an NFA with exactly..?

1 final state with language L.

How many start states can a DFA have?

1.

If you have a CFG that is in a CNF, how do calculate how many derivations it'll take to derive a particular string?

2(string length)-1.

Suppose that I have 2 DFAs and have 7 and 6 states respectively, and 3 and 4 final states respectively. If I built the product DFA for the UNION f their languages. How many final states will the resulting DFA have?

3*6 = 18. 4 * 7 = 28. 18 + 28 - (3*4) = 34.

Suppose that I have 2 DFAs and have 7 and 6 states respectively, and 3 and 4 final states respectively. If I built the product DFA for the INTERSECTION if their languages. How many final states will the resulting DFA have?

4 * 3 = 12.

Total function is defined as...?

A function that has a defined value for all possible input values.

The agreement A of two languages L1 and L2 is a language consisting of all strings that are in both or neither of the two. Suppose that L1 and L2 are regular. Is A regular and if so, why?

A is regular because we could construct a DFA using the product construction

The pumping lemma for regular languages implies that..?

A regular language is infinite if and only if it contains a string that can be pumped.

Consider the regular expression (ab U baa)*. Consider the NFA that is produced from this regular expression by the algorithm described in class. Without simplifying the NFA, how many states does the NFA have?

AB has 4 states, BAA has 6 states, the union of this adds in an extra state in the beginning for epsilon transitions + 1, the star of this adds a final state for epsilon transition + 1 = 12.

(A ∪ B) bar =

Abar ∩ Bbar

If I have an algorithm that, given two DFAs decides whether or not they have the same language. Then I also have...?

An algorithm, given two regular expressions, decides whether or not they have the same language.

The set of non-regular languages is closed under which of the following operations?

Complement.

What is the powerset construction about?

Converting an NFA to a DFA.

Suppose we have a DFA D = (Q, Σ, δ, q0, F) and know that D accepts every string. What can we infer about D?

Every reachable state from q0 is a final state.

The GNFA method is used to show that...?

Every regular language is described by a regular expression.

The language {a, b}*: the number of occurrences of ab in w is the same as that of ba in w is not regular. T or F?

F.

If a regular language L has the property that L = L U L, then L is finite. True or false + explain.

False because think of Σ*.

The alphabet of a DFA must have cardinality at least 1. True or false?

False.

We say that a state qj is unreachable from state qi if there does not exist a path from qi to qj. Suppose I have 2 DFAs, both with unreachable states from the state state. If we perform the product construction on these DFAs, then the resulting DFA will have no unreachable states from its start state. T or F?

False. It is not necessarily true.

If a regular expression is star-free then L(R) is...?

Finite.

To show that a language is regular, one could give a DFA for it. Or could also...?

Give a regular expression or use closure properties.

My friend is convinced that L = {w ∈ {0, 1}* : w is not of the form 0^n1^n} is non-regular, in that it is the complement of the non-regular language L' = {0^n1^n : n >= 0}. Is my friend correct?

He is correct because we showed that regular language are closed under complement, so there is no possibility that L could be regular, given that L' is non-regular.

Every non-regular language is..?

Infinite.

Let L be a regular language. How many DFAs have language L?

Infinite.

What does the pumping lemma do?

It proves by contradiction that a language is not regular.

How do you convert something into Chomsky normal form?

Make sure that start variable doesn't appear on RHS -> Remove all ε rules -> Remove unit rules (nonterminal going to single nonterminal) -> Make sure that if anything on the RHS has length 3, create new variable to fix it -> Make sure that if there are any front terminals (like aB), create new variable to fix it.

Does L being closed under the regular operations imply that L is regular?

No.

Among the context-free, regular, and finite languages, the classes that are closed under subsets are

Only finite.

To show a language is NOT regular, one could...?

Pumping lemma or closure properties.

What is Q in (Q, Σ, δ, q0, F)?

Q describes all the states such as Q0, Q1, etc.

The sharing of two languages L1, L2 is the set of all strings that are in both or neither of L1 and L2. If L1 and L2 are regular, then the sharing of L1 and L2 is...?

Regular.

The pumping lemma for regular languages can be proved by?

Showing that a DFA computation must repeat a state.

Suppose we are given an NFA with δ(q0, ε) = {q1}, δ(q0, a) = {q2}, δ(q1, ε) = {q1}, δ(q2, ε) = {q3}, δ(q3, a) = {q1}, δ(q3, ε) = {q4}. What is E({q0, q2})?

So this notation is supposed to dictate all the things that q0 and q2 go to via ε transitions. Also include themselves. {q0, q1, q2, q3).

Context-free languages are closed under the 3 regular operations, which are are...?

Star, union, concatenation.

What step can be skipped when converting a regular grammar to a CNF. EMPHASIS ON REGULAAAAR

Step 5 (since regular grammars have longest length 2).

The language {a, b}*: the number of occurrences of a in w is the same as that of b in w is not regular. T or F?

T

The language {ww: w ∈ Σ*} with |Σ| > 2 is not regular. T or F?

T.

Consider the DFA used in the proof of the pumping lemma: we chose a string long enough so that it is accepted by the DFA and repeats a state. What if such a string happens to not exist for this DFA?

The DFA's language must be finite.

Suppose that we have an NFA and a input string. How many computations, not necessarily accepting, are there of the machine on that string?

The answer depends on the machine and string.

What is Σ in (Q, Σ, δ, q0, F)?

The inputs such as 0, 1, etc.

When an NFA M is converted to a DFA M', only adding states as needed, M' may have more states than M does. T or F?

True.

When an NFA M is converted to a DFA M', only adding states as needed, M' may have same states as M does. T or F?

True. If the transition diagram of the NFA is in fact a DFA then during conversion, no more states are added.

When an NFA M is converted to a DFA M', only adding states as needed, M' may have less states than M does. T or F?

True. Think of an NFA that has a transition diagram equivalent to a DFA but an unreachable state from the start state.

What are regular languages closed under?

Union, intersection, concatenation, complement, star, reverse, prefix, etc.

What gives us a clue that a language isn't regular?

Unlimited # of possibilities.

What do we do with the resulting N when we star operation them?

We add a new start state (that is also a accepting state) and ε transition it to the old start state. Accepting states also are directed to point at the old start state via ε transition.

What do we do with the resulting N when we concatenate N1 and N2?

We change the accepting states in N1 to regular states and have them ε transition to N2's start states.

What do we do with the resulting N when we union N1 and N2?

We create a new start state that ε transitions into the previous start states.

What is the meaning of the statement q2 = δ(q0, a)?

When reading an a in state q0, the next state is q2.

Do MSNFAs recognize the same languages as NFAs? If so, why?

Yes because we can add an extra start state with ε transitions to all the old start states to get an NFA with the same language.

Can a DFA have 0 final states?

Yes! It doesn't necessarily have to accept or reject as it can be a transducer.

Are languages defined over finite alphabets?

Yes.

Are regular languages context free?

Yes.

Is every regular language context free?

Yes.

Suppose I have a CFG that isn't in CNF, will the derivation be possibly infinite?

Yes.

Suppose that we have a given fixed string s = s1...sn with each si ∈ Σ. I want to recognize the langauge {w ∈ Σ* : s is a substring of w}. There exists an NFA with x states to recognize this language. What is the smallest possible value of x?

n + 1. We must have n transitions for each character so there must be n + 1 states.

If a DFA accepts input string w ∈ Σ* with |w| = n, a computation of M on w is a sequence of exactly...?

n+1 states.

On input string w ∈ Σ*, the number of computations of an NFA is always at least 1 if...?

the NFA accepts w.

For any language L1 (regular or not) L1 U L1bar =

Σ*, which is regular.

L1 ∩ L1bar

A GNFA can have transitions labelled with...?

∅* or ∅.


Ensembles d'études connexes

Segment 7 - Fraud & Money Laundering

View Set

Management Questions, Chapter 11

View Set