UNIVERSITY OF TECHNOLOGY, JAMAICA

SCHOOL OF COMPUTING AND INFORMATION TECHNOLOGY
BACHELOR IN COMPUTING & IT Computer Science Major PROGRAMMING ASSIGNMENT

GROUP: BSC3 SUBJECT: THEORY OF COMPUTATION

DATE GIVEN: February 16, 2012 DATE DUE: March 15, 2012

Turing Machine Simulator
This project aims to simulate the computation of the Turing Machine. A Turing Machine consists of a tape of infinite length and a read-write head which can move either left or right across the tape. For each transition, the machine checks the current state and the character on the tape below the head, then changes to a new state, writes a new character on the tape, and moves the head one space left or right. The machine stops after transferring to accept or reject state.

Implementation
This project is implemented with C++ or JAVA on the language which accepts a string and determine whether it is an even number or a palindrome.

Basic idea There is a transition table for the Turing Machine. The record in the transition table is just like this: [current state, current character, next state, next character, direction]. Current state is the current state of Turing Machine; Current Character is the character in the tape below the read-write head; Next state is the new state after the transition; Next character is the new character written in the tape; Direction is the movement of the read-write head which is right or left. User can input the transition rules of Turing Machine and input string of tape. Then the Turing Machine can decide if it accepts, rejects, or does not halt based on the transition rules.

Verify Turing Machine In this project, we assume the alphabet of Turing Machine is 0..1. The left direction is presented by ‘L’ and right direction is presented by ‘R’. So we need to check if the Turing Machine violates these rules. Simulator Design • The program should accept string from user
• • •

The user should be able to choose whether to check if string is an even number or a palindrome State whether or not the string entered is an even number or a palindrome Your program must have an option to display the Turing Machine configuration (state, head position, and tape) after each execution cycle, i.e. a trace or debug mode.

The program should compile without errors, and work in accordance to the specifications of a Turing Machine.
1

[3 marks] [3 marks] b. however. up to you. this means that. ask you to structure the document as follows: 1. and how they relate to the components of the automaton 2. More particularly:  If we input any of the strings of the language which the TM has to accept. it must reject that string and also inform us that it has done so [10 marks]  2 . [3 marks] Automaton design: Formal specification of the Turing Machine which defines the language in question. it really must accept them. User guidelines [3 marks] 4.Simulator Description The document [20 marks] How you choose to present your work is. How the structure of the program implements the operation of the automaton ◦ Step by step operation of Turing Machine c. which implements the operation of the automaton [10 marks] User Interface [5 marks] Presentation and Readability of code [5 marks] The program should compile without errors. being implemented. In practice. and also inform us that it has done so. [10 marks] If we input any other string. [6 marks] C++/JAVA implementation: a. and do what the formal specification of the Turing Machine does. once submitted. of course. Limitations: Circumstances that were not considered in design [2 marks] The program [40 marks]    An algorithm. we must be able to run your program and expect it to work in accordance with the TM specification. What data types are used. 3. Introduction: A summary of the aim of the project. We do. and how you propose to go about it.

Mark deduction will be applied for days late as follows: 25% 1 day. No assignment will be accepted after the third day late. in which case the student will be awarded zero marks for the assignment. Failure to comply with one or more of the guidelines provided above. 2012. 75% 3 days. the pre-compiled version only –no executable files only are allowed). They are late after that. CD’s or disk which cannot be read. Submission All projects are to be handed in at SCIT Student affairs office.Instructions Students are expected to work in groups of three persons to complete this assignment. Names of ALL participating group members. will automatically be dumped in “file 13”. Each Group is to be formed from within each respective Tutorial class at the discretion of tutor responsible for that class. and class group to which they belong should be clearly affixed to the assignment. student identification numbers. with a printout of the program code. and students are asked to refer to the University Handbook for further information on this matter. 3 . and documentation along with a readable CD of source programs (i. Hard-copy submissions should be packaged in envelopes and sealed. along with Authorship Declaration signed and attached by each group member. Plagiarism is disallowed. 50% 2 days.e. can result in a zero award for this assignment. Assignments are due at 11 am on March 15. Students will be individually assessed within the context of each group for their actual proven involvement.