FORMAL LANGUAGE & AUTOMATA THEORY
100406Module 2: Context-Free Languages (CFL) and PDA
Q1a. A language accepted by deterministic pushdown automata is closed under which of the following? (i) Complement (ii) Union (iii) Both (i) and (ii) (iv) None of the above20232m
Module 2: Context-Free Languages (CFL) and PDA
View this question on its own page →A language accepted by deterministic pushdown automata is closed under which of the following?
(i) Complement
(ii) Union
(iii) Both (i) and (ii)
(iv) None of the aboveWorked SolutionAnswer
Correct Option: (i) Complement
Explanation
Languages accepted by Deterministic Pushdown Automata (DPDA) are Deterministic Context-Free Languages (DCFLs).
Closure Properties of DCFLs
Operation Closed? Complement Yes Union No Intersection No Intersection with Regular Yes Concatenation No Kleene Star No Reason:
- A DPDA can be complemented by swapping final/non-final states after ensuring it is total and handles end-of-input deterministically, similar to DFA complementation, but adapted for stack handling.
- DCFLs are not closed under union: e.g., and are DCFLs, but is not a DCFL.
- Since union fails, (iii) Both is false and (iv) is false.
Contrast with general CFLs (NPDA)
CFLs (non-deterministic) are not closed under complement nor intersection, but are closed under union, concatenation, Kleene star – opposite behaviour.
Final Answer
DCFL is closed under complement only. Hence option (i) Complement is correct.
Q1d. Context-free languages are NOT closed under (i) Union (ii) Concatenation (iii) Intersection (iv) Kleene star20252m
Module 2: Context-Free Languages (CFL) and PDA
View this question on its own page →Context-free languages are NOT closed under
(i) Union
(ii) Concatenation
(iii) Intersection
(iv) Kleene starWorked SolutionAnswer
Correct Option: (iii) Intersection
Explanation
Closure properties of Context-Free Languages (CFLs):
Operation Closed? Union Yes – Concatenation Yes – Kleene star Yes – Intersection No Complement No Counterexample for intersection:
(CFL), (CFL)
which is not CFL (pumping lemma).Since De Morgan: , non-closure under intersection implies non-closure under complement.
Final Answer
CFLs are NOT closed under Intersection → Option (iii).
Q1e. If L_1 and L_2 are CFLs, L_1 - L_2 is ____ context-free. (i) always (ii) sometimes (iii) never (iv) None of the above20212m
Module 2: Context-Free Languages (CFL) and PDA
View this question on its own page →If and are CFLs, is ____ context-free.
(i) always
(ii) sometimes
(iii) never
(iv) None of the aboveWorked SolutionAnswer
Correct Option: (ii) sometimes (i.e., not always — CFLs are not closed under difference)
Explanation
.
- CFLs are closed under union, concatenation, Kleene star, but NOT under intersection, complement, difference.
- Since complement of a CFL is not necessarily CFL, difference need not be CFL.
Counterexample:
(actually regular, also CFL)
Let (CFL) and (CFL)
not CFL.
Then style constructions show difference can be non-CFL.But sometimes it is CFL: e.g., if is regular, then is CFL because CFL ∩ Regular = CFL. So difference is sometimes CFL.
Many textbooks phrase options as:
- (i) always — false
- (ii) sometimes / not always closed
- (iii) never — false (counterexample above shows sometimes)
Hence correct is not necessarily CFL → Option (ii) sometimes (or “not always”). If exam key uses “never”, they mean “not closed”, also acceptable as (iii) in that phrasing — but strictly “sometimes” is precise.
Final Answer
is not guaranteed CFL → Not closed → Option (ii) sometimes / not always (exam may list as (iii) never in weaker phrasing).
Q1f. Which of the following does not have left recursion? (i) Chomsky Normal Form (ii) Greibach Normal Form (iii) Backus–Naur Form (iv) All of the above20212m
Module 2: Context-Free Languages (CFL) and PDA
View this question on its own page →Which of the following does not have left recursion?
(i) Chomsky Normal Form
(ii) Greibach Normal Form
(iii) Backus–Naur Form
(iv) All of the aboveWorked SolutionAnswer
Correct Option: (i) Chomsky Normal Form and (ii) Greibach Normal Form — both have no left recursion; if single choice required, (i) CNF is the textbook answer, and BNF may contain left recursion.
Explanation
Left recursion: Production .
- Chomsky Normal Form (CNF): or , where , . No on RHS leftmost as non-terminal with same , and no . No left recursion.
- Greibach Normal Form (GNF): , where , . Starts with terminal → no left recursion by definition.
- Backus-Naur Form (BNF): General notation for CFG, e.g., . May contain left recursion (common in expression grammars).
Options:
- (i) CNF → no left recursion ✓
- (ii) GNF → no left recursion ✓
- (iii) BNF → can have left recursion ✗
- (iv) All of above → false because BNF can have it.
If exam expects single answer, CNF (and GNF) are correct; many keys mark (i) Chomsky Normal Form.
Final Answer
CNF / GNF have no left recursion → Option (i) (and (ii)). BNF can have left recursion.
Q1f. A given grammar is called ambiguous if: (i) two or more productions have the same non-terminal on LHS (ii) a derivation tree has more than one associated sentence (iii) there exists a sentence with more than one derivation tree (iv) brackets are not present in the grammar20232m
Module 2: Context-Free Languages (CFL) and PDA
View this question on its own page →A given grammar is called ambiguous if:
(i) two or more productions have the same non-terminal on LHS
(ii) a derivation tree has more than one associated sentence
(iii) there exists a sentence with more than one derivation tree
(iv) brackets are not present in the grammarWorked SolutionAnswer
Correct Option: (iii) there exists a sentence with more than one derivation tree
Explanation
Ambiguous Grammar: Grammar is ambiguous iff there exists a string that has two or more distinct derivation trees (or equivalently two distinct leftmost / rightmost derivations).
- (i) “two productions have same LHS” → false; e.g., has same LHS but not ambiguous (each string one tree).
- (ii) “derivation tree has more than one sentence” — every tree yields exactly one sentence (its yield), false.
- (iii) True — definition of ambiguity: .
- (iv) “brackets not present” — irrelevant.
Example ambiguous: ; string has two trees (different precedence).
Final Answer
Ambiguous iff some sentence has ≥2 parse trees → Option (iii).
Q1g. Which one of the following statements is true? (i) The intersection of two CFLs is context-free (ii) Every CFL can be accepted by a DPDA (iii) The union of two CFLs is context-free (iv) The complement of a CFL is context-free20232m
Module 2: Context-Free Languages (CFL) and PDA
View this question on its own page →Which one of the following statements is true?
(i) The intersection of two CFLs is context-free
(ii) Every CFL can be accepted by a DPDA
(iii) The union of two CFLs is context-free
(iv) The complement of a CFL is context-freeWorked SolutionAnswer
Correct Option: (iii) The union of two CFLs is context-free
Explanation
CFL closure:
Operation Closed? Example Union Yes Intersection No not CFL Complement No Follows from De Morgan Every CFL is DPDA No is CFL but not DCFL Intersection of 2 CFLs is CFL No Thus only union is guaranteed.
Options:
- (i) Intersection → false
- (ii) Every CFL is DPDA → false (DCFL ⊂ CFL)
- (iii) Union → true ✓
- (iv) Complement → false
Final Answer
Union of two CFLs is CFL → Option (iii).
Q1h. ____ is the acyclic graphical representation of a grammar. (i) Binary tree (ii) Octtree (iii) Parse tree (iv) None of the above20212m
Module 2: Context-Free Languages (CFL) and PDA
View this question on its own page →____ is the acyclic graphical representation of a grammar.
(i) Binary tree
(ii) Octtree
(iii) Parse tree
(iv) None of the aboveWorked SolutionAnswer
Correct Option: (iii) Parse tree
Explanation
Parse tree (derivation tree / syntax tree): Acyclic, rooted, ordered tree representing derivation.
- Root = start symbol
- Internal nodes = non-terminals
- Leaves = terminals (yield = derived string)
- No cycles (grammar is context-free, derivation finite).
Not binary tree specifically (parse tree can be -ary), not octtree. Binary tree is for CNF.
Final Answer
Parse tree → Option (iii).
Q1i. Which of the following CFLs is deterministic? (i) {a^n b^n} (ii) Arithmetic expressions (iii) Palindromes (iv) {ww^R}20252m
Module 2: Context-Free Languages (CFL) and PDA
View this question on its own page →Which of the following CFLs is deterministic?
(i) {}
(ii) Arithmetic expressions
(iii) Palindromes
(iv) {}Worked SolutionAnswer
Correct Option: (i)
Explanation
Deterministic CFL (DCFL): Accepted by DPDA (deterministic pushdown).
- (i) : DPDA can push 's, then pop for 's, deterministic (no choice). DCFL.
- (ii) Arithmetic expressions (e.g., ) → inherently ambiguous, CFL but not deterministic (needs guessing).
- (iii) Palindromes → not deterministic (needs to guess middle). is DCFL, but plain palindromes is NPD A.
- (iv) similar to (iii) — not DCFL.
Hence only is deterministic.
Final Answer
is DCFL → Option (i).
Q1j. Which of the following is a PDA? (i) Finite automaton with a stack (ii) Turing machine with a stack (iii) Finite automaton with a queue (iv) Turing machine with a queue20242m
Module 2: Context-Free Languages (CFL) and PDA
View this question on its own page →Which of the following is a PDA?
(i) Finite automaton with a stack
(ii) Turing machine with a stack
(iii) Finite automaton with a queue
(iv) Turing machine with a queueWorked SolutionAnswer
Correct Option: (i) Finite automaton with a stack
Explanation
PDA definition:
- Essentially a finite automaton (finite control) augmented with a stack (LIFO memory).
- Stack provides unbounded memory but restricted access (push/pop at top only).
- Enables recognition of CFLs: e.g., by pushing 's, popping for 's.
Options:
- (ii) TM with stack → equivalent to TM (stack is not needed)
- (iii) FA with queue → queue automaton = TM-powerful
- PDA = FA + stack.
Final Answer
PDA = FA + stack → Option (i).
Q2a. Given the grammar G = (\{S\}, \{a, b\}, P, S) P: S \rightarrow aSb | ab Derive the string aabb using leftmost derivation, rightmost derivation and also draw the parse tree.20257m
Module 2: Context-Free Languages (CFL) and PDA
View this question on its own page →Given the grammar
Derive the string aabb using leftmost derivation, rightmost derivation and also draw the parse tree.
Worked SolutionAnswer
Grammar: with
1. Leftmost Derivation (LMD)
At each step, replace the leftmost non-terminal.
LMD Steps:
2. Rightmost Derivation (RMD)
At each step, replace the rightmost non-terminal.
RMD Steps:
Note: Since this grammar is unambiguous and has only one non-terminal, LMD and RMD coincide in the sequence of sentential forms.
3. Parse Tree (Derivation Tree)
S /|\ a S b | S /|\ a S b | abText/Mermaid representation:
MermaidDiagramRendering diagram…Tree structure:
- Root:
- Internal nodes: (non-terminals)
- Leaves (yield): (reading left to right =
aabb) - Height: 3 (excluding root)
Verification
- String generated:
aabb✓ - Language of grammar:
aabbcorresponds to ✓
Final Answer
LMD:
RMD:
Parse Tree: As shown above (yield =aabb).- Install PocketlyBudget App•POCKETLY
Pocketly on Android
Log daily food, travel, and hostel expenses instantly. Set monthly spending limits and see where your money goes without complex spreadsheets.
Q2b. State the pumping lemma for context-free languages.20237m
Module 2: Context-Free Languages (CFL) and PDA
View this question on its own page →State the pumping lemma for context-free languages.
Worked SolutionAnswer
Pumping Lemma for Context-Free Languages (CFL)
Statement:
Let be a context-free language. Then there exists a constant (the pumping length) such that for every string with , can be written assatisfying the following conditions:
- — the middle part is short (bounded by )
- — at least one of or is non-empty (not both empty)
- For all : — pumping and together (0, 1, 2, … times) keeps the string in
Interpretation
- For any sufficiently long CFL string, you can find a decomposition into 5 parts such that the inner and can be "pumped" simultaneously (repeated same number of times) and the result stays in the language.
- The simultaneous pumping of and is the key difference from the regular pumping lemma (which pumps a single ).
- means the "pumpable" region is near the center of the string (within length ).
How to Use (Proving Non-CFL)
To prove is not context-free:
- Assume is CFL → pumping lemma holds with some .
- Choose a specific string with (usually or similar).
- Show that for every valid decomposition satisfying (1) and (2), there exists some such that $uv^i x y^i z
otin L$. - Contradiction → not CFL.
Common Strategy: Choose so that any of length cannot span all "coordinated" parts (e.g., three blocks ). Pumping disrupts the balance.
Example Application
Prove is not CFL.
- Let be pumping length. Take , .
- By lemma, with , .
- Since , the substring cannot contain 's, 's, and 's simultaneously — it lies within at most two adjacent blocks.
- Cases:
- only in 's: pumping adds 's → $#a
eq #b = #c$ ❌ - only in 's: pumping adds 's → $#b
eq #a, #c$ ❌ - only in 's: pumping adds 's ❌
- spans boundary: pumping changes and differently (or adds both) → $#a
eq #b#b
eq #c$ ❌ - spans boundary: similar ❌
- only in 's: pumping adds 's → $#a
- All decompositions fail for some $i
e 1$. Contradiction.
Contrast with Regular Pumping Lemma
Aspect Regular (Type-3) CFL (Type-2) String split Pumped part (single) and (pair) Constraint Non-empty Result
Important Notes
- The lemma gives necessary but not sufficient condition for CFL.
- There are non-CFL languages that satisfy the lemma (e.g., some non-context-free languages still pump).
- For CFL, pumping is simultaneous of two substrings ( and ), reflecting stack push/pop pairing.
- The pumping length depends on the grammar (e.g., number of variables in Chomsky Normal Form).
Final Answer
Pumping Lemma for CFL: such that , with , , and . Used to prove languages like are not context-free.
Q3a. Design a PDA (empty stack and final state both) for L = \{ WW^r \mid W \in \{a,b\}^* \}.20237m
Module 2: Context-Free Languages (CFL) and PDA
View this question on its own page →Design a PDA (empty stack and final state both) for .
Worked SolutionAnswer
Language: — even-length palindromes over .
= reverse of . Examples: , , , , , , …
PDA Design (NPDA)
This language is not deterministic (NPDA needed) — the PDA must guess the midpoint.
PDA:
- : reading first half, pushing symbols
- : reading second half, popping & matching
- : accept (final state)
- ( = bottom marker)
- = start
- (final state)
- Empty stack also accepted: remains at bottom, all input symbols pushed then popped
Transition Function
Current State Input Stack Top Action Next State Push/Pop Push Push Guess midpoint, switch to pop (no change) Pop & match (pop) Pop & match (pop) All matched, stack = Formally:
- for
- for
- for (midpoint guess)
State Diagram
a,b / X → aX,bX ┌───────────────────┐ ▼ │ (q0)──ϵ, X/X──►(q1)──a/a:pop,b/b:pop──►(q1) │ │ │ ϵ, Z0/ϵ │ ▼ └──────────────►(q2) [Accept]
How It Works (Example: → )
Push phase ():
- Read
a, pusha: stack =a Z0 - Read
b, pushb: stack =b a Z0 - Guess midpoint (): go to , stack unchanged
b a Z0
- Read
Pop phase ():
- Read
b, top=b→ pop → stack =a Z0 - Read
a, top=a→ pop → stack =Z0 - Input exhausted, -transition on →
- Read
Accept: , or stack = (empty-stack acceptance).
Acceptance Modes
Mode Condition Final State Reach Empty Stack After reading all input, stack = (all pushed symbols matched and popped, only remains) Both equivalent here; PDA accepts by both.
Why Nondeterministic?
- The -transition from to guesses the midpoint.
- For odd-length strings (not in ), no guess works → rejects.
- For , correct guess at exact middle → accepts.
- DPDA cannot guess midpoint deterministically → not DCFL.
Alternative: CFG
generates .
Final Answer
NPDA with 3 states ():
- : push onto stack while reading first half
- -transition: guess midpoint, switch to
- : pop & match each input symbol with stack top
- on : accept ()
- Accepts by final state and empty stack ( only).
Q3a. Design a context-free grammar (CFG) that generates all palindromes over the alphabet {0, 1}. The grammar should generate both even-length palindromes (e.g., 0110) and odd-length palindromes (e.g., 010).20257m
Module 2: Context-Free Languages (CFL) and PDA
View this question on its own page →Design a context-free grammar (CFG) that generates all palindromes over the alphabet {0, 1}. The grammar should generate both even-length palindromes (e.g., 0110) and odd-length palindromes (e.g., 010).
Q3a. Prove that if L is accepted by a PDA, then L can be generated by a CFG.20227m
Module 2: Context-Free Languages (CFL) and PDA
View this question on its own page →Prove that if is accepted by a PDA, then can be generated by a CFG.
Worked SolutionAnswer
Theorem: is accepted by a PDA is generated by a CFG (i.e., CFL = NPDA languages).
We prove PDA CFG using the Triplet Construction (Sipser / standard textbook method).
Given
PDA accepting by final state (empty stack can be converted).
Assume has no -transitions on input (can be eliminated). If -moves exist, handle via closure.
Construction of CFG
Variables :
- Start symbol
- Triplet variables for every and
- Meaning: "Starting in state with stack top , can reach state with popped off (and any symbols pushed above it matched)."
Productions :
Start: for each
- Begin at with initial stack , end in any final state .
From PDA transitions:
For every transition $\delta(p, a, A)
i (q, \alpha)a \in \Sigma \cup {\epsilon}$:Case (pop , no push):
(if , RHS is )Case ():
For all :- Push ; must pop them in order via intermediate states.
- consumed on transition; each matches push/pop of .
Empty stack (optional, for empty-stack acceptance):
Add for all (not needed for final-state).
Intuition of Triplet
- Represents a matching push-pop pair on symbol .
- : state where is pushed
- : state where is popped
- The derivation inside generates the string read between push and pop of .
Proof of Correctness (Sketch)
Soundness (CFG PDA):
Every derivation in corresponds to a valid PDA computation:- maps to initial config.
- Production mimics transition .
- Base case mimics .
- Induction on derivation length shows derived string is accepted by .
Completeness (PDA CFG):
For any accepting run of on , build a parse tree in :- Root .
- Each push of at state and corresponding pop at gives variable .
- The substring read between push and pop is generated by that variable.
- By induction on height of push-pop pairs, is generated.
Example
PDA for :
CFG variables:
Productions:
(after resolving all intermediate states)Yields .
Formal Statement
Theorem: is accepted by a (nondeterministic) PDA iff is generated by a CFG.
Corollary: CFL = languages accepted by NPDA. DPDA CFL (strict).
Final Answer
Proof via Triplet Construction: Create CFG with variables representing push-pop of from state to . Productions mirror PDA transitions. for final . Induction on derivations/computations proves . Hence every PDA language is a CFL.
Q3b. Design an NPDA (empty stack and final state acceptance) for: L = \{\text{palindromes over } \{a,b\}\}20227m
Module 2: Context-Free Languages (CFL) and PDA
View this question on its own page →Design an NPDA (empty stack and final state acceptance) for:
Q3b. Eliminate \varepsilon, unit, and useless productions from the grammar: A → bA | Bba | aa B → aba | b | D C → CA | AC | B D → a | \varepsilon20237m
Module 2: Context-Free Languages (CFL) and PDA
View this question on its own page →Eliminate , unit, and useless productions from the grammar:
A → bA | Bba | aa
B → aba | b | D
C → CA | AC | B
D → a |Q3b. Construct a PDA that accepts: L = \{ u a w b : u,w \in \{a,b\}^*,\; |u| = |w| \}20217m
Module 2: Context-Free Languages (CFL) and PDA
View this question on its own page →Construct a PDA that accepts:
Q4a. Define Chomsky Normal Form. Convert the CFG: S → aSb | ab | Aa A → aab to CNF.20237m
Module 2: Context-Free Languages (CFL) and PDA
View this question on its own page →Define Chomsky Normal Form. Convert the CFG:
S → aSb | ab | Aa
A → aabto CNF.
Q4b. Show whether the given grammar is ambiguous: S \to a \mid abSb \mid aAb \\ A \to bS \mid aAAb20227m
Module 2: Context-Free Languages (CFL) and PDA
View this question on its own page →Show whether the given grammar is ambiguous:
Q5a. Using the CYK algorithm, determine whether baaba is in L(G) for the grammar: `` S → AB | BC A → BA | a B → CC | b C → AB | a ``202114m
Module 2: Context-Free Languages (CFL) and PDA
View this question on its own page →Using the CYK algorithm, determine whether
baabais in for the grammar:S → AB | BC A → BA | a B → CC | b C → AB | a- Install PocketlyBudget App•POCKETLY
Pocketly on Android
Log daily food, travel, and hostel expenses instantly. Set monthly spending limits and see where your money goes without complex spreadsheets.
Q5a. Show that the following grammar is ambiguous: S \rightarrow SS | aSb | bSa | \epsilon20257m
Module 2: Context-Free Languages (CFL) and PDA
View this question on its own page →Show that the following grammar is ambiguous:
Q5b. Suppose L is CFL and R is regular: (i) Is L - R always CFL? (ii) Is R - L always CFL?202114m
Module 2: Context-Free Languages (CFL) and PDA
View this question on its own page →Suppose is CFL and is regular:
(i) Is always CFL?
(ii) Is always CFL?Q5b. Write the difference between Pushdown Automata and Finite Automata.20247m
Module 2: Context-Free Languages (CFL) and PDA
View this question on its own page →Write the difference between Pushdown Automata and Finite Automata.
Q6a. Construct a PDA for the language: L = \{ 0^m 1^n 0^k \mid k \ge 1, m \ge 1, m > n + 2 \}20247m
Module 2: Context-Free Languages (CFL) and PDA
View this question on its own page →Construct a PDA for the language:
Q6a. Construct a CFG for: \{ 0^i 1^j 2^k \mid i + j \ge 2k \}20227m
Module 2: Context-Free Languages (CFL) and PDA
View this question on its own page →Construct a CFG for:
Q6b. Let G be a CFG in CNF with b variables. Show that if G derives any string using at least 2^b steps, then L(G) is infinite.20217m
Module 2: Context-Free Languages (CFL) and PDA
View this question on its own page →Let be a CFG in CNF with variables. Show that if derives any string using at least steps, then is infinite.
Q6b. Convert the CFG to GNF: S \to AB \mid BC \\ A \to aB \mid bA \mid a \\ B \to bB \mid cC \mid b \\ C \to c20227m
Module 2: Context-Free Languages (CFL) and PDA
View this question on its own page →Convert the CFG to GNF:
Q7a. Construct a PDA for the grammar: S \to 0BB B \to 0S \mid 1S \mid 0 Test whether 0104 is accepted by this PDA.20247m
Module 2: Context-Free Languages (CFL) and PDA
View this question on its own page →Construct a PDA for the grammar:
Test whether is accepted by this PDA.
Q7a. Construct NPDA for the grammar: S \to \alpha ABB \mid \alpha AA \\ A \to \alpha BB \mid \alpha \\ B \to bBB \mid A20237m
Module 2: Context-Free Languages (CFL) and PDA
View this question on its own page →Construct NPDA for the grammar:
Q7b. Check whether the grammar is ambiguous: S \to a \mid abSb \mid aAb A \to bS \mid aAAb20247m
Module 2: Context-Free Languages (CFL) and PDA
View this question on its own page →Check whether the grammar is ambiguous:
- Install PocketlyBudget App•POCKETLY
Pocketly on Android
Log daily food, travel, and hostel expenses instantly. Set monthly spending limits and see where your money goes without complex spreadsheets.
Q7b. Check whether the grammar: S \to aSa \mid bSb \mid a \mid b is ambiguous.20217m
Module 2: Context-Free Languages (CFL) and PDA
View this question on its own page →Check whether the grammar:
is ambiguous.
Q8a. Construct FOLLOW sets for the grammar: E \to T E' \\ E' \to +\,T\,E' \mid \varepsilon \\ T \to F T' \\ T' \to -\,F\,T' \mid \varepsilon \\ F \to (E) \mid id20227m
Module 2: Context-Free Languages (CFL) and PDA
View this question on its own page →Construct FOLLOW sets for the grammar:
Q8b. Given the regular expression r = (a+b)^* (i) Construct a context-free grammar that generates the language described by r. (ii) Explain why the grammar correctly represents the given regular expression.20257m
Module 2: Context-Free Languages (CFL) and PDA
View this question on its own page →Given the regular expression
(i) Construct a context-free grammar that generates the language described by .
(ii) Explain why the grammar correctly represents the given regular expression.Q8b. Construct a PDA accepting: L = \{ a^{2n}bc : n \ge 0 \}20217m
Module 2: Context-Free Languages (CFL) and PDA
View this question on its own page →Construct a PDA accepting:
Q8b. Given the grammar: S \to aB \mid ba \\ B \to b \mid bs \mid aBB For the string aaabbabbba find: 1. Leftmost derivation 2. Rightmost derivation 3. Parse tree20237m
Module 2: Context-Free Languages (CFL) and PDA
View this question on its own page →Given the grammar:
For the string find:
- Leftmost derivation
- Rightmost derivation
- Parse tree
Q9b. Write a short note on Chomsky Normal Form.20213.5m
Module 2: Context-Free Languages (CFL) and PDA
View this question on its own page →Write a short note on Chomsky Normal Form.
Q9b. Write a short note on Deterministic vs Nondeterministic PDA.20254.66m
Module 2: Context-Free Languages (CFL) and PDA
View this question on its own page →Write a short note on Deterministic vs Nondeterministic PDA.
Q9b(i). Write a short note on Deterministic PDA vs. Non-deterministic PDA.20227m
Module 2: Context-Free Languages (CFL) and PDA
View this question on its own page →Write a short note on Deterministic PDA vs. Non-deterministic PDA.
Q9b(ii). Write a short note on Chomsky Normal Form (CNF).20227m
Module 2: Context-Free Languages (CFL) and PDA
View this question on its own page →Write a short note on Chomsky Normal Form (CNF).
Q9d. Write short notes on: Pumping lemma for CFL.20237m
Module 2: Context-Free Languages (CFL) and PDA
View this question on its own page →Write short notes on: Pumping lemma for CFL.
- Install PocketlyBudget App•POCKETLY
Pocketly on Android
Log daily food, travel, and hostel expenses instantly. Set monthly spending limits and see where your money goes without complex spreadsheets.
Q9d. Write a short note on the Pumping Lemma for CFL.20213.5m
Module 2: Context-Free Languages (CFL) and PDA
View this question on its own page →Write a short note on the Pumping Lemma for CFL.
Q9d. Write a short note on Greibach Normal Form (GNF).20254.66m
Module 2: Context-Free Languages (CFL) and PDA
View this question on its own page →Write a short note on Greibach Normal Form (GNF).