ArticleslgStudy

computer science

State-transition table

State-transition table 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 State-transition table rather than just read about it. In short: In automata theory and sequential logic, a state-transition table is a table showing what state (or states in the case of a nondeterministic finite automaton) a finite-state machine will move to, based on the current state and other inputs. It is essentially a truth table or a control table, in which the inputs include the current state along with other inputs and the outputs include the next state along with other…

State-transition table — main illustration
State-transition table — illustration

Key takeaways

  • State-transition table 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 State-transition table to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of State-transition table from memory before moving on to harder problems.

Reference excerpt

In automata theory and sequential logic, a state-transition table is a table showing what state (or states in the case of a nondeterministic finite automaton) a finite-state machine will move to, based on the current state and other inputs. It is essentially a truth table or a control table, in which the inputs include the current state along with other inputs and the outputs include the next state along with other outputs. A state-transition table is one of many ways to specify a finite-state machine. Other ways include a state diagram.

Common forms

One-dimension State-transition tables are sometimes one-dimensional tables, also called characteristic tables. They are much more like truth tables than their two-dimensional form. The single dimension indicates inputs, current states, next states and (optionally) outputs associated with the state transitions.

Two-dimensions State-transition tables are typically two-dimensional tables. There are two common ways for arranging them. In the first way, one of the dimensions indicates current states, while the other indicates inputs. The row/column intersections indicate next states and (optionally) outputs associated with the state transitions.

In the second way, one of the dimensions indicates current states, while the other indicates next states. The row/column intersections indicate inputs and (optionally) outputs associated with the state transitions.

Other forms Simultaneous transitions in multiple finite-state machines can be shown in what is effectively an n-dimensional state-transition table in which pairs of rows map (sets of) current states to next states. This is an alternative to representing communication between separate, interdependent finite-state machines. At the other extreme, separate tables have been used for each of the transitions within a single finite-state machine: "AND/OR tables" are similar to incomplete decision tables in which the decision for the rules which are present is implicitly the activation of the associated transition.

Example An example of a state-transition table together with the corresponding state diagram for a finite-state machine that accepts a string with an even number 0s is given below:

In the state-transition table, all possible inputs to the finite-state machine are enumerated across the columns of the table, while all possible states are enumerated across the rows. If the machine is in the state S1 (the first row) and receives an input of 1 (second column), the machine will stay in the state S1. Now if the machine is in the state S1 and receives an input of 0 (first column), the machine will transition to the state S2. In the state diagram, the former is denoted by the arrow looping from S1 to S1 labeled with a 1, and the latter is denoted by the arrow from S1 to S2 labeled with a 0. This process can be described statistically using Markov Chains. For a nondeterministic finite-state machine, an input may cause the machine to be in more than one state, hence its non-determinism. This is denoted in a state-transition table by the set of all target states enclosed in a pair of braces {}. An example of a state-transition table together with the corresponding state diagram for a nondeterministic finite-state machine is given below:

If the machine is in the state S2 and receives an input of 0, the machine will be in two states at the same time, the states S1 and S2.

Transformations from/to state diagram It is possible to draw a state diagram from a state-transition table. A sequence of easy to follow steps is given below:

Draw the circles to represent the states given. For each of the states, scan across the corresponding row and draw an arrow to the destination state(s). There can be multiple arrows for an input character if the finite-state machine is nondeterministic. Designate a state as the start state. The start state is given in the formal definition of a finite-state machine. Designate one or more states as accepting state. This is also given in the formal definition of a finite-state machine.

See also Adjacency list Adjacency matrix Dataflow Excitation table Finite-state machine Index notation Moore machine Mealy machine Ward-Mellor methodology

References

Further reading Michael Sipser: Introduction to the Theory of Computation. PWS Publishing Co., Boston 1997 ISBN 0-534-94728-X

Illustrations

State-transition table illustration

Worked examples

Example 1 — a first encounter with State-transition table

Start with the simplest possible case. Write down what State-transition table 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 State-transition table 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 State-transition table 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 State-transition table

In research
State-transition table 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 State-transition table 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
State-transition table is common in secondary-school and first-year university syllabi. It links to neighbouring topics Automata (computation), so understanding it makes those chapters shorter.
In everyday life
Look for State-transition table 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 “State-transition table” →

How to study State-transition table in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what State-transition table 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 State-transition table out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is State-transition table in simple terms?

In automata theory and sequential logic, a state-transition table is a table showing what state (or states in the case of a nondeterministic finite automaton) a finite-state machine will move to, based on the current state and other inputs. It is essentially a truth table or a control table, in whi…

Why does State-transition table 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 State-transition table?

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 State-transition table.

Tags

  • Automata (computation)

Keep exploring