Question

Let swap_every_two be an operation on languages that is defined as follows: swap_every_two(L) = {a2a1a4a3 ....

Let swap_every_two be an operation on languages that is defined as follows:

swap_every_two(L) = {a2a1a4a3 . . . a2na2n−1 | a1a2a3a4 . . . a2n−1a2n ∈ L where a1, . . . , a2n ∈ Σ} In this definition, Σ is the alphabet for the language L.

1. What languages result from applying swap every two to the following languages:

(a) {1 n | n ≥ 0}, where the alphabet is {1}.

(b) {(01)n | n ≥ 0}, where the alphabet is {0, 1}.

2. Show that if L is a regular language then so it swap every two(L).

below is a hint Hint: Try to construct an automaton accepting swap every two(L) from a DFA accepting L. The automaton you construct should conceptually process the input symbols in pairs, using its finite control to somehow remember the first symbol of the pair. If you use such a “proof-by-construction” approach, you should define the automaton formally and provide a brief, informal argument to show that your automaton accepts swap every two(L).

plz provide full detail! this assignment is very important for me

Homework Answers

Answer #1

1 (a) The language given is , and the operation swap_every_two is to be applied to L. According to the definition of the operation swap_every_two, for every string , swap_every_two(L) should contain the strings . So, this would mean that swap_every_two(L) should be formed by swapping the alternate symbols of all strings of even length in L. However, for the given language, swapping the alternate symbols should result in the same string. Thus, it would contain all the even length strings in L, which can be written as:

(b) The language given is . On applying the operation swap_every_two to L, the strings obtained by swapping alternate symbols of each member of L should be returned. So, each must be replaced with a . Hence, the language returned by the operation is:

2. The following is a procedure to construct a N.F.A. for the language swap_every_two(L) where L is a regular language:

  • Construct the D.F.A. which recognises L.
  • Construct a new D.F.A. where the alphabet is the Cartesian product of the alphabet of M with itself.
  • The transition function for is which is defined as follows:
    For and , .
  • Construct a new N.F.A. where .
  • The transition function for is which is defined as follows:
    For and , and .
  • is the required N.F.A.

The D.F.A. is constructed by taking pairs of symbols and leading to the state where the automata would have reached if the symbols were provided individually. The N.F.A. is constructed by adding dummy states corresponding to each state where for individually processing the pair of symbols. The order of processing is reversed. So, the N.F.A. recognises the language swap_every_two(L) which makes it a regular language.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Automata Theory and Formal Languages Instructions: Draw the DFA (Deterministic Finite Automaton) of the following: DFA...
Automata Theory and Formal Languages Instructions: Draw the DFA (Deterministic Finite Automaton) of the following: DFA in which start and end symbol must be different Design a DFA in which start and end symbol must be same DFA in which every 'a' should be followed by 'b' DFA in which every 'a' should never followed by 'b' DFA in which every 'a' should followed by 'bb' DFA in which every 'a' should never followed by 'bb' DFA for anbm| n,m...
Each of the following languages is the union or intersection of two simpler languages. In each...
Each of the following languages is the union or intersection of two simpler languages. In each part, construct DFAs for the simpler languages, then combine them using the construction discussed in class to give the state diagram of a DFA for the language given. In all parts, Σ = {0,1}. 1. {w|w starts with an 0 and has at most one 1}
Are the following languages over {a, b} regular? If they are then prove it. If they...
Are the following languages over {a, b} regular? If they are then prove it. If they are not prove it with the Pumping Lemma {an bm | m != n, n >= 0} {w | w contains the substring ‘aaa’ once and only once } Clear concise details please, if the language is regular, provide a DFA/NFA along with the regular expression. Thank you. Will +1
Provide direct answers. This question has been posted here by someone else before, but the answer...
Provide direct answers. This question has been posted here by someone else before, but the answer is unreadable and does not indicate clearly the answer. DO C. Let Lodd = {w ∈ {0, 1}∗ | w contains an odd number of 0s}. a) - What is L∗odd? (arrive at a direct description of this language that does not refer to Lodd). b) Then Start with a DFA recognizing Lodd, and use the construction we saw in class to obtain an...
Provide direct answers. This question has been posted here by someone else before, but the answer...
Provide direct answers. This question has been posted here by someone else before, but the answer is unreadable and does not indicate clearly the answer. DO A. Let Lodd = {w ∈ {0, 1}∗ | w contains an odd number of 0s}. a) - What is L∗odd? (arrive at a direct description of this language that does not refer to Lodd). b) Then Start with a DFA recognizing Lodd, and use the construction we saw in class to obtain an...
Let S denote the set of all possible finite binary strings, i.e. strings of finite length...
Let S denote the set of all possible finite binary strings, i.e. strings of finite length made up of only 0s and 1s, and no other characters. E.g., 010100100001 is a finite binary string but 100ff101 is not because it contains characters other than 0, 1. a. Give an informal proof arguing why this set should be countable. Even though the language of your proof can be informal, it must clearly explain the reasons why you think the set should...
Automata Theory and Formal Languages Problems 1: Consider the following two grammars. Grammar G1- S →...
Automata Theory and Formal Languages Problems 1: Consider the following two grammars. Grammar G1- S → aSb / ∈ Grammar G2- S → aAb / ∈, A → aAb / ∈ a. is G1=G2 b. What is the grammar generated by the expression Problem 2: Let us consider the grammar. G2 = ({S, A}, {a, b}, S, {S → aAb, aA → aaAb, A → ε } ) Derive aaabbb Problem 3: Suppose we have the following grammar. G: N...
1. Given β = XT 1×nAn×nXn×1, show that the gradient of β with respect to X...
1. Given β = XT 1×nAn×nXn×1, show that the gradient of β with respect to X has the following form: ∇β = X T (A + A T ). Also, simplify the above result when A is symmetric. (Hint: β can be written as Pn j=1 Pn i=1 aijxixj ). 2. In this problem, we consider a probabilistic view of linear regression y (i) = θ T x (i)+ (i) , i = 1, . . . , n, which...
Let x be a random variable that represents micrograms of lead per liter of water (µg/L)....
Let x be a random variable that represents micrograms of lead per liter of water (µg/L). An industrial plant discharges water into a creek. The Environmental Protection Agency (EPA) has studied the discharged water and found x to have a normal distribution, with σ = 0.7 µg/L. † Note: For degrees of freedom d.f. not in the Student's t table, use the closest d.f. that is smaller. In some situations, this choice of d.f. may increase the P-value a small...
1. Usain Bolt sprints along the track, with his feet pushing down and behind him. Therefore...
1. Usain Bolt sprints along the track, with his feet pushing down and behind him. Therefore the track actually pushes Usain Bolt along the track. Group of answer choices True or False 2.You study two objects in motion, Object J and Object S. Each object has its own velocity graph, with same time and velocity scales. The slope of each graph is positive, upward and to the right  ⁄ but Object J's tilt angle is only 10º and Object S's tilt...