Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 4 out of 64 pages
Exam (elaborations)

COS3701 Theoretical Computer Science III Exam Preparation Pack 2026–2027 | Comprehensive Theoretical Computer Science III Practice Questions with Verified Answers & Explanations | Latest COS3701 Syllabus & Exam Prep

Document preview thumbnail
Preview 4 out of 64 pages

COS3701 Theoretical Computer Science III Exam Preparation Pack 2026–2027 | Comprehensive Theoretical Computer Science III Practice Questions with Verified Answers & Explanations | Latest COS3701 Syllabus & Exam Prep

Content preview

COS3701 Theoretical Computer Science III Exam
Preparation Pack 2026–2027 | Comprehensive
Theoretical Computer Science III Practice Questions
with Verified Answers & Explanations | Latest
COS3701 Syllabus & Exam Prep




Description:
This comprehensive exam preparation pack is designed to simulate the
COS3701 Theoretical Computer Science III examination for 2027, based
on the University of South Africa (UNISA) module . The module
focuses on enabling students to understand the concept of computability,
including context-free languages, recursively enumerable languages, and
the machines that accept them . The 120 multiple-choice questions cover
all key content areas including regular expressions and finite automata,
context-free grammars and Chomsky Normal Form, pushdown
automata, the pumping lemma, Turing machines, and computability
theory . Questions range from foundational recall to complex proof and
model construction scenarios, mirroring the official COS3701 exam
format . Actual COS3701 exams typically consist of 6 to 7 questions
worth 80 to 100 marks, with a 2-hour duration and IRIS invigilation .


COS3701 Theoretical Computer Science III Exam Preparation Pack

,Instructions: This is a closed-book examination with multiple-choice
questions. Select the single best answer for each question. Show all
working for proof and algorithm questions. The actual COS3701 exam
consists of questions covering regular expressions, DFA design, CFG
conversion to CNF, deterministic pushdown automata (DPDA), the
pumping lemma for CFLs, and Turing machine design . The exam is 2
hours and invigilated using the IRIS tool .


SECTION 1: REGULAR EXPRESSIONS AND FINITE AUTOMATA
(Questions 1-30)


1. Determine a regular expression for the language L over the alphabet
{a, b} that consists of all words that start with the substring ab, have one
or more bs, have at least two as, and have no bs after the two or more as.
Examples: abbaaa, abbbbbbaa .
A. ab{2,}(ba){2,}
B. ab+b*aa+
C. ab+aa+
D. ab+b*aa+ a*


Correct Answer: C
Rationale: The language requires words that start with "ab", followed by
one or more "b"s (b+), followed by two or more "a"s (aa+). There should
be no "b"s after the "a"s, so the string ends with the "a"s. The correct
regular expression is ab+aa+ which ensures at least one b between "ab"
and "aa", and at least two a's at the end.

,2. Design a deterministic finite automaton (DFA) that will recognise all
of the words in the language L from Question 1. What is the minimum
number of states required?
A. 3
B. 4
C. 5
D. 6


Correct Answer: C
Rationale: The language L = ab+aa+ requires states to track: reading "a"
(state A), reading "b" after "a" (state B), reading at least one additional
"b" (state C), reading the first "a" after the "b"s (state D), and reading at
least one more "a" (accepting state E). This requires 5 states plus a trap
state for invalid words.


3. Which of the following words is NOT in the language L = {w | w
contains at least one a and exactly one occurrence of the substring bb}?
A. abb
B. abba
C. bba
D. bab


Correct Answer: D
Rationale: The language requires words that have at least one 'a' and
exactly one 'bb' substring. "abb" has one 'bb' and one 'a' - valid. "abba"

, has one 'bb' and two 'a's - valid. "bba" has one 'bb' and one 'a' - valid.
"bab" has no 'bb' substring, so it is not in the language.


4. What is the primary limitation of finite automata that makes them
unable to recognize languages like {a^n b^n | n ≥ 1}?
A. They cannot read input symbols
B. They cannot count unbounded values
C. They cannot handle the alphabet {a,b}
D. They cannot accept the empty string


Correct Answer: B
Rationale: Finite automata have finite memory, meaning they cannot
track unbounded quantities. The language {a^n b^n | n ≥ 1} requires
matching the number of 'a's with the number of 'b's, which requires
unbounded counting. A finite automaton cannot perform this task.


5. A regular expression for all strings over {a,b} that have an even
number of a's is:
A. (b*ab*a)*
B. (b*ab*ab*)*
C. (a*b*a*)*
D. (b*a*b*a)*


Correct Answer: B

Document information

Uploaded on
September 1, 2026
Number of pages
64
Written in
2026/2027
Type
Exam (elaborations)
Contains
Questions & answers
$26.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Sold
14
Followers
0
Items
900
Last sold
2 days ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions