Browse papers
A

Section A: Long Answer Questions

Attempt all / any as specified.

3 questions
1long16 marks

(a) Define a Non-deterministic Finite Automaton (NFA) formally as a 5-tuple and explain how it differs from a Deterministic Finite Automaton (DFA). (b) Construct an NFA that accepts the language of all strings over {0,1}\{0,1\} that contain the substring 011011. Convert the obtained NFA into an equivalent DFA using the subset construction method, clearly showing the transition table and the resulting state diagram.

finite-automatanfa-to-dfadfa-design
2long16 marks

(a) Define a Context-Free Grammar (CFG) and a Pushdown Automaton (PDA). Explain the equivalence between CFGs and PDAs. (b) Consider the grammar SaSbabS \rightarrow aSb \mid ab. Show that it generates the language L={anbnn1}L = \{a^n b^n \mid n \geq 1\} and construct a PDA (accepting by empty stack) that recognizes this language, giving its complete set of transition rules.

context-free-grammarpushdown-automatacfg-to-pda
3long16 marks

(a) Describe the formal model of a standard (single-tape) Turing machine and explain the Church-Turing thesis. (b) Design a Turing machine that accepts the language L={anbncnn1}L = \{a^n b^n c^n \mid n \geq 1\}. Give the transition function and trace the computation of the machine on the input string aabbccaabbcc.

turing-machinedecidability
B

Section B: Short Answer Questions

Attempt all / any as specified.

8 questions
4short8 marks

(a) State the precedence and meaning of the regular expression operators. (b) Write regular expressions for: (i) all strings over {0,1}\{0,1\} whose length is a multiple of 3, and (ii) all strings over {a,b}\{a,b\} that begin and end with the same symbol.

regular-expressionsregular-languages
5short8 marks

State the Pumping Lemma for regular languages. Using it, prove that the language L={anbnn0}L = \{a^n b^n \mid n \geq 0\} is not regular.

pumping-lemmaregular-languages
6short6 marks

Explain the Chomsky hierarchy of grammars. For each of the four types, give the form of production rules and the corresponding class of accepting automaton, illustrating with a suitable example for each type.

chomsky-hierarchy
7short6 marks

Define an ambiguous grammar. Show that the grammar EE+EEE(E)idE \rightarrow E + E \mid E * E \mid (E) \mid id is ambiguous by giving two distinct parse trees (or leftmost derivations) for the string id+ididid + id * id, and suggest how the ambiguity can be removed.

context-free-grammargrammar-ambiguity
8short6 marks

Differentiate between a decidable and an undecidable problem. State the Halting Problem and explain, with the essential argument, why it is undecidable.

decidabilityundecidabilityhalting-problem
9short6 marks

Given the regular grammar with productions SaAbSεS \rightarrow aA \mid bS \mid \varepsilon and AaSbAA \rightarrow aS \mid bA, construct the equivalent finite automaton and describe the language it accepts.

regular-grammarfinite-automata
10short6 marks

Convert the following context-free grammar into Chomsky Normal Form (CNF): SASBεS \rightarrow ASB \mid \varepsilon, AaASaA \rightarrow aAS \mid a, BSbSAbbB \rightarrow SbS \mid A \mid bb. Show all intermediate steps including removal of ε\varepsilon-productions and unit productions.

context-free-grammarcnfgrammar-normalization
11short6 marks

Distinguish between recursive (decidable) languages and recursively enumerable languages. Explain why every recursive language is recursively enumerable but the converse is not necessarily true.

turing-machinerecursive-enumerabledecidability