100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
COS3701 EXAM PACK 2025 $2.60   Add to cart

Exam (elaborations)

COS3701 EXAM PACK 2025

 6 views  0 purchase
  • Course
  • Institution

COS3701 EXAM PACK 2025

Preview 4 out of 50  pages

  • November 6, 2024
  • 50
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
avatar-seller
lOMoAR cPSD| 47715245




Downloaded by palmer kamulee (kamuleepalmer@gmail.com)

, lOMoAR cPSD| 47715245




COS3701
Jan/Feb 2023



UNIVERSITY EXAMINATIONS




Jan/Feb 2023

COS3701

Theoretical Computer Science III

80 Marks
Duration 2 Hours




Welcome to the COS3701 exam.

Examiner name: Ms DR Mokwana
Internal moderator name: Prof F Bankole

This paper consists of 5 pages.


Instructions:

• Upload you answer script in a single PDF file format not password
protected
• No emailed scripts will be marked
• Preview your submission to ensure legibility and correct script file
has been uploaded
• Students who have not utilised IRIS invigilation app will be
subjected to disciplinary process
• Students suspected of dishonesty conduct during examination will
be subjected to disciplinary process
• Write neatly and legibly
Downloaded by palmer kamulee (kamuleepalmer@gmail.com)

, lOMoAR cPSD| 47715245




COS3701
Jan/Feb 2023
• The mark for each question is in brackets next to the question




Question 1 [16]

(a) Determine a regular expression for the language L over the alphabet
{a, b} that consists of all words that have at least one b but contain
exactly one aa substring (and no other as).
Example of words in the language are aab, bbbaabbb,
bbbbaabbbbbbbb etc.
Examples of words that are not in the language are a, aba, bbab,
aaabbbb, baabbbbaabb
etc. (2)

Design a deterministic finite automaton (DFA) that will recognise all
(b)
of the words in L
as defined above. (4)

Downloaded by palmer kamulee (kamuleepalmer@gmail.com)

, lOMoAR cPSD| 47715245




COS3701
Jan/Feb 2023
(c) Use Theorem 21 to develop a context-free grammar (CFG) for (4)
the language L.

(d) Convert the following CFG to Chomsky Normal Form
(CNF):



S → aX Y | Y b
X→XZYZ|
a Y → bY |
Λ
Z→a|Λ (6)

Question 2 [10]

Build a deterministic pushdown automata (DPDA) that
accepts the language
L = {(ab)n(aa)m(ba)n−1 | n ≥ 1, m ≥ 1} over the alphabet Σ =
{a, b}.

Question 3 [12]

The pumping lemma with length for context-free languages (CFLs) can
be stated as follows: Let L be a CFL generated by a CFG in CNF with p
live productions. Then any word w in L with length > 2p can be broken
into five parts:

w = uvxyz such that length(vxy) ≤ 2p length(x) > 0 length(v) +
length(y) > 0 and such that all the words uvnxynz with n ∈ {2, 3,
4, . . .} are also in the language L.

Use the pumping lemma with length to prove that the language


L = {(a)n(b)2n+2(a)n−1 | n ≥ 1}

Downloaded by palmer kamulee (kamuleepalmer@gmail.com)

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller Seller28. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $2.60. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

72042 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$2.60
  • (0)
  Add to cart