In: Computer Science
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).
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.
======================================================================