Theory of Computation

The Theory of Computation is a field in computer science that explores the study of algorithms, computational machines, and the inherent limits and capabilities of computation. It is concerned with understanding the fundamental principles that govern computation and the nature of problems that can be solved algorithmically.

Theory of Computation


Finite Automata

As an automata proposition is a study of an abstract machine as well as the calculation problems that can be answered using them. So some fine overtures and elements are used to represent a machine geste. Then we study the leading memos and related language that are used in the calculation process in the study of the proposition of automata.


An alphabet is a finite non-empty set of symbols, which used to represent the input of a machine. rudiments are generally allowed as represented by letters, characters, integers, signs, punctuation, etc. Conventionally we use the symbol ∑ for an ABC. Common rudiments include in the Theory of Computation;

∑ = {0, 1}: The binary alphabets.
∑ = {a, b, c, ……, z}: The set of all lower-case letters.
∑ = {The sets of all ASCII characters or the set of all printable ASCII characters}.


A string is a finite ordered sequence of symbols chosen from some set of ABC or ∑. For illustration, ‘baba’ is a valid string from the alphabet ∑ = { a, b}, also ‘ 001111000101 ’ is a valid string from the alphabet ∑ = { 0, 1}.


In the Theory of Computation proposition of calculation, several formal languages are studied to understand the abecedarian principles of calculation and the limits of what can be reckoned. Then are some important languages in the proposition of calculation

  1. Regular Languages.
  2. Context-Free Languages.
  3. Context-Sensitive Languages.
  4. Recursive Languages.
  5. Recursively Enumerable Languages.
  6. Unrecognizable Languages.

Acceptance of string

The concept of accepting strings in the Theory of Computation refers to the process by which a computation device, such as a Turing machine or a finite automaton, determines whether a given string belongs to a specific language. Acceptance is a fundamental concept that helps define and understand the properties and capabilities of different models of computation.

Deterministic Finite Automata (DFA)

A Deterministic Finite Automaton( DFA) Theory of Computation is defined as a 5- tuple( Q, Σ, δ, s, F) conforming of

  • A finite set Q( the set of countries)
  • A finite set of symbols Σ( the input ABC)
  • A transition function δ Q × Σ → Q mapping the current state q ∈ Q and input symbol a ∈ Σ to a new state δ( q, a) ∈ Q
  • An original state s ∈ Q( the launch state)

A set of accepting countries F( the final countries) A DFA is a fine model of a simple computational device that reads a string of symbols over the input ABC Σ, and either accepts or rejects the input string. We’d like to turn this fine definition into a working program so that we can run DFAs on our computers.

Non Deterministic Finite Automata (NFA)

NFA stands fornon-deterministic finite automata. It’s easy to construct an NFA than DFA for a given regular language.

The finite automata are called NFA when there live numerous paths for specific input from the current state to the coming state.

Every NFA isn’t DFA, but each NFA can be restated into DFA.

NFA is defined in the same way as DFA but with the following two exceptions, it contains multiple coming countries, and it contains ε transition.

Transition Diagrams

A transition diagram in the Theory of Computation, also known as a state diagram or a finite automaton, is a graphical representation of a finite state machine (FSM). An FSM is a mathematical model that consists of a set of states, a set of input symbols, a transition function that determines the next state based on the current state and input symbol, and a set of accepting states.

Language Recognizers

A language recognizer, also known as an acceptor or a language acceptor, is a computational device that takes a string of symbols as input and determines whether the string belongs to a particular formal language. The language recognizer accepts the string if it is a member of the language and rejects it otherwise in the Theory of Computation.


Conversions in the theory of computation involve transforming one computational model into another while preserving the computational power or functionality. Several well-known conversions are often studied:

  1. Turing Machine (TM) to Finite Automaton (FA) Conversion.
  2. Regular Expression (RE) to Finite Automaton (FA) Conversion.
  3. Context-Free Grammar (CFG) to Pushdown Automaton (PDA) Conversion.


Equivalences in the theory of computation refer to relationships between different computational models that have the same computational power. If two models are equivalent, it means that they can solve the same class of problems or recognize the same class of languages. Some common equivalences are:

  1. Regular Languages and Finite Automata
  2. Context-Free Languages and Pushdown Automata.
  3. Turing Machines and Other Computational Models.

Equivalence between NFA with

NFA- DFA parity In principle, every NFA can be turned into an original DFA. The introductory idea is that when a transition results in a set of countries, we treat the set as one state in the original DFA.

NFA to DFA conversion

In this section, we will bandy the system of converting NFA to its original DFA. In NFA, A specific input is given to the current state, the machine goes to multiple countries. It can have zero, one, or further than one move on a given input symbol. On the other hand, in DFA, A specific input is given to the current state, and the machine goes to only one state.

Let, M = (Q, ∑, δ, q0, F) is an NFA that accepts the language L(M). There should be equivalent DFA denoted by M’ = (Q’, ∑’, q0′, δ’, F’) such that L(M) = L(M’).

Minimization of FSM

The minimization of FSM means reducing the number of countries from a given FA. therefore we get the FSM with spare countries after minimizing the FSM. While minimizing FSM we first find out which two countries are original.

Equivalence between two FSMs

The two finite automata( FA) are said to be original if both the automata accept the same set of strings over an input set Σ.

When two FA’s are original also, there’s some string x over Σ. On acceptance of that string, if one FA reaches the final state, the other FA also reaches the final state.

Finite Automata with output-Moore

Finite automata may have to do each transition. Two types of finite state machines induce affair − lurid Machine Moore machine Mealy Machine A Mealy Machine is an FSM whose affair depends on the present state as well as the present input. It can be described by a 6 tuple( Q, ∑, O, δ, X, q 0)

Mealy machines

In the proposition of calculation, a lurid machine is a finite-state machine whose affair values are determined both by its current state and the current inputs. This is in discrepancy to a Moore machine, whose affair values are determined solely by its current state. A lurid machine is a deterministic finite-state transducer for each state and input, at most one transition is possible.

Regular Expressions

Regular Expressions are used to denote regular languages. An expression is regular if :

  • ɸ is a regular expression for regular language ɸ.
  • ɛ is a regular expression for regular language{ ɛ}.
  • still, a is regular expression with language{ a}, If a ∈ Σ( Σ represents the input ABC).
  • if a & b is also a regular expression with language{ a, b},
  • If a and b are regular expressions. still, ab( consecution of a and b) is also regular.
  • If a and b are regular expressions. still, a *( 0 or further times a) is also regular, If a is regular expression.

Regular Languages

Regular languages in the Theory of Computationare a class of languages that can be described by regular expressions or honoured by finite automata. They’re the simplest type of formal language and have several original representations, including regular expressions, finite automata, regular principles, and regular language equations.

Finite Automata

A finite automaton is a mathematical model used to recognize or accept strings from a given language. It consists of a finite set of states, an input alphabet, a transition function, a start state, and one or more final states.

Construction of an FA from an RE

To convert the shaft to FA, we’re going to use a system called the subset system. This system is used to gain FA from the given regular expression. This system is given below

  • Step 1 Design a transition illustration for a given regular expression, using NFA with ε moves.
  • Step 2 Convert this NFA with ε to NFA without ε.
  • Step 3 Convert the attained NFA to the original DFA.

Pumping lemma for regular languages

Let L be a regular language. also, there exists a constant ‘ c ’ similar to that for every string w in L −

w| ≥ c

We can break w into three strings, w = xyz, similar that −

y|> 0
xy| ≤ c
For all k ≥ 0, the string xykz is also in.

Closure properties of regular languages

Closure parcels on regular languages in the Theory of Computation are defined as certain operations on regular language which are guaranteed to produce regular language. Closure refers to some operation on a language, performed in a new language that’s of the same “ type ” as first operated on i.e., regular. Regular languages are closed under the following operations.

Equivalence and minimization of Automata

In nearly all the operations of automata proposition, a pivotal problem is the one of determining the” minimum” automaton which is” original” to a given bone. The term minimum can be simply- and traditionally- taken as being a synonym of” smallest- state”( indeed an extension of this conception to the combined state-input reduction has been proposed( 6)). The term fellow, rather, is to be precisely defined.

Context Free Grammars

An environment-free alphabet( CFG) conforming to a finite set of alphabet rules is a quadruple( N, T, P, S) where.

  • N is a set of-terminal symbols.
  • T is a set of outstations where N ∩ T = NULL.
  • P is a set of rules, P N →( N ∪ T) *, i.e., the left-hand side of the product rule P does have any right environment or left environment.
  • S is the launch symbol.


context-free grammars (CFGs) are a formalism used to describe the syntax or structure of languages. CFGs are commonly employed in the study of formal languages, parsing, and compiler design.

Leftmost derivative

In Theory of Computation a leftmost derivation, the leftmost non-terminal symbol in the current string is always selected for expansion. This means that at each step, the leftmost non-terminal is replaced by the right-hand side of a production rule that has that non-terminal on the left. This process continues until all non-terminals are replaced by terminal symbols, resulting in the derived string.

Rightmost derivations

In a leftmost derivation, the leftmost non-terminal symbol in the current string is always selected for expansion. This means that at each step, the leftmost non-terminal is replaced by the right-hand side of a production rule that has that non-terminal on the left. This process continues until all non-terminals are replaced by terminal symbols, resulting in the derived string.

Ambiguity in grammars

A CFG is said to be nebulous if there exists further than one derivate tree for the given input string i.e., further than one LeftMost Derivation Tree( LMDT) or RightMost Derivation Tree( RMDT).


Language nebulosity can be a fun or serious case in affecting the followership’s understanding. So, let’s look at the two exemplifications below Sam went for a walk with her friend in the red shirt) The result of the exploration ensures that youthful women and men are healthy) These two rulings could beget intriguing or serious confusion as they lead us to two different meanings.

Simplification of Context-Free Grammar

context-free alphabet can effectively represent a variety of languages. Because not all alphabet is streamlined, some principles may contain redundant symbols(non-terminal). Adding redundant meaningless symbols lengthens the alphabet. The alphabet that has been reduced by the junking of symbols is said to be simpler. Below are some reduced characteristics of the alphabet.

Chomsky normal form (CNF)

CNF stands for Chomsky’s normal form. A CFG(environment-free alphabet) is in CNF( Chomsky normal form) if all product rules satisfy one of the ensuing conditions

  • launch symbol generating ε. For illustration, A → ε.
  • A non-terminal generating two-terminals. For illustration, S → AB.
  • A non-terminal generating a terminal. For illustration, S →a.

Greibach normal form (GNF)

GNF stands for Greibach normal form. A CFG(environment-free alphabet) is in GNF( Greibach normal form) if all the product rules satisfy one of the ensuing conditions

  • A launch symbol generating ε. For illustration, S → ε.
  • A non-terminal generating a terminal. For illustration, A →a.
  • A non-terminal generates a terminal which is followed by any number of terminals. For illustration, S → aASB.

Pumping Lemma for Context-Free Languages

the pumping lemma for environment-free languages, also known as the Bar- Hillel lemma,( 1) is a lemma that gives a property participated by all environment-free languages and generalizes the pumping lemma for regular languages.

Push Down Automata-Definition

Pushdown automata are used in propositions about what can be reckoned with by machines. They’re more able than finite-state machines but lower able than Turing machines( see below). Deterministic pushdown automata can fete all deterministic environment-free languages while nondeterministic bones can fete all environment-free languages, with the former frequently used in parser design.

Languages of PDA

The languages of PDAs can be described using formal grammar, specifically context-free grammar. Context-free grammar consists of a set of production rules that define how symbols can be rewritten. The grammar typically includes a set of non-terminal symbols, terminal symbols, a start symbol, and production rules.

Equivalence of CFGs

Given a CFG, we can construct an equivalent PDA that accepts the same language. The general idea is to design a PDA that simulates the derivation process of the CFG.

The PDA’s stack is used to keep track of the variables and terminals used during the derivation. The transition function of the PDA is designed to mimic the derivation steps of the CFG. The start variable of the CFG corresponds to the initial state of the PDA, and the acceptance condition of the PDA is based on the empty stack.

Deterministic PDA

The Deterministic Pushdown Automata is a variation of pushdown automata that accepts deterministic environment-free languages.

A language L( A) is accepted by deterministic pushdown automata if and only if there’s a single calculation from the original configuration until an accepting bone for all strings belonging to L( A). It isn’t as important as-deterministic finite automata. That is why it’s lower in use and used only where determinism is much easier to apply.

Turing Theory

The Turing theory, also known as the Turing machine theory, is a fundamental concept in the theory of computation. It was introduced by the British mathematician and computer scientist Alan Turing in 1936 as a theoretical model for studying the limits and capabilities of computation.

Turing Machines

Turing Machines (TMs) are fundamental mathematical models used to study the limits and capabilities of computation. They were introduced by the British mathematician and computer scientist Alan Turing in the 1930s as a way to formalize the concept of an algorithm.

Design of TM

The design of a Turing machine involves specifying all of these components. Typically, a Turing machine is described using a formal notation that represents its states, symbols, transition rules, and initial/final states. This notation can vary slightly depending on the specific formalism used.

Variants of TMs

  1. TMs with stay-put
  2. Multitape TMs
  3. Nondeterministic TMs (NTMs)
  4. TM with output (enumerators)

Multitape TMs

Multi-tape Turing Machines have multiple tapes where each tape recording is entered with a separate head. Each head can move independently of the other heads. firstly the input is on tape recording 1 and others are blank. At first, the first tape recording is enthralled by the input and the other tapes are kept blank. Next, the machine reads consecutive symbols under its heads and the TM prints a symbol on each tape recording and moves its heads.

Non Deterministic TM

In a non-deterministic Turing Machine, for every state and symbol, there is a group of conduct the TM can have. So, then the transitions aren’t deterministic. The calculation of an anon-deterministic Turing Machine is a tree of configurations that can be reached from the launch configuration.

Universal TM

A universal Turing machine( UTM) is a Turing machine that can pretend an arbitrary Turing machine on arbitrary input. The universal machine principally achieves this by reading both the description of the machine to be dissembled as well as the input to that machine from its tape recording.

Church-Turing Thesis

The Church-Turing thesis is a hypothesis stating that any function that can be effectively computed by an algorithm can be computed by a Turing machine. In simpler terms, it suggests that Turing machines provide an accurate and comprehensive model of computation. The thesis was proposed by Alonzo Church and Alan Turing independently in the 1930s.

Recursively Enumerable Languages

In the proposition of calculation, languages are sets of strings over a given ABC. A language is recursively numberable( also known as recursively numberable or semidecidable) if there exists a Turing machine that, when given any input string belonging to the language, ultimately gridlocks and accepts it as valid. still, if the input string doesn’t belong to the language, the Turing machine may either halt and reject it or run indefinitely without halting.

Context -Sensitive Languages

In formal language proposition, an environment-sensitive language is a language that can be defined by an environment-sensitive alphabet( and equally by a noncontracting alphabet). environment-sensitive is one of the four types of principles in the Chomsky scale.

The Chomsky Hierarchy

In formal language proposition, computer wisdom, and linguistics, the Chomsky scale is a constraint scale of classes of formal principles. This scale of principles was described by Noam Chomsky in 1956.

Halting Problem Unsolvable

The halting problem is a classic unsolvable problem in the theory of computation. It was formulated by Alan Turing in 1936 as part of his work on computability theory. The halting problem asks whether there exists a general algorithm that can determine, for any arbitrary program and input, whether that program will eventually halt (terminate) or run forever.

Post’s Correspondence Problem (PCP)

This is one of the three introductory undecidable problems, the other two being the halting problem and Hilbert’s tenth problem. To establish the algorithmic unsolvability of a specific problem, a reduction to the Post correspondence problem,( a3), is in numerous cases the most natural procedure.

Attestations of undecidability are moreover direct or circular. circular attestations bear some points of reference problems formerly known to be undecidable. Regarding language proposition, the most useful among similar points of reference is the Post correspondence problem. For case, when dealing with environment-free languages, it’s rather delicate to use the halting problem as a point of reference, whereas the Post correspondence problem is veritably suitable.