Question

In: Computer Science

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. (it is a2a1a4a3 not a^2a^1 !!)

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).

Solutions

Expert Solution


Related Solutions

Let L be the set of all languages over alphabet {0}. Show that L is uncountable,...
Let L be the set of all languages over alphabet {0}. Show that L is uncountable, using a proof by diagonalization.
Assume that an operation * is defined as follows: x * y = x' + y...
Assume that an operation * is defined as follows: x * y = x' + y Using Boolean algebra theorems and postulates (don’t use K-maps), check whether the operation * is associative or not?
An operation * is defined for two-valued variables a and b as follows: a*b = ab+a’b’
An operation * is defined for two-valued variables a and b as follows:     a*b = ab+a’b’Let c = a*b. Determine which of the following identities are valid:a = b*ca*(bc) =1
Let M be defined as follows M = (K, Σ, s, ∆, F ) for K...
Let M be defined as follows M = (K, Σ, s, ∆, F ) for K = {q0, q1, q2, q3, }, s = q0, Σ = {a, b, c}, F = {q0, q2, q3} and ∆ = {(q0, abc, q0), (q0, a, q1), (q0, e, q3), (q1, bc, q1), (q1, b, q2), (q2, a, q2), (q2, b, q3), (q3, a, q3)}. 1. (1pts) Draw the diagram of M 2. (6pts ) DRAW a diagram of an automata M0 such...
Given an alphabet Σ, what are the languages L over Σ for which L ∗ is...
Given an alphabet Σ, what are the languages L over Σ for which L ∗ is finite? How many such languages exist?
let sigma = {a,b,c}. Use the Pumping Lemma to show that the language L defined below...
let sigma = {a,b,c}. Use the Pumping Lemma to show that the language L defined below is not regular. L={ a^p c(bb)^q : q > p >1}
Let D(x, y) be the predicate defined on natural numbers x and y as follows: D(x,...
Let D(x, y) be the predicate defined on natural numbers x and y as follows: D(x, y) is true whenever y divides x, otherwise it is false. Additionally, D(x, 0) is false no matter what x is (since dividing by zero is a no-no!). Let P(x) be the predicate defined on natural numbers that is true if and only if x is a prime number. 1. Write P(x) as a predicate formula involving quantifiers, logical connectives, and the predicate D(x,...
1. Average Cost for Producing Microwaves Let the total cost function C(x) be defined as follows....
1. Average Cost for Producing Microwaves Let the total cost function C(x) be defined as follows. C(x) = 0.0003x3 − 0.02x2 + 103x + 3,600 Find the average cost function C. C(x) = Find the marginal average cost function C '. C '(x) = 2. Marginal Revenue for Producing Loudspeakers The management of Acrosonic plans to market the ElectroStat, an electrostatic speaker system. The marketing department has determined that the demand for these speakers is represented by the following function,...
Let a < c < b, and let f be defined on [a,b]. Show that f...
Let a < c < b, and let f be defined on [a,b]. Show that f ∈ R[a,b] if and only if f ∈ R[a, c] and f ∈ R[c, b]. Moreover, Integral a,b f = integral a,c f + integral c,b f .
Let G be a group with the binary operation of juxtaposition and identity e. Let H...
Let G be a group with the binary operation of juxtaposition and identity e. Let H be a subgroup of G. (a) (4 points) Prove that a binary relation on G defined by a ∼ b if and only if a−1b ∈ H, is an equivalence. (b) (3 points) For all a ∈ G, denote by [a] the equivalence class of a with respect to ∼ . Prove that [a] = {ah|h ∈ H}. We write [a] = aH and...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT