A language is a regular language if and only if a finite state machine recognizes it. To understand this concept better, we need to understand what a finite state machine is.
A finite state machine, also known as finite automata, is the simplest form of computation and has limited memory. Let’s have a look at some of the prerequisites of the finite state machine:
Symbol: Any character or element can be considered a symbol, for example,
Alphabet: An alphabet is denoted by
String: A sequence of symbols is known as a string, for example,
Language: A set of strings is known as a language. Let’s look at the following examples:
Let us say that we have the alphabet
We have language
The possible strings for language
We have language
The possible strings for language
We have language
The possible strings for language
The languages
Let’s say that we have the alphabet
A special case where the power of
Now, let’s look at what finite state machines are.
States: A finite state machine has a finite set of states represented by the notation
The machine can be defined by using the following five tuples:
Transitions: Based on input events or circumstances, transitions—represented by arrows or edges—define the permitted state transitions. Transitions show how the machine changes states in response to particular inputs.
Input alphabet: A finite set of symbols or events that can cause state transitions serves as the input alphabet for the machine. The machine reads one input symbol at a time, which then responds by switching between states.
Transition function: Using the transition function,
Start state: The machine starts at one state, known as the start state
Accept states: Some state(s) may be designated as accept state(s) or final state(s). These states denote the completion of a particular pattern. Accept states are frequently used by finite state machines that recognize particular languages or patterns, such as regular expressions.
Output (optional): Based on the output behavior, finite state machines can be divided into two categories:
Moore machine: Only the current state can determine the output. Each state is connected to a predetermined output.
Mealy machine: The input as well as the output are dependent on one another. There may be associated output values for transitions.
Let’s take an example of a finite state machine:
As stated earlier, a language is said to be a regular language if and only if a finite state machine recognizes it.
A language which is not recognized by a finite state machine
A language that requires memory
Why is that? This is because the memory of a finite-state machine is very limited. It only stores the current state and it cannot store or count strings. This makes such a language "not regular."
Let’s have a look at some examples:
Language:
Language:
Therefore, by counter-example, we now know what regular languages are.
Test your knowledge of the regular languages.
What is a finite state machine (FSM)?
A machine with unlimited memory.
A machine that can recognize any language.
A simple computational model with limited memory.
A machine used only for graphics rendering.
Free Resources