Midterm Solution
Midterm Solution
Correct
3.00 points out of 3.00
Flag question
Question text
S -> SSSSS | a
a(aaaaa)*
Answer 1
Flag question
Question text
Find the regular expression of the language of all strings that do not end with bc over {b,c}.
Select one:
a. (b + c)*(bb + cc + cb)*
b. (b + c)*(b + c)+
c. None of the options.
d. (b + c)*
e. (b + c)*(bb + cc + cb)
Correct!
Feedback
Flag question
Question text
Find the regular expression for the following language over {a, b} with strings containing at least
two a's.
Select one:
a. (a+b)+a(a+b)+a(a+b)+
b. (a+b)*a(a+b)*a(a+b)*
Correct!
c. (a+b)*(a+b)*(a+b)*
d. (a+b)+(a+b)+
e. b*a*b*a*
Question 4
Partially correct
4.00 points out of 5.00
Flag question
Question text
Match the following machines with the description of the machine or the language it accepts.
Your answer is partially correct.
You have correctly selected 4.
The correct answer is:
→ An NFA that accepts the language
defined by: (0 U 1)*01(011 U 0*)11*.,
→ All binary strings with the property that in every prefix, the number of 0s and the number of 1s
differ by at most 2.,
→ Binary strings in which the number of 0s and the number of 1s is both even.
Question 5
Correct
1.00 points out of 1.00
Flag question
Question text
Which simple description correctly describes the language recognized by the following DFA?
Select one:
a. All binary strings of length 12 that contains the substring 1111
b. None of the options.
c. All binary strings that contain 0010 but not 00010
d. All binary strings that contain 0010
Correct!
Question 6
Correct
1.00 points out of 1.00
Flag question
Question text
Correct!
b. S -> 0TB
T -> 0ABB
A -> 0ABB | 1
B -> 1
c. S -> 0T
T -> 0AB
A -> 0AB | 1
B -> 1 | λ
Feedback
Question 7
Correct
1.00 points out of 1.00
Flag question
Question text
False
Feedback
Correct! The nonregular language L = {anbn} over {a,b} is not regular, but L* = {a, b}* is regular.
The correct answer is 'True'.
Question 8
Correct
1.00 points out of 1.00
Flag question
Question text
b. 1000111001010001110111010010100110110101011
c. 0011101011011111
d. 11100011100001111000
e. 0101010101
Feedback
Question 9
Incorrect
0.00 points out of 1.00
Flag question
Question text
Find the regular expression for the language which contains strings containing
both aba and bab as substrings over {a,b}.
Select one:
a. (a+b)* ((aba (a+b)* bab) + (bab (a+b)* aba))+ (a+b)*
Incorrect. Does not allow for the strings abab or baba.
b. (a+b)* ((aba (a+b)* bab) + (bab (a+b)* aba) + abab + baba) + (a+b)*
c. (a+b)*(aba)*(bab)*(a+b)*
d. (a+b)*((aba (a+b)* bab))+ (a+b)*
Question 10
Correct
1.00 points out of 1.00
Flag question
Question text
Find the regular expression for the language of strings not containing aaa over {a,b}.
Select one:
a. None of the options.
b. b* (a + aa + λ)
c. (a+b)*(ab+ + aab+)* (a + aa + λ)
d. b*(ab+ + aab+)* (a + aa + λ)
Correct!
e. b*(ab+ + aab+)*
Feedback