Turing_Machine | Turing Machine - an abstract performer
kandi X-RAY | Turing_Machine Summary
kandi X-RAY | Turing_Machine Summary
Turing Machine (TM) - an abstract performer (abstract computing machine). It was proposed by Alan Turing in 1936 to formalize the concept of an algorithm. The Turing Machine is an extension of the finite state machine and, according to the Church-Turing thesis, is able to simulate all performers (by setting transition rules) that somehow implement the process of stepwise calculation in which each step of the calculation is quite elementary. That is, any intuitive algorithm can be implemented using some Turing machine.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of Turing_Machine
Turing_Machine Key Features
Turing_Machine Examples and Code Snippets
Community Discussions
Trending Discussions on Turing_Machine
QUESTION
A Turing machine manipulates symbols on an infinite strip of tape according to a table of rules.
In my case entries on the tape can be either 0's and 1's (binary).
The tape starts off 'empty' with an infinity of 0's in both positive and negative directions. This tape gets written on based on the rules that the machine follows, potentially adding 0's or 1's to the unwritten edges.
Since the tape values are binary is there a most efficient way to represent them in memory as the machine writes to the tape, adding new values to the left or right? Obviously I don't need to represent the infinite zeros (unwritten tape), but I do need to expand the data structure as new values are added to the ends of the tape.
A python list could do the trick, shown here inserting a 1 on the left:
...ANSWER
Answered 2017-Mar-30 at 07:36Given that the tape is infinite at both ends, you will have to consider the (-inf, -1]
range of indices too. The best representation, IMO, would be a pair of lists - one for the non-negative range and the other for the negative range (with indexing reversed). As you move beyond the allocated range of the tape, you will simply have to append to the respective list (which, unlike prepending to a list, is a fast operation).
A draft implementation (using an enhanced version of GrowingList
from this answer):
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Turing_Machine
Run git clone https://github.com/tivole/Turing_Machine.git to clone repository.
Run cd Turing_Machine/src to change directory.
Run pip install -r requirements.txt to install required libraries.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page