100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
COS3701 Assignment 2 2024 (365071) - DUE 27 June 2024 R56,10   Add to cart

Exam (elaborations)

COS3701 Assignment 2 2024 (365071) - DUE 27 June 2024

 5 views  0 purchase

COS3701 Assignment 2 2024 (365071) - DUE 27 June 2024 QUESTIONS AND ANSWERS

Preview 2 out of 8  pages

  • April 22, 2024
  • 8
  • 2023/2024
  • Exam (elaborations)
  • Questions & answers
All documents for this subject (12)
avatar-seller
brighttutor10
[Date]



COS3701 Assignment
2 2024 (365071) -
DUE 27 June 2024
QUESTIONS AND ANSWERS




[COMPANY NAME]

, COS3701 Assignment 2 2024 (365071) - DUE 27 June 2024

Question 1 [15]
Build a DPDA to show that the language L = {(ba)na(ab)n-2 | n > 2} is
deterministic context free.
Deterministic Pushdown Automaton (DPDA) for L = {(ba)na(ab)n-2 | n > 2}
States:
• q0: Start state
• q1: Reading the first part (n repetitions of "ba")
• q2: Reading the middle "aaa"
• q3: Reading the second part (n-2 repetitions of "ba")
• q4: Accepting state
Stack Alphabet:
• X: Symbol used for bookkeeping
Input Alphabet:
• Σ = {a, b}
Transition Function (δ):
δ is a function that maps (state, input symbol, top stack symbol) to a next state
and a stack symbol to push (or ε for no push). Here's the table representation:
| δ(q, σ, z) | |---|---| | δ(q0, a, -) | (q1, X) | // Start reading "ba" and push X |
δ(q0, b, -) | - | // Reject if input doesn't start with "a" (deterministic) | δ(q1, b,
X) | (q1, X) | // Read "b" in "ba" and keep X | δ(q1, a, X) | (q2, ε) | // Read "a"
in "ba", consume X, and move to middle "aaa" | δ(q2, a, -) | (q2, a) | // Read
first "a" in "aaa" and push "a" | δ(q2, a, a) | (q2, aa) | // Read second "a" in
"aaa" and push another "a" | δ(q2, a, aa) | (q3, X) | // Read third "a" in

For exam pack with questions and answers, quality notes, assignments and exam
help:
email: musyokah11@gmail.com
WhatsApp: +254792947610

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 EFT, 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 this summary from?

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

Will I be stuck with a subscription?

No, you only buy this summary for R56,10. 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 summaries for 14 years now

Start selling
R56,10
  • (0)
  Buy now