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...
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...
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...
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...
1. For a pair of sample x- and y-values, what is the difference between the observed...
1. For a pair of sample x- and y-values, what is the difference between the observed value of y and the predicted value of y? a) An outlier b) The explanatory variable c) A residual d) The response variable 2. Which of the following statements is false: a) The correlation coefficient is unitless. b) A correlation coefficient of 0.62 suggests a stronger correlation than a correlation coefficient of -0.82. c) The correlation coefficient, r, is always between -1 and 1....
**please write code with function definition taking in input and use given variable names** for e.g....
**please write code with function definition taking in input and use given variable names** for e.g. List matchNames(List inputNames, List secRecords) Java or Python Please Note:    * The function is expected to return a STRING_ARRAY.      * The function accepts following parameters:      *  1. STRING_ARRAY inputNames      *  2. STRING_ARRAY secRecords      */ Problem Statement Introduction Imagine you are helping the Security Exchange Commission (SEC) respond to anonymous tips. One of the biggest problems the team faces is handling the transcription of the companies reported...
BridgeRock is a major manufacturer of tires in the U.S.. The company had five manufacturing facilities...
BridgeRock is a major manufacturer of tires in the U.S.. The company had five manufacturing facilities where tires were made and another 20 facilities for various components and materials used in tires. Each manufacturing facility produced 10,000 tires every hour. Quality had always been emphasized at BridgeRock, but lately quality was a bigger issue because of recent fatal accidents involving tires made by other manufacturers due to tread separation. All tire manufacturers were under pressure to ensure problems did not...