Purchase Solution

Turing machine for unary decrement

Not what you're looking for?

Ask Custom Question

Write a Turing machine algorithm to perform a unary decrement. Assume that the input number may be 0, in which case a single 0 should be output on the tape to signify that the operation results in a negative number.

When writing Turing machine algorithm, include comments for each instruction or related group of instructions. The comments should convey information in terms of the algorithm the Turing machine is accomplishing. Thus, the instruction

(1,0,0,1,R)

might have a comment such as "Pass to the right over all the 0s.", but not a comment such as "In state 1 looking at a 0, write a 0, stay in state 1, and move right." which provides no additional information.

Purchase this Solution

Solution Summary

Solution gives a turing machine that performs the unary decrement in constant time irrespective of the input size.

Solution Preview

In unary representation, any unsigned whole number n is encoded by a sequence of n+1 1s. Following Turing machine instructions will perform the ...

Purchase this Solution


Free BrainMass Quizzes
Basic Networking Questions

This quiz consists of some basic networking questions.

C++ Operators

This quiz tests a student's knowledge about C++ operators.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.