Counter Machines vs Turing Machines
- 17Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
- spaceFlip card
- KI knew it
- DI didn't know it
- ←Previous card
- →Next card
What is a Turing machine?
A Turing machine is a universal model of computation capable of performing any calculation a computer can do, utilizing an infinite tape, symbols, and a moving tape head.
Or swipe the card
17 cards
What is a Turing machine?
A Turing machine is a universal model of computation capable of performing any calculation a computer can do, utilizing an infinite tape, symbols, and a moving tape head.
What are the components of a Turing machine?
An infinite tape divided into cells, symbols (typically 0s and 1s), and an old-fashioned tape head that moves across the tape, reading and writing.
What is a key capability of a Turing machine regarding computation?
It can compute anything that you want to compute, and no computational devices found so far can outperform it.
What is a counter machine?
A counter machine replaces the infinite tape with individual 'counters' (bags) where operations are adding, subtracting, or checking if a counter is empty, without being able to 'peek inside' to see the exact count.
What are the allowed operations for a counter machine?
You can add a counter, subtract a counter, and check whether or not a counter is empty. You cannot count beyond that.
How does the computational power of a counter machine compare to a Turing machine?
A counter machine is just as powerful as a Turing machine, and therefore, it can compute pretty much anything a modern computer can.
Describe the 'Hello World' operation for counters: resetting a counter.
To reset Counter 1 (C1), repeatedly subtract one from C1 and check if it's empty, continuing in a loop until C1 is empty. Once empty, you exit the loop.
How can you add the contents of C2 to C1 using counter machine operations?
Subtract one from C2 and add one to C1, repeating this process until C2 is empty. The contents of C2 are destroyed in the process.
Explain the process of copying the contents of C2 into C4 while preserving C2's original value.
First, subtract from C2 and add to both C4 and a temporary counter (T). Repeat until C2 is empty. Then, in a second loop, subtract from T and add back to C2 until T is empty.
How do you double the contents of C1, storing the result back in C1?
Repeatedly remove one from C1 and add two to a temporary counter (T) until C1 is empty. Then, move all contents from T back to C1.
How can you half the value of a counter, like C1, storing the result in a temporary counter T?
Repeatedly subtract two from C1 and add one to a temporary counter (T) until C1 is empty. If an odd number is encountered, the remainder of one will be disregarded unless specifically stored.
How can a Turing machine's tape configuration be represented using counter machines, especially for binary tapes?
The tape can be split into three parts: left of the tape head (C1), under the tape head (C2), and right of the tape head (C3). These parts are represented as binary numbers in the counters.
How is moving the Turing machine tape head one square to the right simulated by counter operations?
C1 is doubled and has C2's original contents added. C2 takes the remainder of C3 divided by two. C3 is halved (quotient only).
How is moving the Turing machine tape head one square to the left simulated by counter operations?
C3 is doubled and has C2's original contents added. C2 takes the remainder of C1 divided by two. C1 is halved (quotient only).
How can a counter machine simulate writing a '0' under the Turing machine tape head?
To write a '0', the counter C2 (representing the symbol under the tape head) is simply reset to zero.
How can a counter machine simulate writing a '1' under the Turing machine tape head?
To write a '1', first reset C2 to zero, and then increment C2 by one.
How does a counter machine 'read' the symbol under the tape head (represented by C2)?
To read, you must check if C2 is empty (meaning '0') or if it contains one item (meaning '1'). This is done by attempting to subtract one from C2; if successful, it was '1', if not, it was '0'. The removed item must be restored if C2 is to remain '1'.

Ask anything
We've read this whole study set, so questions about it get the best answers.