ArticleslgStudy

computer science

Counter-machine model

Counter-machine model is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Counter-machine model rather than just read about it. In short: There are many variants of the counter machine, among them those of Hermes, Ershov, Péter, Minsky, Lambek, Shepherdson and Sturgis, and Schönhage. These are explained below.

Key takeaways

  • Counter-machine model belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Counter-machine model to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Counter-machine model from memory before moving on to harder problems.

Reference excerpt

There are many variants of the counter machine, among them those of Hermes, Ershov, Péter, Minsky, Lambek, Shepherdson and Sturgis, and Schönhage. These are explained below.

The models in more detail

1954: Hermes' model Shepherdson & Sturgis (1963) observe that "the proof of this universality [of digital computers to Turing machines] ... seems to have been first written down by Hermes, who showed in [7--their reference number] how an idealized computer could be programmed to duplicate the behavior of any Turing machine", and: "Kaphengst's approach is interesting in that it gives a direct proof of the universality of present-day digital computers, at least when idealized to the extent of admitting an infinity of storage registers each capable of storing arbitrarily long words". The only two arithmetic instructions are

Successor operation Testing two numbers for equality The rest of the operations are transfers from register-to-accumulator or accumulator-to-register or test-jumps. Kaphengst's paper is written in German; Sheperdson and Sturgis' translation uses terms such as "mill" and "orders". The machine contains "a mill" (accumulator). Kaphengst designates his mill/accumulator with the "infinity" symbol but we will use "A" in the following description. It also contains an "order register" ("order" as in "instruction", not as in "sequence"). (This usage came from the Burks–Goldstine–von Neumann (1946) report's description of "...an Electronic Computing Instrument".) The order/instruction register is register "0". And, although not clear from Sheperdson and Sturgis' exposition, the model contains an "extension register" designated by Kaphengst "infinity-prime"; we will use "E". The instructions are stored in the registers:

"...so the machine, like an actual computer, is capable of doing arithmetic operations on its own program" (p. 244). Thus this model is actually a random-access machine. In the following, "[ r ]" indicates "contents of" register r, etc.

Shepherdson & Sturgis (1963) remove the mill/accumulator A and reduce the Kaphengst instructions to register-to-register "copy", arithmetic operation "increment", and "register-to-register compare". Observe that there is no decrement. This model, almost verbatim, is to be found in Minsky (1967); see more in the section below.

1958: Ershov's class of operator algorithms Shepherdson & Sturgis (1963) observe that Ersov's model allows for storage of the program in the registers. They assert that Ersov's model is as follows:

1958: Péter's "treatment" Shepherdson & Sturgis (1963) observe that Péter's "treatment" (they are not too specific here) has an equivalence to the instructions shown in the following table. They comment specifically about these instructions, that:

"from the point of view of proving as quickly as possible the computability of all partial recursive functions Péter's is perhaps the best; for proving their computability by Turing machines a further analysis of the copying operation is necessary along the lines we have taken above."

1961: Minsky's model of a partial recursive function reduced to a "program" of only two instructions In his inquiry into problems of Emil Post (the tag system) and Hilbert's 10th problem (Hilbert's problems, Diophantine equation) led Minsky to the following definition of:

"an interesting basis for recursive function theory involving programs of only the simplest arithmetic operations". His "Theorem Ia" asserts that any partial recursive function is represented by "a program operating on two integers S1 and S2 using instructions Ij of the forms:

The first theorem is the context of a second "Theorem IIa" that

"...represents any partial recursive function by a program operating on one integer S [contained in a single register r1] using instructions Ij of the forms":

In this second form the machine uses Gödel numbers to process "the integer S". He asserts that the first machine/model does not need to do this if it has 4 registers available to it.

1961: Melzak model: a single ternary instruction with addition and proper subtraction "It is our object to describe a primitive device, to be called a Q-machine, which arrives at effective computability via arithmetic rather than via logic. Its three operations are keeping tally, comparing non-negative integers, and transferring" (Melzak (1961) p. 281) If we use the context of his model, "keeping tally" means "adding by successive increments" (throwing a pebbles into) or "subtracting by successive decrements"; transferring means moving (not copying) the contents from hole A to hole B, and comparing numbers is self-evident. This appears to be a blend of the three base models. Melzak's physical model is holes { X, Y, Z, etc. } in the ground together with an unlimited supply of pebbles in a special hole S (Sink or Supply or both? Melzak doesn't say).

"The Q-machine consists of an indefinitely large number of locations: S, A1, A2, ..., an indefinitely large supply of counters distributed among these locations, a program, and an operator whose sole purpose is to carry out the instructions. Initially all but a finite number from among the locations ... are empty and each of the remaining ones contains a finite number of counters" (p. 283, boldface added) The instruction is a single "ternary operation" he calls "XYZ":

"XYZ" denotes the operation of Of all the possible operations, some are not allowed, as shown in the table below:

Some observations about the Melzak model:

1961: Lambek "abacus" model: atomizing Melzak's model to X+, X- with test Original "abacus" model of Lambek (1962): Lambek references Melzak's paper. He atomizes Melzak's single 3-parameter operation (really 4 if we count the instruction addresses) into a 2-parameter increment "X+" and 3-parameter decrement "X-". He also provides both an informal and formal definition of "a program". This form is virtually identical to the Minsky (1961) model, and has been adopted by Boolos, Burgess & Jeffrey 2007, p. 45, Abacus Computability.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Counter-machine model

Start with the simplest possible case. Write down what Counter-machine model claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Counter-machine model before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Counter-machine model ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Counter-machine model

In research
Counter-machine model appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Counter-machine model in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Counter-machine model is common in secondary-school and first-year university syllabi. It links to neighbouring topics Models of computation, so understanding it makes those chapters shorter.
In everyday life
Look for Counter-machine model outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Counter-machine model” →

How to study Counter-machine model in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Counter-machine model means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Counter-machine model out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Counter-machine model in simple terms?

There are many variants of the counter machine, among them those of Hermes, Ershov, Péter, Minsky, Lambek, Shepherdson and Sturgis, and Schönhage. These are explained below.

Why does Counter-machine model matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Counter-machine model?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Counter-machine model.

Tags

  • Models of computation

Keep exploring