a)
size is 3 // {e,1,10}
b)
size is 6 //{0,01,010,01,011,0110}
c)
size is 6 //{0,01,10,101,100,1001}
d)
size is 2//{0,01}
e)
size is 1 //{e}
Give the size of each of the following languages over S = {0, 1} below. If...
2. Give the first five strings in L-ordering for each of the following languages over 2 - {0,1}. If there are fewer than five strings, give the entire language instead: Let L1= {0, 11, 101) Let L2 = {€, 0,10 a) LUL b) L2-L2 c) L L2 d) L22
Automata Question. Over the alphabet Σ = {0, 1}: 1) Give a DFA, M1, that accepts a Language L1 = {all strings that contain 00} 2) Give a DFA, M2, that accepts a Language L2 = {all strings that end with 01} 3) Give acceptor for L1 intersection L2 4) Give acceptor for L1 - L2
Let L1 = {ω|ω begins with a 1 and ends with a 0}, L2 = {ω|ω has length at least 3 and its third symbol is a 0}, and L3 = {ω| every odd position of ω is a 1} where L1, L2, and L3 are all languages over the alphabet {0, 1}. Draw finite automata (may be NFA) for L1, L2, and L3 and for each of the following (note: L means complement of L): Let L w begins...
3) Construct a regular expression defining each of the following languages over the alphabet {a, b}. (a) L = {aab, ba, bb, baab}; (b) The language of all strings containing exactly two b's. (c) The language of all strings containing at least one a and at least one b. (d) The language of all strings that do not end with ba. (e) The language of all strings that do not containing the substring bb. (f) The language of all strings...
Let M = {0} and N = Ø and L = {ε, 1} be the languages over {0,1}. Which of the following represents the language NN*M ? {0} {0}* {ε} None of the above
Part B - Automata Construction Draw a DFA which accepts the following language over the alphabet of {0,1}: the set of all strings such that the number of 0s is divisible by 2 and the number of 1s is divisible by 5. Your DFA must handle all intput strings in {0,1}*. Here is a methodical way to do this: Figure out all the final states and label each with the shortest string it accepts, work backwards from these states to...
1(a)Draw the state diagram for a DFA for accepting the following language over alphabet {0,1}: {w | the length of w is at least 2 and has the same symbol in its 2nd and last positions} (b)Draw the state diagram for an NFA for accepting the following language over alphabet {0,1} (Use as few states as possible): {w | w is of the form 1*(01 ∪ 10*)*} (c)If A is a language with alphabet Σ, the complement of A is...
Programming Languages Final Exam Name: Question 1 (15 points) Give a regular expression for each of the following languages over = {0,1,2). 1. All strings that begin with 1 and end with 2. 2. All strings that contain exactly three 1's. For example, "0101012" is valid. 3. All strings in which the digits are non-decreasing. For example, "002" is valid, but "102" is not.
3. [20 points] Give short answers to each of the following parts. Each answer should be at most three sentences. Be sure to define any notation that you use. (a) Explain the difference between a DFA and an NFA. (b) Give a regular expression for the language consisting of strings over the alphabet 2-(0, 1) that contains an even number of 0's and an odd number of 1's and does not contain the substring 01. (c) Give the formal definition...
Give context-free grammars generating each of the following languages over Σ = {0, 1}: {w : |w| ≤ 5} {w : |w| > 5 or its third symbol is 1} {w : every odd position of w is 1}