CS8501 Iq
CS8501 Iq
net
SUBJECT : CS8501
et
UNIT I AUTOMATA FUNDAMENTALS
Introduction to formal proof – Additional forms of Proof – Inductive Proofs –Finite Automata – Deterministic
Finite Automata – Non-deterministic Finite Automata – Finite Automata with Epsilon Transitions
.n
PART – A
z
Q.No Questions BT Level Competence
1.
2.
3.
Define DFA
Define inductive proof.
ep
Differentiate between DFA and NFA. BTL-2
BTL-1
BTL-1
Understand
Remember
Remember
de
4. Identify NFA- ε to represent a*b | c BTL-1 Remember
5. Consider the String X=110 and y=0110 find BTL-4 Analyze
i) XY ii) X2 iii) YX iv) Y2
6. Describe the following language over the input set A={a,b}
a
www.padeepz.net
www.padeepz.net
17. Create a FA which accepts the only input 101 over the input set
Z={ 0,1} BTL-6 Create
18. Describe a Finite automata and give its types.
BTL-4 Analyze
19. Illustrate deductive proof.
BTL-3 Apply
20. Create a FA which checks whether the given binary number is
BTL-6 Create
even.
PART - B
et
1. (i)Explainif L is accepted by an NFA with ε-transition then show
that L is accepted by an NFA without ε-transition.(6)
.n
(ii)Construct a DFA equivalent to the NFA.
M=({p,q,r},{0,1},δ,p,{q,s}) Where δ is defined in the following
table.(7)
BTL-5 Evaluate
z
0 1
p {q,s} {q}
2.
∑ (i)={n(n+1)/2}.
q
r
s ep {r}
{s}
-
{q,r}
{p}
(13) BTL-3
Apply
de
3.
Let L be a set accepted by a NFA then show that there exists a
BTL-1 Remember
DFA that accepts L.(13)
a
4.
Give the NFA that accepts all strings that end in 01.Give its
transition table and the extended transition function for the input
.p
BTL-2 Understand
string 00101.Also construct a DFA for the above NFA using
subset construction method.(13)
w
5.
Construct DFA equivalent to the NFA given below: (13)
w
BTL-2 Understand
w
www.padeepz.net
www.padeepz.net
6. (i)Compose that a language L is accepted by some ε–NFA
if and only if L is accepted by some DFA. (6)
(ii)Consider the following ε–NFA. Compute the ε–closure of
each state and find it‟ s equivalent DFA. (7)
ε a b C BTL-6 Create
p ф {p} {q} {r}
qp {p} {q} {r}
Ф фФ
*r q {q} ф
{r} ф Ф
{p}
et
7. i)Classify how a language L is accepted by some DFA if L is
accepted by some NFA(7)
(ii)Convert the following NFA to its equivalent DFA.(6)
.n
0 1 BTL-3 Apply
p {p,q} {p}
q {r} {r}
z
r {s} ф
*s {s} {s}
8.
number 0’s (7) ep
i)Construct the DFA to recognize odd number of 1’s and even
ii) Construct the DFA over {a,b} which produces not more than 3
a’s (6)
BTL-1 Remember
de
9. (i)Point out the steps in conversion of NFA to DFA and for the
following convert NFA to a DFA(7)
a
.p
BTL-4 Analyze
(ii)Infer the following to a regular expression.(6)
1
w
0 1
q q
q
1 3
2
w
0 0,1
w
www.padeepz.net
www.padeepz.net
10. Identify and explain the algorithm for minimization of
DFA.Using the above algorithm minimize the following
DFA.(13)
BTL-1 Remember
et
.n
11. Tabulate the difference between the NFA and DFA .Convert the
following ε-NFA to DFA.(13)
z
states ε a b c
BTL-1 Remember
p Ф {p} {q} {r}
12.
q
*r
{p}
{q}ep {q}
{r}
{r}
ф
Ф
{p}
BTL-2 Understand
.p
w
PART – C
www.padeepz.net
www.padeepz.net
1. (i) Draw and Explain the transition diagram for recognizing the set
of all operators in c Language.(8)
(ii)Evaluate a DFA from the given NFA(7)
M=({qo,q1},{a,b},δ,q0,{q1} with the state table diagram for δ given
BTL-5 Evaluation
below:
δ a b
qo {qo,q1} q1
q1 Ф {qo,q1}
et
2. Construct the following ε-NFA to DFA.(15)
states ε a b c
.n
BTL-6 Create
p Ф {p} {q} {r}
q {p} {q} {r} {p,q}
*r {q} {r} ф Ф
z
3. Infer the DFA which is accepting the following language over the
alphabet{0,1}.The set of all the strings beginning with a1 that
4.
ep
wheninterrupted as a binary integer , is multiple of 5, For example
strings 101,1010 and 1111 are in the language 0,100 and 111 are
not.(15)
Regular Expressions – FA and Regular Expressions – Proving Languages not to be regular – Closure Properties
of Regular Languages – Equivalence and Minimization of Automata.
.
w
PART - A
Q.No Questions BT Level Competence
w
6. Illustrate a regular expression for the set of all the strings BTL-1 Remember
have odd number of 1’s R.E=1(0+11)*
www.padeepz.net
www.padeepz.net
7. Illustrate a regular expression for the set of all the strings
have odd number of 1’s R.E=1(0+11)* BTL-3 Apply
8. Compose the difference between the + closure and * closure BTL-4 Analyze
9. Illustrate a regular expression for the set of all strings of 0’s BTL-2 Understand
10. What
and 1’sisnot
thecontaining
Closure property
101 as of regular set S.?
substring. BTL-2 Understand
11. BTL-2 Understand
12. Find out the language generated by the regular
expression(0+1)*. BTL-5 Evaluate
et
13. Name the four closure properties of RE.
BTL-1 Remember
14. Is it true the language accepted by any NFA is different from
the regular language? Justify your answer. BTL-4 Analyze
.n
15. Show the complement of a regular language is also regular. BTL-3 Apply
16. Construct a DFA for the regular expression aa*bb*.
BTL-3 Apply
z
17. State the precedence of RE operator. BTL-5 Evaluate
18. Construct RE for the language over the set z={a,b} in which
ep
total number of a’s are divisible by 3.
19. Define RE.
BTL-1
BTL-6
Create
Remember
Create
de
PART - B
1.
Demonstrate how the set L= {abn/n>=1} is not a
BTL5 Evaluate
regular.(13)
2. Express that the regular languages are closed under:(13)
a
3.
Examine whether the language L=(0n1n | n>=1) is regular or BTL-2 Understand
not? Justify your answer (13)
4. (i)Describe a Regular Expression. Write a Regular
Expression for the set of strings that consists of alternating 0’s
w
and 1’s.(6)
BTL1 Remember
(ii)Construct Finite Automata equivalent to the regular
w
expression (ab+a)*(7).
5. (i)Describe the closure properties of regular languages.(6)
w
(ii)Describe NFA with epsilon for the RE=(a/b)*ab and BTL1 Remember
convert it into DFA and further find the minimized
DFA.(7)
www.padeepz.net
www.padeepz.net
6.
Demonstrate how the set L= {anbn /n>=0} is not a
regular.(13) BTL-3 apply
et
10 Construct NDFA for given RE using Thomson rule. (13)
i) a.(a+b)* ab
ii) (a.b)* BTL-6 Create
.n
iii) (a+b)
z
example.(13)
12
Demonstrate how the set L= {anbm| m,n>=1} is not a
regular.(13)
ep BTL 2
Understand
de
13 i) Prove the L1 and L2 are two languages then L1- L2 is
regular (7)
ii) Prove the L1 and L2 are two languages then L1 . L2 is BTL 4 Analyze
regular (6)
a
PART – C
w
1 0 0,1
1 2
BTL-5 Evaluate
w
www.padeepz.net
www.padeepz.net
2. Set the algorithm for minimization of a DFA. Develop a
minimized DFA for the RE (a+b)(a+b)* and trace for the BTL-6 Create
string baaaab.(15)
3. Point out about the regular exression and regular Language. (15) BTL-4 Analyze
4. Develop the procedure for minimizing DFA with example (15) BTL-6 Create
et
CFG – Parse Trees – Ambiguity in Grammars and Languages – Definition of the Pushdown Automata – Languages of a
Pushdown Automata – Equivalence of Pushdown Automata and CFG, Deterministic Pushdown Automata .
.n
PART - A
Q.No Questions BT Level Competence
1. Express the ways of languages accepted by PDA and define BTL 2 Understand
z
them?
2. Summarize PDA .Convert the following CFG to PDA
3.
4.
5.
S aAA , A aS|bS|a.
BTL 1
BTL 1
Understand
Remember
Remember
de
BTL 2 Understand
Palindrome over (0+1)*
6. Compare Deterministic and Non deterministic PDA. Is it true
that non deterministic PDA is more powerful than that of BTL 2 Understand
deterministic PDA? Justify your answer.
a
11. Point out the languages generated by a PDA using final state
BTL 4 Analyze
of the PDA and empty stack of that PDA
12. Illustrate the rule for construction of CFG from given PDA BTL 3 Apply
w
www.padeepz.net
www.padeepz.net
16. Infer the CFG for the set of strings that contains equal number
BTL 4 Analyze
of a’s and b’s over ∑ ={a,b}
17. Point out the various types of grammar with example BTL 1 Remember
et
19. Point out the additional features a PDA has when compared
BTL 4 Analyze
with NFA.
20. Convince your answer of acontext free grammar for the given
.n
BTL6 Create
expression (a+b) (a+b+0+1)*
PART - B
z
1. (i)Discuss about PDA and CFL Prove the equivalence of PDA
and CFL.(6) BTL 2 Understand
2. ep
(ii)If L is Context free language then prove that there exists
PDA M such that L=N(M). (7)
following rules :
E D|(E)|E+E|E-E|E/E BTL 6
D 0|1|2|…9 (6) Create
w
www.padeepz.net
www.padeepz.net
5. (i)Define Non Deterministic Push Down Automata. Is it true
that DPDA and NDPDA are equivalent in the sense of
language acceptance is concern? Justify Your answer.(5)
(ii)Convert PDA to CFG.PDA is given by
P=({p,q},{0,1},{X,Y},δ,q,Z}, δ is defined by
δ(p,1,z)={(p,XZ)}, BTL 1 Remember
δ(p,ε,Z)={p, ε)},
δ(p,1,X)={(p,XX)},
δ(q,1,X)={(q, ε)},
δ(p,0,X)={(q,X0}
δ(q,0,Z)={(p,Z)} (8)
et
6. (i)Define PDA. Give an Example for a language accepted
byPDA by empty stack.(7)
(ii)Convert the grammar
.n
BTL 2 Understand
S ->0S1|A
A ->1A0|S| εinto PDA that accepts the same language by the
empty stack .Check whether 0101 belongs to N(M).(6)
z
7. (i)Analyze the theorem: If L is Context free language then
prove that there exists PDA M such that L=N (M). (7) Analyze
8.
State.(6)
Solve the following grammar
SaAa | bBb | BB
ep
(ii) Prove that if there is PDA that accepts by the final state
then there exists an equivalent PDA that accepts by Null
BTL 4
de
A C
B S | A
C S | ε for the string abaaba .Give BTL 5 Evaluate
i) Left most derivation(3)
ii)Right most derivation(3)
a
iii)Derivation Tree(3)
iv) For the string abaabbba, find the right most derivation.(4)
.p
δ(q0,0,X)={(q0,XX)},
δ(q0,1,X)={(q1, ε)},
δ(q1,1,X)={(q1, ε)}, BTL 3 Apply
δ(q1,ε,X)={(q1, ε)},
w
δ(q1, ε, Z0)=
{(q1, ε)}. (7)
(ii)Prove that if L is N(M1) for some PDA M1 then L is
w
www.padeepz.net
www.padeepz.net
11. Examine and construct a CFG G which accepts N(M), where
M=({q0, q1},{a,b},{z0,z},δ,q0,z0,Φ) and where δis given by
δ(q0,b,z0)={(q0,zz0)}
δ(q0, ε,z0)={(q0, ε)}
δ(q0,b,z)={(q0,zz)}
δ(q0,a,z)={(q1,z)} BTL-1 Remember
δ(q1,b,z)={(q1, ε)
δ(q1,a,z0)={(q0,z0)}
Show that anb ncn is not context free language i.e show that the
set of strings of a’ s and b’s and c’s with an equal number of
et
each is not context free(13)
12. (i) Describe the PDA that accept the given CFG (7)
.n
S→xaax BTL-2 Understand
X→ax/bx/€
(ii) Express a PDA for the language anb man+m (6)
13. (i) Illustratea PDA for the language {WCWR/W€{0,1}}.(7)
z
BTL-3 Apply
(ii) Illustrate a CFG for the constructed PDA. (6)
ep
14. (i)Identify CFG for the language L={0 i1j 0k | j>i+k} (7)
(ii)Define derivation tree. Explain its uses with an
example.(6)
PART – C
BTL-4 Analyze
de
1. (i)Design and Explaina PDA to accept each of the following
language BTL-5 Evaluation
{aibjck|i=j or j=k}(7)
(ii) The set of all string with twice as many 0’s and 1’s. (8)
a
S0S1/A;
A1A0/S/ ε Infer whether 0101 belongs to N(M).
w
4. (i)If L is a CFL then prove that there exists PDA M, such that
L=N(M) , language accepted by empty stack .(7) BTL-6 Create
(ii)Construct a PDA empty store , L= {am b n|n<m}.(8)
www.padeepz.net
www.padeepz.net
UNIT IV PROPERTIES OF CONTEXT FREE LANGUAGES
Normal Forms for CFG – Pumping Lemma for CFL – Closure Properties of CFL – Turing Machines –
Programming Techniques for TM.
PART - A
Q.No Questions BT Level Competence
1. Conclude the procedure for converting CNF to GNF with an BTL 2 Understand
example
et
2. Illustrate the Basic Turing Machine model and explain in one
BTL 3 Apply
move. What are the actions take place in TM?
.n
4. Point out the hierarchy summarized in the Chomsky BTL 4 Analyze
hierarchy..
5. Define the pumping Lemma for CFLs BTL1 Remember
z
6. Define Turing Machine. BTL1 Remember
7. Discuss the applications of Turing machine. BTL 2 Understand
8.
9. ep
Define Chomskian hierarchy of language.
What is the class of language for which the TM has both
accepting and rejecting configuration? Can this be called a
Context free Language? Discuss.
BTL 1
BTL 2
Remember
Understand
de
10. Show the following grammar into an equivalent one with no
unit productions and no useless symbols
SABA
BTL 3 Apply
AaAA|aBC|bB
BA|bB|Cb
a
CCC|cC
11. Explain the special features of TM? Define universal TM. BTL 5 Evaluate
.p
machine.
14. List the three ways to simplify a context free grammar. What
BTL 5 Evaluate
are the properties of the CFL generated by a CFG?
w
15. Draw a transition diagram for a Turing machine to identify BTL 1 Remember
n mod 2.
w
www.padeepz.net
www.padeepz.net
PART - B
1. Express the following grammar G into Greibach Normal
Form(GNF) (13)
SXA|BB BTL 1 Remember
Bb|SB
Xb
Aa
2. Use the CFL pumping lemma to show how each of these
languages not to be context-free{aibjck| i<j<k} (13) BTL 2 Understand
et
3. (i)Discussa TM to accept the language LE={1 n 2 n 3n|n >= 1}
(6) BTL 2 Understand
(ii)Construct a turing machine that estimate unary
.n
multiplication (Say 111 X 11 = 11111) (7)
4. (i)Illustrate the Turing machine for computing f(m, n)=m-n
( proper subtraction). (7)
BTL 3 Apply
(ii)Demonstrate a Turing Machine to compute f(m+n)=m+n,
z
m,n>=0 and simulate their action on the input 0100. (6)
5.
6.
ep
(i)Examinethe role of checking off symbols in a Turing
Machine.(6)
(ii)Describe a Turing Machine M to implement the function
“multiplication” using the subroutine copy(7)
(i)Demonstrate the implications of halting problem.(7)
BTL 1 Remember
de
(ii)Show that if a language is accepted by a multitapeturing BTL 3 Apply
machine ,it is accepted by a single-tape TM .(6)
7. (i)Summarize in detail about multihead and multitape TM
with an example.(7) BTL 5 Evaluate
(ii)Construct a Turing Machine to accept palindromes in an
a
www.padeepz.net
www.padeepz.net
13. (i)Analyze and Construct a TM to compute a function f(w)
=WR where W€{a,b}.(7) BTL 4 Analyze
(ii)Construct Turing machine (TM) that replace all occurence
of 111 by 101 from sequence of 0’s and 1’s.(6)
14. (i)Infer the Chomsky grammar classification with necessary
example. (6) BTL 4 Analyze
(ii)Explain a TM with no more than three states that accepts
the language. a(a+b) *.Assume €={a,b}. (7)
PART – C
et
1. (i)Compose the limitation of automata for Type 3, Type 2, type
0 languages.(7)
(ii) Consider two-tape Turing Machine (TM) and determine
BTL-6 Create
whether the TM always writes a nonblank symbol on its second
.n
tape during the computation on any input string ‘w’. Formulate
this problem as a language and show it is undecidable.(8)
2. (i) Define pumping lemma for CFL. Show that L={aibjck, i<j<k}
z
is not context free and Judge your answer.(6)
(ii) Construct a TM to move an input string over the alphabet A= BTL-5 Evaluate
ep
{a} to the right one cell. Consider that the tape head starts
somewhere on a blank cell to the left of the input string to the
right one cell , leaving all the remaining cell blank.(9)
TM that accepts all strings of 0’s and 1’s that do not have two
1’s in a row.(8)
(ii)Write short notes on checking off symbols(7)
w
w
w
www.padeepz.net
www.padeepz.net
UNIT V UNDECIDABILITY
Non Recursive Enumerable (RE) Language – Undecidable Problem with RE – Undecidable Problems about TM –
Post‘s Correspondence Problem, The Class P and NP
PART - A
Q.No Questions BT Level Competence
1. Distinguish between PCP and MPCP? What are the concepts BTL 2 Understand
et
used in UTMs?
.n
recursive? Discuss on it.
z
5. State when a problem is said to be decidable and give an
BTL 1 Remember
example of an undecidable problem.
6.
7.
8.
ep
Define NP hard and NP completeness problem.
Define a universal language Lu?
Is it true that the language accepted by a non-deterministic
Turing Machine is different from recursively enumerable
BTL 1
BTL 1
BTL 5
Remember
Remember
Evaluate
de
language? Judge your answer.
9. Formulate the two properties of recursively BTL 6 Create
enumerable sets which are undecidable
10. When a problem is said to be decidable? Give an example of BTL 4 Analyze
undecidable problem. Analyze it.
a
11. What is (a) recursively enumerable languages (b) recursive BTL 6 Create
sets? Generalize your answer.
.p
20. Illustrate about Time and space complexity of TM. BTL 3 Apply
PART - B
www.padeepz.net
www.padeepz.net
1. (i)Describe about the tractable and intractable problems.(7) BTL 1 Remember
(ii)Identify that “MPCP reduce to PCP”.(6)
2. (i)Describe about Recursive and Recursive Enumerable
languages with example.(7) BTL 1 Remember
(ii)State and describe RICE theorem.(6)
3. (i)Summarize diagonalization language.(6)
(ii)Discuss the significance of universal turing machine and BTL 2 Understand
also construct a turing machine to add two numbers and encode
it .(7)
et
4. Discuss post correspondence problem .Let ∑={0,1}.Let A and
B be the lists of three strings each ,defined as
List A List B
.n
i wi xi
1 1 111 BTL 2 Understand
2 10111 10
3 10 0
z
(i)Does the PCP have a solution?(7)
(ii)Prove that the universal language is recursively
5.
6.
enumerable.(6)
ep
(i)Explain computable functions with suitable example.(6)
(ii)Explain in detail notes on Unsolvable Problems.(7)
(i)Describe in detail notes on universal Turing machines with
example.(7)
BTL 4 Apply
de
BTL 1 Remember
(ii)Collect and write the short notes on NP-complete
problems.(6)
7. (i) Show that the diagonalization language (Ld) is not a
recursively enumerable.(7) BTL 3 Apply
(ii)Illustrate about unsolvability.(6)
a
11. (i)Show that the characteristic function of the set of all even
number is recursive .(7) BTL-3 Apply
(ii)Illustrate in detail notes on primitive recursive functions
with examples.(6)
www.padeepz.net
www.padeepz.net
12. (i)Point out the Measuring and Classifying Complexity.(7)
BTL-4 Analyze
(ii)Does PCP with two lists x=(b,b ab3,ba) and y=(b3,ba,a)
have a solution. Analyze your answer.(6)
13. (i)Discuss in detail about Time and Space Computing of a
Turing Machine(6)
BTL-2 Understand
(ii)Express two languages which are not recursively
enumerable.(7)
14. (i)Describe in detail Polynomial Time reduction and NP-
et
completeness.(7) BTL 1 Remember
(ii)List out the short notes on NP-Hard Problems.(6)
PART – C
.n
1. Consider and find the languages obtained from the following
operations:
(i)Union of two recursive languages.(5) BTL-5 Evaluate
(ii)Union of two recursively enumerable languages.(5)
z
(iii)L if L and complement of L are recursively enumerable.(5)
2. Prove that the universal language is recursively enumerable but BTL-6 Create
3.
with an example(7)
ep
not recursive. Generalize your answer.(15)
(ii) Design and prove that for two recursive languages L1 and
BTL-6 Create
de
L2 their union and intersection is recursive.(8)
4. (i) Compare and write about tractable and untractactable
problems with an example.(10) BTL-4 Analyze
(ii) Explain the language L u and show that Lu is RE
language.(5)
a
.p
w
w
w
www.padeepz.net