Browse papers
A

Section A: Long Answer Questions

Attempt all / any as specified.

4 questions
1long15 marks

(a) Distinguish between a Deterministic Finite Automaton (DFA) and a Non-deterministic Finite Automaton (NFA), clearly stating the role of the transition function in each. (5)

(b) Consider the NFA with ϵ\epsilon-transitions over the alphabet Σ={0,1}\Sigma = \{0, 1\} that accepts strings containing the substring 01 or ending in 00. Construct an equivalent DFA using the subset (powerset) construction method, showing the resulting state-transition table and the final transition diagram. (10)

finite-automatadfa-nfasubset-construction
2long15 marks

(a) Define a Context-Free Grammar (CFG) formally as a 4-tuple. Design a CFG that generates the language L={anbmcmdnn1, m0}L = \{ a^n b^m c^m d^n \mid n \ge 1,\ m \ge 0 \} and show a leftmost derivation for the string aabccbb... if it belongs to LL (justify your answer). (7)

(b) Convert the following grammar into Chomsky Normal Form (CNF), showing each step (removal of ϵ\epsilon-productions, unit productions, and useless symbols): (8)

SASBϵ,AaASa,BSbSAbbS \rightarrow ASB \mid \epsilon,\quad A \rightarrow aAS \mid a,\quad B \rightarrow SbS \mid A \mid bb
context-free-grammarchomsky-normal-formcfg-design
3long15 marks

(a) Describe the formal model of a standard (single-tape) Turing Machine as a 7-tuple and explain how it accepts, rejects, or loops on an input string. (5)

(b) Design a Turing Machine that accepts the language L={wcwRw{a,b}}L = \{ w c w^{R} \mid w \in \{a, b\}^{*} \}, where wRw^{R} denotes the reverse of ww. Give the complete transition table and trace the computation of the machine on the input string abcba. (10)

turing-machinetm-designcomputability
4long15 marks

(a) Explain the formal definition of a Pushdown Automaton (PDA) and distinguish between acceptance by final state and acceptance by empty stack. (5)

(b) Construct a PDA that accepts the language L={anb2nn1}L = \{ a^n b^{2n} \mid n \ge 1 \} by empty stack. Give the transition function and show the sequence of instantaneous descriptions (moves) for the input string aabbbb. (10)

pushdown-automatacfg-to-pdacontext-free-grammar
B

Section B: Short Answer Questions

Attempt all / any as specified.

8 questions
5short7 marks

State the pumping lemma for regular languages. Using it, prove that the language L={aibji>j0}L = \{ a^{i} b^{j} \mid i > j \ge 0 \} is not regular.

pumping-lemmaregular-languagesnon-regularity
6short7 marks

(a) Write regular expressions over Σ={0,1}\Sigma = \{0, 1\} for: (i) all strings of even length, and (ii) all strings in which every 0 is immediately followed by at least one 1. (4)

(b) State the identities used to simplify regular expressions and use them to simplify (ϵ+0)1(ϵ+0)(\epsilon + 0)^{*} 1 (\epsilon + 0)^{*}. (3)

regular-expressionsregular-languages
7short7 marks

Differentiate between a decidable and an undecidable problem. State the Halting Problem and give an outline of the argument (proof by contradiction) showing that it is undecidable.

decidabilitydecidable-problemsturing-machine
8short7 marks

(a) Define the complexity classes P, NP, and NP-Complete, and explain the significance of the P=?NPP \stackrel{?}{=} NP question. (4)

(b) What is a polynomial-time reduction? Explain its role in proving that a problem is NP-complete. (3)

computational-complexityp-npnp-completeness
9short7 marks

Differentiate between a Moore machine and a Mealy machine. Design a Mealy machine over Σ={0,1}\Sigma = \{0, 1\} that outputs 1 whenever the input sequence ends in the substring 101, and 0 otherwise.

finite-automatamoore-mealysequential-machines
10short7 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 for the string id + id * id.

context-free-grammarambiguityparse-tree
11short7 marks

(a) State and briefly justify any three closure properties of regular languages (e.g. under union, concatenation, and complementation). (4)

(b) Define the terms recursive language and recursively enumerable language, and state the relationship between them. (3)

regular-languagesclosure-propertiesset-theory
12short7 marks

(a) State the Church-Turing thesis and explain its significance in the theory of computation. (4)

(b) Briefly explain how a multi-tape Turing machine is equivalent in computational power to a single-tape Turing machine. (3)

turing-machinechurch-turing-thesisvariants