Hello! Welcome to your fifth lesson. This lesson marks the end of our first module on the foundational concepts of computation.
In our last lesson, we discovered a crucial fact: while any single formal language is countable, the set of all possible languages is uncountably infinite. This creates a fundamental challenge: we have an infinite number of problems (languages) that we can't even describe with any finite tool like a program or a grammar. This insight motivates the central question of this course: what kinds of infinite languages can we describe and process using finite means?
Today, we will begin to answer that question by introducing automata theory. The learning outcome for this lesson is to describe the role of automata as abstract mathematical models of computation. We will explore why we need these models, what they are, and how they form a hierarchy of computational power.
1. Why Use Abstract Models of Computation?
Before diving into specific models, it's important to understand why we use them in the first place. Real-world computers are incredibly complex systems involving hardware, operating systems, and various layers of software. Studying computation at that level of detail would be overwhelming and obscure the fundamental principles.
Instead, in theoretical computer science, we use simplified, mathematical abstractions called models of computation. These models strip away the non-essential details to help us focus on the core capabilities and limitations of computation itself.
1. Introduction, Finite Automata, Regular Expressions
To start, watch this short segment from an MIT OpenCourseWare lecture by Prof. Michael Sipser, a leading figure in this field. He explains why we turn to abstract models to understand real-world computers.
Please watch from 09:16 to 10:08. Pay attention to the reasoning for using simpler models to capture the important aspects of what we want to understand.
As Prof. Sipser explains, the goal is to create models that are simple enough to analyze with mathematical precision, yet powerful enough to capture the essence of what a computer does.
2. The General Anatomy of an Automaton
The abstract machines we study in this course are called automata (singular: automaton). An automaton is a mathematical model of a computing device that follows a predetermined sequence of operations automatically.
At a high level, most automata share a common structure. The following reading describes the essential features of a generic automaton.
theory of computation lecture notes
These lecture notes provide a clear, high-level overview of what constitutes an automaton.
Please read the section titled 'Automata' (it begins with 'An automata is an abstract computing device...'). Focus on the four essential features described and the accompanying diagram (Figure 1). This will give you a blueprint for all the models we'll study.
To summarize, a generic automaton has:
- An input mechanism (like a tape) that holds the input string.
- A control unit which is in one of a finite number of states at any given moment.
- A transition function that determines the next state based on the current state and the input symbol being read.
- (Optionally) some form of temporary storage or memory (e.g., a stack or a writable tape).
- An output, which for our purposes will typically be a simple "accept" or "reject" decision after reading the entire input.
An automaton that makes a binary accept/reject decision is called a language recognizer. Its "job" is to determine whether an input string belongs to a specific language. The set of all strings that an automaton accepts is called the language of the automaton.
3. A Hierarchy of Computational Models
A key insight of automata theory is that not all models are created equal. Their computational power is largely determined by the type and amount of memory they have. This creates a beautiful and elegant hierarchy of machine models, where each level can solve a wider class of problems than the one below it.
The following video and diagram introduce the main families of automata and their relative power.
Introduction to Theory of Computation
This clip from Neso Academy provides a concise overview of the different layers of computational models you will encounter in this course.
Please watch from 07:48 to 11:10. The video introduces Finite State Machines (FSM), Context-Free Languages (and their corresponding Pushdown Automata), Turing Machines, and the concept of undecidability. Focus on the differences in their capabilities.
As the video explained, we have a clear progression of power:
- Finite Automata (FA) / Finite State Machines (FSM): The simplest model. They have no memory other than their current state.
- Pushdown Automata (PDA): These are Finite Automata augmented with a stack for memory. This allows them to recognize a broader class of languages, called Context-Free Languages.
- Turing Machines (TM): The most powerful model. They have an infinite tape that they can read from, write to, and move along in both directions. The Turing Machine is considered a universal model of computation, capable of performing any task that a modern computer can.
This hierarchy is often visualized as a series of nested sets, as each model fully contains the capabilities of the models within it.

4. Our Starting Point: The Finite Automaton
We will begin our journey with the simplest model: the Finite Automaton (FA). An FA is a machine with a finite number of states and no external memory. It reads an input string one symbol at a time and changes its state based on a transition function. When it reaches the end of the string, it either accepts or rejects it based on the state it landed in.
Many real-world systems can be modeled as FAs. A simple example is a vending machine. It has states like "waiting for money," "25 cents inserted," "50 cents inserted," etc. It accepts inputs (coins) and transitions between states until it reaches an accepting state where it dispenses a product. Your experience with building systems that respond to inputs based on a current state, like in backend development or even smart contracts, reflects the core logic of these machines.
The next video demonstrates a classic computational example of an FA.
1. Introduction, Finite Automata, Regular Expressions
Let's return to the MIT lecture to see a concrete example of a Finite Automaton in action. This will illustrate how the abstract components (states, transitions) work together to recognize a language.
Please watch from 10:08 to 14:01. The video presents a 'state diagram' for an automaton and traces its execution on an input string. Focus on how the machine moves from state to state and what determines if the final output is 'accept' or 'reject'.
This example perfectly illustrates the role of an automaton: it's a precise, mechanical procedure for recognizing whether strings have a certain property (in this case, containing the substring 11).
Test your understanding!
Consider a simple automatic door controller. It has two states: CLOSED and OPEN. It reacts to two inputs: PERSON_DETECTED and NO_PERSON_DETECTED.
- Initially, the state is
CLOSED. - If it's
CLOSEDand it receivesPERSON_DETECTED, it moves to theOPENstate. - If it's
OPENand it receivesNO_PERSON_DETECTED(after a short delay, which we can ignore for this model), it moves to theCLOSEDstate. - In all other cases, it stays in its current state (e.g., if it's
OPENand still detects a person).
How does this simple system fit the definition of a Finite Automaton? What corresponds to its states, alphabet, and transitions?
Show answer
This system is a perfect example of a Finite Automaton.
- States (Q): The set of states is
{CLOSED, OPEN}. - Alphabet (): The set of input symbols is
{PERSON_DETECTED, NO_PERSON_DETECTED}. - Transitions (): The rules describe the transition function. For example,
δ(CLOSED, PERSON_DETECTED) = OPEN. - Start State (): The initial state is
CLOSED. - Accepting States (F): In this example, the concept of an "accepting" state isn't as clear as in language recognition, but we could designate
OPENas a special state representing the successful completion of its primary task.
5. From Pictures to Mathematics: The Formal Definition
While state diagrams are great for intuition, we need a precise mathematical definition to formally prove properties about these machines. As you prefer a mix of intuition and rigor, this step is crucial. It prepares us for the more formal work in the upcoming modules.
A Finite Automaton is formally defined as a 5-tuple.
1. Introduction, Finite Automata, Regular Expressions
This final video clip formally defines a Finite Automaton and shows how the 5-tuple notation maps directly to the state diagram we saw earlier.
Please watch from 18:30 to 23:50. Focus on understanding each of the five components in the tuple: Q, Σ, δ, q₀, and F. Note how the transition function δ can be represented by a table.
So, a finite automaton is a 5-tuple , where:
- is a finite set of states.
- is a finite set called the alphabet (the set of allowed input symbols).
- is the transition function. It takes a state and an input symbol and returns the next state.
- is the start state.
- is the set of accept (or final) states.
This formal definition is the bedrock upon which we will build our understanding of regular languages.
Conclusion
This lesson served as a bridge from the "what" of formal languages to the "how" of processing them. We've introduced the concept of automata as the theoretical machines that perform this processing.
Key Takeaways:
- Automata are abstract mathematical models of computation that allow us to study the fundamental capabilities of machines in a precise way.
- Their primary role in this course is as language recognizers: they accept or reject input strings based on a set of rules.
- Automata exist in a hierarchy of power (Finite Automata < Pushdown Automata < Turing Machines), with the main difference being their memory capabilities.
- Finite Automata (FA) are the simplest model, having only a finite number of states and no external memory.
- An FA can be represented intuitively with a state diagram or formally as a 5-tuple .
We have now completed the first module of the course. You have a solid grasp of the basic building blocks (alphabets, strings, languages) and an understanding of why we need abstract machines to reason about them.
Preview of the Next Lesson:
We are now ready to dive deep into our first family of machines. In the next lesson, we will begin Module 2 by formally defining Deterministic Finite Automata (DFAs) and Nondeterministic Finite Automata (NFAs). We will learn to construct their state diagrams and begin designing our own machines to recognize specific languages.