The “tail” of a language is defined as the set of all suffixes of its strings. That is,
tail(L) = {y : xy ∈ L for some x ∈ Σ∗}
(i). If L = {w ∈ {a, b}∗ : w contains exactly three b’s}, give a brief description of tail(L).
(ii). Show that if L is any regular language, then tail(L) is also a regular language. As with Question 3, you can assume Σ = {a, b} if you like.
*(Hint: There could be various ways to prove this, but the argument I found involves starting with an NFA for L and altering it in a specific way.)
The “tail” of a language is defined as the set of all suffixes of its strings....
Give regular expressions for the following languages: (a) The language of all strings over {a,b} except the empty string. (b) The language of all strings over {a,b} that contain both bab and bba as substrings. (c)L k = {w ∈ {a,b} * | w contains a substring having 3 more b’s than a’s}. (d) The language of all strings over {a,b} that have a b in every odd position (first symbol is considered position 1; empty string should be accepted)...
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...
John Doe claims that the language L, of all strings over the alphabet Σ = { a, b } that contain an even number of occurrences of the letter ‘a’, is not a regular language. He offers the following “pumping lemma proof”. Explain what is wrong with the “proof” given below. “Pumping Lemma Proof” We assume that L is regular. Then, according to the pumping lemma, every long string in L (of length m or more) must be “pumpable”. We...
Question 1: Every language is regular T/F Question 2: There exists a DFA that has only one final state T/F Question 3: Let M be a DFA, and define flip(M) as the DFA which is identical to M except you flip that final state. Then for every M, the language L(M)^c (complement) = L( flip (M)). T/F Question 4: Let G be a right linear grammar, and reverse(G)=reverse of G, i.e. if G has a rule A -> w B...
Consider the application of the Pumping Lemma to prove that the language over Σ = {a,b,c} shown below is not regular: L = {aibjck: i ≥ j ≥ k ≥ 0} First, we choose an input string w = apbpcp=xyz, 1|xy| p, |y|=k≥1, where p is the critical length. Next, create another string w´ L to produce a contradiction. Which of the following string will produce a contradiction? e) w´ = xz f) w´ = xyz g) w´ = xy2z h)...
Just answer the second problem the photo is my answer for
first one and need to use in the second problem
all questions. Unless otherwise stated, all the DFAs and 1 /2 1 this homework use Σ-(0, 1 } as the alphabet. (50 point) For i=1, 2, 3, 4 and 5, design NFAs Ni, such that L(M) = Bi, where 1, (a) Bi -[w w has an even number of O's, or, contains exactly two 1's). (b) B2-[w every odd...
Question 41 (1 point) The following sentence is not a statement… Question 41 options: Seven minus five is equal to three. Go determine the quality of your beliefs. The taco salad is excellent today! There is no time like the present to do a good deed. Argument or Not? If argument what's the conclusion? If nonargument, what kind? Determine whether the following are arguments are not. If an argument, state the conclusion. If not an argument, state what kind of...
0. Introduction. This involves designing a perfect hash function for a small set of strings. It demonstrates that if the set of possible keys is small, then a perfect hash function need not be hard to design, or hard to understand. 1. Theory. A hash table is an array that associates keys with values. A hash function takes a key as its argument, and returns an index in the array. The object that appears at the index is the key’s...
l. Suppose that A, B, and C are events such that PLA] = P[B] = 0.3, P[C] = 0.55, P[An B] = For each of the events given below in parts (a)-(d), do the following: (i) Write a set expression for the event. (Note that there are multiple ways to write this in many cases.) (ii) Evaluate the probability of the event. (Hint: Draw the Venn Diagram. You may then want to identify the probabilities of each of the disjoint...
In Problem Set 7 you designed and implemented a Message class. This time, let's design and implement a Mailbox class in a file named Mailbox java. Do the following with this class • You may use the Message class from PS 7. You will have to add new features to the Message class from PS 7 as you work through this problem. You are welcome to start with my sample solution if you wish • Suppose there are multiple mail...