You are on page 1of 4

# Code No: R7310501 1

## III B.Tech I Semester(R07) Regular & Supplementary Examinations, November 2010

FORMAL LANGUAGES AND AUTOMATA THEORY
(Computer Science & Engineering)
Time: 3 hours Max Marks: 80
All questions carry equal marks
?????

## 1. (a) Define string and alphabet. Discuss the operations on string.

(b) Define language? Discuss its operations.

2. Prove the theorem “if L is accepted by an NFA with ε - transitions then L is accepted by an
NFA with out ε - transitions”.

3. Find a string of minimal length in Σ = {a,b} that is not in the language corresponding to the
given regular expression.

(a) 1 ∗ (01) ∗ 0 ∗ .
(b) (0 ∗ +1∗)(0 ∗ +1∗)(0 ∗ +1∗).

## 4. (a) What are the properties of the CFL generated by a CFG.

(b) Find the grammar for the language L={a2n bc, where n>1}
(c) Find the language generated by S → 0S1|0A|0|1B|1, A → 0A|0, B → 1B|1.

5. (a) Find out a context free grammar for the language of strings over the alphabet {0, 1} such
that the number of 0’s are more than the number of 1’s in the strings.
(b) Show that the following grammar is ambiguous.
E → E+E / E*E / a
Eliminate the ambiguity from the above grammar using precedence of + is higher than
the precedence of * in evaluating the expressions.

6. (a) Define a PDA. Design a PDA for L = { xcxr / x ∈ {a,b} * }. Process the string “abba-
cabba”.
Note: xr stands for reverse of the string x.
(b) What do you mean by an instantaneous description of a PDA. Explain with example.

7. Define a Turing Machine(TM) and the language accepted by a TM. Design a TM for rec-
ognizing the language (a+b)*aba(a+b)*. Draw it’s transition diagram and table. Using the
Instantaneous Description notation. process the string “aabaabaaab”.

8. (a) What is PCP? Find the solution to the following instance of PCP.
w = (1, 10111, 10) and x = (111, 10, 0)
(b) Discuss in detail about LBA model with one example.

?????
Code No: R7310501 2
III B.Tech I Semester(R07) Regular & Supplementary Examinations, November 2010
FORMAL LANGUAGES AND AUTOMATA THEORY
(Computer Science & Engineering)
Time: 3 hours Max Marks: 80
All questions carry equal marks
?????

## 1. (a) Prove the following theorem by Induction.

1 + 2 + 3 + ........ + n = n(n + 1)/2
(b) A tree with ‘n’ vertices has (n-1) edges. Prove the theorem by induction.

## 2. (a) Discuss briefly the significance of NFA and DFA.

(b) Write about NFA with ε transitions and also discuss the significance of NFA with ε?

3. Show that the language L = {x²{0, 1}∗ : x has equal number of 01 and 01 as substrings} is
regular.

## 4. (a) construct CFG without ² production form S → a | Ab | aBa, A → b | ², B → b | A

(b) Explain the relationship between derivation and derivation tree with an example.

5. (a) Show that the following grammar is ambiguous and also eliminate the ambiguity using
the if else rules in C language.
S → if (c) S / if (c) S else S / S
(b) What are unit productions? Write the disadvantages of unit productions? Write the
procedure for eliminating unit productions from a given CFG. Eliminate unit productions
from the following grammar.
E → E+T / T T → T*F / F F → (E) / id

6. (a) Design a PDA for L = {xxr / x ∈ {a,b} * }. Process the string abbaabba. Is you PDA
Note: xr stands for reverse of the string x.
(b) Explain the differences between a PDA and FA.

7. Design a TM for recognizing L = { xx / x ∈ {a, b}* }. Show the moves of the TM for the
strings abaaba and abaabb.

8. (a) What is Modified PCP? Does the following instance of MPCP has solution? If so, give
w = (1, 10111, 10) and x = (111, 10, 0)
(b) Explain about halting problem of Turing Machine.

?????
Code No: R7310501 3
III B.Tech I Semester(R07) Regular & Supplementary Examinations, November 2010
FORMAL LANGUAGES AND AUTOMATA THEORY
(Computer Science & Engineering)
Time: 3 hours Max Marks: 80
All questions carry equal marks
?????

1. (a) Describe the following languages over the input set A={a,b}
i. L1 = {a, ab, abb, aba}
ii. L2 = {an bn | n >= 1}
iii. L3 = {an bn | n > 0}
P
(b) What is the Kleen closure? Let = {a,b} obtain
Σ∗ = Σ0 ∪ Σ1 ∪ Σ2 ∪ Σ3.........

2. Find the Minimal DFA for the language L={an bm , n > 2, m > 1}.

3. Discuss and prove that the closure properties of regular sets are closed.

## 4. (a) If S → Asb | aAb, A → bAa, A → ba. Find out the CFL.

(b) Consider the grammar P = {S → aS | aSbS | ε} Prove that it is ambiguous by
constructing:
i. Two parse trees.
ii. Two leftmost derivation.
iii. Rightmost derivation.
(c) Find CFG with no useless symbols equivalent to S → AB | CA, B → BC | AB, A →
a, C → aB | b.

5. (a) What are useless variable in a CFG? How do you find out useless variable in a given CFG?
Explain with an example.
(b) Eliminate ambiguity from the following grammar.
E → E+E / E*E / (E) / id

6. (a) When do we say that a PDA is non deterministic? Design a PDA for recognizing the
language of palindromes over the input alphabet {a, b}.
(b) Distinguish between a DPDA and NPDA.

7. (a) Design a TM for recognizing the language of palindromes over the input alphabet {a, b}.
Show the moves of TM for the string abbbba.
(b) What is Instantaneous Description of a TM? Briefly explain.

## 8. (a) Discuss about P and NP complexity of algorithms.

(b) What is PCP? Find solution to the following PCP instance, if exists?
w = (10, 011, 101) and x = (101, 11, 011)

?????
Code No: R7310501 4
III B.Tech I Semester(R07) Regular & Supplementary Examinations, November 2010
FORMAL LANGUAGES AND AUTOMATA THEORY
(Computer Science & Engineering)
Time: 3 hours Max Marks: 80
All questions carry equal marks
?????

1. (a) What is the finite state machine? Define finite Automata and discuss the representation
of finite automata.
(b) Discuss the applications of finite automata.

2. Prove the theorem “Let L be a set accepted by non-deterministic finite automata, then there
exists a DFA that accepts L”.

3. Give a DFA for accepting L = {an bm | abs (n − m) mod 3 ≤ 1} and show that L is non regular.

4. (a) What is
i. CFL.
ii. Sentential form? Give example for each.
(b) What is the language generated by the grammar G=(v,t,p,s) where
P = {S → aSb, S → ab} ?
(c) What is
i. Derivation
ii. Derivation/Parse tree.
iii. Sub tree. Give example for each.

5. Write a procedure for eliminating. ∈ - productions from a given CFG. Eliminate ∈ - productions
from the following grammar.
S → ABCBCD A → CD B → Cb C → a / ∈ D → bD / ∈

6. When do you say that a language L is recognized or accepted by a PDA? Design PDA for L
= { ai bj ck / j ≥ i+k and i,j,k > 0}. Process the string aaabbbbbbccc using instantaneous
description.

## 7. Define a TM and the instantaneous description of a TM. Design a TM for recognizing L = { x

∈ {a, b}* / x ends with aba}. Specify it’s transition diagram . Process the the strings abaaba
and ababaa using ID notation.

8. (a) What is an LR(0) grammar? Show that the grammar with following productions is LR(0)
grammar.
S → aA A → Abb / b
(b) Find solution to following PCP instance, if exists?
w = (01, 001, 10) and x = (011, 10, 00)

?????