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

Exam (elaborations)

COS3701 Assignment 3 Yearly Module 2022 (Unique Number: 830430)

 81 views  2 purchases

Guaranteed A+. COS3701 Assignment 3 Yearly Module 2022

Last document update: 2 year ago

Preview 2 out of 8  pages

  • July 5, 2022
  • July 5, 2022
  • 8
  • 2021/2022
  • Exam (elaborations)
  • Questions & answers
All documents for this subject (44)
avatar-seller
t0dd
UnisaAssignHelp




COS3701
Assignment 3
Unique Number:
830430

, UnisaAssignHelp
Question 1


Problem 6 (ii) on page 454:

Design a turing machine to accept the language anb2n

The TM in Figure 1 solves this problem.

From the START state an a is read and an A is printed on the tape. In state 1 the TM loops, moving the tape
head right, for all the as read until the first b is read.

If the first b is read a B is printed on the tape, the tape head moves right and we are at state 2. Another b
is read and the next B is printed on the tape, the tape head moves left, we arrive at state 3.

In state 3 we loop to the left reading first Bs and then as until we encounter an A which takes us to state 4.

In state 4 we read an a if all the as read have not yet been converted to As else we read a B. If we read an
a in state 4 the TM prints an A on the tape and the tape head moves right.

We are now in state 1 and the described cycle state 1 – state 2 – state 3 – state 4 is repeated until a B is
read in state 4.

If a B is read in state 4 we move to state 5. In state 5 we loop to the right through all the characters on
the remainder of the tape. If all these characters are Bs and we finally read ∆ then we move to the HALT
state.

Note, in short we compare the number of as to the number of bs by converting two bs to Bs for each a
converted to an A.

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)

64438 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
  • (0)
  Buy now