COS3701 Assignment 3 memo 2024:
Material to be tested: Cohen, Chapter 19, 21 - 25
Question 1 [10]
Build/design a Turing machine (TM) that determines whether a given word contains at least one insta...
Hie, may we know the reason for this review so that we improve in the future
Seller
Follow
CrystalIndigo
Reviews received
Content preview
COS3701 Assignment 3 memo 2024
Detailed complete explanation and everything that is needed
Crystal Indigo!
Crystal Indigo!
Providing all solutions you need anytime
+27 76 626 8187
, Question 1 Build/design a Turing machine (TM) that determines whether
a given word contains at least one instance of the substring aab. If it
does, then the TM should write a T on the tape after the input word
Explanation:
This TM checks whether a given word contains the substring "aab". If the substring is found, it
writes "T" on the tape after the input word.
• States and Transitions: The TM starts in an initial state, it start with either an "a" or "b". It
reads the input symbols one by one, looking for the sequence "aab". If it finds "a", it stays in
the current state; when it sees another "a", it might move to a new state. Upon seeing "b"
after two "a"s, it transitions to a state where it will write "T" after the word.
• Halting: The TM halts once it has written "T" on the tape, signaling that the substring was
found.
Question 2 Build/design a TM that:
· accepts all words that start with an a, and ends with a b,
· loops forever on all words that start with a b, and
· rejects all other words.
Explanation:
This TM accepts words that start with an "a" and end with a "b". It loops forever on words that start
with a "b" and rejects all other words.
• States and Transitions: For words starting with "a" and ending with "b", the TM transitions
through states that validate the sequence. If it encounters an invalid pattern, it either loops
(in case of starting with "b") or moves to a reject state.
• Looping: For words starting with "b", it keeps the TM in a loop without ever reaching a
halting state.
The benefits of buying summaries with Stuvia:
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
You can quickly pay through credit card for the summaries. There is no membership needed.
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 these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller CrystalIndigo. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for £6.39. You're not tied to anything after your purchase.