Turing Machine in TOC
Turing Machine in TOC The Turing Machine is a mathematical computation model that accepts Recursive Enumerable Languages (ERL) in TOC (Theory of Computation). The mathematician and logician Alan Turing invented the Turing machine in 1936. Turing machine is not a physical device but a theoretical model for some computations. A Turing Machine can accept a […]
Closure Properties Of CFL
Closure Properties Of CFL Context free grammer (CFG) generates the Context free languages (CFL) which are accepted by pushdown automata (PDA) but not by finite automata (FA). Let’s discuss some of the closure properties of Context free Language (CFL). Closure Properties of CFL Consider two context-free languages L1 and If L2 where L1 = […]
Transition Function of PDA
Transition Function of PDA There are three essential cases in Pushdown Automata (PDA) to understand the functionality of the transition function. As we know, the transition function is Q × (∑ ∪ {ε}) x Γ → Q × Γ *. Where Γ represents the symbol which is at the Top of the Stack before […]
PDA in TOC
PDA in TOC A pushdown automaton (PDA) is a way to implement a context-free grammar (CFG) in a similar way we design Finite Automata (FA) for a regular grammar (RG) in TOC. A DFA has limited memory, but a PDA can hold unlimited memory. Basically, a Pushdown Automaton is “Finite Automata Machine” + “a stack”, […]
Ambiguity in Context Free Grammar
Ambiguity in Context-Free Grammar Ambiguity in a context-free grammar occurs when a single string can be generated by the grammar in more than one way, resulting in multiple parse trees, leftmost derivations, or rightmost derivations. A context-free grammar is said to be ambiguous if at least one string in its language has two or more […]
Leftmost and Rightmost Derivation
Leftmost and Rightmost Derivation In Theory of Computation (TOC), when generating strings from a Context-Free Grammar (CFG), we can apply production rules in different orders. Two primary approaches to applying these rules are: Leftmost Derivation Rightmost Derivation Both methods provide the same string as output, but follow different strategies for replacing non-terminal symbols. Understanding these […]
Derivation Tree in TOC
Derivation Tree in TOC Deriving a string in the form of a tree from a CFG grammar is called a derivation tree in TOC. A Context-Free Grammar (CFG) generates strings by applying production rules. These strings can be represented in the form of a tree, which is called a derivation Tree. Note: Derivation tree is […]
Pumping Lemma for Regular Languages
Pumping Lemma for Regular Languages Pumping Lemma is applied to infinite languages to show that languages are not regular. It should never be used to prove that a language is regular. That’s why the pumping lemma is also called a negative test. A simple description of the pumping lemma is given in the following diagram. […]
Closure Properties of Regular Languages
Closure Properties of Regular Languages Closure properties in regular languages are nothing but an operation that is performed on a language, and then the new resulting language will be of the same “type” as the original language. Thus, If closure operations are performed on some regular languages, then the result will also be a regular […]
Regular Expression In TOC
Regular Expression In TOC Regular expressions in TOC is a powerful mathematical tool used to define regular languages, which are recognized by Finite Automata. They are similar to arithmetic, logic, and Boolean expressions in representation but different in their operation and purpose. Regular expressions are used for representing certain sets of strings in an algebraic […]
Difference Between Mealy and Moore Machine
Difference Between Mealy and Moore Machine Both Mealy and Moore Machines accept the regular languages and provide the output. Before proceeding to the key difference between Mealy and Moore machines, let’s look at the basic definition of the Mealy and Moore machines which helps us to understand all the key differences in the Mealy and […]
Mealy to Moore Conversion
Mealy to Moore Conversion Mealy to Moore Conversion is slightly more complex than the conversion of Moore to Mealy machine. In a Mealy machine, the output depends on both the current state and the input, whereas in a Moore machine, the output is determined only by the current state. The following diagram represents the transition […]
Moore to Mealy Conversion
Moore to Mealy Conversion Each Moore Machine is easily converted into its corresponding Mealy Machine. The equivalence of the Moore and Mealy machines means that both machines produce the same output for the same input. As we know, in the Moore machine, the output is attached to every state symbol, and in the Mealy machine, […]
Mealy Machine
Mealy Machine Automata Mealy Machine is similar to the Automata Moore Machine except for the following, In the Automata Mealy Machine, the output symbol is represented along with the input symbol for each state. Both input and output symbols are separated by /. In Mealy Machine, the length of the input is always equal to […]
Moore Machine Examples
Moore Machine Examples A Moore Machine is a type of finite state machine (FSM) where the output depends only on the current state, not on the input. This means that each state has a fixed output, and the output changes only when the machine transitions to a different state. Structure of a Moore Machine A […]
Moore Machine
Moore Machine As we already covered the topics of DFA and NFA. DFA and NFA are the automata machines that take the input and do not give the output. Both DFA and NFA just check the acceptance of the given string. However, the Automata Moore Machine and Mealy also take the input and give the […]
(DFA and NFA) VS (Moore and Mealy) Machines
(DFA and NFA) VS (Moore and Mealy) Machines Like DFA and NFA Automata Machine, the Moore and Mealy are also Automata machines. Moore and Mealy’s machine also accepts regular languages like DFA and NFA. (DFA and NFA) VS (Moore and Mealy) Sr. DFA and NFA Machines Moore and Mealy Machine 1 In NFA, there is […]
Epsilon NFA (∈-NFA)
Epsilon NFA (∈-NFA) Epsilon NFA (∈-NFA) is similar to the NFA but with a little difference in that, it has an epsilon (∈) transition that NFA doesn’t have. A Transition that does not consume any input symbol is called an ε-transitions. Epsilon NFA (∈-NFA) is also called a null NFA or an NFA lambda. ∈-NFA state diagrams […]
Dead State in DFA
Dead State in DFA In automata theory, a Dead State (also known as a trap state or rejecting state) is a key concept in the design and analysis of deterministic finite automata. Whether you’re a computer science student or preparing for competitive exams like GATE or UGC NET, understanding dead states helps you optimize and […]
NFA Examples

NFA Examples This lecture will cover various scenarios of different categories to explain all examples of NFA. Below is a list of different categories of NFA examples. Followed by Drawing NFA from a given language Must contain and many more We covered NFA in the last lecture. Let’s examine some examples of non-deterministic finite automata […]