100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
COS3701 Assignment 2 (COMPLETE ANSWERS) 2024 DUE 27 June 2024 100% TRUSTED WORKING ,EXPLAINATION AND SOLUTIONS R50,80   Add to cart

Exam (elaborations)

COS3701 Assignment 2 (COMPLETE ANSWERS) 2024 DUE 27 June 2024 100% TRUSTED WORKING ,EXPLAINATION AND SOLUTIONS

 8 views  0 purchase

COS3701 Assignment 2 (COMPLETE ANSWERS) 2024 DUE 27 June 2024 100% TRUSTED WORKING ,EXPLAINATION AND SOLUTIONS

Preview 2 out of 6  pages

  • April 25, 2024
  • 6
  • 2023/2024
  • Exam (elaborations)
  • Questions & answers
All documents for this subject (1)
avatar-seller
EstudyTube
A+

cOs3701
ASSIGNMEMT 2
SEMESTER 1


THIS DOCUMENT CONTAINS
ANSWERS WORKINGS AND
SOLUTION TO THE QUESTION
BELOW




ADMIN

JIMMYCOSMAS

, COS3701 Assignment 2 (COMPLETE ANSWERS) 2024 DUE 27 June 2024

100% TRUSTED WORKING ,EXPLAINATION AND SOLUTIONS




Question 1 [15] Build a DPDA to show that the language L = {(ba)na(ab)n-2 | n > 2} is deterministic
context free.


To demonstrate that the language

={()()−2 >2}L={(ba)n(ab)n−2 n>2} is deterministic context-free, we
can construct a deterministic pushdown automaton (DPDA) that recognizes it.

Here's the high-level idea of how to design such a DPDA:
1. The DPDA needs to ensure that there are at least three 'ba' pairs at the beginning and at least
one 'ab' pair at the end.

2. After the minimum required 'ba' pairs at the beginning, it needs to allow any number of 'ab'
pairs minus two.

Let's build the DPDA:
• State set: ={0,1,2,3,4,5} Q={q0,q1,q2,q3,q4,q5}

• Input alphabet: Σ={,} Σ={a,b}
where Z is the initial stack
• Stack alphabet: Γ={,, symbol.
} Γ={a,b,Z}

• Transition function: Define transition rules based on the current state, input symbol, and top of
the stack.


• Initial state: 0q0


Initial stack symbol: Z

Accept state: 5 q5

The DPDA transitions are as follows:
1. From 0 q0 , upon reading 'b', push 'b' onto the stack and remain in 0 q0 .
2. From 0 , upon reading 'a', push 'a' onto the stack and transition to
q0 1 q1 .

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 EstudyTube. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy this summary for R50,80. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

80562 documents were sold in the last 30 days

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

Start selling
R50,80
  • (0)
  Buy now