100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
COS3701 Assignment 4 Yearly Module 2022 (Unique Number: 830436) R100,00   Add to cart

Exam (elaborations)

COS3701 Assignment 4 Yearly Module 2022 (Unique Number: 830436)

1 review
 50 views  2 purchases

Guaranteed A+. COS3701 Assignment 4 Yearly Module 2022

Preview 2 out of 13  pages

  • July 5, 2022
  • 13
  • 2021/2022
  • Exam (elaborations)
  • Questions & answers
All documents for this subject (44)

1  review

review-writer-avatar

By: examsummaries29 • 2 year ago

avatar-seller
t0dd
UnisaAssignHelp




COS3701
Assignment 4
Unique Number:
830436

, UnisaAssignHelp
Question 1


Chapter 23 – Problem 1(i), p. 562

Σ = {a, b}. EVEN-EVEN is defined on page 236 of Cohen: EVEN-EVEN = all strings x with an even number of
as and an even number of bs.

Note that TL101 refers to ODDPALINDROME but the language we are actually interested in is EVEN-EVEN.

A TM that accepts this language is illustrated in Figure 1.

This TM has essentially four states


State 1 This represents the case where an odd number of as and an even number of bs have been read
(OE).

State 2 This represents the case where an even number of as and an odd number of bs have been read
(EO).

State 3 This represents the case where an even number of as and an even number of bs have been read
(EE).

State 4 This represents the case where an odd number of as and an odd number of bs have been read (OO).


Consider the string aa. In this case the TM moves to state 1 after reading the first a (OE) and then to state
3 after reading the second a (EE). The TM will then go the halt state and even number of as (2) and an even
number of bs (0) have been read.

Consider a more complicated string abaabbba. In this case the word is in EVEN-EVEN so the TM should
reach the halt state. What happens is:

Read a go to state 1 – here we have 1 a and 0 bs so we have OE
Read b go to state 4 – OO
Read a go to state 2 – EO
Read a go to state 4 – OO
Read b go to state 1 – OE
Read b go to state 4 – OO
Read b go to state 1 – OE
Read a go to state 3 –EE
Read ∆ go to state halt

The TM will reject any word that is not in EVEN-EVEN.




2

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

Will I be stuck with a subscription?

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

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

67474 documents were sold in the last 30 days

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

Start selling
R100,00  2x  sold
  • (1)
  Buy now