Exercise about Turing machine in C language

Assignment Help Other Subject
Reference no: EM132371775

Assignment - Exercise about Turing machine in C language.

Its double linked list, Also don't try tokens it. Take it by the array. Better use fgets then sscanf.

Differentiate between characters representing numbers (e.g., '1') and numbers themselves

It has infinite tape, divided into cells

  • A read/write head which traverses along the tape, capable of reading the current cell, writing a new value in the current cell, and moving left or right
  • A state register
  • A finite table of instructions which, given the current state of the machine, and the value in the tape cell currently being read, retrieves an instruction which tells the machine to:

1. Write some (possibly the same) item into the cell

2. Move the head left or right one cell

3. Change to some (possibly the same) state

It's one way infinite to the right with starting character A and A can be used somewhere else.

TM tape is made up of cells. Computationally, represent the tape as a linked data structure of cells, wherein a cell (most conveniently represented as a struct) has a character representing what is written in that cell of the tape, and pointers to previous and next cells.

The initial contents of the tape (to be written immediately after the 'A' cell) will be provided by an input file. Your program should allocate just enough cells for the input. If you need more cells during processing you should create new blank cells on the fly. We'll establish the convention that a tape cell containing the character 'B' is a blank cell.

The read/write head of your TM should be a pointer to some cell of the tape. Begin machine execution with the read/write head pointing to the leftmost cell on the tape (the 'A'). As you move the read/write head, you will update the pointer to the current cell seen by the read/write head. The set of instructions will be provided in the input file in the form:

(CurrentState, ReadVal)->(WriteVal, MoveDirection, NewState). The first pair represents a configuration of the machine wherein an instruction, the triple after the arrow, should be executed.

In order to represent the instruction table in your program, make two- dimensional array, where the row indices are states and the columns indices are all standard ASCII characters which may be read from or written to the tape (i.e., there should always be 128 columns, representing ASCII 0-127). Given the current state and the current character being read by the read/write head, the machine looks up an instruction in this array. For example, if the machine is in state 1, reading a 'B' from the tape it should access [1]['B'] in the array. The instruction at that position will tell the machine what value to write, what direction to move, and what the new state should be.

Attachment:- Assignment File.rar

Reference no: EM132371775

Questions Cloud

How would you go about determining accuracy : How would you ensure the highest level of accuracy with your simulation, and how would you go about determining accuracy?
Describe some of the techniques associated with acceptance : Describe some of the techniques associated with acceptance and commitment therapy (ACT). Mental illness is the outcome of a complex web of factors involving.
Why is important to formulate brief for data presentation : Why is it so important to formulate your brief for a data presentation? What are some advantages to your methods? What are some disadvantages?
Describe the clinical application of positive psychology : The theme for this week is Clinical Application of Positive Psychology. You should be aware that Positive Psychology does not see itself offering an alternative
Exercise about Turing machine in C language : Assignment - Exercise about Turing machine in C language. Write some (possibly the same) item into the cell and Move the head left or right one cell
Do bit of research on the hearsay rule in legal proceedings : Do a bit of research on the hearsay rule in legal proceedings.
Write algorithm to check the model of a Petri Nets : How to write algorithm to check the model of a Petri net whether the property of Asymmetric choice hold or not
Information governance and legal functions : Information Governance and Legal Functions. According to authors, Smallwood, Kahn and Murphy, IG is perhaps one of functional areas that impact legal functions
Conduct a sensitivity analysis : SBM3307 - Project Development and Optimisation - Asia Pacific International College - Assessment - Unit Project Part - Conduct a sensitivity analysis

Reviews

Write a Review

Other Subject Questions & Answers

  Cross-cultural opportunities and conflicts in canada

Short Paper on Cross-cultural Opportunities and Conflicts in Canada.

  Sociology theory questions

Sociology are very fundamental in nature. Role strain and role constraint speak about the duties and responsibilities of the roles of people in society or in a group. A short theory about Darwin and Moths is also answered.

  A book review on unfaithful angels

This review will help the reader understand the social work profession through different concepts giving the glimpse of why the social work profession might have drifted away from its original purpose of serving the poor.

  Disorder paper: schizophrenia

Schizophrenia does not really have just one single cause. It is a possibility that this disorder could be inherited but not all doctors are sure.

  Individual assignment: two models handout and rubric

Individual Assignment : Two Models Handout and Rubric,    This paper will allow you to understand and evaluate two vastly different organizational models and to effectively communicate their differences.

  Developing strategic intent for toyota

The following report includes the description about the organization, its strategies, industry analysis in which it operates and its position in the industry.

  Gasoline powered passenger vehicles

In this study, we examine how gasoline price volatility and income of the consumers impacts consumer's demand for gasoline.

  An aspect of poverty in canada

Economics thesis undergrad 4th year paper to write. it should be about 22 pages in length, literature review, economic analysis and then data or cost benefit analysis.

  Ngn customer satisfaction qos indicator for 3g services

The paper aims to highlight the global trends in countries and regions where 3G has already been introduced and propose an implementation plan to the telecom operators of developing countries.

  Prepare a power point presentation

Prepare the power point presentation for the case: Santa Fe Independent School District

  Information literacy is important in this environment

Information literacy is critically important in this contemporary environment

  Associative property of multiplication

Write a definition for associative property of multiplication.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd