Hello! In our last lesson, we formally defined a Deterministic Finite Automaton (DFA) as a 5-tuple, establishing the static blueprint of this computational model. We identified its states, alphabet, transition function, start state, and accepting states.
Today, we bring that blueprint to life. This lesson focuses on the dynamic process of computation. You will learn how to trace the path a DFA takes when given an input string, step-by-step, to arrive at a final decision: accept or reject. Mastering this process is crucial, as it's the mechanism by which a DFA recognizes a language. We will explore both an intuitive visual trace and the rigorous mathematical formalisms that underpin it.
The Intuition of a Computation
At its heart, a DFA's computation is a journey through its state diagram. The machine starts in the designated start state. It then reads the input string one symbol at a time from left to right. For each symbol, it follows the single, uniquely defined transition arrow from its current state to the next. When the string is exhausted, the journey ends. If the final state is an accepting state (a double circle), the string is accepted; otherwise, it is rejected.
Let's consider the following DFA as our example for this lesson:

Let's trace the input string 101 on this machine intuitively:
- Start: The machine begins at the start state, .
- Read
1: From state , the transition for the symbol1leads to state . The machine is now in state . - Read
0: From state , the transition for the symbol0leads to state . The machine is now in state . - Read
1: From state , the transition for the symbol1leads back to state (a self-loop). The machine remains in state . - End of string: We have processed all symbols. The machine's final state is .
Since is in the set of accepting states , we conclude that the DFA accepts the string 101. The sequence of states visited was .
This intuitive trace is useful, but for formal proofs and unambiguous definitions, we need to ground this process in mathematics.
Formalizing Computation: The Extended Transition Function
The transition function, , is defined to handle only a single input symbol. To formalize computation over an entire string, we must extend it. We define the extended transition function, commonly denoted as (pronounced "delta-hat"), which takes a state and a string as input and returns the state the machine is in after processing that string. Its signature is .
Given your background in mathematical proofs, you will find its inductive definition quite natural:
- Base Case: For the empty string , no transitions occur.
- Recursive Step: For any string and any symbol , the string is one symbol longer than . We find the state after processing , and then apply the standard transition for the final symbol .
With this function, we can formally define acceptance. A DFA accepts a string if and only if .
To see a detailed walkthrough of this definition and a concrete example of its application, please watch the following video.
Theory of Computation: Extended Transition Function for DFA with an Example
This video from the channel Anita R first formally defines the extended transition function (delta-hat) and then meticulously applies it to trace the input string 1010 on an example DFA.
First, watch the explanation of the formal definition. Then, pay close attention to the step-by-step example where the function is recursively applied to process the string 1010, from checking the string.
Let's apply this to our earlier trace of 101 on the example DFA. We want to compute .
- To solve this, we need :
- And for that, we need :
- Now we can substitute back into step 2:
- Finally, we substitute back into step 1:
The result is . Since , the string 101 is accepted, matching our intuitive trace.
An Alternative View: Sequences of Configurations
Another way to formalize computation is by describing it as a sequence of "snapshots" of the machine. Each snapshot is called a configuration and captures the machine's current state and the remaining portion of the input string. A configuration is typically written as a pair , where is the current state and is the unread part of the input.
The process of moving from one configuration to the next is defined by the yields relation, denoted by the symbol.
We say if . This means that if the machine is in state with aw left to read, it can take one step to be in state with just w left to read.
A full computation is a sequence of such steps. We use (the reflexive, transitive closure of ) to denote zero or more steps. A DFA accepts a string if the initial configuration yields a final configuration where the input is empty and the state is an accepting one. Formally:
for some .
To explore these concepts in more detail, please consult the following resource.
Deterministic Finite Automaton - an overview | ScienceDirect Topics
This article from ScienceDirect provides a rigorous definition of configurations and the "yields" relation, and demonstrates their use in a computation trace.
Start by reading the definitions of a configuration and the yields relation (Definitions 3 and 4). Then, follow the concrete trace of the input string 0011. Finally, see how this is all tied together in the definition of a computation (Definition 5).
The Computation Trace as a Sequence of States
Both the extended transition function and the sequence of configurations describe the same underlying phenomenon: the unique path of states the DFA takes for a given input. This path is the computation trace.
For an input string of length , the computation is a sequence of states, let's call it , where:
- (the computation starts in the start state).
- for (each subsequent state is determined by the transition from the previous state on the corresponding input symbol).
The string is accepted if the final state in this sequence, , is an accepting state.
It's important to recognize this as a sequence rather than a set of states. A state can be visited multiple times, and the order of visits is fundamental to the computation. The following video clarifies this distinction and provides another formal definition of a computation.
This video from Easy Theory provides a clear, formal definition of a DFA computation as a sequence of states, explaining why order and repetition are important.
First, watch the informal trace from look at a particular string, where the distinction between a sequence and a set of states is explained. Then, focus on the formal definition of a computation as a sequence of n+1 states and the conditions it must satisfy.
Conclusion
In this lesson, we have moved from the static definition of a DFA to its dynamic operation. We have meticulously defined what it means for a DFA to compute and to accept a string.
Here are the key takeaways:
- A DFA's computation is a step-by-step process of reading an input string and transitioning between states.
- This process can be formally described using the extended transition function, , which recursively determines the final state after processing an entire string.
- Alternatively, computation can be seen as a sequence of configurations, where the machine moves from one configuration to the next via the yields relation, .
- The result of a computation on an input string is a unique trace, a sequence of states .
- A string is accepted if and only if the final state in its computation trace, , is an element of the DFA's set of accepting states, .
Now that you can precisely trace a DFA's execution, you are ready for the next logical step. In our next lesson, we will shift from analyzing existing DFAs to designing new ones to recognize specific languages we want to capture.