Theory of Computation (BSc CSIT, CSC257): the questions likely to come
30 analyzed questions from 7 past papers (2074-2081), grouped by syllabus unit — each with its probability, how often it's been asked, and where to study the answer.
Define context-free grammar (CFG). Convert the following CFG into an equivalent grammar in Chomsky Normal Form (CNF): S -> ASA | aB, A -> B | S, B -> b | epsilon.
Context-Free Grammar (CFG)
A CFG is a 4-tuple where is a finite set of variables (non-terminals), is a finite set of terminals (), is the start symbol, and is a finite set of productions of the form with and . The language generated is the set of terminal strings derivable from .
Chomsky Normal Form (CNF): every production is (two variables) or (single terminal); is allowed only if .
Converting the given CFG to CNF
Grammar:
Step 1: Add a new start symbol
Step 2: Remove -productions
Nullable variable: (since ), and hence (since ). Remove and add versions of rules with nullable symbols omitted.
- : dropping nullable 's gives . Drop the unit . So .
- : gives .
- stays; would appear (A nullable) but we drop it.
Result:
Step 3: Remove unit productions
Unit pairs: , , .
- (from ), and (from ).
Result:
Step 4: Replace terminals in long rules
Introduce . Replace a in by : .
Step 5: Break rules longer than two symbols
For each introduce , so with .
Final CNF Grammar
Every production now has the form or , so the grammar is in Chomsky Normal Form.
Context-Free Grammars and Languages
Define context-free grammar (CFG). Convert the following CFG into an equivalent grammar in Chomsky Normal Form (CNF): S -> ASA | aB, A -> B | S, B -> b | epsilon.
Explain the conversion of a CFG into Greibach Normal Form (GNF).
What is an ambiguous grammar? Show with an example that a grammar is ambiguous.
Eliminate left recursion from the grammar A -> Aa | b.
State and prove the Pumping Lemma for context-free languages. Use it to show that L = { a^i b^j c^k | i = j = k } is not context-free.
Explain the Chomsky hierarchy of languages with the corresponding grammars and recognizing machines. Discuss the closure properties of context-free languages.
What is the membership problem? Explain the CYK algorithm in brief.
Sit a probable paper
A full mock exam built from the most likely questions, mirroring the real paper's structure. Every slot is a real past question.
Most Probable Paper
Mirrors the real structure · 60 marks · based on 7 past papers
- 1.[10 marks]
Define a Turing Machine formally. Design a Turing Machine that accepts the language L = { a^n b^n c^n | n >= 1 } and explain its working with a transition diagram.
This question has recurred in 3 of 7 years; so far only in internal assessments, not the board; and its topic recurs in 5 of 7 years.
- 2.[10 marks]
Define context-free grammar (CFG). Convert the following CFG into an equivalent grammar in Chomsky Normal Form (CNF): S -> ASA | aB, A -> B | S, B -> b | epsilon.
This question has recurred in 2 of 7 years; so far only in internal assessments, not the board; and its topic (Context-Free Grammars and Languages) appears in 100% of years.
- 3.[10 marks]
Explain the relationship between regular expressions and finite automata. Show that for every regular expression there is an epsilon-NFA accepting the same language, and convert (a+b)*ab into an equivalent finite automaton.
This question has recurred in 2 of 7 years; so far only in internal assessments, not the board; and its topic (Regular Expressions and Languages) appears in 100% of years.
- 1.[5 marks]
Explain the conversion of a CFG into Greibach Normal Form (GNF).
This question has recurred in 5 of 7 years; so far only in internal assessments, not the board; and its topic (Context-Free Grammars and Languages) appears in 100% of years.
- 2.[5 marks]
What is an ambiguous grammar? Show with an example that a grammar is ambiguous.
This question has recurred in 4 of 7 years; so far only in internal assessments, not the board; and its topic (Context-Free Grammars and Languages) appears in 100% of years.
- 3.[5 marks]
Eliminate left recursion from the grammar A -> Aa | b.
This question has recurred in 4 of 7 years; so far only in internal assessments, not the board; and its topic (Context-Free Grammars and Languages) appears in 100% of years.
- 4.[5 marks]
Explain the closure properties of regular languages.
This question has recurred in 4 of 7 years; so far only in internal assessments, not the board; and its topic (Regular Expressions and Languages) appears in 100% of years.
- 5.[5 marks]
Write a regular expression for strings over {0,1} that contain at least one '0' and at least one '1'.
This question has recurred in 4 of 7 years; so far only in internal assessments, not the board; and its topic (Regular Expressions and Languages) appears in 100% of years.
- 6.[5 marks]
Differentiate between recursive and recursively enumerable languages.
This question has recurred in 4 of 7 years; so far only in internal assessments, not the board; and its topic (Undecidability and Computational Complexity) appears in 86% of years.
- 7.[5 marks]
Explain the working of a multi-tape Turing Machine.
This question has recurred in 4 of 7 years; so far only in internal assessments, not the board; and its topic recurs in 5 of 7 years.
- 8.[5 marks]
What is a Universal Turing Machine? Explain its significance.
This question has recurred in 4 of 7 years; so far only in internal assessments, not the board; and its topic recurs in 5 of 7 years.
- 9.[5 marks]
Define instantaneous description (ID) of a PDA and explain acceptance by final state and by empty stack.
This question has recurred in 4 of 7 years; so far only in internal assessments, not the board; and its topic recurs in 4 of 7 years.
Behind the numbers
The raw evidence the predictions are computed from: marks per unit per year, syllabus weights, trends, and coverage.
Show the heatmap, topic table and coverage analysis
The receipt: marks per unit, per year
Each row is a syllabus unit, each column an exam year, each cell the marks that unit earned that year. Click any cell to see the actual questions behind it.
| # | Syllabus unit | Probability | Appeared | Avg marks | Syllabus weight | Exam vs syllabus | Trend | Questions |
|---|---|---|---|---|---|---|---|---|
| 1 | U4Context-Free Grammars and Languages | Very likely100% | 17.1 | 20%10 lecture hrs | Balancedexam 23% · syllabus 20% | Steady | 5 recurring7 total | |
| 2 | U3Regular Expressions and Languages | Very likely100% | 15.7 | 20%10 lecture hrs | Balancedexam 21% · syllabus 20% | Steady | 6 recurring6 total | |
| 3 | U2Introduction to Finite Automata | Very likely86% | 16.7 | 24%12 lecture hrs | Balancedexam 19% · syllabus 24% | Steady | 5 recurring7 total | |
| 4 | U7Undecidability and Computational Complexity | Very likely86% | 11.7 | 12%6 lecture hrs | Balancedexam 13% · syllabus 12% | Steady | 4 recurring4 total | |
| 5 | U6Turing Machines | Likely71% | 14 | 10%5 lecture hrs | Balancedexam 13% · syllabus 10% | Steady | 3 recurring3 total | |
| 6 | U5Pushdown Automata | Likely57% | 10 | 8%4 lecture hrs | Balancedexam 8% · syllabus 8% | Steady | 2 recurring2 total | |
| 7 | U1Basic Foundations | Possible43% | 5 | 8%4 lecture hrs | Balancedexam 3% · syllabus 8% | Steady | 1 recurring1 total |
Study smart, not hard
Drag the slider: studying the top 5 units in priority order covers ~90% of all observed marks.
- ~80% line
Lecture time vs exam marks
Where the exam pays more than the curriculum spends: ● lectures vs ● exam marks, as a share of the whole course. A long teal-leading bar = high-yield unit.