Question

In: Computer Science

Let L ⊆ Σ ∗ and define S(L), the suffix-language of L, as S(L) = {w...

Let L ⊆ Σ ∗ and define S(L), the suffix-language of L, as S(L) = {w ∈ Σ ∗ | x = yw for some x ∈ L, y ∈ Σ ∗ } Show that if L is regular, then S(L) is also regular.

Solutions

Expert Solution

If L is regular, then there is a DFA that accepts L. This DFA has an initial state q0.

Construct an NFA that is the same as the DFA, except it has a new initial state q-1 with an outgoing lambda transition to q0 and every other state that is reachable from q0.

The NFA accepts S(L), therefore S(L) is regular.


Explanation:

In plain language, S(L) is the set of strings that the strings of L end with. That is, every string in L is also in S(L), and so are all of the suffixes of L.

This means that we can transform the finite state machine that accepts L into one that accepts S(L) by providing a way to jump to every arbitrary initial part of the processing, and to let the last part of a string find the accepting state as normal. The given construction does this. To prove it, you would show that S(L) is equal to the language accepted by the NFA by showing that each is a subset of the other, as follows:

If x = yw is an element of L, then the string y would leave the DFA in some particular state. In the NFA, there is a lambda-transition from the initial state to this particular state, so processing the string w from this state will land the NFA in an accepting state by following the same path as the DFA.

Conversely, if w is any string accepted by the NFA, that means that it followed one of the lambda transitions from the initial state and then followed the same path as the DFA. Since these lambda transitions only go to reachable states of DFA, there is some string y that would put the DFA in that state. Since x = yw is accepted by the DFA, that means w is an element of S(L).

.... Please like the answer........ And comment if any query....... Thanks


Related Solutions

Define a Turing machine TM3 that decides language L3 = { w | w ∈ Σ*,...
Define a Turing machine TM3 that decides language L3 = { w | w ∈ Σ*, #a(w) = #b(w) } over the alphabet Σ = {a, b}. IMPLEMENT USING JFLAP NO PAPER SOLUTION
CS 301 Homework 1- Let Σ = {a, b}. Show that the language [2 marks] L...
CS 301 Homework 1- Let Σ = {a, b}. Show that the language [2 marks] L = is not regular.
For a given language L = { w | na(w) + nb(w) = nc(w) } where...
For a given language L = { w | na(w) + nb(w) = nc(w) } where S = G = {a, b, c} Looking for answer to 3 Construct a PDA M that accepts L with S = G = {a, b, c} Show the sequence of instantaneous descriptions for the acceptance of acacbcbc by M in 1). Give a CFG G that generates L, L(G) = L.
write the dfa for Let L={w in {0,1}*| w is a binary number that is a...
write the dfa for Let L={w in {0,1}*| w is a binary number that is a multiple of 4}
Given two languages A and B, let A/B denote the language {w | w x ∈...
Given two languages A and B, let A/B denote the language {w | w x ∈ A for some x ∈ B}. Show that if A is a context-free language and B is a regular language, then A/B is a context-free language. hint (construct PDAs)
Draw an NFA for the following language then convert to a DFA: L = {w :...
Draw an NFA for the following language then convert to a DFA: L = {w : |w| is odd or |w| is a multiple of 4} where Σ = {0, 1}
Let S={1,2,3,6} and define the relation ~ on S2 by (m,n) ~ (k,l) for m+l=n+k Show...
Let S={1,2,3,6} and define the relation ~ on S2 by (m,n) ~ (k,l) for m+l=n+k Show that it is an equivalent relation Find the number of different equivalent classes and write all of them
In C++ Consider the language L = { s$s' : s is a possibly empty string...
In C++ Consider the language L = { s$s' : s is a possibly empty string of characters other than $ , s' = reverse( s )} as defi ned in Chapter 6 . Write a recognition algorithm for this language that uses both a queue and a stack. Thus, as you traverse the input string, you insert each character of s into a queue and each character of s' into a stack. Assume that each input string contains exactly...
Given the language L={w| the number of a’s is greater than or equal to the number...
Given the language L={w| the number of a’s is greater than or equal to the number of b’s in w} a) Using the Pumping Lemma to prove L is not a regular language. b) Using closure property to prove L is not a regular language.
Given a regular language A, define L2 = { xz | there exists y Σ*, xyz...
Given a regular language A, define L2 = { xz | there exists y Σ*, xyz A, |x|=|z|, |y| = 2 }. Decide with a formal proof if L2 is (a) regular; or (b) not regular but context-free; or (c) not context-free.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT