Question: Task 4 . For this task you will need to provide a specification of a Turing machine which solves the following problem. INPUT: A string
Task
For this task you will need to provide a specification of a Turing machine which solves the following problem.
INPUT: A string of s
OUTPUT: The string consisting of Os ie the output is the th triangular number
For example, on the input string your TM should generate the output
You should test whether the machine works properly by using the simulator you have built in tasks The machine specification should be given in a firstnamelastname.py file and uploaded to Canvas. The py file should provide the first three lines of the specification presented on Figure but the lines should be assigned to variables as shown below. You must adhere to the following rules when uploading your file.
The first line should be a comment giving your first and last name, your section, and email address.
The second and third lines should specify the alphabets your machine works with.
The next lines must specify the transition function as a dictionary described in tasks The transition function must be named tF but can be specified over several lines as shown in the example below.
The last line of your file should contain the new line character.
There should not be any other empty lines in your submission.
Note that your file will amount to a few lines of valid Python code.
For example, the machine from Problem WH would be specified as follows:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
