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 2 out of 13 pages
Exam (elaborations)

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

Document preview thumbnail
Preview 2 out of 13 pages

Guaranteed A+. COS3701 Assignment 4 Yearly Module 2022

Content preview

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

Document information

Uploaded on
July 5, 2022
Number of pages
13
Written in
2021/2022
Type
Exam (elaborations)
Contains
Questions & answers
$6.39

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.
t0dd
4.0
(1)
Sold
38
Followers
33
Items
4
Last sold
3 year ago


Reviews from verified buyers




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