20
DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI Department of Computer Science and Engineering CS6503 Theory of Computation Question Bank 2 Mark Questions & Answers Year / Semester: III / V Regulation: 2013 Academic year: 2016 - 2017 Prepared by, Ms. S.Anusha, AP/CSE Ms.M.Kalaivani, AP/CSE

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI · DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI ... CS6503 – Theory of Computation Question Bank ... What are the applications of automata

  • Upload
    phamdan

  • View
    226

  • Download
    9

Embed Size (px)

Citation preview

DHANALAKSHMI COLLEGE OF ENGINEERING,

CHENNAI

Department of Computer Science and Engineering

CS6503 – Theory of Computation

Question Bank – 2 Mark Questions & Answers

Year / Semester: III / V

Regulation: 2013

Academic year: 2016 - 2017

Prepared by,

Ms. S.Anusha, AP/CSE

Ms.M.Kalaivani, AP/CSE

UNIT I

AUTOMATA

1. List out the four ways of theorem proving. The four ways of theorem proving are: 1. Deductive 2. If and only if 3. Induction 4. Proof by contradiction

2. What is deductive proof? A deductive proof consists of a sequence of statements, which starts from a

hypothesis, or a given statement to a conclusion. Each step is satisfying some logical

principle.

3. Differentiate NFA from DFA. (N/D-12, M/J-12, N/D-11) Non Deterministic Finite Automaton is the one in which there exists many paths for a

specific input from current state to next state. NFA can be used in theory of computation

because they are more flexible and easier to use than DFA. Deterministic Finite Automaton is a FA in which there is only one path for a specific

input from current state to next state. There is a unique transition on each input symbol.

4. What is a Non Deterministic Finite Automaton? (N/D-13)

Non Deterministic Finite Automaton is the one in which there exists many paths for a

specific input from current state to next state. NFA can be used in theory of computation

because they are more flexible and easier to use than DFA.

5. Write a short note on minimization of DFA. Minimization of DFA reduces the number of states from given FA. First find out

which two states are equivalent and then those two states are to be replaced by one

representative state. For finding the equivalent states, the rule applied is that “The two

states S1 & S2 are equivalent if and only if both the states are final or non-final states”.

6. Prove 1+2+3+…+n = n (n + 1) / 2 using induction method. Consider the two step approach for a proof by method of induction

1. Basis of induction: Let n = 1 then LHS = 1 and RHS = 1 + 1 / 2 = 1 Hence, LHS = RHS.

2. Induction hypothesis: To prove 1 + 2 + 3 +… + n = n ( n + 1 ) / 2 + ( n + 1

) Consider n = n + 1 then, 1 + 2 + 3+…+ n + ( n + 1 ) = n ( n + 1 ) / 2 + ( n + 1 )

= n2 + 3n + 2 / 2

= ( n + 1 ) ( n + 2 ) / 2 Thus it is proved that 1 + 2 + 3+ … + n = n (n + 1 ) / 2.

7. Define − Finite Automaton (N/D-12) FA consists of a finite set of states and a set of transitions from state to state that occur on

input symbols chosen from an alphabet Σ. Finite Automaton is denoted by a 5- tuple (Q, Σ, δ,

q0, F), where Q is the finite set of states, Σ is a finite input alphabet, q0 in Q is the initial state,

F is the set of final states and δ is the transition mapping function Q * Σ to

Q.

8. Define − Transition Diagram (N/D-12) Transition diagram is a directed graph in which the vertices of the graph correspond

to the states of FA. If there is a transition from state q to state p on input a, then there is an

arc labelled ‘a’ from q to p in the transition diagram.

9. What are the applications of automata theory? The applications of automata theory are as follows: 1. In compiler construction 2. In switching theory and design of digital circuits 3. To verify the correctness of a program 4. Design and analysis of complex software and hardware systems 5. To design finite state machines such as Moore and Mealy machines

10. What is a string? A string x is accepted by a Finite Automaton M = (Q, Σ, δ.q0,F) if δ (q0,x)=p, for

some p in F.FA accepts a string x if the sequence of transitions corresponding to the

symbols of x leads from the start state to accepting state.

11. List out the operations on strings. The various operations performed on strings are: 1. Length of a string 2. Empty string 3. Concatenation of string 4. Reverse of a string 5. Power of an alphabet 6. Kleene closure 7. Substring 8. Palindrome

12. What are the components of finite automaton model? The components of FA model are input tape, read control and finite control. 1. The input tape is divided into number of cells. Each cell can hold one i/p symbol. 2. The read head reads one symbol at a time and moves ahead. 3. Finite control acts like a CPU. Depending on the current state and input symbol

read from the input tape it changes state.

13. List out the applications for finite automaton.

Text editors and lexical analyzers are designed as finite state systems. A lexical

analyzer scans the symbols of a program to locate strings corresponding to identifiers,

constants etc, and it has to remember limited amount of information.

14. What are the properties of transition function (δ)? The properties of transition function are as follows: 1. δ(q.ε )=q

2. For all strings w and input symbol a Δ(q, aw)= δ(δ(q.a), w)

Δ(q, wa)= δ(δ(q, w).a) 3. The transition function δ can be extended that operates on states and

strings.

15. Lists out the operations on Languages.

The operations permitted on languages are: 1. Product 2. Reversal 3. Power 4. Kleene star 5. Kleene plus 6. Union 7. Intersection

16. Define - Substring A string v appears within another string w (w = uv) is called “substring of w”. If w =

uv, then substrings u & v are said to be prefix and suffix of w respectively.

17. Define TOC

Theory of Computation is the branch that deals with how efficiently problems can be

solved on a model of computation, using an algorithm. The field is divided into three

major branches: automata theory, computability theory, and computational complexity

theory.

18. Why switching circuits are called as finite state systems? A switching circuit consists of a finite number of gates, each of which can be in any

one of the two conditions 0 or 1. Although the voltages assume infinite set of values, the

electronic circuitry is designed so that the voltages corresponding to 0 or 1 are stable and

all others adjust to these values. Thus control unit of a computer is a finite state system.

19. What is Moore machine and Mealy machine? A special case of FA is Moore machine in which the output depends on the state of

the machine. An automaton in which the output depends on the transition and current

input is called Mealy machine.

20. Construct deterministic FA to recognize odd number of 1’s and even number of 0’s.

(A/M-10) Solution

The initial state is q0, and the final state is q1. Let us see how this diagram has been

constructed. Consider the paths from q0 to q1 without loops (cycles). If you go to the

right, (q0,q1) this path has odd number of 1's (exactly one ‘1’). And even number of 0's

(zero b's). If you go to the left (q0,q2,q3,q1) this path has odd number of 1's (q2,q3) and

even number of 0's ((q0,q2) and (q3,q1)). If you go back and forth, you will make

cycles, and each cycle in this diagram gives even number of 1's and even number of 0's.

You know that when an even number is added to an odd number the result is an odd

number. Also, when an even number is added to an even number, the result is an even

number. Thus, this FSA recognizes strings than have odd number of 0's and even

number of 1's.

21. Define – Graph A graph is denoted by G = (V, E) consists of a finite set of vertices (or) nodes V and

a set E, a pair of vertices called edges.

22. What is meant by DFA? (M/J-13)

Deterministic Finite Automaton (DFA) also known as deterministic finite state machine is a finite state machine that accepts/rejects finite strings of symbols and only

produces a unique computation (or run) of the automaton for each input string.

'Deterministic' refers to the uniqueness of the computation.

23. What is regular language? The language accepted by M is L(M) is the set {x | δ(q0,x) is in F}. A language

is regular if it is accepted by some finite automaton.

26. What is ε-closure of state q0?

ε-closure (q0) denotes a set of all vertices p such that there is a path from q0 to p

labeled ε. Example: closure (q0) = {q0, q1}.

65

UNIT II

CONTEXT FREE GRAMMAR

1. Write the regular expression for “set of all strings with even length”. (N/D-12, N/D-10)

The regular expression for “set of all strings with even length” is R = (11)*.

2. What is a regular expression? (M/J-13) A regular expression is a string that describes the whole set of strings according to

certain syntax rules. These expressions are used by many text editors and utilities to search

bodies of text for certain patterns etc. Definition: Let Σ be an alphabet. The regular expression over Σ and the sets they denote

are: 1. Ф is a r.e and denotes empty set 2. є is a r.e and denotes the set { є } 3. For each ‘a’ in Σ, a

+ is a r.e and denotes the set {a}

4. If ‘r’ and ‘s’ are r.e denoting the languages R and S respectively the (r+s), (rs)

and (r*) are r.e that denote the sets RUS, RS and R* respectively

3. If L = {The language starting and ending with ‘a’ and having any combinations of

‘b’ in between}, then what will be the regular expression?

The regular expression is written as r = a b*a.

4. Write the regular expression for the language that accepts all strings in which

‘a’ appears tripled over the set ∑ = {a}.

The regular expression is written as r = (aaa)*.

5. Write the regular expression for the language in which every string will have at least

one ‘a’ followed by at least one ‘b’. The regular expression for the language in which every string will have at least one

‘a’ followed by atleast one ‘b’ is given as: R=a+b

+.

6. Construct a regular expression for the language over the set Σ = {a, b} in which total

numbers of ‘a’ are divisible by 3. The regular expression is (b* a b* a b* a b*)*.

7. Write the regular expression to denote language L which accepts all the strings

that begins or ends with either 00 or 11. The regular expression consists of two parts: L1 = (00+11) (any no of 0’s and 1’s) =(00+11)(0+1)*

L2 = (any no of 0’s and 1’s)(00+11) =(0+1)*(00+11)

Hence, regular expression R=L1+L2 =[(00+11)(0+1)*] + [(0+1)* (00+11)].

8. Write regular expressions for the following L1 = set of all strings of 0 and 1 ending in 00.

L2 = set of all strings of 0 and 1 beginning with 1 and ending with 0. (N/D-12) The regular expressions are:

L1 = (0+1)*0 L2 = 1(0+1)*0

9. What is the relationship between FA and regular expression? (A/M-10) The relationship between FA and regular expression is shown below

10. What are the applications of regular expressions and finite automata? Lexical analyzers and Text editors are the two applications. 1. Lexical analyzers

The tokens of the programming language can be expressed using regular

expressions. The lexical analyzer scans the input program and separates the tokens.

For example, identifier can be expressed as a regular expression as: (letter) (letter +

digit)*. If anything in the source language matches with this regular expression

then it is recognized as an identifier. The letter is {A, B, C,…Z, a, b, c, … z} and

digit is {0,1,…9}.Thus regular expression identifies token in a language. 2. Text editors

These are programs used for processing the text. For example, a UNIX text

editor uses the regular expression for substituting the strings such as: S/bbb*/b/. It

substitutes a single blank for the first string of two or more blanks in a given line. In UNIX text editors any regular expression is converted to an NFA with Є

transitions, this NFA can be then simulated directly.

11. List out the methods that are used for converting DFA to RE. The three methods are: 1. Regular Expression Equation Method 2. Arden’s Theorem 3. State Elimination Technique

12. State Arden’s theorem. Arden’s theorem helps in checking the equivalence of two regular expressions. Let P

and Q be the two regular expressions over the input alphabet Σ. The regular expression

R is given as: R=Q+RP which has a unique solution as R=QP*.

13. What is dead state? All the non final states which transmit to itself for all input symbols in Σ are called

dead state.

14. Let R be any set of regular languages. Is UR regular? Prove it. Yes, UR is regular. Let P, Q be any two regular languages. As per

theorem L(R) = L (P UQ) = L (P+Q)

Since ‘+’ is a operator for regular expressions L(R) is also regular.

15. What is pumping lemma? (N/D-13) Let L be a regular language. Then there exists a constant n such that for every string

w in L such that |w| ≥ n, w = xyz such that: 1. y ≠ ε 2. |xy| ≤ n

3. For all i ≥ 0, xyiz Σ L

16. What is the use of pumping lemma? Pumping lemma is used to check if a language is regular or not. The steps are as

follows: 1. Assume that the language (L) is regular 2. Select a constant ‘n’ 3. Select a string (z) in L, such that |z|>n 4. Split the word z into u, v and w such that |uv|<=n and |v|>=1 5. A contradiction to pumping lemma is achieved that there exists an ‘i’

Such that uviw is not in L.

17. List the closure properties of regular language. (A/M-10, A/M-11, M/J-13) The regular languages are closed under the following properties: 1. Union 2. Intersection 3. Complement 4. Difference 5. Reversal 6. Closure 7. Concatenation 8. Homomorphism 9. Inverse Homomorphism

18. Prove that (0 * 1*) * = (0 + 1)*. LHS: (0*1*)* = { ε, 0,1, 00, 11, 0011, 011, 0011110…} RHS: (0+1)* = { ε, 0,1,00,11,0011,011,0011110…} Hence LHS = RHS is proved

19. Prove that (r*)* = r

* for a regular expression r.

Solution: (r*)*== {ε, r, rr, …} = r

*

20. Differentiate L* from L+.

∞ L

i

L* denotes Kleene closure and is given by L* = i0

Example: 0* ={ ε, 0, 00, 000,…}

Language also includes the empty words. ∞ L

i

L+ denotes Positive closure and is given by L

+ =

i1 Example: 0

+ = {0, 00, 000,…}

21. What is the closure property of regular set?

The regular sets are closed under union, concatenation and Kleene closure.

r1Ur2= r1 +r2 r1.r2= r1r2

( r )*=r* The class of regular sets is closed under complementation, substitution, homomorphism

and inverse homomorphism.

UNIT III

PUSHDOWN AUTOMATA

1. What are the uses of context free grammar? (M/J-12) The uses of context free grammar are as follows: 1. Construction of compilers

2. Simplified the definition of programming languages

3. Describes the arithmetic expressions with arbitrary nesting of balanced parenthesis

{(,)}

4. Describes block structure in programming languages

5. Model neural nets

2. Define − Context Free Grammar (M/J-13) A Context Free Grammar (CFG) is denoted as G = (V, T, P, S) where V and T are

finite set of variables and terminals respectively. V and T are disjoint. P is a finite set of

productions each is of the form A->α where A is a variable and α is a string of symbols

from (V U T)*

3. What are the applications of context free languages? Context free languages are used in: 1. Defining programming languages

2. Formalizing the notion of parsing

3. Translation of programming languages

4. String processing applications

4. List out the ways to simplify the context free grammar. The three ways of simplifying a context free grammar are: 1. Removing the useless symbols from the set of productions

2. By eliminating the empty productions

3. By eliminating the unit productions

5. What are the properties of the CFL generated by CFG? The properties are: 1. Each variable and each terminal of G appears in the derivation of some word in L 2. Here are no productions of the form A->B where A and B are variables

6. What is sentential form? A string of terminals and variables α is called a sentential form if: S => α, where S is

the start symbol of the grammar.

7. Differentiate sentences from sentential forms.

A sentence is a string of terminal symbols. A sentential form is a string containing a mix of variables and terminal symbols or

all variables. This is an intermediate form in doing a derivation.

8. If S->aSb | aAb, A->bAa, A->ba then determine CFL. Solution: S->aAb=>abab S->aSb=>a aAb b =>a a ba b b(sub S->aAb) S->aSb =>a aSb b =>a a aAb b b=>a a a ba b bb

Thus L={anb

ma

mb

n, where n,m>=1}

9. Construct CFG without Є production from: S →a | Ab | aBa, A →b | Є, B →b | A. Solution: S-

>a S-

>Ab S-

>aBa

A->b

A->Є

B->b B->A are the given set of production.

10. Determine CFG with no useless symbols equivalent to: S→AB | CA, B→BC | AB,

A→a, C→aB | b. Solution:

S-> B

S->CA

B->BC

B->AB

A->a

C->aB C->b are the given productions.

A symbol X is useful if S => αXβ => w The variable B cannot generate terminals as B->BC and B->AB. Hence B is useless

symbol and remove B from all productions. The useful productions are: S->CA, A->a,

C->b.

11. Construct a grammar for the language L which has all the strings that are all

palindrome over Σ = {a, b}.

Solution: G = ({S}, {a, b}, P, S) P: {S -> aSa, S-> b S b, S-> a, S->b, S->Є} which is in palindrome.

12. Define − Derivation Tree for CFG

A derivation tree for a CFG G = (V, T, P, S) is a tree satisfying the following: 1. Every vertex has a label, which is a symbol of V U T U ε 2. The label of the root is S 3. If a vertex is interior and has a label A, then A must be in V 4. If n has a label A and vertices n1, n2,… nk are sons of the vertex n, in

x1,x2,……xk must be a production in P

13. Draw the derivation tree for the grammar G = ({S, A, B}, {a, b}, P, S}) Where P is

given by S -> Aa / bB , A ->ab, B ->aBb / a Solution:

S S

B A (or) b B

a b a

B b

b

14. Define − Parse Tree A data structure that represents the source program in a complier is called parse tree.

Parse tree can have nodes and edges.

15. What is an ambiguous grammar? (M/J-13, M/J-12, N/D-12, N/D-11, N/D-10) A grammar is said to be ambiguous if it has more than one derivation tree for a

sentence or in other words if it has more than one leftmost derivation or more than one

rightmost derivation. 16. What is the language generated by CFG or G?

The language generated by G ( L(G) ) is {w | w is in T* and Sw. That is a G

string is in L(G) if: G

1. The string consists solely of terminals

2. The string can be derived from S.

17. Define − Pushdown Automata (A/M-10)

A pushdown Automata M is a system (Q, Σ, Ґ, δ, q0, Z0, F) Q is a finite set of states. Σ is an alphabet called the input alphabet. Ґ is an alphabet called stack alphabet.

q0 in Q is called initial state. Zo in Ґ is start symbol in stack. F is the set of final states.

is a mapping from Q X ( Σ U {Є} ) X Ґ to finite subsets of Q X Ґ*.

18. Define − Instantaneous Description (ID) in PDA (N/D-09)

ID describe the configuration of a PDA at a given instant. ID is a triple such as (q, w ,γ ) , where q is a state , w is a string of input symbols and γ is a string of stack symbols.

If M =( Q, Σ ,Ґ ,δ ,q0 ,Z0 ,F ) is a PDA we say that (q, aw, Zα) | -----( p, , βα) if δ(q, a, Z) contains (p, β ).

In M ‘a’ may be Є or an input symbol. Example: (q1, BG) is in δ (q1, 0) else that (q1,

011, GGR )|---- ( q1, 11, BGGR).

19. What is the significance of PDA? PDA is used to model the context of the language and where the Finite Automata is

used to model regular expression.

20. When is a string accepted by a PDA?

The input string is accepted by the PDA if: 1. The final state is reached

2. The stack is empty

21. Is NPDA (Nondeterministic PDA) and DPDA (Deterministic PDA equivalent)? (A/M-11)

The languages accepted by NPDA and DPDA are not equivalent. For example, wwR

is accepted by NPDA and not by any DPDA.

22. Define − Deterministic PDA A PDA M =( Q, Σ ,Ґ ,δ ,q0 ,Z0 ,F ) is deterministic if:

1. For each q in Q and Z in Ґ , whenever δ(q,Є,Z) is nonempty then δ(q,a,Z) is

empty for all a in Σ 2. For no q in Q, Z in Ґ , and a in Σ U { Є} does δ(q,a,Z) contains more than one

element. (Eg): The PDA accepting {wcw R | w in ( 0+1 ) * }

23. Write the equivalence of acceptance by final state and empty stack.

The equivalence of acceptance by final state and empty stack is as follows: 1. If L = L(M2) for some PDA M2, then L = N(M1) for some PDA M1

2. If L = N(M1) for some PDA M1, then L = L(M2 ) for some PDA M2

Where L(M) = language accepted by PDA by reaching a final state N(M) = language accepted by PDA by empty stack

24. Prove that the NDPA is more powerful than that of DPDA? No, NPDA is not powerful than DPDA. Because NPDA may produce ambiguous

grammar by reaching its final state or by emptying its stack. But DPDA produces only

unambiguous grammar.

25. What is the language generated by the grammar G = (V, T, P, S) where P={S->aSb,

S->ab}?

S=> aSb => aaSbb =>… =>anb

n

Thus the language L(G)={ anb

n | n>=1}.The language has strings with equal number of

a’s and b’s.

UNIT IV

TURING MACHINES

1. What is CNF? (M/J-12) In formal language theory, a CFG is said to be in Chomsky Normal Form if all of its

production rules are of the form: A BC or

A α or

S є where A, B and C are non terminal symbol, α is a terminal symbol, S is the

start symbol, є is the empty string.

2. What is multiple tracks Turing machine? A Turing Machine in which the input tape is divided into multiple tracks where each

track is having different inputs is called multiple tracks Turing machine.

3. What is a multidimensional Turing machine?

The Turing Machine which has the useful finite control consists of a k-dimensional

array of cells in all 2K directions for some fixed K in a tape cell. Depending on the state

and symbol scanned, the device changes state, prints a new symbol and moves its tape

head in one of 2K directions, along one of the K axes.

4. How is context-free grammar simplified? The steps for simplifying the context free grammar are as follows: 1. First eliminate useless symbols, where the variable or terminals that do not appear

in any derivation of a terminal string from the start symbol 2. Next eliminate ε- productions which are of the form A-> ε for some variable A 3. Eliminate unit productions, which are of the form A -> B for variables A, B 4. Finally use any of the normal forms to get the simplified CFG

5. What is useless symbol? A symbol x is useful if there is a derivation S=>* α x β =>* w for some α, β, w Σ T*

or else, it is said to be useless symbol. 6. Define − Nullable Variable

Nullable variable in a CFG G = (V,T,P,S) can be defined as follows: 1. Any variable A for which P contains the production A A, is nullable 2. If P contains the production A B1,B2, ……. Bn and B1, B2, ….Bn are nullable

variables, then A is nullable 3. No other variables in V are nullable

7. What is a generating symbol? Let G = (V, T, P, S) is generating, if X => * w for some terminal string w.

For example, A-> aAB / ε and B-> b Then A is a generating symbol since A => *ab

8. What is GNF? (M/J-13) A CFG is in GNF if the right hand sides of all productions rules start with a terminal

symbol, optionally followed by some variables. Context-Free Grammar is in Greibach

Normal Form, if all production rules are of the form: A αA1A2….Anwhere A is a non-terminal symbol, is a terminal symbol,

A1A2….An is a sequence of non-terminal symbols not including the start symbol, S is the

start symbol, and ε is the empty word.

9. What is parser?

A parser for grammar G is a program that takes as input a string w and produces as output either a parse tree for w, if w is a sentence of G or an error message indicating that

w is not a sentence of G.

10. What are the closure properties of CFL? (N/D-11, N/D-10, M/J-12, N/D-13, M/J-13)

1. CFL are closed under union, concatenation and Kleene closure.

2. CFL are closed under substitution and homomorphism.

3. CFL are not closed under intersection and complementation.

4. Closure properties of CFL’s are used to prove that certain languages are not

context free.

11. What is substitution rule?

A production A x1Bx2 can be eliminated from a grammar if B is replaced by all

strings derived by B in one step, provided A and B are variables.

12. What is total recursive function?

If f (i1, i2, … ik) is defined for all i1,… ik then we say f is a total recursive function.

They are similar to recursive languages as they are computed by TM that always halts.

13. What is partial recursive function?

A function f (i1,…ik) computed by a Turing machine is called a partial recursive

function. They are similar to regular expression languages as they are computed by TM

that may or may not halt on a given input.

14. Define − Turing Machine (N/D-12, N/D-10) A Turing machine is denoted as M = (Q, Σ, Ґ, δ, q0, B, F) Q is a finite set of states. Σ is set of i/p symbols, not including

B. Ґ is the finite set of tape symbols. q0 in Q is called start state. B in Ґ is blank symbol. F is the set of final states.

is a mapping from Q X Ґ to Q X Ґ X {L, R}.

15. What is a Turning Machine? A finite state machine with storage is called as Turing Machine. Turing machine is a

simple mathematical model of a computer. TM has unlimited and unrestricted memory

and is a much more accurate model of a general purpose computer. The Turing machine

is a FA with an R/W Head. It has an infinite tape divided into cells, each cell holding one

symbol.

16. What are the special features of TM? In one move, TM depending upon the symbol scanned by the tape head and state of

the finite control listed as below: 1. Changes state 2. Prints a symbol on the scanned tape cell 3. Moves the R/w head left or right

17. Differentiate 2-way FA from TM. Turing machine can change symbols on its tape, whereas the FA cannot change

symbols on tape. Also TM has a tape head that moves both left and right side, whereas

the FA doesn’t have such a tape head.

18. Define − Instantaneous Description of TM The ID of a Turing Machine M is denoted as α1q α2. Here q is the current state of M

s in Q; α1 α2 is the string in Ґ * that is the contents of the tape up to the rightmost

nonblank symbol or the symbol to the left of the head, whichever is the rightmost. 19. What are the applications of TM?

TM can be used as: 1. Recognizers of languages 2. Computers of functions on non negative integers 3. Generating devices

20. What is off-line Turing machine? An Off-line Turing Machine is a multitape TM whose input tape is read only. The

Turing Machine is not allowed to move the input tape head off the region between left

and right end markers.

21. When is a function f said to be Turing computable? (N/D-09)

A Turing Machine defines a function y = f(x) for strings x,y *, if q0 x |--* qfy. A

function f is ‘Turing Computable’ if there exists a Turing Machine that performs a

specific function.

UNIT V

UNSOLVABLE PROBLEMS AND COMPUTABLE FUNCTIONS

1. When is recursively enumerable language said to be recursive? Is it true that the

language accepted by non-deterministic Turing machine different from recursively

enumerable language? (N/D-12) A language L is recursively enumerable if there is a TM that accepts L and recursive

if there is a TM that recognizes L. Thus regular expression language is Turing acceptable

and recursive language is Turing decidable languages. No, the language accepted by non-deterministic Turing machine is same as

recursively enumerable language.

2. What is recursively enumerable language? (M/J-13, N/D-12, M/J-12, N/D-10, N/D-09)

A language is recursively enumerable if there exists a Turing Machine that accepts

every string of the language and does not accept strings that are not in the language.

3. Define − Decidability (Or) What is decidable problem? (M/J-12, N/D-10)

A problem is said to be decidable if there exists a Turing machine which gives one

‘yes’ or ‘no’ answer for every input in the language. (or)

A problem is said to be decidable if it is a recursive language.

4. Define Problem Solvable in Polynomial Time A Turing Machine M is said to be of time complexity T(n) if whenever m given an

input w of length n, m halts after making at most T(n) moves, regardless of whether or not m accepts.

5. Define − MPCP or Modified PCP. The MPCP is: Given lists A and B of K strings from ∑*, say A = w1 ,w2, …wk and

B= x1, x2,…..xk does there exists a sequence of integers i1,i2,…ir such that wi1wi2 ...wim = xi1xi2…xir.

6. When a problem is said to be undecidable? (N/D-12)

If a problem is not a recursive language, then it is said to be undecidable problem.

7. When a language is said to be recursive? A language L is said to be recursive if there exists a Turing machine M that accepts L,

and goes to halt state or else M rejects L.

8. Write examples of recursive languages?

The examples of recursive languages are given below: 1. The language L defined as L= { “M” ,”w” : M is a DFSM that accepts w} is

Recursive 2. L defined as {“M1” U “M2” : DFSMs M1 and M2 and L(M1) = L(M2) } is

Recursive

9. What is diagonalization language? The language Ld Which consists of all those strings w such that the Turing machine

represented by w does not accept the input w. Ld = { wi | wi L(Mi)}

10. What are the properties of recursive enumerable sets which are undecidable? The properties of recursive enumerable sets are: 1. Emptiness

2. Finiteness

3. Regularity

4. Context – freedom

11. What is Church’s hypothesis? The notion of computable function can be identified with the class of partial recursive

functions is known as Church-hypothesis or Church-Turing thesis. The Turing machine

is equivalent in computing power to the digital computer.

12. What are the different types of grammar/languages? The different types of grammar/languages are: 1. Unrestricted or Phase structure grammar.(Type 0 grammar).(for TMs) 2. Context sensitive grammar or context dependent grammar (Type1)(for

Linear Bounded Automata ) 3. Context free grammar (Type 2) (for PDA) 4. Regular grammar (Type 3) (or Finite Automata). This hierarchy is called as

Chomsky Hierarchy.

13. Prove that AMBIGUITY problem is un-decidable.

Consider the ambiguity problem for CFGs. Use the “yes-no” version of AMB. An

algorithm for FIND is used to solve AMB. FIND requires producing a word with two or

more parses if one exists and answers “no” otherwise. By the reduction of AMB to FIND

we conclude there is no algorithm for FIND and hence no algorithm for AMB.

14. When is shifting over used?

A Turing machine can make space on its tape by shifting all nonblank symbols a

finite number of cells to the right. The tape head moves to the right, repeatedly storing

the symbols in the FC and replacing the symbols read from the cells to the left. The TM

can then return to the vacated cells and prints symbols.

15. Define − Universal Language A Universal Turing Machine Mu is an automaton, that given as input the description

of any Turing Machine M and a string w, can simulate the computation of M on w.

16. Define − Rice Theorem (A/M-10, N/D-09) The Rice theorem states that “Every nontrivial property of RE languages

is undecidable.”

17. State the usage of checking off symbol in TM. (N/D-09) Checking off symbols is useful method when a TM recognizes a language with

repeated strings and also to compare the length of substrings.

(eg) : { ww | w _ _ * } or {aib

i | i>=1}. This is implemented by using an extra track on

the tape with symbols Blank or √.

18. How can a TM used as a transducer? A TM can be used as a transducer. The most obvious way to do this is to treat the

entire nonblank portion of the initial tape as input, and to treat the entire blank portion of

the tape when the machine halts as output. Or a TM defines a function y=f(x) for strings

x ,y _ _* if: q0X | --- qfY, where qf is the final state.

19. List out the various representation of TM.

We can describe TM using: 1. Instantaneous description 2. Transition table 3. Transition diagram

20. List out the techniques for Turing machine construction. The various techniques used for Turing Machine construction are as follows: 1. Storage in finite control

2. Multiple tracks

3. Checking off symbols

4. Shifting over

5. Subroutines

21. What are UTMs or Universal Turing machines? (N/D-13) Universal TMs are TMs that can be programmed to solve any problem that can be

solved by any Turing machine. A specific Universal Turing machine U is Input to U: The encoding “M “of a Tm M and encoding “w” of a string

w. Behavior: U halts on input “M” “w” if and only if M halts on input w.

22. What is the crucial assumption for encoding a TM?

The crucial assumption is that there are no transitions from any of the halt states of

any given TM. Apart from the halt state, a given TM is total.

23. How can a Turing Machine acts as a generating device?

In a multi-tape TM, one tape acts as an output tape, on which a symbol, once written

can never be changed and whose tape head never moves left. On that output tape , M

writes strings over some alphabet Σ, separated by a marker symbol # , G(M) ( where

G(M) is the set w in Σ * * such that w is finally printed between a pair of #’s on the

output device).

24. State the halting problem of Turing Machine. The halting problem for TMs is: Given any Turing Machine M and an input string w,

does M halt on w? This problem is undecidable as there is no algorithm to solve this

problem.

25. What is the weak-form of Turing thesis? A Turing Machine can compute anything that can be computed by a general purpose

digital computer which is said to be a weak form of Turing thesis.

26. What is the strong-form of Turing thesis?

A Turing Machine can compute anything that can be computed. This is the strong

form of Turing thesis. The strong form of Turing’s thesis cannot be “proved”, because it

states a relationship between mathematical concepts and the “real world”.