Quiz #1 Help Center

Learn more

Warning: The hard deadline has passed. You can attempt it, but you will not get credit for it. You are welcome to try it as a learning exercise.

Question 1

How many distinct strings are in the language of the regular expression:
(0+1+ϵ)(0+1+ϵ)(0+1+ϵ)(0+1+ϵ)
?

Question 2

Consider the string abbbaacc. Which of the following lexical specifications produces the tokenization ab/bb/a/acc ?
[Check all that apply]

Question 3

Using the lexical specification below, how is the string "dictatorial" tokenized?

dict (1)
dictator (2)
[a-z]* (3)
dictatorial (4)

Question 4

Which of the following regular expressions generate the same language as the one recognized by this NFA?
[Check all that apply]

In this NFA, there are five states, S0, S1, S2, S3 and S4. S0 is the start state, S4 is the accepting state. The transactions are following. If we are in state S0 and read input 0, we go to S1.If we are in state S1, we can go to state S3 without consuming any input, that is a epsilon-move. If we are in state S1 and read 0, we go to S2. If we are in state S2 and read 0, we go to S0.  If we are in state S3 and read 1, we go to S4. If we are in S4 and read 0, we go to S3.

Question 5

Let Si be the string consisting of i 0's follwed by 2i 1's. Define the language Ln={Si|1≤i≤n}. For example,
L3={011,001111,000111111}.
For any given n, what is the smallest number of states needed for a DFA that recognizes Ln?

Question 6

The language of the regular expresion (abab)* is equivalent to the language of which of the following regular expressions?
[Check all that apply]

Question 7

What is the minimum number of states a DFA recognizing the language of a(bc)∗d can have?

Question 8

Given the following lexical specification:

a(ba)*
b*(ab)*
abd
d+

Which of the following statements is true?
[Check all that apply]

Question 9

Given the following lexical specification:

(00)*
01+
10+
Which strings are NOT successfully processed by this specification?
[Check all that apply]

Question 10

For any language L, the complement of the language (usually written L′) is defined as the language
that consists of all the strings that are NOT in L. That is,

L′=Σ∗−L
It turns out that the complement of any regular language is also a regular language.

Which of the following regular expressions define a language that is the complement of the language defined by the
regular expression: 1(01)∗?
[Check all that apply]

Question 11

Which of the following automata are DFAs?
[Check all that apply]

Question 12

Which of the following automata are NFAs?
[Check all that apply]
    
You cannot submit your work until you agree to the Honor Code. Thanks!