Decidable Languages_2_

Document Sample
Decidable Languages_2_ Powered By Docstoc
					Aditya Joshi


    1. Decidable Languages

4.19: Let S = {<M> | M is a DFA that accepts wR whenever it accepts w}. Show that S
is decidable.

Let P = ADFA. We know this to be decidable.

We also know that regular languages are closed under the reverse operation. So, if there is a DFA D for
w, there is a DFA D‟ for wR. We can then construct an NFA N by branching to D and D‟. Since we have
an algorithm to convert NFAs to DFAs, we run it on <N> to get <M>. Now we have a DFA M, and since
ADFA is decidable, there is some S such that S = {<M>}. Since M is a DFA that accepts wR whenever it
accepts w, S = {<M> | M is a DFA that accepts wR whenever it accepts w}, and S is decidable.



*4.25 Let E = {<M> | M is a DFA that accepts some string with more 1s than 0s}. Show that E is
decidable. (Hint: Theorems about CFLs are helpful here.)

Let P = ADFA. We know this to be decidable. Also, let L be the language defined above. It can be defined
as the following CFG.
S  1S0 | 0S1 | 1X
X  1X0 | 0X1 | XX |ε
But M needs to accept a regular language since M is a DFA.
Since the intersection of a regular and a CF Language is regular, the intersection of 1{1,0}* must also be
regular. This new language can be converted to M. So, we can construct a DFA that accepts some string
with more 1s than 0s.

Since P = ADFA is decidable, E is decidable as E accepts if <M> is a DFA that accepts some string with
more 1s than 0s and rejects if not.
Aditya Joshi


3.

5.13 A useless state in a Turing machine is one that is never entered on any input string. Consider the
problem of determining whether a Turing machine has any useless states. Formulate this problem as a
language and show that it is undecidable.

Let us suppose, for contradiction, that this problem is decidable. So, we have a TM U that decides
whether or not a state is useless. Hence, it rejects if there is a useless state and accepts if it does not.

Let us now construct a TM N.

N = “On input <M, w>

        1. Construct a new TM M‟ = „On input x
               a. Ignore x
               b. Run U on <M, Qaccept>
               c. If U accepts, accept.                      //M halts always at Qaccept
                   If U rejects, reject. „                   // M does not always halt at Qaccept
        2. If M‟ accepts, accept
           If M‟ rejects, reject.”

So, N accepts <M, w> only if M always halts at every w (since otherwise there is a useless state Qaccept).
This is ATM. Since we know ATM is undecidable, we have a contradiction.

(b) Let L = {<M> | M is a TM that accepts some string with more 1s than 0}. Show that L is undecidable.

Let us suppose, for contradiction, that L is decidable, then for some M that accepts some string with more
1s than 0s, L accepts. Otherwise it rejects.

Construct a TM S deciding ATM.

S = “On input <M, w>

Construct a TM M‟ = “On input X,

        1. If X = 100, then accept                    // not part of L‟s language
        2. Otherwise, run M‟ on w. Accept if accepts. Reject otherwise.”
     1. Run L on <M‟>.
     2. If L accepts, accept
        Otherwise, reject.”

So, ATM is decidable when we know it is not. Contradiction

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:6
posted:10/26/2011
language:English
pages:2