Question

In: Computer Science

Show that Turing-decidable languages are closed under the following operations: union concatenation star Show that Turing-recognizable...

Show that Turing-decidable languages are closed under the following operations:

  • union

  • concatenation

  • star

Show that Turing-recognizable languages are closed under the following operations:

  • union

  • concatenation

  • star

Each answer needs only be a short informal description of a Turing Machine (but it must still be sufficiently precise so someone could reconstruct a formal machine if needed).

Solutions

Expert Solution

SOLUTION-(1):- In this solution, we will show that Turing-decidable languages are closed under the following operations: union, concatenation, star

For Union operation :  Suppose that L1 and L2 are two decidable languages accepted by halting TMs M1 and M2 respectively. The machine for L1 ∪ L2can be designed as given below :
Given an input x, simulate M1 on x. If M1 will be accepted then accept, else simulate M2 on x. If M2 accepts then accept else reject.

For Concatenation operation : Let K, L be decidable languages. The concatenation operation of languages K and L is the language KL = {xy|x ∈ K and y ∈ L}. Because K and L are decidable languages, so it will follow that there exist turing machines MK and ML that decide the languages K and L respectively. In order to show that KL is decidable, a turing machine can be constructed that decides KL. This machine, MKL can utilize the machines MK and ML to decide if a string is in KL or not. The machine can be constructed as given below:
Lets consider an input string w. We will be required to decide if w is of the form xy for x ∈ K and y ∈ L.If that is the scenario, there must be a place at which we can partition w into x and y. Because there exists only finitely multiple methods to partition the string, we can try all possibilities and accept if there is such a partition and reject otherwise. We will describe a nondeterministic turing machine because it is easier to describe.
(a) On input w, non-deterministically partition w into strings xy.
(b) Input x to MK and y to y on ML.
(c) accept if both MK and ML accept, else reject.
If there exists an accepting computation route, then we have found a successful split and the string is in KL. If all computation routes are reject, then the string is not in KL. In either scenario, it is convenient to see that the machine MKL halts. Therefore, KL is decidable.

For Star operation : A language L, L = {x ∈ L∪LL∪LLL∪· · ·}. i.e. all strings obtained via concatenating L with itself, and so on. For showing that L is decidable, we require to find cuts of the input string w, such that each of them is accepted by the TM ML that decides L. Suppose ML be the machine that that decides L .
(a) On input w : For each way to cut w into parts w1w2 · · · wn
(b) Run ML on wi  for i = 1, · · · , n.
(c) If ML accepts each of the strings wi accept.
(d) If all cuts have been tried without success, reject.

SOLUTION-(2):- In this solution, we will show that Turing-recognizable languages are closed under the following operations: union, concatenation, star

For Union operation : Suppose that L1 and L2 are two Turing-recognizable languages, and suppose M1 and M2 are TMs that recognizes L1 and L2 respectively. We can construct a TM M that recognizes L1 ∪ L2 : On input w,
(a) Run M1 and M2 on w “in parallel”. That is, in each step, M executes one step of M1 and one step of M2.
(b) If either of M1 and M2 accepts, output ACCEPT. If both reject, output REJECT.
If M1 or M2 will accept w, then M will halt and accept w because M1 and M2 are executed in parallel and an accepting TM will halt and accept w in a finite number of steps. If both M1 and M2 will reject w, then M will reject w. If neither M1 nor M2 will accept w and one of them loops on w, then M will loop on w. Therefore, L(M) = L1 ∪ L2, and Turing-recognizable languages are closed under union.

For Concatenation operation :  Suppose that L1 and L2 are two Turing-recognizable languages, and let M1 and M2 be TMs that recognizes L1 and L2 respectively. We can construct a Nondeterministic TM N that recognizes L1 ◦ L2: On input w,
(a) Nondeterministically split w into two parts w = xy.
(b) Execute M1 on x. If it rejects, halt output REJECT. If it accepts, go to Step (c).
(c) Execute M2 on w. If it accepts, output ACCEPT. If it rejects, output REJECT.
If w ∈ L1 ◦ L2 , then there is a method to split w into two parts w = xy such that x ∈ L1 and y ∈ L2, therefore, M1 will halt and accepts x, and M2 will halt and accepts y. So, at least one branch of N will accept w. On the contrary, if w ∉ L1 ◦ L2, then for every possible splitting w = xy, x ∉ L1 or y ∉ L2 , so M1 does not accept x or M2 does not accept y. Therefore, all branches of N will reject w. So, L(N) = L1 ◦ L2 , and Turing-recognizable languages are closed under concatenation.

For Star operation : Let L be a Turing-recognizable languages, and let M be a TM that recognizes L. We can construct a TM M' that recognizes L : On input w,

(a) Nondeterministically select an integer k and split w into k parts w = w1w2 · · · wk.
(b) Run M on each wi . If M accepts all of w1, . . . , wk, output ACCEPT. If M rejects one of w1, . . . , wk, output REJECT.
If w ∈ L , then there exists a splitting of w = w1w2 . . . wk so that wi ∈ L for each i, and thus at least one branch of M' will accept w. On the contrary, if w ∉ L , then for every possible splitting w = w1w2 . . . wk, wi ∉ L for at least one i, therefore all branches of M' will reject w. So, L(M') = L, and Turing-recognizable languages are closed under the star operation.

======================================================================


Related Solutions

Closure under Context-Free Languages Show that the following operations are closed under context-free languages: union concatentation...
Closure under Context-Free Languages Show that the following operations are closed under context-free languages: union concatentation Kleene star
I need a program(code) in any programming language that performs the following operations: union, concatenation and...
I need a program(code) in any programming language that performs the following operations: union, concatenation and conversion DFA-NDFA.
Show that the following language is decidable APDA = { | M is a push down...
Show that the following language is decidable APDA = { | M is a push down automata that accepts string w} Explain your steps.
Use the pumping lemma to show that the following languages are not regular. A a. A1={0^n...
Use the pumping lemma to show that the following languages are not regular. A a. A1={0^n 1^n 2^n | n≥0} b. A2 = {www | w ∈ {a,b}∗} A c. A3 ={a^2^n | n≥0} (Here, a^2^n means a string of 2^n a’s.) A ={a3n |n > 0 }
Use the pumping lemma to show that the following languages are not regular (c) (5 pts)...
Use the pumping lemma to show that the following languages are not regular (c) (5 pts) Let Σ = {0, 1, −, =} and SUB = {x = y − z | x, y, z are binary integers, and x is the result of the subtraction of z from y}. For example: 1 = 1 − 0, 10 = 11 − 01 are strings in SUB but not 1 = 1 − 1 or 11 = 11 − 10.
Show that the following problem i undecidable: Input: A Turing machine M. Output: Yes if M...
Show that the following problem i undecidable: Input: A Turing machine M. Output: Yes if M eventually halts when started on a blank tape, no otherwise Input: A Turing machine M and a tape symbol a. Output: Yes if M eventually writes a when started on an blank tape, no otherwise. Input: A Turing machine M. Output: Yes if M ever writes a nonblank symbol when started on a blank tape, No otherwise. Input: A Turing machine M and a...
Prove the following Closure Properties with respect to Context Free Languages. 1. Show that Context Free...
Prove the following Closure Properties with respect to Context Free Languages. 1. Show that Context Free Languages are Closed under union(∪), concatenation(·), kleene star(*). (Hint: If L1 and L2 are Context Free languages then write Context Free grammar equivalent to L1 ∪ L2, L1 · L2, L∗ 1 ) 2. Show that if L1 and L2 are Context Free Languages, then L1 ∩ L2 is not necessarily Context Free. (Hint: Use Proof by Counter Example)
Which of the following sets are closed under addition? (i) The set of all vectors in...
Which of the following sets are closed under addition? (i) The set of all vectors in R2 of the form (a, b) where b = a2. (ii) The set of all 3 × 3 matrices that have the vector [3 -1 -1]T as an eigenvector. (iii) The set of all polynomials in P2 of the form a0 + a1 x + a2 x2 where a0 = a2. (A) (i) only (B) all of them (C) (ii) only (D) (i) and...
Which of the following sets are closed under addition? (i) The set of all vectors in...
Which of the following sets are closed under addition? (i) The set of all vectors in R2 of the form (a, b) where b = a. (ii) The set of all 3 × 3 matrices that have the vector [-1  3  -3]T as an eigenvector. (iii) The set of all polynomials in P2 of the form a0 + a1 x + a2 x2 where a0 = a22.
Which of the following sets are closed under addition? (i) The set of all vectors in...
Which of the following sets are closed under addition? (i) The set of all vectors in R2 of the form (a, b) where b = a. (ii) The set of all 2 × 2 matrices that have the vector [-2  -3]T as an eigenvector. (iii) The set of all polynomials in P2 of the form a0 + a1 x + a2 x2 where a0 = a22.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT