Professional Documents
Culture Documents
Formal Language and Automata Theory Notes F
Formal Language and Automata Theory Notes F
INES-RUHENGERI
Administering Faculty: FAFS
Department: Computer Science
Module Title:
FORMAL LANGUAGE AND FINITE AUTOMATA
1
D’ENSEIGNEMENT SUPERIEUR DE RUHENGERI 2022-
BP:155 Ruhengeri-Rwanda, Tel:+250788903030, +250788903032;
website:www.ines.ac.rw; Email: infoi@ines.ac.rw; 2023
TABLE OF CONTENTS
Unit 3:Regular Set –Regular Expression and regular set, Closure properties of
regular sets,Pumping lemma,
Unit 4: Push Down Automata (PDA)–Definition and description, PDA and Turing
Machines.
2
D’ENSEIGNEMENT SUPERIEUR DE RUHENGERI 2022-
BP:155 Ruhengeri-Rwanda, Tel:+250788903030, +250788903032;
website:www.ines.ac.rw; Email: infoi@ines.ac.rw; 2023
UNIT 1: INTRODUCTION
1. Basics of Automata:
Definitions:
Automata theory is the basis for the theory of formal languages. A proper treatment of
formal language theory begins with some basic definitions:
The set of words that form a language is usually infinite, although it may
be finite or empty as well. Formal languages are treated like mathematical sets, so they
can undergo standard set theory operations such as union and intersection.
Additionally, operating on languages always produces a language. As sets, they are
defined and classified using techniques of automata theory.
Formal languages are normally defined in one of three ways, all of which can be
described by automata theory:
regular expressions
standard automata
a formal grammar system
3
D’ENSEIGNEMENT SUPERIEUR DE RUHENGERI 2022-
BP:155 Ruhengeri-Rwanda, Tel:+250788903030, +250788903032;
website:www.ines.ac.rw; Email: infoi@ines.ac.rw; 2023
alphabet A1 = {a, b}
alphabet A2 = {1, 2}
language L1 = the set of all words over A1 = {a, aab, ...}
language L2 = the set of all words over A2 = {2, 11221, ...}
language L3 = L1 ∪ L2
signals. Namely, set I is the set {x1, x,2, x3... xk} where k is the number of inputs.
Outputs: sequences of symbols selected from a finite set Z. Namely, set Z is the
set {y1, y2, y3 ... ym} where m is the number of outputs.
States: finite set Q, whose definition depends on the type of automaton.
Finite-state machine
Pushdown automata
Linear-bounded automata
Turing machine
The families of automata above can be interpreted in a hierarchal form, where the finite-
state machine is the simplest automata and the Turing machine is the most complex.
The focus of this project is on the finite-state machine and the Turing machine. A Turing
machine is a finite-state machine yet the inverse is not true.
The exciting history of how finite automata became a branch of computer science
illustrates its wide range of applications. The first people to consider the concept of a
finite-state machine included a team of biologists, psychologists, mathematicians,
engineers and some of the first computer scientists. They all shared a common interest:
to model the human thought process, whether in the brain or in a computer. Warren
McCulloch and Walter Pitts, two neurophysiologists, were the first to present a
description of finite automata in 1943. Their paper, entitled, "A Logical Calculus
Immanent in Nervous Activity", made significant contributions to the study of neural
network theory, theory of automata, the theory of computation and cybernetics. Later,
two computer scientists, G.H. Mealy and E.F. Moore, generalized the theory to much
5
D’ENSEIGNEMENT SUPERIEUR DE RUHENGERI 2022-
BP:155 Ruhengeri-Rwanda, Tel:+250788903030, +250788903032;
website:www.ines.ac.rw; Email: infoi@ines.ac.rw; 2023
An automaton in which the state set Q contains only a finite number of elements is
called a finite-state machine (FSM). FSMs are abstract machines, consisting of a set of
states (set Q), set of input events (set I), a set of output events (set Z) and a state
transition function. The state transition function takes the current state and an input
event and returns the new set of output events and the next state. Therefore, it can be
seen as a function which maps an ordered sequence of input events into a
corresponding sequence, or set, of output events.
Finite-state machines are ideal computation models for a small amount of memory, and
do not maintain memory. This mathematical model of a machine can only reach a finite
number of states and transitions between these states. Its main application is in
mathematical problem analysis. Finite-machines are also used for purposes aside from
general computations, such as to recognize regular languages.
An elevator is a mechanism that does not remember all previous requests for service
but the current floor, the direction of motion (up or down) and the collection of not-yet
satisfied requests for services. Therefore, at any given moment in time, an elevator in
operated would be defined by the following mathematical terms:
States: finite set of states to reflect the past history of the customers' requests.
Inputs: finite set of input, depending on the number of floors the elevator is able
6
D’ENSEIGNEMENT SUPERIEUR DE RUHENGERI 2022-
BP:155 Ruhengeri-Rwanda, Tel:+250788903030, +250788903032;
website:www.ines.ac.rw; Email: infoi@ines.ac.rw; 2023
to access. We can use the set I, whose size is the number of floors in the building.
Outputs: finite set of output, depending on the need for the elevator to go up or
down, according to customers' needs.
From the mathematical interpretation above, it can be said that a finite-state machine
contains a finite number of states. Each state accepts a finite number of inputs, and
each state has rules that describe the action of the machine for ever input, represented
in the state transition mapping function. At the same time, an input may cause the
machine to change states. For every input symbol, there is exactly one transition out of
each state. In addition, any 5-tuple set that is accepted by nondeterministic finite
automata is also accepted by deterministic finite automata.
Having finite, constant amounts of memory, the internal states of an FSM carry no
further structure. They can easily be represented using state diagrams, as seen below:
The state diagram illustrates the operation of an automaton. States are represented
by nodes of graphs, transitions by the arrows or branches, and the corresponding inputs
7
D’ENSEIGNEMENT SUPERIEUR DE RUHENGERI 2022-
BP:155 Ruhengeri-Rwanda, Tel:+250788903030, +250788903032;
website:www.ines.ac.rw; Email: infoi@ines.ac.rw; 2023
and outputs are denoted by symbols. The arrow entering from the left into q0 shows
that q0 is the initial state of the machine. Moves that do not involve changes of states
are indicated by arrows along the sides of individual nodes. These arrows are known
as self-loops.
A finite automaton/machine has a finite number of states where a state can either be
an accepting state or rejecting state. It takes a sequence of input and changes its
current state pointer according to the rules of the machine known as the state function.
After the input sequence ends the current state of the machine determines whether the
input is accepted or rejected based on the type of the state. In other words, if the
current/active state of a machine after the input given ends, is an accepting state the
input is known to be accepted and vice versa.
Hence a finite automaton is designed to result in an accepting state if the input lies in
the language (set of strings) we want to recognize. Also vice versa.
A simple fa example is that of airplane safety control. It tracks the state of the airplane,
8
D’ENSEIGNEMENT SUPERIEUR DE RUHENGERI 2022-
BP:155 Ruhengeri-Rwanda, Tel:+250788903030, +250788903032;
website:www.ines.ac.rw; Email: infoi@ines.ac.rw; 2023
like fuel, doors open, fins operating etc. Different events change the state of the airplane
safety control, which might either result into an accepting state (allowing starting the
engine and takeoff) or a rejecting state if the airplane is not a condition for a safe flight.
Methamatical Representation
Q,,,q0,F
Where,
Q: set of all states.
Σ(Alphabet): all possible symbols for an input.
δ (Transition Function): the rules which specify the next state.
q0: the initial state
F: set of accepting state
Example:
Here,
Q: {a1,a2,okay,never}
Σ(Alphabet): {a,b,c, ....} (finite)
q0: 'no input yet'
F: {okay}
δ (Transition Function):
9
D’ENSEIGNEMENT SUPERIEUR DE RUHENGERI 2022-
BP:155 Ruhengeri-Rwanda, Tel:+250788903030, +250788903032;
website:www.ines.ac.rw; Email: infoi@ines.ac.rw; 2023
Non accepting states are the sates at which if the input string ends the input is
considered to be rejected.
Accepting States
Accepting states are the sates at which if the input string ends the input is considered
to be accepted.
Trap States
For some languages a machine can determine if a string is valid or invalid in early stage
10
D’ENSEIGNEMENT SUPERIEUR DE RUHENGERI 2022-
BP:155 Ruhengeri-Rwanda, Tel:+250788903030, +250788903032;
website:www.ines.ac.rw; Email: infoi@ines.ac.rw; 2023
and after which no symbol has any effect on the result such a state is known as a trap
state.
State Transition
where the transition symbol is the character in the input which results in the transition.
Types
11
D’ENSEIGNEMENT SUPERIEUR DE RUHENGERI 2022-
BP:155 Ruhengeri-Rwanda, Tel:+250788903030, +250788903032;
website:www.ines.ac.rw; Email: infoi@ines.ac.rw; 2023
Example 1:
1. Q = {q0, q1, q2}
2. ∑ = {0, 1}
3. q0 = {q0}
4. F = {q2}
o DFA can contain multiple final states. It is used in Lexical Analysis in Compiler.
In the following diagram, we can see that from state q0 for input a, there is only one
path which is going to q1. Similarly, from q0, there is only one path for input b going
to q2.
Example 1:
1. Q = {q0, q1, q2}
2. ∑ = {0, 1}
3. q0 = {q0}
4. F = {q2}
Solution:
Transition Diagram:
13
D’ENSEIGNEMENT SUPERIEUR DE RUHENGERI 2022-
BP:155 Ruhengeri-Rwanda, Tel:+250788903030, +250788903032;
website:www.ines.ac.rw; Email: infoi@ines.ac.rw; 2023
Transition Table:
→q0 q0 q1
q1 q2 q1
*q2 q2 q2
Example 2:
Solution:
Explanation:
o In the above diagram, we can see that on given 0 as input to DFA in state q0 the DFA change
always go to final state q1 on starting input 0. It can accept 00, 01, 000, 001....etc. It can't acc
starts with 1, because it will never go to final state on a string starting with 1.
14
D’ENSEIGNEMENT SUPERIEUR DE RUHENGERI 2022-
BP:155 Ruhengeri-Rwanda, Tel:+250788903030, +250788903032;
website:www.ines.ac.rw; Email: infoi@ines.ac.rw; 2023
Example 3:
Solution:
Explanation:
In the above diagram, we can see that on given 0 as input to DFA in state q0, the DFA changes state to
It can accept any string which ends with 0 like 00, 10, 110, 100....etc. It can't accept any string which en
1, because it will never go to the final state q1 on 1 input, so the string ending with 1, will not be accep
Will be rejected.
(Here the power set of Q (2Q) has been taken because in case of NDFA, from a
15
D’ENSEIGNEMENT SUPERIEUR DE RUHENGERI 2022-
BP:155 Ruhengeri-Rwanda, Tel:+250788903030, +250788903032;
website:www.ines.ac.rw; Email: infoi@ines.ac.rw; 2023
q0 is the initial state from where any input is processed (q0 ∈ Q).
Example
Q = {a, b, c}
∑ = {0, 1}
q0 = {a}
F = {c}
Present State Next State for Input 0 Next State for Input 1
A a, b b
16
D’ENSEIGNEMENT SUPERIEUR DE RUHENGERI 2022-
BP:155 Ruhengeri-Rwanda, Tel:+250788903030, +250788903032;
website:www.ines.ac.rw; Email: infoi@ines.ac.rw; 2023
B c a, c
C b, c c
DFA vs NDFA
The following table lists the differences between DFA and NDFA.
DFA NDFA
The transition from a state is to a single The transition from a state can be to
particular next state for each input symbol. multiple next states for each input
Hence it is called deterministic. symbol. Hence it is called non-
deterministic.
Empty string transitions are not seen in NDFA permits empty string transitions.
DFA.
17
D’ENSEIGNEMENT SUPERIEUR DE RUHENGERI 2022-
BP:155 Ruhengeri-Rwanda, Tel:+250788903030, +250788903032;
website:www.ines.ac.rw; Email: infoi@ines.ac.rw; 2023
A string is accepted by a DFA/NDFA iff the DFA/NDFA starting at the initial state ends
in an accepting state (any of the final states) after reading the string wholly.
δ*(q0, S) ∈ F
{S | S ∈ ∑* and δ*(q0, S) ∈ F}
δ*(q0, S′) ∉ F
{S | S ∈ ∑* and δ*(q0, S) ∉ F}
Example
Let us consider the DFA shown in Figure 1.3. From the DFA, the acceptable strings can
be derived.
18
D’ENSEIGNEMENT SUPERIEUR DE RUHENGERI 2022-
BP:155 Ruhengeri-Rwanda, Tel:+250788903030, +250788903032;
website:www.ines.ac.rw; Email: infoi@ines.ac.rw; 2023
Strings accepted by the above DFA: {0, 00, 11, 010, 101, ...........}
Strings not accepted by the above DFA: {1, 011, 111, ........}
Que-1: Draw a deterministic and non-deterministic finite automate which accept 00 and
11 at the end of a string containing 0, 1 in it, e.g., 01010100 but not 000111010.
Explanation: Design a DFA and NFA of a same string if input value reaches the final
state then it is acceptable otherwise it is not acceptable.
NFA of the given string is as follows:
19
D’ENSEIGNEMENT SUPERIEUR DE RUHENGERI 2022-
BP:155 Ruhengeri-Rwanda, Tel:+250788903030, +250788903032;
website:www.ines.ac.rw; Email: infoi@ines.ac.rw; 2023
Here, q0 shows the initial state, q1 and q2 are the transition states, and q3 and q4 are
the final states.
Note – NFA and DFA both have same power that means if NFA can recognized an
language L then DFA can also be defined to do so and if DFA can recognized an
language L then NFA can also be defined to do so.
20
D’ENSEIGNEMENT SUPERIEUR DE RUHENGERI 2022-
BP:155 Ruhengeri-Rwanda, Tel:+250788903030, +250788903032;
website:www.ines.ac.rw; Email: infoi@ines.ac.rw; 2023
Que-2: Draw a deterministic and non-deterministic finite automata which accept a string
containing “the” anywhere in a string of {a-z}, e.g., “there” but not “those”.
Explanation – Design a DFA and NFA of a same string if input value reaches the final
state then it is acceptable otherwise it is not acceptable. It is applicable for all the DFA
and NFA. Since, NFA is quit easier then DFA, so first make its NFA and then go through
the DFA.
NFA of the given string is as follows:
Example 1:
Design a FA with ∑ = {0, 1} accepts those string which starts with 1 and ends with 0.
Solution:
The FA will have a start state q0 from which only the edge with input 1 will go to the
next stat
In state q1, if we read 1, we will be in state q1, but if we read 0 at state q1, we will reach
to state q2 which is the final state. In state q2, if we read either 0 or 1, we will go to q2
state or q1 state respectively. Note that if the input ends with 0, it will be in the final
state.
21
D’ENSEIGNEMENT SUPERIEUR DE RUHENGERI 2022-
BP:155 Ruhengeri-Rwanda, Tel:+250788903030, +250788903032;
website:www.ines.ac.rw; Email: infoi@ines.ac.rw; 2023
Example 2:
Solution:
In the given solution, we can see that only input 101 will be accepted. Hence, for input
101, there is no other path shown for other input.
Example 3:
Design FA with ∑ = {0, 1} accepts even number of 0's and even number of 1's.
Solution:
This FA will consider four different stages for input 0 and input 1. The stages could be:
22
D’ENSEIGNEMENT SUPERIEUR DE RUHENGERI 2022-
BP:155 Ruhengeri-Rwanda, Tel:+250788903030, +250788903032;
website:www.ines.ac.rw; Email: infoi@ines.ac.rw; 2023
Here q0 is a start state and the final state also. Note carefully that a symmetry of 0's
and 1's is maintained. We can associate meanings to each state as:
23
D’ENSEIGNEMENT SUPERIEUR DE RUHENGERI 2022-
BP:155 Ruhengeri-Rwanda, Tel:+250788903030, +250788903032;
website:www.ines.ac.rw; Email: infoi@ines.ac.rw; 2023
Example 4:
Design FA with ∑ = {0, 1} accepts the set of all strings with three consecutive 0's.
Solution:
The strings that will be generated for this particular languages are 000, 0001, 1000,
10001, .... in which 0 always appears in a clump of 3. The transition graph is as follows:
Example 5:
Design a DFA L(M) = {w | w ε {0, 1}*} and W is a string that does not contain consecutive
1's.
Solution:
24
D’ENSEIGNEMENT SUPERIEUR DE RUHENGERI 2022-
BP:155 Ruhengeri-Rwanda, Tel:+250788903030, +250788903032;
website:www.ines.ac.rw; Email: infoi@ines.ac.rw; 2023
The stages q0, q1, q2 are the final states. The DFA will generate the strings that do not
contain consecutive 1's like 10, 110, 101,..... etc.
Example 6:
Design a FA with ∑ = {0, 1} accepts the strings with an even number of 0's followed by
single 1.
Solution:
Example 1:
1. Q = {q0, q1, q2}
2. ∑ = {0, 1}
3. q0 = {q0}
4. F = {q2}
25
D’ENSEIGNEMENT SUPERIEUR DE RUHENGERI 2022-
BP:155 Ruhengeri-Rwanda, Tel:+250788903030, +250788903032;
website:www.ines.ac.rw; Email: infoi@ines.ac.rw; 2023
Solution:
Transition diagram:
Transition Table:
→q0 q0, q1 q1
q1 q2 q0
*q2 q2 q1, q2
In the above diagram, we can see that when the current state is q0, on input 0, the next
state will be q0 or q1, and on 1 input the next state will be q1. When the current state is
q1, on input 0 the next state will be q2 and on 1 input, the next state will be q0. When the
current state is q2, on 0 input the next state is q2, and on 1 input the next state will be
q1 or q2.
26
D’ENSEIGNEMENT SUPERIEUR DE RUHENGERI 2022-
BP:155 Ruhengeri-Rwanda, Tel:+250788903030, +250788903032;
website:www.ines.ac.rw; Email: infoi@ines.ac.rw; 2023
Example 2:
Solution:
Transition Table:
→q0 q1 ε
q1 ε q2
*q2 q2 q2
Example 3:
Solution:
27
D’ENSEIGNEMENT SUPERIEUR DE RUHENGERI 2022-
BP:155 Ruhengeri-Rwanda, Tel:+250788903030, +250788903032;
website:www.ines.ac.rw; Email: infoi@ines.ac.rw; 2023
Transition Table:
→q0 q1 q1
q1 q2 q2
*q2 ε ε
28
D’ENSEIGNEMENT SUPERIEUR DE RUHENGERI 2022-
BP:155 Ruhengeri-Rwanda, Tel:+250788903030, +250788903032;
website:www.ines.ac.rw; Email: infoi@ines.ac.rw; 2023
Regular Expression:
Finite automata are used to recognize patterns of strings, regular
expressions are used to generate patterns of strings. A regular expression
is an algebraic formula whose value is a pattern consisting of a set of
strings, called the language of the expression.
29
D’ENSEIGNEMENT SUPERIEUR DE RUHENGERI 2022-
BP:155 Ruhengeri-Rwanda, Tel:+250788903030, +250788903032;
website:www.ines.ac.rw; Email: infoi@ines.ac.rw; 2023
Examples
(0 | 1)* 111
0* 1 (0 | 1)*
0* | 0* 1 0*
30
D’ENSEIGNEMENT SUPERIEUR DE RUHENGERI 2022-
BP:155 Ruhengeri-Rwanda, Tel:+250788903030, +250788903032;
website:www.ines.ac.rw; Email: infoi@ines.ac.rw; 2023
The set of strings over {A..Z,a..z} that contain the word "main".
Or
Some RE Examples
31
D’ENSEIGNEMENT SUPERIEUR DE RUHENGERI 2022-
BP:155 Ruhengeri-Rwanda, Tel:+250788903030, +250788903032;
website:www.ines.ac.rw; Email: infoi@ines.ac.rw; 2023
(a+b)* Set of strings of a’s and b’s of any length including the null string.
So L = { ε, a, b, aa , ab , bb , ba, aaa…….}
(a+b)*abb Set of strings of a’s and b’s ending with the string abb. So L =
{abb, aabb, babb, aaabb, ababb, …………..}
Any set that represents the value of the Regular Expression is called a Regular Set.
32
D’ENSEIGNEMENT SUPERIEUR DE RUHENGERI 2022-
BP:155 Ruhengeri-Rwanda, Tel:+250788903030, +250788903032;
website:www.ines.ac.rw; Email: infoi@ines.ac.rw; 2023
33
D’ENSEIGNEMENT SUPERIEUR DE RUHENGERI 2022-
BP:155 Ruhengeri-Rwanda, Tel:+250788903030, +250788903032;
website:www.ines.ac.rw; Email: infoi@ines.ac.rw; 2023
34
D’ENSEIGNEMENT SUPERIEUR DE RUHENGERI 2022-
BP:155 Ruhengeri-Rwanda, Tel:+250788903030, +250788903032;
website:www.ines.ac.rw; Email: infoi@ines.ac.rw; 2023
Unit 4:
The formal notation for a pushdown automata (PDA) involves seven tuples. We write the
specification of a PDA ‘M’ as follows;
M = (Q, ∑, Γ, δ, q0 , z0, F)
35
D’ENSEIGNEMENT SUPERIEUR DE RUHENGERI 2022-
BP:155 Ruhengeri-Rwanda, Tel:+250788903030, +250788903032;
website:www.ines.ac.rw; Email: infoi@ines.ac.rw; 2023
δ: (Q x (Σ ∪{ε}) x X) → (p, γ)
Here the output of δ is a finite set of pair (p, γ), where p is the new state, and γ is the string
of stack symbols that replaces X at the top of the stack. For instance, if γ = ε, then the stack
is popped, if γ = X, then the stack is unchanged, and if γ = YZ, then X is replaced by Z and Y
is pushed onto the stack.
5. q0: The initial state. The PDA is in this state before making any transitions.
6. z0: The stack start symbol. Initially, the PDA’s stack consists of one instance of
this symbol, and nothing else.
7. F: The set of final states or accepting states.
A pushdown automaton is like a finite state automaton that has a pushdown stack as
additional memory. Thus, it is a finite state device equipped with a one-way input tape
and a ‘last-in first-out’ external memory that can hold unbounded amounts of
information; each individual stack element contains finite information.
an input tape,
36
D’ENSEIGNEMENT SUPERIEUR DE RUHENGERI 2022-
BP:155 Ruhengeri-Rwanda, Tel:+250788903030, +250788903032;
website:www.ines.ac.rw; Email: infoi@ines.ac.rw; 2023
A PDA may or may not read an input symbol, but it has to read the top of the stack in
every transition.
or
37
D’ENSEIGNEMENT SUPERIEUR DE RUHENGERI 2022-
BP:155 Ruhengeri-Rwanda, Tel:+250788903030, +250788903032;
website:www.ines.ac.rw; Email: infoi@ines.ac.rw; 2023
This means at state q1, if we encounter an input string ‘a’ and top symbol of the stack
is ‘b’, then we pop ‘b’, push ‘c’ on top of the stack and move to state q2.
Instantaneous Description
The instantaneous description (ID) of a PDA is represented by a triplet (q, w, s) where
q is the state
w is unconsumed input
s is the stack contents
Turnstile Notation
The "turnstile" notation is used for connecting pairs of ID's that represent one or many
moves of a PDA. The process of transition is denoted by the turnstile symbol "⊢".
This implies that while taking a transition from state p to state q, the input symbol ‘a’ is
38
D’ENSEIGNEMENT SUPERIEUR DE RUHENGERI 2022-
BP:155 Ruhengeri-Rwanda, Tel:+250788903030, +250788903032;
website:www.ines.ac.rw; Email: infoi@ines.ac.rw; 2023
consumed, and the top of the stack ‘T’ is replaced by a new string ‘α’.
39
D’ENSEIGNEMENT SUPERIEUR DE RUHENGERI 2022-
BP:155 Ruhengeri-Rwanda, Tel:+250788903030, +250788903032;
website:www.ines.ac.rw; Email: infoi@ines.ac.rw; 2023
Consumes from the input the symbol that it uses in the transition. If ε is used
for the input, then no input symbol is consumed.
Goes to a new state, which may or may not be the same as the previous state.
Replace the symbol at the top of the stack by any string. The string could be ε, which
corresponds to a pop of the stack. It could be the same symbol that appeared at the top
of the stack previously; i.e. no change to the stack is made. If could also replace the top
stack symbol does not push or pop it. Finally, the top stack symbol could be replaced by
two or more symbols, which has the effect of (possibly) changing the top stack symbol,
and then pushing one or more symbol onto the stack.
40
D’ENSEIGNEMENT SUPERIEUR DE RUHENGERI 2022-
BP:155 Ruhengeri-Rwanda, Tel:+250788903030, +250788903032;
website:www.ines.ac.rw; Email: infoi@ines.ac.rw; 2023
The Turing machine can equivalently be defined as a model that recognises valid input
strings, rather than enumerating output strings.
A Turing machine is a finite automaton that can read, write, and erase symbols
on an infinitely long tape. The tape is divided into squares, and each square
contains a symbol. The Turing machine can only read one symbol at a time, and it
uses a set of rules (the transition function) to determine its next action based on
the current state and the symbol it is reading.
41
D’ENSEIGNEMENT SUPERIEUR DE RUHENGERI 2022-
BP:155 Ruhengeri-Rwanda, Tel:+250788903030, +250788903032;
website:www.ines.ac.rw; Email: infoi@ines.ac.rw; 2023
For example:
42
D’ENSEIGNEMENT SUPERIEUR DE RUHENGERI 2022-
BP:155 Ruhengeri-Rwanda, Tel:+250788903030, +250788903032;
website:www.ines.ac.rw; Email: infoi@ines.ac.rw; 2023
43
D’ENSEIGNEMENT SUPERIEUR DE RUHENGERI 2022-
BP:155 Ruhengeri-Rwanda, Tel:+250788903030, +250788903032;
website:www.ines.ac.rw; Email: infoi@ines.ac.rw; 2023
44
D’ENSEIGNEMENT SUPERIEUR DE RUHENGERI 2022-
BP:155 Ruhengeri-Rwanda, Tel:+250788903030, +250788903032;
website:www.ines.ac.rw; Email: infoi@ines.ac.rw; 2023
45
D’ENSEIGNEMENT SUPERIEUR DE RUHENGERI 2022-
BP:155 Ruhengeri-Rwanda, Tel:+250788903030, +250788903032;
website:www.ines.ac.rw; Email: infoi@ines.ac.rw; 2023
Overall, Turing machines are a fundamental tool in computer science and are
used in a wide range of applications, including artificial intelligence,
46
D’ENSEIGNEMENT SUPERIEUR DE RUHENGERI 2022-
BP:155 Ruhengeri-Rwanda, Tel:+250788903030, +250788903032;
website:www.ines.ac.rw; Email: infoi@ines.ac.rw; 2023
47