程序代写代做代考 Haskell 11/9/2020 Grok | COMP30026 Practice Exam

11/9/2020 Grok | COMP30026 Practice Exam
Queson 9 (6 marks)
Queson 9 (6 marks)
Construct a Turing machine (over alphabet ) which will decide the language consisng of all strings of length 4 or greater, having as their fourth last symbol. More formally,
For example, abba and bbaaab are in , but baba and aaa are not. Instrucons
PresenttheTuringmachineasaHaskellexpressiontm9 :: TM.Inthedefinionofyour Turing machine, indicate clearly the inial state , the accept state , and the reject state (even if your transions don’t menon the laer).
 Format
The Haskell representaon defined in TM.hs allows us to represent Turing machines bydescribingtheirstates,inputalphabet,tapealphabet(including’ ‘),transion
funcon, start state, accept state, and reject state. States must be non-negave integers.
In the transion funcon, you can leave out transions to the machine’s reject state, with the understanding that missing transions are transions to the reject state. That is, if the machine gets stuck before reaching an accept state, we assume it rejects.
For example, this Turing machine:
https://groklearning.com/learn/unimelb-comp30026-2020-s2/prac-exam/23/ 1/1
Cheng
aq 0q
} a si w ni lobmys tsal htruof eht dna∣w{ = A ,erom ro 4 htgnel sah ∗}b,a{ ∈ w∣
a
A }b,a{ M
A
rq