INSTITUTE OF AERONAUTICAL ENGINEERING DFA. states ε A b c p {q} {p} ᴓ ᴓ q {r} ᴓ {q} ᴓ *r...
Click here to load reader
Transcript of INSTITUTE OF AERONAUTICAL ENGINEERING DFA. states ε A b c p {q} {p} ᴓ ᴓ q {r} ᴓ {q} ᴓ *r...
Hall Ticket No Question Paper Code: CAIT002
INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous)
Dundigal, Hyderabad - 500 043
B.Tech. IV Semester End Examinations (Regular), November – 2017
Regulations: IARE-R16
THEORY OF COMPUTATION
(Computer Science and Engineering)
Time: 3 hours Max. Marks: 70
Answer ONE Question from each Unit
All Questions Carry Equal Marks
All parts of the question must be answered in one place only
UNIT – I
1. a) Write the DFA that will accept those words from ∑= {a, b} where the number of a’s is divisible by two and the number of b’s is divisible by three. Sketch the transition
table of the finite automata
[7M]
b) Construct DFA equivalent to the NFA given below:
[7M]
2. a) Let L be a set accepted by an NFA. Then prove that there exists a deterministic finite automaton that accepts L.Is the converse true? Justify your answer.
[7M]
b) Consider the following ε–NFA. Compute the ε–closure of each state and find it’s equivalent DFA.
states ε A b c
p {q} {p} ᴓ ᴓ
q {r} ᴓ {q} ᴓ
*r ᴓ ᴓ ᴓ {r}
[7M]
UNIT – II
3. a) Show that following languages are not regular
L={anb
m | n, m andn<m }
L={ anb
m | n, m and n>m }
L={ anb
m c
md
n | n, m }
L={an | n is a perfect square }
L={an | n is a perfect cube }.
[7M]
MODEL QUESTION PAPER
q0
qf q1
0,1
0
1
b) Construct Leftmost Derivation. , Rightmost Derivation,
Derivation Tree for the following grammar
S-->Ab|bA
A-->a |aS|bAA
B--> b |bS|aBB
For the string aaabbabbba .
[7M]
4. a) Prove that L={w|w=wR, w∈{0,1}∗} is not regular (This is the language of
binary palindromes).
palindromes). = { w | w = w R
, w
∈{ 0 , 1 } ∗
} is not regular (This is the language of binary palindromes).
[7M]
b) Simplify the following grammar G=(V,T,P,S) Where
V={S,A,B,C}
T={a,b}
P={S→ aAa | bBb | BB ; A→ C ; B→ S | A ; C →S | € }
S=S
[7M]
UNIT – III
5. a) Consider the grammar E→E + E | E*E | (E) | I and I → a+b. Show that the grammar
is ambiguous and remove the ambiguity.
[7M]
b) Design a grammar for valid expressions over operator - and /. the arguments of
expressions are valid identifiers over symbols a,b,0 and 1. Derive Left Most Derivation
and Right Most Derivation for string W= (a11-b0) / (b00-a01). Draw parse tree for Left Most Derivation.
[7M]
6. a) What is Normalization of CFG? What is the use of Normalization? Explain different types of normal forms.
[7M]
b) Convert the following CFG into GNF.
A1 → A2A3
A2 → A3A1/b
A1 → A1A2/a
[7M]
UNIT – IV
7. a) Is NPDA(Nondeterministic PDA) and DPDA(deterministic PDA) equivalent? Illustrate with an example.
[7M]
b) Construct the grammar for the following PDA. M=({q0, q1},{0,1},{X,z0},δ,q0,Z0,Φ) and where δ is given by δ(q0,0,z0)={(q0,XZ0)}, δ(q0,0,X)={(q0,XX)},δ(q0,1,X)={(q1,
ε)}, δ(q1,1,X)={(q1, ε)},δ(q1, ε,X)={(q1, ε)}, δ(q1, ε, Z0 )={(q1, ε)}.
[7M]
8. a) Explain different types of acceptance of a PDA. Are they equivalent in sense of language acceptance? Justify your answer.
[7M]
b) Design Push Down Automata for L={ ai b
j c
k | j = i + k, i, k >=0 }. Draw Transition
Diagram for the string W = abbbcc.
[7M]
UNIT – V
9. a) What is the class of language for which the TM has both accepting and rejecting
configuration? Can this be called a Context free Language? [7M]
b) Design a Turing Machine with no more than three states that accepts the language. a(a+b) *. Assume €={a,b}.
[7M]
10. a) Explain Multitape Turing Machine and Non-deterministic Turing Machine with neat block diagram.
[7M]
b) Define Turing Machine. Also, design a Turing Machine to accept the set of all
palindromes over{0,1}*. Write the transition diagram for the constructed Turing Machine and write the sequence of ID's for the input string '001'.
[7M]
INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous)
Dundigal, Hyderabad - 500 043
COURSE OBJECTIVES:
The course should enable the students to:
I. Understand comprehend abstract, mathematical models of computation and use them to solve
computational problems
II. Illustrates the relationship between formal languages in Chomsky's hierarchy and different machines
III. Understand the behaviour of push-down automata.
IV. Analyze the limits and capacities of Turing‘s machines to recognize languages
COURSE LEARNING OUTCOMES:
Students, who complete the course, will have demonstrated the asking to do the following:
CAIT002.01 Use the definitions and notations for sets, relations and functions in defining and study Finite Automata
CAIT002.02 Knowledge on formal languages and Kleene’s Theorem to intend programming languages
CAIT002.03 Construct deterministic and nondeterministic finite state automata (DFA and NFA) for
solving simple decision problems.
CAIT002.04 Perform conversions between nondeterministic finite automata and deterministic finite
automata and regular expressions and finite state automata to gain knowledge about
formal proofs in computer science
CAIT002.05 Knowledge on recursive definitions of regular languages, regular expressions and the use of regular expressions to represent regular languages
CAIT002.06 Detailed knowledge on the relationship between regular expressions and finite automata
CAIT002.07 Identify that few languages are not regular by using Pumping lemma
CAIT002.08 Knowledge on Left Linear grammar, Right Linear grammars and converting grammars
into Finite Automata.
CAIT002.09 Understand the fundamental role played by Context-Free Grammars (CFG) in designing formal computer languages
CAIT002.10 Knowledge on Context‐ Free Grammars so that able to prove properties of Context‐ Free Grammars.
CAIT002.11 Identify relationship between regular languages and context-free grammars
CAIT002.12 Use the pumping lemma for Context Free Languages to show that a language is not
context‐ free
CAIT002.13 Understand the equivalence between Context-Free Grammars and Non-deterministic
Pushdown Automata
CAIT002.14 Understand deterministic Pushdown Automata to parse formal language strings by using (i) top down or (ii) bottom up techniques
CAIT002.15 Knowledge on converting Context-Free Grammars into pushdown automata to identify the acceptance of a string by the Context Free Language
CAIT002.16 Understand the path processing computation using Turing Machines (Deterministic and
Non-Deterministic) and Church‐Turing Thesis in computers.
CAIT002.17 Knowledge on non-halting Turing Machine accepted by Recursively Enumerable
Languages
CAIT002.18 Understand the power of the Turing Machine, as an abstract automaton, that describes
computation, effectively and efficiently
CAIT002.19 Theory of Computation is important in programming language design, parsers, web-
scrappers, Natural Language Processing (NLP), and is at the heart of modern compiler
architectures.
CAIT002.20 Process the knowledge and skills for employability and to succeed in national and
international level competitive exams.
MAPPING OF SEMESTER END EXAMINATION TO COURSE LEARNING OUTCOMES:
SEE
Question
Number
COURSE LEARNING OUTCOME
Blooms
Taxonomy
Level
1
a CAIT002.03 Construct deterministic and nondeterministic finite state automata
(DFA and NFA) for solving simple decision problems.
Understand
b CAIT002.04 Perform conversions between nondeterministic finite automata and deterministic finite automata and regular expressions and finite state
automata to gain knowledge about formal proofs in computer science
Remember
2
a CAIT002.03 Construct deterministic and nondeterministic finite state automata (DFA and NFA) for solving simple decision problems.
Understand
b CAIT002.04
Perform conversions between nondeterministic finite automata and
deterministic finite automata and regular expressions and finite state automata to gain knowledge about formal proofs in computer science
Understand
3
a CAIT002.05 Knowledge on recursive definitions of regular languages, regular expressions and the use of regular expressions to represent regular
languages.
Remember
b CAIT002.06 Detailed knowledge on the relationship between regular expressions and finite automata.
Remember
4
a CAIT002.07 Identify that few languages are not regular by using Pumping lemma Understand
b CAIT002.09 Understand the fundamental role played by Context-Free Grammars
(CFG) in designing formal computer languages
Understand
5
a CAIT002.10 Knowledge on Context Free Grammars so that able to prove
properties of Context Free Grammars. Remember
b CAIT002.08 Knowledge on Left Linear grammar, Right Linear grammars and
converting grammars into Finite Automata. Understand
6
a CAIT002.10 Knowledge on Context‐ Free Grammars so that able to prove properties of Context‐ Free Grammars.
Remember
b CAIT002.09 Understand the fundamental role played by Context-Free Grammars (CFG) in designing formal computer languages with simple
examples
Remember
7
a CAIT002.13 Understand the equivalence between Context-Free Grammars and Non-deterministic Pushdown Automata
Understand
b CAIT002.15
Knowledge on converting Context-Free Grammars into pushdown
automata to identify the acceptance of a string by the Context Free Language
Remember
8
a CAIT002.15
Knowledge on converting Context-Free Grammars into pushdown
automata to identify the acceptance of a string by the Context Free Language
Understand
b CAIT002.14 Understand deterministic Pushdown Automata to parse formal
language strings by using (i) top down or (ii) bottom up techniques Remember
9 a CAIT002.17 Knowledge on non-halting Turing Machine accepted by Recursively
Enumerable Languages Remember
HOD, CSE
b CAIT002.16
Understand the path processing computation using Turing Machines
(Deterministic and Non-Deterministic) and Church-Turing Thesis in computers.
Understand
10
a CAIT002.16
Understand the path processing computation using Turing Machines
(Deterministic and Non-Deterministic) and Church-Turing Thesis in computers.
Understand
b CAIT002.18 Understand the power of the Turing Machine, as an abstract
automaton, that describes computation, effectively and efficiently Remember