0% found this document useful (0 votes)
56 views48 pages

Cs3452 Toc Unit3

Uploaded by

Sasikala R
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views48 pages

Cs3452 Toc Unit3

Uploaded by

Sasikala R
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 48

Unit Lectur

3 19
No e No
Topic Types of Grammar - Chomsky‘s hierarchy of languages
Bloom’s
Learning Outcome (LO) At the end of this lecture, students will be able to Knowledge
Level
LO1 Identify the hierarchy of languages. Understand
LO2 Summaraize the characteristics and limitations of grammar Understand
LO3 Observer the relation between types of grammar and automata theory Understand

Lecture notes
Type 0 Grammar:

Type 0 grammar is known as Unrestricted grammar. There is no restriction on the grammar rules
of these types of languages. These languages can be efficiently modeled by Turing machines.

For example:

bAa → aa
S→s

Assessment questions to the lecture


Bloom’s
Qn
Question Answer Knowledge
No
Level
Which of the following is NOT one of the types of grammars in
Chomsky's hierarchy?
a) Type 0
1 c Remember
b) Type 3
c) Type 4
d) Type 2
Which type of grammar in Chomsky's hierarchy generates the
most powerful language class?
a) Type 3
2 b Remember
b) Type 0
c) Type 2
d) Type 1
A context-free grammar corresponds to which type in
Chomsky's hierarchy?
a) Type 0
3 c Remember
b) Type 1
c) Type 2
d) Type 3
Which of the following automata is associated with a context-
free language?
a) Turing machine
4 b Remember
b) Pushdown automaton
c) Finite-state machine
d) Linear-bounded automaton
What type of language can be generated by a regular grammar?
a) Context-free language
5 b) Context-sensitive language c Remember
c) Regular language
d) Recursively enumerable language

Students have to prepare answers for the following questions at the end of the lecture

Bloom’s
Qn
Question Marks CO Knowledge
No
Level
Identify the type of grammar as per Chomsky’s
hierarchy and design an appropriate automata model .
SaSBC SaBC
1 15 C210.3 Create
CBC Bab
Bbb Cbc
(AU-NOV 2022)
Design appropriate automation model for the
language defined by the grammar given below.
Sabc / aAbc
AbbA
2 15 C210.3 Create
AcBbcc
bBBb
aBaa /aaA
(AU-NOV 2021)

Reference Book
Author(s) Title of the book Page numbers
Hopcroft J.E., "Introduction to Automata Theory, Languages
Motwani R. & and
Ullman J.D., Computations", 3rd Edition, Pearson Education,
2008.

Unit Lectur
3 20
No e No
Topic Context-Free Grammar (CFG) and Languages
Bloom’s
Learning Outcome (LO) At the end of this lecture, students will be able to Knowledge
Level
LO1 Understand Context-Free Grammar Understand
LO2 Use parsing techniques to analyze strings according to the rules defined by Understand
a CFG,
LO3 Understand the significance of Chomsky Normal Form Understand

Lecture notes
Assessment questions to the lecture

Bloom’s
Qn
Question Answer Knowledge
No
Level
Which of the following is a characteristic of Context-Free
Grammars (CFGs)?
a) Production rules can be of the form α → βγ
1 a Understand
b) They can generate regular languages
c) They require left-linear rules
d) They cannot handle nested structures
Which of the following statements about Context-Free
Languages is true?
a) They are a proper superset of regular languages
2 a Understand
b) They can be recognized by finite automata
c) They can only generate strings of equal length
d) They cannot generate nested structures
In which phase of compiler design are Context-Free Grammars
primarily used?
a) Lexical analysis
3 b Remember
b) Syntax analysis
c) Semantic analysis
d) Code generation
Which of the following is NOT a component of a Context-Free
Grammar?
a) Terminals
4 d Remember
b) Non-terminals
c) Production rules
d) Regular expressions

language? a) {a^n b^n | n ≥ 0} b) {ww^R | w ∈ {a, b}} c) {ww |


Which of the following is an example of a context-free

w ∈ {a, b}} d) {a^n b^m | n, m ≥ 0}


5 c Understand

Students have to prepare answers for the following questions at the end of the lecture

Bloom’s
Qn
Question Marks CO Knowledge
No
Level
i j k
Write CFG to accept the language defined by L={a b c |
1 2 C210.3 Understand
I,j,k,>=0 and i=j+k} (AU-NOV-2021)
What language over {0,1} does the CFG with productions
2 S00S | 11S |S00|S11|01S01 |01S10 |10S10 |10S01 |ε 13 C210.3 Apply
generate ?Justify your answer.(AU MAY-2023
Let G=(V,E,R,0 be the CFG , where V={ A,B,S}, E={ a,b} , S
is the start variable and R consist of the rules
SaB | bA
Aa | aS | BAA

i)Prove that ababba ∈ L(G)


B b | bS | ABB
3 13 C210.3 Apply
ii) Prove that L(G) is the set of all non
empty strings w over the alphabet {a,b}
such that the number a’s in w is equal to
the number of b’s in w. AU-MAY-2023
Reference Book
Author(s) Title of the book Page numbers
Hopcroft J.E., "Introduction to Automata Theory, Languages
Motwani R. & and
169-173
Ullman J.D., Computations", 3rd Edition, Pearson Education,
2008.

Unit Lectur
3 21
No e No
Topic Derivations and Parse trees
Bloom’s
Learning Outcome (LO) At the end of this lecture, students will be able to Knowledge
Level
LO1 Derive derivations for given grammars and strings Understand
LO2 Recognize the importance of parse trees in parsing algorithms
and compiler design. Understand
LO3 Analyze and compare different parsing techniques Analyze

Lecture notes
Assessment questions to the lecture

Bloom’s
Qn
Question Answer Knowledge
No
Level
1 What is the primary purpose of a derivation tree in
formal language theory?
a) To represent the syntactic structure of a sentence
a Understand
b) To represent the semantic meaning of a sentence
c) To represent the lexical analysis of a sentence
d) To represent the runtime execution of a program
2 Which of the following best describes a parse tree?
a) A graphical representation of the syntax structure of
a string according to a given grammar
b) A runtime data structure used during program
execution a Understand
c) A linear sequence of symbols generated by a
grammar
d) A tree structure representing the execution flow of a
program
3 In a parse tree, what do the internal nodes represent? b Understand
a) Terminals in the grammar
b) Non-terminals in the grammar
c) Syntactic categories in the language
d) Lexical tokens in the input string
4 Which of the following parsing techniques directly
constructs a parse tree?
a) LL(1) parsing
c Understand
b) LR(1) parsing
c) Recursive descent parsing
d) Operator precedence parsing
5 In a derivation tree, what do the internal nodes
represent?
a) Terminals in the grammar
c Understand
b) Non-terminals in the grammar
c) Syntactic categories in the language
d) Lexical tokens in the input string

Students have to prepare answers for the following questions at the end of the lecture

Bloom’s
Qn
Question Marks CO Knowledge
No
Level

Reference Book
Author(s) Title of the book Page numbers
Hopcroft J.E., "Introduction to Automata Theory, Languages
Motwani R. & and
173-187
Ullman J.D., Computations", 3rd Edition, Pearson Education,
2008.

Unit Lectur
3 22
No e No
Topic Ambiguity in grammars and Languages
Bloom’s
Learning Outcome (LO) At the end of this lecture, students will be able to Knowledge
Level
LO1 Understand the concept of ambiguity in formal language theory Understand
and its implications for parsing.
LO2 Identify ambiguity in context-free grammars (CFGs) and regular Understand
grammars.
LO3 Construct unambiguous grammars for languages with ambiguous Apply
specifications.
Lecture notes
a context free grammar G with production rules : S -> aSb | bSa | SS | e
Left Most Derivation (LMD) and Derivation Tree : Leftmost
derivation of a string from starting symbol S is done by replacing leftmost
non-terminal symbol by RHS of corresponding production rule. For
example, the leftmost derivation of string abab from grammar G above is
done as : S => aSb => abSab => abab The symbols underlined are
replaced using production rules. Derivation Tree : It tells how a string is
derived using production rules from S and has been shown in Figure 1.

Right Most Derivation (RMD) : Rightmost


derivation of a string from starting symbol S is done by replacing
rightmost non-terminal symbol by RHS of corresponding production rule.
e.g.; The rightmost derivation of string abab from grammar G above is
done as : S => SS => SaSb => Sab => aSbab => abab The symbols
underlined are replaced using production rules. The derivation tree for
abab using rightmost derivation has been shown in Figure 2.

A derivation can be either LMD or RMD or both or none. For


example, S => aSb => abSab => abab is LMD as well as RMD but S =>
SS => SaSb => Sab => aSbab => abab is RMD but not LMD.
Ambiguous Context Free Grammar : A context free grammar is called
ambiguous if there exists more than one LMD or more than one RMD for a
string which is generated by grammar. There will also be more than one
derivation tree for a string in ambiguous grammar. The grammar
described above is ambiguous because there are two derivation trees
(Figure 1 and Figure 2). There can be more than one RMD for string abab
which are: S => SS => SaSb => Sab => aSbab => abab S => aSb =>
abSab => abab
Ambiguous Context Free Languages : A context free language is
called ambiguous if there is no unambiguous grammar to define that
language and it is also called inherently ambiguous Context Free
Languages. eg- L={anbncm} U {anbmcm} Note :
 If a context free grammar G is ambiguous, language generated by
grammar L(G) may or may not be ambiguous.
 It is not always possible to convert ambiguous CFG to
unambiguous CFG. Only some ambiguous CFG can be converted
to unambiguous CFG.
 There is no algorithm to convert ambiguous CFG to unambiguous
CFG.
 There always exists a unambiguous CFG corresponding to
unambiguous CFL.
 Deterministic CFL are always unambiguous and are parsed by LR
parsers.

Assessment questions to the lecture

Bloom’s
Qn
Question Answer Knowledge
No
Level
1 b Remember
Which of the following best defines ambiguity in
the context of grammars and languages?

a) It refers to the clarity and precision of language


rules.

b) It indicates the existence of multiple parse trees


or interpretations for a given string in a grammar.
c) It signifies grammatical errors in a language.

d) It denotes the complexity of a language's


syntax.

2 Which one of the following statements is c Understand


FALSE?
A. There exist context-free languages such
that all the context-free grammars generating
them are ambiguous.
B. An unambiguous context free grammar
always has a unique parse tree for each string
of the language generated by it.
C. Both deterministic and non-deterministic
pushdown automata always accept the same
set of languages.
D. A finite set of string from one alphabet is
always a regular language.
3 Consider the following statements about the b Understand
context free grammar G = {S -> SS, S -> ab, S
-> ba, S -> ?}
I. G is ambiguous
II. G produces all strings with equal
number of a’s and b’s
III. G can be accepted by a deterministic
PDA Which combination below
expresses all the true statements
about G?
A. I only
B. I and III only
C. II and III only
D. I, II and III
4 A CFG is ambiguous if b Remember
a) It has more than one rightmost derivations
b) It has more than one leftmost derivations
c) No parse tree can be generated for the CFG
d) None of the mentioned
5 Which of the following are always unambiguous? a Remember
a) Deterministic Context free grammars
b) Non-Deterministic Regular grammars
c) Context sensitive grammar
d) None of the mentioned

Students have to prepare answers for the following questions at the end of the lecture

Bloom’s
Qn
Question Marks CO Knowledge
No
Level
1 When do you say that the given grammar G is 2 C210.3 Remember
ambiguous? ( AU-DEC 2022)

Reference Book
Author(s) Title of the book Page numbers
Hopcroft J.E., "Introduction to Automata Theory, Languages
Motwani R. & and
205-215
Ullman J.D., Computations", 3rd Edition, Pearson Education,
2008.
Unit Lectur
3 23
No e No
Topic Push Down Automata (PDA): Definition – Moves - Instantaneous descriptions
Bloom’s
Learning Outcome (LO) At the end of this lecture, students will be able to Knowledge
Level
LO1 Describe the formal definition, operation of pushdown automata. Understand
LO2 Relate context free language and pushdown automata. Understand
LO3 Summarize the applications and limitations of pushdown automata. Understand

Lecture notes
Assessment questions to the lecture

Bloom’s
Qn
Question Answer Knowledge
No
Level
1 Which of the following components is NOT a part of a B Remamber
pushdown automaton (PDA)?
A) States
B) Input tape
C) Stack
D) Transition function
2 In a pushdown automaton (PDA), the transition function C Remamber
δ is defined as:
A) δ: Q × Σ × Γ → Q
B) δ: Q × Σ → Q × Γ
C) δ: Q × Σ × Γ → P(Q × Γ*)
D) δ: Q × Γ → Q × Γ*
3 What is the main purpose of the stack in a pushdown B Remamber
automaton?
A) To store input symbols
B) To store intermediate results
C) To store transition rules
D) To store the current state
4 1. Which of the following languages can be A Remamber
recognized by a pushdown automaton?
2. A) Context-free languages
3. B) Regular languages
4. C) Turing languages
5. D) Recursively enumerable languages
6.
5 1. Which of the following statements about pushdown a Remamber
automata is true?
2. A) Pushdown automata can recognize non-context-
free languages.
3. B) Pushdown automata can recognize all regular
languages.
4. C) Pushdown automata do not require a stack.
5. D) Pushdown automata are equivalent to Turing
machines.
6.
Students have to prepare answers for the following questions at the end of the lecture

Bloom’s
Qn
Question Marks CO Knowledge
No
Level
Design a pushdown automata that will accept strings
(a+b)* in which the number of a’s is greater than the
1 7 C210.3 Apply
number of b’s given the alphabet {a,b} (AU-MAY
2023)
Design a PDA to recognize the language , L defined
C C
2 by , L ={WCW \ W ε {0,1} and W is one’s 13 C210.3 Apply
complement of W} (AU-NAOV-2021)
What is deterministic pushdown automata (AU-MAY
3 2 C210.3 Remember
2023)

Reference Book
Author(s) Title of the book Page numbers
Hopcroft J.E., "Introduction to Automata Theory, Languages
Motwani R. & and
219-228
Ullman J.D., Computations", 3rd Edition, Pearson Education,
2008.

Unit Lectur
3 24
No e No
Topic Languages of pushdown automata
Bloom’s
Learning Outcome (LO) At the end of this lecture, students will be able to Knowledge
Level
LO1 Understand the Context-Free Languages Understand
LO2 Associate the relationship between CFLs and PDAs Understand
LO3 Infer the language Recognized by Pushdown Automata Understand

Lecture notes
Construct a PDA for language L = {0 n1m | n >= 1, m >= 1, m >
n+2}
Approach used in this PDA –
First 0’s are pushed into stack.When 0’s are finished, two 1’s are ignored.
Thereafter for every 1 as input a 0 is popped out of stack. When stack is
empty and still some 1’s are left then all of them are ignored.

 Step-1: On receiving 0 push it onto stack. On receiving 1, ignore it and


goto next state
 Step-2: On receiving 1, ignore it and goto next state
 Step-3: On receiving 1, pop a 0 from top of stack and go to next state
 Step-4: On receiving 1, pop a 0 from top of stack. If stack is empty, on
receiving 1 ignore it and goto next state
 Step-5: On receiving 1 ignore it. If input is finished then goto last state

Examples:
Input : 0 0 0 1 1 1 1 1 1
Result : ACCEPTED

Input : 0 0 0 0 1 1 1 1
Result : NOT ACCEPTED
Assessment questions to the lecture

Bloom’s
Qn
Question Answer Knowledge
No
Level
Which of the following languages can be accepted by a
pushdown automaton?
A) Regular languages
1 c Remember
B) Context-sensitive languages
C) Context-free languages
D) Recursively enumerable languages
The language accepted by a pushdown automaton is defined as:
B
A) The set of strings that lead to a non-final state.
2 B) The set of strings that lead to an empty stack. Remember
C) The set of strings that lead to a final state.
D) The set of strings that lead to a non-empty stack.
Which of the following acceptance criteria is commonly used for
pushdown automata?
A) Acceptance by halting on a final state.
3 b Remember
B) Acceptance by halting on an empty stack.
C) Acceptance by reaching a designated accept state.
D) Acceptance by having a non-empty stac
1. A language L is said to be accepted by a pushdown automaton
if:
2. A) There exists a string in L that leads to a non-final state. B)
4 C Remember
Every string in L leads to a non-empty stack.
3. C) Every string in L leads to an empty stack.
4. D) There exists a string in L that leads to a final state.
Which of the following statements about the languages accepted
by pushdown automata is true?
A) Pushdown automata can accept all regular languages.
B) Pushdown automata can accept all context-sensitive
5 languages. D Remember
C) Pushdown automata can accept all recursively enumerable
languages.
D) Pushdown automata can accept all recursively enumerable
languages, but not all context-sensitive languages.

Students have to prepare answers for the following questions at the end of the lecture

Qn Question Marks CO Bloom’s


Knowledge
No
Level
Draw a PDA to accept strings of the language
1 n 2 C210.3 Understand
L={ a n c b | n>=0} (AU-NOV 2022)
2n p 2n
Explain whether the language L=[ a b c | n>=0 } can
2 be designed using pushdown automata. Justify your 13 C210.3 Apply
answer. (AU-NOV 2022)
n p n 2n
Explain whether the language L=[ a b c d | n>=0 }
3 can be designed using pushdown automata. Justify your 13 C210.3 Apply
answer. (AU-NOV 2022)

Reference Book
Author(s) Title of the book Page numbers
Hopcroft J.E., "Introduction to Automata Theory, Languages
Motwani R. & and
229-236
Ullman J.D., Computations", 3rd Edition, Pearson Education,
2008.

Unit Lectur
3 25
No e No
Topic Equivalence of pushdown automata and CFG -CFG to PDA
Bloom’s
Learning Outcome (LO) At the end of this lecture, students will be able to Knowledge
Level
LO1 Illustrate the equivalence between pushdown automata and context-free Understand
grammar.
LO2 Convert between CFGs and PDAs. Understand
LO3 Solve problems related to language recognition and parsing Apply

Lecture notes

PDA corresponding to a given CFG


Input − A CFG, G = (V, T, P, S)
Output − Equivalent PDA, P = (Q, ∑, S, δ, q0, I, F)
Step 1 − Convert the productions of the CFG into GNF.
Step 2 − The PDA will have only one state {q}.
Step 3 − The start symbol of CFG will be the start symbol in the PDA.
Step 4 − All non-terminals of the CFG will be the stack symbols of the PDA and all the terminals of
the CFG will be the input symbols of the PDA.
Step 5 − For each production in the form A → aX where a is terminal and A, X are combination of
terminal and non-terminals, make a transition δ (q, a, A).
Problem

Construct a PDA from the following CFG.

G = ({S, X}, {a, b}, P, S)

where the productions are −

S → XS | ε , A → aXb | Ab | ab
Solution

Let the equivalent PDA,

P = ({q}, {a, b}, {a, b, X, S}, δ, q, S)

where δ −

δ(q, ε , S) = {(q, XS), (q, ε )}

δ(q, ε , X) = {(q, aXb), (q, Xb), (q, ab)}

δ(q, a, a) = {(q, ε )}

δ(q, 1, 1) = {(q, ε )}

Assessment questions to the lecture

Bloom’s
Qn
Question Answer Knowledge
No
Level
Which of the following statements about the conversion from a
CFG to a PDA is true? A) The conversion involves adding
terminals to the stack alphabet of the PDA.
B) The conversion involves adding non-terminals to the stack
1 alphabet of the PDA. a Understand
C) The conversion involves adding productions to the transition
function of the PDA.
D) The conversion involves adding productions to the set of
rules of the CFG.
2 In the conversion from a CFG to a PDA, each production of the a Understand
CFG is translated into:
A) A transition in the PDA.
B) A state in the PDA.
C) A terminal symbol in the PDA.
D) A non-terminal symbol in the PDA.
Which of the following components is added to the PDA during
the conversion from a CFG?
A) Start symbol
3 C Understand
B) Terminal symbols
C) Stack alphabet symbols
D) Transition rules
The purpose of adding ε-transitions in the conversion from a
CFG to a PDA is to:
A) Eliminate non-determinism.
4 B Understand
B) Ensure that the PDA accepts the empty string.
C) Ensure that the PDA rejects the empty string.
D) Reduce the number of states in the PDA.
In the conversion from a CFG to a PDA, the start symbol of the
CFG corresponds to:
A) The start state of the PDA.
5 B Understand
B) The initial symbol pushed onto the stack of the PDA.
C) The accept state of the PDA.
D) The reject state of the PDA.
Students have to prepare answers for the following questions at the end of the lecture

Bloom’s
Qn
Question Marks CO Knowledge
No
Level

Reference Book
Author(s) Title of the book Page numbers
Hopcroft J.E., "Introduction to Automata Theory, Languages
Motwani R. & and
237-241
Ullman J.D., Computations", 3rd Edition, Pearson Education,
2008.

Unit Lectur
3 26
No e No
Topic PDA to CFG
Bloom’s
Learning Outcome
Knowledge
(LO) At the end of this lecture, students will be able to
Level
LO1 Illustrate the equivalence between pushdown automata and context-free Understand
grammar.
LO2 Convert between CFGs and PDAs. Understand
LO3 Solve problems related to language recognition and parsing Apply
Lecture notes

Algorithm to find CFG corresponding to a given PDA


Input − A CFG, G = (V, T, P, S)

be {Xwx | w,x ∈ Q} and the start state will be Aq0,F.


Output − Equivalent PDA, P = (Q, ∑, S, δ, q0, I, F) such that the non- terminals of the grammar G will

Step 1 − For every w, x, y, z ∈ Q, m ∈ S and a, b ∈ ∑, if δ (w, a, ε) contains (y, m) and (z, b, m)

Step 2 − For every w, x, y, z ∈ Q, add the production rule Xwx → XwyXyx in grammar G.
contains (x, ε), add the production rule Xwx → a Xyzb in grammar G.

Step 3 − For w ∈ Q, add the production rule Xww → ε in grammar G.

Assessment questions to the lecture

Bloom’s
Qn
Question Answer Knowledge
No
Level
Which of the following statements about converting a Pushdown
Automaton (PDA) to a Context-Free Grammar (CFG) is correct?
A) Converting a PDA to a CFG is not possible.
B) Every PDA can be converted into an equivalent CFG, and
1 vice versa. b Understand
C) Only deterministic PDAs can be converted to CFGs.
D) CFGs and PDAs are unrelated formalisms and cannot be
converted into each other.

Which of the following describes the process of converting a


Pushdown Automaton (PDA) to a Context-Free Grammar
(CFG)?
A) Eliminating non-determinism in the PDA and then converting
it to a CFG.
2 B) Constructing a CFG directly from the transition rules and b Understand
stack operations of the PDA.
C) Simplifying the PDA's transition rules and then applying a
series of transformations to derive a CFG.
D) It is not possible to convert a PDA to a CFG.

3 Which of the following steps is involved in converting a c Understand


Pushdown Automaton (PDA) to a Context-Free Grammar
(CFG)?
A) Eliminating the stack operations from the PDA.
B) Introducing a new set of states in the PDA.
C) Constructing productions for the CFG based on PDA's
transitions.
D) Adding non-terminal symbols to the PDA's alphabet.

4 When converting a Pushdown Automaton (PDA) to a Context-


Free Grammar (CFG), which of the following is NOT a typical
step in the conversion process?
A) Constructing productions for the CFG based on PDA
transitions.
B) Introducing new non-terminal symbols to represent stack c Understand
contents.
C) Eliminating the need for terminal symbols in the CFG.
D) Ensuring each transition in the PDA corresponds to a
production rule in the CFG.

5 Which of the following statements accurately describes the


conversion process of a Pushdown Automaton (PDA) to a
Context-Free Grammar (CFG)?
A) Converting a PDA to a CFG always results in a deterministic
CFG.
B) The conversion of a PDA to a CFG is a one-to-one mapping,
ensuring equivalence in language recognition. d Understand
C) The conversion process involves removing non-terminal
symbols from the PDA and replacing them with terminals in the
CFG.
D) Productions in the CFG are generated based on PDA
transitions, capturing stack operations and state transitions.

Students have to prepare answers for the following questions at the end of the lecture

Bloom’s
Qn
Question Marks CO Knowledge
No
Level
1. Design a pushdown automata that will accept strings 13 C210.3 Apply
(a+b)* in whichthe number of a’s is greater than
number of b’s . Convert the above PDA to its
equivalent CFG (AU-MAY 2023)

Reference Book
Author(s) Title of the book Page numbers
Hopcroft J.E., "Introduction to Automata Theory, Languages 242-245
Motwani R. & and
Ullman J.D., Computations", 3rd Edition, Pearson Education,
2008.

Unit Lectur
3 27
No e No
Topic Deterministic Pushdown Automata
Bloom’s
Learning Outcome (LO) At the end of this lecture, students will be able to Knowledge
Level
LO1 Define Deterministic Pushdown Automata (DPDA) and distinguish them Remember
from Non-deterministic Pushdown Automata
LO2 Describe the operational model of a DPDA Understand
LO31. Differentiate between acceptance by final state and acceptance by empty Understand
stack in DPDA.

Lecture notes
Assessment questions to the lecture

Bloom’s
Qn
Question Answer Knowledge
No
Level
Which of the following statements accurately
describes Deterministic Pushdown Automata
(DPDA)?

A) DPDA can have multiple transitions for the same


input symbol and stack symbol.
1 B) DPDA can recognize languages beyond the Understand
context-free languages.
C) DPDA can process input strings with the help of
an auxiliary tape. d
D) DPDA has at most one transition for each input
symbol and stack symbol combination.

Which of the following statements accurately


describes a property of Deterministic Pushdown
Automata (DPDA)?
A) DPDA can have multiple transitions from a given
state for the same input symbol and stack symbol.
B) DPDA can recognize languages that are not
context-free.
2 d Understand
C) DPDA can process input strings without the use
of a stack.
D) DPDA has a transition function that maps each
combination of current state, input symbol, and
stack symbol to at most one next state and one
stack operation.

Which of the following statements is true regarding


Deterministic Pushdown Automata (DPDA)?
A) DPDA can have multiple transitions from a given
state for the same input symbol and stack symbol.
B) DPDA can recognize languages that are not
context-free.
3 c Understand
C) DPDA's transition function is such that for each
state and input symbol, there can be at most one
next state and one stack operation.
D) DPDA requires an auxiliary memory tape in
addition to its stack for processing input strings.

4 Which of the following accurately describes a C Understand


property of Deterministic Pushdown Automata
(DPDA)?
A) DPDA can have multiple transitions for the same
input symbol and stack symbol.
B) DPDA can recognize non-context-free languages.
C) DPDA's stack alphabet can be different from its
input alphabet.
D) DPDA processes input symbols from left to right
without utilizing a stack.

In a Deterministic Pushdown Automaton (DPDA), for


each combination of current state, input symbol,
and stack symbol:
A) There can be multiple transitions leading to
different states and stack operations.
B) There can be at most one transition leading to
5 b Understand
the next state and one stack operation.
C) There must be a transition leading to the next
state and one stack operation.
D) The transition to the next state is optional, but
there must always be a stack operation.

Students have to prepare answers for the following questions at the end of the lecture

Bloom’s
Qn
Question Marks CO Knowledge
No
Level

Reference Book
Author(s) Title of the book Page numbers
Hopcroft J.E., "Introduction to Automata Theory, Languages
Motwani R. & and
246-251
Ullman J.D., Computations", 3rd Edition, Pearson Education,
2008.

You might also like