Skip to content
geeksforgeeks
  • Tutorials
    • Python
    • Java
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
    • Practice Coding Problems
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • DSA
  • Practice Problems
  • C
  • C++
  • Java
  • Python
  • JavaScript
  • Data Science
  • Machine Learning
  • Courses
  • Linux
  • DevOps
  • SQL
  • Web Development
  • System Design
  • Aptitude
  • GfG Premium
Open In App

Theory of Computation - GATE CSE Previous Year Questions

Last Updated : 15 Apr, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

The Theory of Computation(TOC) subject has high importance in GATE CSE exam because:

  • large number of questions nearly 6-8% of the total paper
  • significant weightage (6-8 marks) across multiple years

Below is the table for previous four year mark distribution of TOC in GATE CS:

Year

Approx. Marks from TOC

Number of Questions

Difficulty Level

GATE 2024

7–8 marks

3-4

Moderate-Hard

GATE 2023

6.5 marks

3

Moderate

GATE 2022

7 marks

3-4

Hard

GATE 2021

8 marks

4

Moderate

Topic-Wise Quizzes to Practice Previous Year's Questions

Although Theory of Computation is considered to be one of the challenging subjects of GATE CSE exam because of its logical depth, the questions often are structured and follows patterns. With regular practice of PYQs and high-weightage topics such as Finite Automata, Regular Expressions, Turing Machines etc., you can increase your accuracy and score. The links to quiz of these topics are given below:

  • Finite Automata and Regular Language
  • Push Down Automata and Context-Free language
  • Recursively Enumerable Language and Turing Machine
  • Undecidability

We have selected questions of Theory of Computation from GATE previous year questions and compiled for you. Below mentioned are the links to such sets of questions. On each page, you will get the questions asked in TOC along with their respective years.

GATE TOC Previous Year Questions
Automata Theory | Set 1, 2
Automata Theory | Set 3
Automata Theory | Set 4
Automata Theory | Set 5
Automata Theory | Set 6

GATE CSE Previous Year Question Papers

These previous year’s questions help you understand the question patterns followed by GATE that directly help a candidate in scoring good marks in GATE. Given below is the link to year-wise GATE Previous Question Papers:

GATE CSE Previous Year Question Papers

These GATE CSE question papers span over 25+ years, along with their official answer keys. We’ve also provided Quiz tests to help you practice key topics, improve speed, track your progress, and build confidence for the GATE exam 2026.


K

kartik
Improve
Article Tags :
  • GATE
  • AT

Similar Reads

    Introduction to Theory of Computation
    Automata theory, also known as the Theory of Computation, is a field within computer science and mathematics that focuses on studying abstract machines to understand the capabilities and limitations of computation by analyzing mathematical models of how machines can perform calculations.Why we study
    7 min read

    TOC Basics

    Introduction to Theory of Computation
    Automata theory, also known as the Theory of Computation, is a field within computer science and mathematics that focuses on studying abstract machines to understand the capabilities and limitations of computation by analyzing mathematical models of how machines can perform calculations.Why we study
    7 min read
    Chomsky Hierarchy in Theory of Computation
    According to Chomsky hierarchy, grammar is divided into 4 types as follows: Type 0 is known as unrestricted grammar.Type 1 is known as context-sensitive grammar.Type 2 is known as a context-free grammar.Type 3 Regular Grammar.Type 0: Unrestricted Grammar: Type-0 grammars include all formal grammar.
    2 min read
    Applications of various Automata
    Automata are used to design and analyze the behavior of computational systems. Each type of automaton has specific capabilities and limitations, making it suitable for various practical applications. Automata theory is not only fundamental to the design of programming languages and compilers but als
    4 min read

    Regular Expressions & Finite Automata

    Introduction of Finite Automata
    Finite automata are abstract machines used to recognize patterns in input sequences, forming the basis for understanding regular languages in computer science. They consist of states, transitions, and input symbols, processing each symbol step-by-step. If the machine ends in an accepting state after
    4 min read
    Regular Expressions, Regular Grammar and Regular Languages
    To work with formal languages and string patterns, it is essential to understand regular expressions, regular grammar, and regular languages. These concepts form the foundation of automata theory, compiler design, and text processing.Regular ExpressionsRegular expressions are symbolic notations used
    7 min read
    Arden's Theorem in Theory of Computation
    A Regular Expression (RE) is a way to describe patterns of strings using symbols and operators like union, concatenation, and star. A Deterministic Finite Automaton (DFA) is a machine that reads input strings and decides if they match the pattern by moving through a set of defined states without any
    6 min read
    Conversion from NFA to DFA
    An NFA can have zero, one or more than one move from a given state on a given input symbol. An NFA can also have NULL moves (moves without input symbol). On the other hand, DFA has one and only one move from a given state on a given input symbol. Steps for converting NFA to DFA:Step 1: Convert the g
    5 min read
    Minimization of DFA
    DFA minimization stands for converting a given DFA to its equivalent DFA with minimum number of states. DFA minimization is also called as Optimization of DFA and uses partitioning algorithm.Minimization of DFA Suppose there is a DFA D < Q, Δ, q0, Δ, F > which recognizes a language L. Then the
    7 min read
    Reversing Deterministic Finite Automata
    Prerequisite – Designing finite automata Reversal: We define the reversed language L^R \text{ of } L  to be the language L^R = \{ w^R \mid w \in L \} , where w^R := a_n a_{n-1} \dots a_1 a_0 \text{ for } w = a_0 a_1 \dots a_{n-1} a_n Steps to Reversal: Draw the states as it is.Add a new single accep
    4 min read
    Mealy and Moore Machines in TOC
    Moore and Mealy Machines are Transducers that help in producing outputs based on the input of the current state or previous state. In this article we are going to discuss Moore Machines and Mealy Machines, the difference between these two machinesas well as Conversion from Moore to Mealy and Convers
    3 min read

    CFG & PDA

    Simplifying Context Free Grammars
    A Context-Free Grammar (CFG) is a formal grammar that consists of a set of production rules used to generate strings in a language. However, many grammars contain redundant rules, unreachable symbols, or unnecessary complexities. Simplifying a CFG helps in reducing its size while preserving the gene
    6 min read
    Converting Context Free Grammar to Chomsky Normal Form
    Chomsky Normal Form (CNF) is a way to simplify context-free grammars (CFGs) so that all production rules follow specific patterns. In CNF, each rule either produces two non-terminal symbols, or a single terminal symbol, or, in some cases, the empty string. Converting a CFG to CNF is an important ste
    5 min read
    Closure Properties of Context Free Languages
    Context-Free Languages (CFLs) are an essential class of languages in the field of automata theory and formal languages. They are generated by context-free grammars (CFGs) and are recognized by pushdown automata (PDAs). Understanding the closure properties of CFLs helps in determining which operation
    11 min read
    Pumping Lemma in Theory of Computation
    There are two Pumping Lemmas, which are defined for 1. Regular Languages, and 2. Context - Free Languages Pumping Lemma for Regular Languages For any regular language L, there exists an integer n, such that for all x ? L with |x| ? n, there exists u, v, w ? ?*, such that x = uvw, and (1) |uv| ? n (2
    4 min read
    Ambiguity in Context free Grammar and Languages
    Context-Free Grammars (CFGs) are essential in formal language theory and play a crucial role in programming language design, compiler construction, and automata theory. One key challenge in CFGs is ambiguity, which can lead to multiple derivations for the same string.Understanding Derivation in Cont
    3 min read
    Context-sensitive Grammar (CSG) and Language (CSL)
    Context-Sensitive Grammar - A Context-sensitive grammar is an Unrestricted grammar in which all the productions are of form - Where α and β are strings of non-terminals and terminals. Context-sensitive grammars are more powerful than context-free grammars because there are some languages that can be
    2 min read
    Introduction of Pushdown Automata
    We have already discussed finite automata. But finite automata can be used to accept only regular languages. Pushdown Automata is a finite automata with extra memory called stack which helps Pushdown automata to recognize Context Free Languages. This article describes pushdown automata in detail.Pus
    5 min read

    Turing Machine & Decidability

    Turing Machine in TOC
    Turing Machines (TM) play a crucial role in the Theory of Computation (TOC). They are abstract computational devices used to explore the limits of what can be computed. Turing Machines help prove that certain languages and problems have no algorithmic solution. Their simplicity makes them an effecti
    7 min read
    Recursive and Recursive Enumerable Languages in TOC
    Recursive and Recursive Enumerable Languages in TOC are two important classes of languages which are linked with Turing Machine. A recursive language is one where a Turing Machine always halts and decides whether a string belongs to the language or not. A recursively enumerable language is one where
    6 min read
    Halting Problem in Theory of Computation
    The halting problem is a fundamental issue in theory and computation. The problem is to determine whether a computer program will halt or run forever.Definition: The Halting Problem asks whether a given program or algorithm will eventually halt (terminate) or continue running indefinitely for a part
    4 min read
    Turing Machine as Comparator
    Prerequisite – Turing MachineProblem : Draw a turing machine which compare two numbers. Using unary format to represent the number. For example, 4 is represented by 4 = 1 1 1 1 or 0 0 0 0 Lets use one's for representation. Example: Approach: Comparing two numbers by comparing number of '1's.Comparin
    3 min read
    Decidable and Undecidable Problems in Theory of Computation
    In the Theory of Computation, problems can be classified into decidable and undecidable categories based on whether they can be solved using an algorithm. A decidable problem is one for which a solution can be found in a finite amount of time, meaning there exists an algorithm that can always provid
    6 min read
    Undecidability and Reducibility in TOC
    Decidable Problems A problem is decidable if we can construct a Turing machine which will halt in finite amount of time for every input and give answer as ‘yes’ or ‘no’. A decidable problem has an algorithm to determine the answer for a given input. Examples Equivalence of two regular languages: Giv
    5 min read
    Computable and non-computable problems in TOC
    In the Theory of Computation, problems are classified as computable or non-computable based on whether they can be solved by an algorithm. Computable problems have a clear, step-by-step procedure that always lead to a correct solution while non-computable problems cannot be solved by any algorithm,
    6 min read

    Problems on Finite Automata

    DFA for Strings not ending with "THE"
    Problem - Accept Strings that not ending with substring "THE". Check if a given string is ending with "the" or not. The different forms of "the" which are avoided in the end of the string are: "THE", "ThE", "THe", "tHE", "thE", "The", "tHe" and "the" All those strings that are ending with any of the
    12 min read
    DFA of a string with at least two 0’s and at least two 1’s
    Problem - Draw deterministic finite automata (DFA) of a string with at least two 0’s and at least two 1’s. The first thing that come to mind after reading this question us that we count the number of 1's and 0's. Thereafter if they both are at least 2 the string is accepted else not accepted. But we
    3 min read
    DFA for accepting the language L = { anbm | n+m =even }
    ProblemDesign a deterministic finite automata(DFA) for accepting the language L = {an bm | n+m = even}Examples:Input: a a b b , n = 2, m = 2 2 + 2 = 4 (even)Output: ACCEPTEDInput: a a a b b b b ,n = 3, m = 43 + 4 = 7 (odd) Output: NOT ACCEPTEDInput: a a a b b b , n = 3, m = 33 + 3 = 6 (even)Output:
    14 min read
    DFA machines accepting odd number of 0’s or/and even number of 1’s
    Prerequisite - Designing finite automata Problem - Construct a DFA machine over input alphabet \sum_= {0, 1}, that accepts: Odd number of 0’s or even number of 1’s Odd number of 0’s and even number of 1’s Either odd number of 0’s or even number of 1’s but not the both together Solution - Let first d
    3 min read
    DFA of a string in which 2nd symbol from RHS is 'a'
    Draw deterministic finite automata (DFA) of the language containing the set of all strings over {a, b} in which 2nd symbol from RHS is 'a'. The strings in which 2nd last symbol is "a" are: aa, ab, aab, aaa, aabbaa, bbbab etc Input/Output INPUT : baba OUTPUT: NOT ACCEPTED INPUT: aaab OUTPUT: ACCEPTED
    10 min read

    Problems on PDA

    Construct Pushdown Automata for all length palindrome
    A Pushdown Automata (PDA) is like an epsilon Non deterministic Finite Automata (NFA) with infinite stack. PDA is a way to implement context free languages. Hence, it is important to learn, how to draw PDA. Here, take the example of odd length palindrome:Que-1: Construct a PDA for language L = {wcw'
    6 min read
    Construct Pushdown automata for L = {0n1m2m3n | m,n ≥ 0}
    Prerequisite - Pushdown automata, Pushdown automata acceptance by final state Pushdown automata (PDA) plays a significant role in compiler design. Therefore there is a need to have a good hands on PDA. Our aim is to construct a PDA for L = {0n1m2m3n | m,n ≥ 0} Examples - Input : 00011112222333 Outpu
    3 min read
    Construct Pushdown automata for L = {a2mc4ndnbm | m,n ≥ 0}
    Pushdown Automata plays a very important role in task of compiler designing. That is why there is a need to have a good practice on PDA. Our objective is to construct a PDA for L = {a2mc4ndn bm | m,n ≥ 0} Example:Input: aaccccdbOutput: AcceptedInput: aaaaccccccccddbbOutput: AcceptedInput: acccddbOut
    3 min read
    NPDA for accepting the language L = {anbn | n>=1}
    Prerequisite: Basic knowledge of pushdown automata.Problem :Design a non deterministic PDA for accepting the language L = {an bn | n>=1}, i.e.,L = {ab, aabb, aaabbb, aaaabbbb, ......} In each of the string, the number of a's are followed by equal number of b's. ExplanationHere, we need to maintai
    2 min read
    NPDA for accepting the language L = {ambncm+n | m,n ≥ 1}
    The problem below require basic knowledge of Pushdown Automata.Problem Design a non deterministic PDA for accepting the language L = {am bn cm+n | m,n ≥ 1} for eg. ,L = {abcc, aabccc, abbbcccc, aaabbccccc, ......} In each of the string, the total sum of the number of 'a’ and 'b' is equal to the numb
    2 min read
    NPDA for accepting the language L = {aibjckdl | i==k or j==l,i>=1,j>=1}
    Prerequisite - Pushdown automata, Pushdown automata acceptance by final state Problem - Design a non deterministic PDA for accepting the language L = {a^i b^j c^k d^l : i==k or j==l, i>=1, j>=1}, i.e., L = {abcd, aabccd, aaabcccd, abbcdd, aabbccdd, aabbbccddd, ......} In each string, the numbe
    3 min read
    NPDA for accepting the language L = {anb2n| n>=1} U {anbn| n>=1}
    To understand this question, you should first be familiar with pushdown automata and their final state acceptance mechanism.ProblemDesign a non deterministic PDA for accepting the language L = {an b2n : n>=1} U {an bn : n>=1}, i.e.,L = {abb, aabbbb, aaabbbbbb, aaaabbbbbbbb, ......} U {ab, aabb
    2 min read

    Problems on Turing Machines

    Turing Machine for addition
    Prerequisite - Turing Machine A number is represented in binary format in different finite automata. For example, 5 is represented as 101. However, in the case of addition using a Turing machine, unary format is followed. In unary format, a number is represented by either all ones or all zeroes. For
    3 min read
    Turing machine for multiplication
    Prerequisite - Turing Machine Problem: Draw a turing machine which multiply two numbers. Example: Steps: Step-1. First ignore 0's, C and go to right & then if B found convert it into C and go to left. Step-2. Then ignore 0's and go left & then convert C into C and go right. Step-3. Then conv
    2 min read
    Construct a Turing Machine for language L = {wwr | w ∈ {0, 1}}
    The language L = {wwres | w ∈ {0, 1}} represents a kind of language where you use only 2 character, i.e., 0 and 1. The first part of language can be any string of 0 and 1. The second part is the reverse of the first part. Combining both these parts a string will be formed. Any such string that falls
    5 min read
    Construct a Turing Machine for language L = {ww | w ∈ {0,1}}
    Prerequisite - Turing Machine The language L = {ww | w ∈ {0, 1}} tells that every string of 0's and 1's which is followed by itself falls under this language. The logic for solving this problem can be divided into 2 parts: Finding the mid point of the string After we have found the mid point we matc
    7 min read
    Construct Turing machine for L = {an bm a(n+m) | n,m≥1}
    Problem : L = { anbma(n +m) | n , m ≥ 1} represents a kind of language where we use only 2 character, i.e., a and b. The first part of language can be any number of "a" (at least 1). The second part be any number of "b" (at least 1). The third part of language is a number of "a" whose count is sum o
    3 min read
    Construct a Turing machine for L = {aibjck | i*j = k; i, j, k ≥ 1}
    Prerequisite – Turing Machine In a given language, L = {aibjck | i*j = k; i, j, k ≥ 1}, where every string of 'a', 'b' and 'c' has a certain number of a's, then a certain number of b's and then a certain number of c's. The condition is that each of these 3 symbols should occur at least once. 'a' and
    2 min read
    Turing machine for 1's and 2’s complement
    Problem-1:Draw a Turing machine to find 1's complement of a binary number. 1’s complement of a binary number is another binary number obtained by toggling all bits in it, i.e., transforming the 0 bit to 1 and the 1 bit to 0. Example:1's ComplementApproach:Scanning input string from left to rightConv
    3 min read

    Practice

    Last Minute Notes - Theory of Computation
    The Theory of Computation (TOC) is a critical subject in the GATE Computer Science syllabus. It involves concepts like Finite Automata, Regular Expressions, Context-Free Grammars, and Turing Machines, which form the foundation of understanding computational problems and algorithms.This article provi
    13 min read
    Topic wise multiple choice questions in computer science
    We have covered multiple choice questions on several computer science topics like C programming, algorithms, data structures, computer networks, aptitude mock tests, etc. Practice for computer science topics by solving these practice mcq questions.This page specifically covers a lot of questions and
    2 min read
    Theory of Computation - GATE CSE Previous Year Questions
    The Theory of Computation(TOC) subject has high importance in GATE CSE exam because:large number of questions nearly 6-8% of the total papersignificant weightage (6-8 marks) across multiple years Below is the table for previous four year mark distribution of TOC in GATE CS:YearApprox. Marks from TOC
    2 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences