Automata theory studies abstract computing devices and the types of tasks they are capable of. Alan Turing pioneered this field in the 1930s by studying Turing machines. The theory examines questions like which tasks can and cannot be performed by different models of machines. It also considers the distinction between what is computable versus the complexity of computation. Common concepts include finite automata, formal languages, and the Chomsky hierarchy for classifying language types. Proofs in automata theory involve techniques like deduction, induction, contradiction, and establishing results by definition.
The document discusses regular expressions and how they can be used to represent languages accepted by finite automata. It provides examples of how to:
1. Construct regular expressions from languages and finite state automata. Regular expressions can be built by defining expressions for subparts of a language and combining them.
2. Convert finite state automata to equivalent regular expressions using state elimination techniques. Intermediate states are replaced with regular expressions on transitions until a single state automaton remains.
3. Convert regular expressions to equivalent finite state automata by building epsilon-nondeterministic finite automata (ε-NFAs) based on the structure of the regular expression.
The document discusses asymptotic notations that are used to describe the time complexity of algorithms. It introduces big O notation, which describes asymptotic upper bounds, big Omega notation for lower bounds, and big Theta notation for tight bounds. Common time complexities are described such as O(1) for constant time, O(log N) for logarithmic time, and O(N^2) for quadratic time. The notations allow analyzing how efficiently algorithms use resources like time and space as the input size increases.
This document provides an overview of first-order logic in artificial intelligence:
- First-order logic extends propositional logic by adding objects, relations, and functions to represent knowledge. Objects can include people and numbers, while relations include concepts like "brother of" and functions like "father of".
- A sentence in first-order logic contains a predicate and a subject, represented by a variable. For example, "tall(John)" asserts that John is tall. Quantifiers like "forall" and "exists" are used to structure sentences.
- First-order logic contains constants, variables, predicates, functions, connectives, equality, and quantifiers as its basic elements.
Greedy algorithms work by making locally optimal choices at each step to arrive at a global optimal solution. They require that the problem exhibits the greedy choice property and optimal substructure. Examples that can be solved with greedy algorithms include fractional knapsack problem, minimum spanning tree, and activity selection. The fractional knapsack problem is solved greedily by sorting items by value/weight ratio and filling the knapsack completely. The 0/1 knapsack problem differs in that items are indivisible.
The document discusses approximation algorithms for NP-complete problems. It introduces the idea of finding near-optimal solutions in polynomial time for problems where optimal solutions cannot be found efficiently. It provides examples of the vertex cover problem and set cover problem, describing greedy approximation algorithms that provide performance guarantees for finding near-optimal solutions for these problems. The document also discusses some open questions around whether these approximation ratios can be improved.
Automata theory studies abstract computing devices and the types of tasks they are capable of. Alan Turing pioneered this field in the 1930s by studying Turing machines. The theory examines questions like which tasks can and cannot be performed by different models of machines. It also considers the distinction between what is computable versus the complexity of computation. Common concepts include finite automata, formal languages, and the Chomsky hierarchy for classifying language types. Proofs in automata theory involve techniques like deduction, induction, contradiction, and establishing results by definition.
The document discusses regular expressions and how they can be used to represent languages accepted by finite automata. It provides examples of how to:
1. Construct regular expressions from languages and finite state automata. Regular expressions can be built by defining expressions for subparts of a language and combining them.
2. Convert finite state automata to equivalent regular expressions using state elimination techniques. Intermediate states are replaced with regular expressions on transitions until a single state automaton remains.
3. Convert regular expressions to equivalent finite state automata by building epsilon-nondeterministic finite automata (ε-NFAs) based on the structure of the regular expression.
The document discusses asymptotic notations that are used to describe the time complexity of algorithms. It introduces big O notation, which describes asymptotic upper bounds, big Omega notation for lower bounds, and big Theta notation for tight bounds. Common time complexities are described such as O(1) for constant time, O(log N) for logarithmic time, and O(N^2) for quadratic time. The notations allow analyzing how efficiently algorithms use resources like time and space as the input size increases.
This document provides an overview of first-order logic in artificial intelligence:
- First-order logic extends propositional logic by adding objects, relations, and functions to represent knowledge. Objects can include people and numbers, while relations include concepts like "brother of" and functions like "father of".
- A sentence in first-order logic contains a predicate and a subject, represented by a variable. For example, "tall(John)" asserts that John is tall. Quantifiers like "forall" and "exists" are used to structure sentences.
- First-order logic contains constants, variables, predicates, functions, connectives, equality, and quantifiers as its basic elements.
Greedy algorithms work by making locally optimal choices at each step to arrive at a global optimal solution. They require that the problem exhibits the greedy choice property and optimal substructure. Examples that can be solved with greedy algorithms include fractional knapsack problem, minimum spanning tree, and activity selection. The fractional knapsack problem is solved greedily by sorting items by value/weight ratio and filling the knapsack completely. The 0/1 knapsack problem differs in that items are indivisible.
The document discusses approximation algorithms for NP-complete problems. It introduces the idea of finding near-optimal solutions in polynomial time for problems where optimal solutions cannot be found efficiently. It provides examples of the vertex cover problem and set cover problem, describing greedy approximation algorithms that provide performance guarantees for finding near-optimal solutions for these problems. The document also discusses some open questions around whether these approximation ratios can be improved.
Decision properties of reular languagesSOMNATHMORE2
This document discusses decision properties of regular languages. It defines regular languages as those that can be described by regular expressions and accepted by finite automata. It explains that decision properties are algorithms that take a formal language description and determine properties like emptiness, finiteness, membership in the language, and equivalence to another language. The key decision properties - emptiness, finiteness, membership, and equivalence - are then defined along with the algorithms to determine each. Examples are provided to illustrate the algorithms. Applications of decision properties in areas like data validation and parsing are also mentioned.
- Recurrences describe functions in terms of their values on smaller inputs and arise when algorithms contain recursive calls to themselves.
- To analyze the running time of recursive algorithms, the recurrence must be solved to find an explicit formula or bound the expression in terms of n.
- Examples of recurrences and their solutions are given, including binary search (O(log n)), dividing the input in half at each step (O(n)), and dividing the input in half but examining all items (O(n)).
- Methods for solving recurrences include iteration, substitution, and using recursion trees to "guess" the solution.
GE8151 Problem Solving and Python ProgrammingMuthu Vinayagam
The document provides information about various Python concepts like print statement, variables, data types, operators, conditional statements, loops, functions, modules, exceptions, files and packages. It explains print statement syntax, how variables work in Python, built-in data types like numbers, strings, lists, dictionaries and tuples. It also discusses conditional statements like if-else, loops like while and for, functions, modules, exceptions, file handling operations and packages in Python.
The document discusses time and space complexity analysis of algorithms. Time complexity measures the number of steps to solve a problem based on input size, with common orders being O(log n), O(n), O(n log n), O(n^2). Space complexity measures memory usage, which can be reused unlike time. Big O notation describes asymptotic growth rates to compare algorithm efficiencies, with constant O(1) being best and exponential O(c^n) being worst.
The document discusses algorithms and their analysis. It covers:
1) The definition of an algorithm and its key characteristics like being unambiguous, finite, and efficient.
2) The fundamental steps of algorithmic problem solving like understanding the problem, designing a solution, and analyzing efficiency.
3) Methods for specifying algorithms using pseudocode, flowcharts, or natural language.
4) Analyzing an algorithm's time and space efficiency using asymptotic analysis and orders of growth like best-case, worst-case, and average-case scenarios.
This document describes a project on solving the 8 queens problem using object-oriented programming in C++. It includes an introduction to the 8 queens puzzle, a methodology section on the backtracking algorithm used, pseudocode for the algorithm, analysis of the time complexity, a flowchart, results and discussion of the 12 fundamental solutions, and the source code. It was completed by 5 students under the guidance of a professor to fulfill the requirements for a bachelor's degree in computer science and engineering.
This document discusses greedy algorithms and dynamic programming techniques for solving optimization problems. It covers the activity selection problem, which can be solved greedily by always selecting the shortest remaining activity. It also discusses the knapsack problem and how the fractional version can be solved greedily while the 0-1 version requires dynamic programming due to its optimal substructure but non-greedy nature. Dynamic programming builds up solutions by combining optimal solutions to overlapping subproblems.
The document discusses finite automata including nondeterministic finite automata (NFAs) and deterministic finite automata (DFAs). It provides examples of NFAs and DFAs that recognize particular strings, including strings containing certain substrings. It also gives examples of DFA state machines and discusses using finite automata to recognize regular languages.
The document discusses graph coloring and its applications. It defines graph coloring as assigning colors to graph vertices such that no adjacent vertices have the same color. It also discusses the four color theorem, which states that any planar map can be colored with four or fewer colors. Finally, it provides an overview of backtracking as an algorithmic approach for solving graph coloring problems.
This document discusses NP-hard and NP-complete problems. It begins by defining the classes P, NP, NP-hard, and NP-complete. It then provides examples of NP-hard problems like the traveling salesperson problem, satisfiability problem, and chromatic number problem. It explains that to show a problem is NP-hard, one shows it is at least as hard as another known NP-hard problem. The document concludes by discussing how restricting NP-hard problems can result in problems that are solvable in polynomial time.
Semantic nets are a knowledge representation scheme that uses nodes and labeled directed arcs to encode knowledge. Nodes represent objects, concepts, and events, while arcs represent relationships between nodes. Frames are a similar representation that uses slots and fillers to represent entities and their attributes. Both semantic nets and frames allow for inheritance of properties along relationships. More expressive description logics were later developed that combine frame-like representations with formal semantics and classification capabilities. Large knowledge bases like CYC have been created using these representations to encode common-sense knowledge.
Turing Machines are a simple mathematical model of a general purpose computer invented by Alan Turing in 1936. A Turing Machine consists of an infinite tape divided into cells, a head that reads and writes symbols on the tape, a finite set of states, and transition rules determining the behavior of the machine. The machine operates by reading a symbol on the tape, updating the symbol according to its transition rules, moving the head left or right, and transitioning to a new state. Turing Machines can simulate any algorithm and are capable of performing any calculation that can be performed by any computing machine.
The document discusses the problem of determining the optimal way to fully parenthesize the product of a chain of matrices to minimize the number of scalar multiplications. It presents a dynamic programming approach to solve this problem in four steps: 1) characterize the structure of an optimal solution, 2) recursively define the cost of an optimal solution, 3) compute the costs using tables, 4) construct the optimal solution from the tables. An example is provided to illustrate computing the costs table and finding the optimal parenthesization of a chain of 6 matrices.
The document discusses various optimization problems that can be solved using the greedy method. It begins by explaining that the greedy method involves making locally optimal choices at each step that combine to produce a globally optimal solution. Several examples are then provided to illustrate problems that can and cannot be solved with the greedy method. These include shortest path problems, minimum spanning trees, activity-on-edge networks, and Huffman coding. Specific greedy algorithms like Kruskal's algorithm, Prim's algorithm, and Dijkstra's algorithm are also covered. The document concludes by noting that the greedy method can only be applied to solve a small number of optimization problems.
The document discusses different types of knowledge that may need to be represented in AI systems, including objects, events, performance, and meta-knowledge. It also discusses representing knowledge at two levels: the knowledge level containing facts, and the symbol level containing representations of objects defined in terms of symbols. Common ways of representing knowledge mentioned include using English, logic, relations, semantic networks, frames, and rules. The document also discusses using knowledge for applications like learning, reasoning, and different approaches to machine learning such as skill refinement, knowledge acquisition, taking advice, problem solving, induction, discovery, and analogy.
The document provides an overview of algorithms, including definitions, types, characteristics, and analysis. It begins with step-by-step algorithms to add two numbers and describes the difference between algorithms and pseudocode. It then covers algorithm design approaches, characteristics, classification based on implementation and logic, and analysis methods like a priori and posteriori. The document emphasizes that algorithm analysis estimates resource needs like time and space complexity based on input size.
This document provides an introduction to combinatorics including the sum rule, product rule, permutations, and combinations. The sum rule states that if tasks are independent, the number of ways to do either task is the sum of the number of ways to do each individually. The product rule states that if tasks are independent, the number of ways to do both tasks is the product of the number of ways to do each. Permutations refer to ordered arrangements and combinations refer to unordered arrangements. The document includes examples of applying these concepts.
Linear bounded automata are a type of automaton that operates like a Turing machine but with a tape bounded by the length of the input string. They are more powerful than pushdown automata but less powerful than Turing machines. The computation is restricted to a constant bounded area between left and right end markers on the tape. Linear bounded automata accept context sensitive languages.
Cs2303 theory of computation may june 2016appasami
This document contains a question paper for a Theory of Computation exam. It has two parts - Part A contains 10 short answer questions worth 2 marks each on topics like mathematical induction, finite automata, regular expressions, context-free grammars, pushdown automata, Turing machines, and complexity classes. Part B contains 5 long answer questions worth 16 marks each on topics like proofs by induction, Thompson's construction algorithm, regular expressions, context-free grammars, pushdown automata, Turing machines, undecidable problems, and recursively enumerable languages. Students are required to answer all questions in the paper.
Cs6503 theory of computation may june 2016 be cse anna university question paperappasami
This document contains questions from a Computer Science and Engineering exam on the theory of computation. It covers topics like finite automata, context-free grammars, pushdown automata, Turing machines, and more. Students are asked to construct various computational models, prove properties like pumping lemmas, minimize deterministic finite automata, derive strings, and determine whether problems are tractable or intractable. The exam tests understanding of fundamental concepts in formal languages and automata theory.
Decision properties of reular languagesSOMNATHMORE2
This document discusses decision properties of regular languages. It defines regular languages as those that can be described by regular expressions and accepted by finite automata. It explains that decision properties are algorithms that take a formal language description and determine properties like emptiness, finiteness, membership in the language, and equivalence to another language. The key decision properties - emptiness, finiteness, membership, and equivalence - are then defined along with the algorithms to determine each. Examples are provided to illustrate the algorithms. Applications of decision properties in areas like data validation and parsing are also mentioned.
- Recurrences describe functions in terms of their values on smaller inputs and arise when algorithms contain recursive calls to themselves.
- To analyze the running time of recursive algorithms, the recurrence must be solved to find an explicit formula or bound the expression in terms of n.
- Examples of recurrences and their solutions are given, including binary search (O(log n)), dividing the input in half at each step (O(n)), and dividing the input in half but examining all items (O(n)).
- Methods for solving recurrences include iteration, substitution, and using recursion trees to "guess" the solution.
GE8151 Problem Solving and Python ProgrammingMuthu Vinayagam
The document provides information about various Python concepts like print statement, variables, data types, operators, conditional statements, loops, functions, modules, exceptions, files and packages. It explains print statement syntax, how variables work in Python, built-in data types like numbers, strings, lists, dictionaries and tuples. It also discusses conditional statements like if-else, loops like while and for, functions, modules, exceptions, file handling operations and packages in Python.
The document discusses time and space complexity analysis of algorithms. Time complexity measures the number of steps to solve a problem based on input size, with common orders being O(log n), O(n), O(n log n), O(n^2). Space complexity measures memory usage, which can be reused unlike time. Big O notation describes asymptotic growth rates to compare algorithm efficiencies, with constant O(1) being best and exponential O(c^n) being worst.
The document discusses algorithms and their analysis. It covers:
1) The definition of an algorithm and its key characteristics like being unambiguous, finite, and efficient.
2) The fundamental steps of algorithmic problem solving like understanding the problem, designing a solution, and analyzing efficiency.
3) Methods for specifying algorithms using pseudocode, flowcharts, or natural language.
4) Analyzing an algorithm's time and space efficiency using asymptotic analysis and orders of growth like best-case, worst-case, and average-case scenarios.
This document describes a project on solving the 8 queens problem using object-oriented programming in C++. It includes an introduction to the 8 queens puzzle, a methodology section on the backtracking algorithm used, pseudocode for the algorithm, analysis of the time complexity, a flowchart, results and discussion of the 12 fundamental solutions, and the source code. It was completed by 5 students under the guidance of a professor to fulfill the requirements for a bachelor's degree in computer science and engineering.
This document discusses greedy algorithms and dynamic programming techniques for solving optimization problems. It covers the activity selection problem, which can be solved greedily by always selecting the shortest remaining activity. It also discusses the knapsack problem and how the fractional version can be solved greedily while the 0-1 version requires dynamic programming due to its optimal substructure but non-greedy nature. Dynamic programming builds up solutions by combining optimal solutions to overlapping subproblems.
The document discusses finite automata including nondeterministic finite automata (NFAs) and deterministic finite automata (DFAs). It provides examples of NFAs and DFAs that recognize particular strings, including strings containing certain substrings. It also gives examples of DFA state machines and discusses using finite automata to recognize regular languages.
The document discusses graph coloring and its applications. It defines graph coloring as assigning colors to graph vertices such that no adjacent vertices have the same color. It also discusses the four color theorem, which states that any planar map can be colored with four or fewer colors. Finally, it provides an overview of backtracking as an algorithmic approach for solving graph coloring problems.
This document discusses NP-hard and NP-complete problems. It begins by defining the classes P, NP, NP-hard, and NP-complete. It then provides examples of NP-hard problems like the traveling salesperson problem, satisfiability problem, and chromatic number problem. It explains that to show a problem is NP-hard, one shows it is at least as hard as another known NP-hard problem. The document concludes by discussing how restricting NP-hard problems can result in problems that are solvable in polynomial time.
Semantic nets are a knowledge representation scheme that uses nodes and labeled directed arcs to encode knowledge. Nodes represent objects, concepts, and events, while arcs represent relationships between nodes. Frames are a similar representation that uses slots and fillers to represent entities and their attributes. Both semantic nets and frames allow for inheritance of properties along relationships. More expressive description logics were later developed that combine frame-like representations with formal semantics and classification capabilities. Large knowledge bases like CYC have been created using these representations to encode common-sense knowledge.
Turing Machines are a simple mathematical model of a general purpose computer invented by Alan Turing in 1936. A Turing Machine consists of an infinite tape divided into cells, a head that reads and writes symbols on the tape, a finite set of states, and transition rules determining the behavior of the machine. The machine operates by reading a symbol on the tape, updating the symbol according to its transition rules, moving the head left or right, and transitioning to a new state. Turing Machines can simulate any algorithm and are capable of performing any calculation that can be performed by any computing machine.
The document discusses the problem of determining the optimal way to fully parenthesize the product of a chain of matrices to minimize the number of scalar multiplications. It presents a dynamic programming approach to solve this problem in four steps: 1) characterize the structure of an optimal solution, 2) recursively define the cost of an optimal solution, 3) compute the costs using tables, 4) construct the optimal solution from the tables. An example is provided to illustrate computing the costs table and finding the optimal parenthesization of a chain of 6 matrices.
The document discusses various optimization problems that can be solved using the greedy method. It begins by explaining that the greedy method involves making locally optimal choices at each step that combine to produce a globally optimal solution. Several examples are then provided to illustrate problems that can and cannot be solved with the greedy method. These include shortest path problems, minimum spanning trees, activity-on-edge networks, and Huffman coding. Specific greedy algorithms like Kruskal's algorithm, Prim's algorithm, and Dijkstra's algorithm are also covered. The document concludes by noting that the greedy method can only be applied to solve a small number of optimization problems.
The document discusses different types of knowledge that may need to be represented in AI systems, including objects, events, performance, and meta-knowledge. It also discusses representing knowledge at two levels: the knowledge level containing facts, and the symbol level containing representations of objects defined in terms of symbols. Common ways of representing knowledge mentioned include using English, logic, relations, semantic networks, frames, and rules. The document also discusses using knowledge for applications like learning, reasoning, and different approaches to machine learning such as skill refinement, knowledge acquisition, taking advice, problem solving, induction, discovery, and analogy.
The document provides an overview of algorithms, including definitions, types, characteristics, and analysis. It begins with step-by-step algorithms to add two numbers and describes the difference between algorithms and pseudocode. It then covers algorithm design approaches, characteristics, classification based on implementation and logic, and analysis methods like a priori and posteriori. The document emphasizes that algorithm analysis estimates resource needs like time and space complexity based on input size.
This document provides an introduction to combinatorics including the sum rule, product rule, permutations, and combinations. The sum rule states that if tasks are independent, the number of ways to do either task is the sum of the number of ways to do each individually. The product rule states that if tasks are independent, the number of ways to do both tasks is the product of the number of ways to do each. Permutations refer to ordered arrangements and combinations refer to unordered arrangements. The document includes examples of applying these concepts.
Linear bounded automata are a type of automaton that operates like a Turing machine but with a tape bounded by the length of the input string. They are more powerful than pushdown automata but less powerful than Turing machines. The computation is restricted to a constant bounded area between left and right end markers on the tape. Linear bounded automata accept context sensitive languages.
Cs2303 theory of computation may june 2016appasami
This document contains a question paper for a Theory of Computation exam. It has two parts - Part A contains 10 short answer questions worth 2 marks each on topics like mathematical induction, finite automata, regular expressions, context-free grammars, pushdown automata, Turing machines, and complexity classes. Part B contains 5 long answer questions worth 16 marks each on topics like proofs by induction, Thompson's construction algorithm, regular expressions, context-free grammars, pushdown automata, Turing machines, undecidable problems, and recursively enumerable languages. Students are required to answer all questions in the paper.
Cs6503 theory of computation may june 2016 be cse anna university question paperappasami
This document contains questions from a Computer Science and Engineering exam on the theory of computation. It covers topics like finite automata, context-free grammars, pushdown automata, Turing machines, and more. Students are asked to construct various computational models, prove properties like pumping lemmas, minimize deterministic finite automata, derive strings, and determine whether problems are tractable or intractable. The exam tests understanding of fundamental concepts in formal languages and automata theory.
Cs6660 compiler design november december 2016 Answer keyappasami
The document discusses topics related to compiler design, including:
1) The phases of a compiler include lexical analysis, syntax analysis, semantic analysis, intermediate code generation, code optimization, and code generation. Compiler construction tools help implement these phases.
2) Grouping compiler phases can improve efficiency. Errors can occur in all phases, from syntax errors to type errors.
3) Questions cover topics like symbol tables, finite automata in lexical analysis, parse trees, ambiguity, SLR parsing, syntax directed translations, code generation, and optimization techniques like loop detection.
The document describes the syllabus for the course "Formal Languages and Automata Theory". It contains:
- 8 units covering topics like introduction to finite automata, regular expressions, context-free grammars, pushdown automata, Turing machines, and more.
- Details of each unit including hours, chapters covered from the textbook, and topics discussed.
- Information about internal assessment and exams, including marks distribution.
- Names of two recommended textbooks and their relevant chapters.
- A table of contents listing the topics covered in each unit and their page numbers.
Cs6503 theory of computation november december 2015 be cse anna university q...appasami
This document contains a question paper for a Computer Science and Engineering examination with 15 questions covering various topics in theory of computation such as finite automata, regular expressions, context-free grammars, pushdown automata, Turing machines, and complexity theory. It provides definitions and problems related to determining if a language is regular, context-free, recursively enumerable, deciding membership of strings in a language, and analyzing time complexity of problems. The questions range from basic concepts to more advanced topics like the halting problem and Rice's theorem. The document aims to comprehensively test students' understanding of the theory of computation.
Cs2303 theory of computation november december 2015appasami
This document contains an exam for a Theory of Computation course. It includes 15 multiple choice and long answer questions covering topics like non-deterministic finite automata (NFA), regular expressions, closure properties of regular languages, context-free grammars, parse trees, ambiguity, Chomsky normal form, Turing machines, recursively enumerable languages, and the Post correspondence problem (PCP). Students are instructed to answer all questions which involve tasks like constructing automata and grammars, proving languages are/aren't regular, and discussing properties and concepts related to formal languages and computability theory.
This document contains a homework assignment on basic set theory concepts. It includes 15 problems covering topics like set operations, relations, functions, partitions, and closures. The problems involve tasks like describing sets using set builder notation, proving properties of set operations, computing compositions and inverses of relations, and determining cardinalities and closures.
This document provides a 2 mark question and answer review for the Principles of Compiler Design subject. It includes 40 questions and answers covering topics like the definitions and phases of a compiler, lexical analysis, syntax analysis, parsing, grammars, ambiguity, error handling and more. The questions are multiple choice or short answer designed to assess understanding of key compiler design concepts and techniques.
The document provides information about a course on the theory of automata. It includes details such as the course title, prerequisites, duration, lectures, laboratories, and topics to be covered. The topics include finite automata, deterministic finite automata, non-deterministic finite automata, regular expressions, properties of regular languages, context-free grammars, pushdown automata, and Turing machines. It also lists reference books and textbooks, and the marking scheme for the course.
This document outlines the course objectives and units for a Theory of Computation course. The course covers various computing models like finite state machines, pushdown automata, and Turing machines. It examines decidability and undecidability of problems. Key topics include regular languages and expressions, context-free grammars, pumping lemmas, Turing machines, and analyzing complexity classes like P and NP-complete problems. The course aims to help students understand these foundational models of computation and analyze problem solvability.
The document discusses LR parsers and how they are used to parse context-free grammars. Some key points:
- LR parsers are shift-reduce parsers that can parse a wide range of grammars. They operate in a left-to-right manner and can detect syntax errors as early as possible.
- There are different types of LR parsers including SLR, LR, and LALR parsers which use the same algorithm but have different parsing tables.
- The LR parsing algorithm uses a stack and input to shift and reduce based on actions specified in parsing tables. The tables are constructed from LR(0) items and states generated from the grammar.
- Grammars that can be parsed by S
Simplifies and normal forms - Theory of ComputationNikhil Pandit
1) The document discusses simplifying context-free grammars (CFGs) and putting them into normal form.
2) It describes eliminating null productions, unit productions, and useless productions to simplify CFGs.
3) It then explains Greibach normal form, where all productions are of the form A→αX, with A a nonterminal, α a terminal, and X a string of nonterminals. An algorithm is provided to convert CFGs to Greibach normal form.
This document provides an overview of data communications and computer networks. It discusses the need for computer communication over distances, defines data communication, and describes the key components and characteristics of data communication systems. It also covers various data representation methods, transmission media, network topologies, categories of networks including LANs, MANs and WANs, and the importance of protocols and standards in networking.
Cs6702 graph theory and applications Anna University question paper apr may 2...appasami
This document contains a past exam paper for the subject "Graph Theory and Applications". It includes 15 multiple choice and long answer questions covering topics such as Euler graphs, planar graphs, spanning trees, matchings, counting principles, and graph algorithms. The key provided contains concise definitions and explanations for the concepts and steps to solve problems in 3 sentences or less.
The document discusses Chomsky normal form and Greibach normal form, which are simplified forms of context-free grammars (CFGs). It explains that any CFG can be converted into Chomsky normal form through a series of transformations. Greibach normal form further restricts the form of rules so that they start with a terminal symbol. The document provides an example of converting a CFG into Greibach normal form through multiple steps.
Context-free grammars (CFGs) provide a formal way to define recursive languages. A CFG consists of variables, terminals, production rules, and a start variable. Production rules specify how variables can be rewritten in terms of terminals and other variables. For example, a CFG for the language of palindromes defines a variable P for palindromes, with rules like P → 0P0 indicating that if a string w is a palindrome, so is 0w0. Derivations apply rules to show that a string is in the language, like deriving a*(a+b000) from the start variable. Parse trees provide an alternative representation of the structure of strings in the language.
Cs6702 graph theory and applications question bankappasami
This document contains questions and answers related to the course CS6702 Graph Theory and Applications. It is divided into 6 units which cover topics like introduction to graphs, trees, connectivity, planarity, graph colorings, directed graphs, permutations and combinations, and generating functions. For each unit, it lists short answer questions in Part A and longer proof or explanation questions in Part B. The questions test concepts fundamental to graph theory such as definitions of graphs, trees, connectivity, colorings, isomorphism, and counting methods applied to graph theory.
Problem set2 | Theory of Computation | Akash Anand | MTH 401A | IIT KanpurVivekananda Samiti
This document contains 20 problems related to theory of computation and context-free languages. The problems cover topics such as constructing grammars and pushdown automata for specific languages, proving languages are/aren't context-free, ambiguity of grammars, closure properties of context-free languages, and decidability questions.
1. The document contains questions from various computer science subjects including formal languages and automata, regular expressions and languages, pushdown automata, and context-free languages and Turing machines.
2. It includes definitions, examples, differences between models like DFAs and NFAs, properties of languages, and questions asking to construct automata or grammars for specific languages.
3. Several questions ask students to prove statements about language classes, pumping lemmas, ambiguity in grammars, and the equivalence of computational models like PDAs and Turing machines.
This document contains questions from a Theory of Computation exam for a Computer Science degree program. It covers topics like regular expressions, finite automata, context-free grammars, pushdown automata, Turing machines, and the halting problem. The exam has two parts - Part A contains 10 short answer questions worth 2 marks each, and Part B contains 5 longer answer questions worth 16 marks each. Questions test knowledge of concepts like nondeterministic finite automata, parsing, Greibach normal form, programming techniques for Turing machines, and undecidable problems like the Post correspondence problem and the halting problem.
This document contains questions from the Theory of Computation subject for the 5th semester Computer Science engineering students. It has two parts - Part A contains 10 short answer questions worth 2 marks each and Part B contains 5 long answer questions worth 16 marks each. The questions cover various topics in Theory of Computation including finite automata, context-free grammars, pushdown automata, Turing machines, and computability.
CS2303 Theory of computation April may 2015appasami
This document is a question paper for a Computer Science and Engineering degree examination. It contains two parts - Part A with 10 short answer questions worth 2 marks each on topics like proofs of properties of sets, regular expressions, finite automata, context-free grammars, pushdown automata and recursive/non-recursive languages. Part B contains 5 long answer questions worth 16 marks each on topics like designing automata to recognize languages, minimizing DFAs, constructing PDAs and TMs, Post's correspondence problem and complexity classes. The document provides best wishes to students for the exam and lists the qualifications of the person who set the question paper.
Problem set1 | Theory of Computation | Akash Anand | MTH 401A | IIT KanpurVivekananda Samiti
This document contains 20 problems related to theory of computation and finite automata. The problems involve constructing deterministic and non-deterministic finite state machines to recognize various regular languages. They also involve proving properties of regular languages and regular expressions, converting between finite automata and regular expressions, and determining whether specific languages are regular or not.
This document contains a question bank for the subject Theory of Automata and Formal Languages. It includes questions related to finite automata, context-free grammars, pushdown automata, Turing machines, and the Chomsky hierarchy. Some questions ask to design automata or grammars for specific languages, while others define concepts and ask students to prove properties about language classes.
This document contains a term-end examination for a Theory of Computer Science course. It includes 8 questions testing various concepts:
1. Question 1 asks students to explain regular expressions, context-free grammars, non-deterministic finite automata (NFA), and the pumping lemma with examples. It also asks students to build a finite automaton and regular expressions.
2. Later questions address topics like grammars for odd palindromes, Turing machines, growth rate notations like Big O, and unsolvable decision problems.
3. The last few questions involve showing languages are/aren't regular or context-free, describing operations of a Turing machine, applications of finite automata,
The document contains 8 sets of questions related to automata and compiler design. The questions cover topics such as finite automata, context-free grammars, LR parsing, attributes, type checking, storage allocation strategies, optimization techniques, macro preprocessors, and code generation. Sample problems are provided for concepts like constructing DFAs and parsers, deriving strings, writing attribute grammars, and translating code snippets.
Problem set3 | Theory of Computation | Akash Anand | MTH 401A | IIT KanpurVivekananda Samiti
This document outlines 9 problems related to theory of computation. It asks the reader to: 1) Design Turing machines for various languages; 2) Determine complexity classes for other languages; 3) Prove undecidability of determining equivalence of context-free grammars; 4) Determine recursively enumerability of languages; 5) Prove decidability of the Post Correspondence Problem over a 1-letter alphabet; 6) Show a generalized game of Go-Moku is in PSPACE; 7) Show satisfiability of formulas in conjunctive normal form (SAT) is NP-Complete; 8) Prove properties of 2-SAT and 3-SAT problems; 9) Show a solitaire game problem is NP
This document contains information about a computer science examination from May 2017, including sections and questions. Section A contains 10 two-mark questions about topics like finite automata, regular expressions, pumping lemma, context-free grammars, pushdown automata, Turing machines, and Post correspondence problem. Section B has 5 five-mark questions. Section C contains 3 fifteen-mark questions. Section D has 1 ten-mark question. The document provides details about the exam format, sections, question types and marks for each question.
This document contains information about a computer science examination from May 2017, including sections and questions. Section A contains 10 two-mark questions about topics like finite automata, regular expressions, pumping lemma, context-free grammars, pushdown automata, Turing machines, and Post correspondence problem. Section B has 5 five-mark questions. Section C contains 3 fifteen-mark questions. Section D has 1 ten-mark question. The document provides details about the exam format, sections, question types and marks for each question.
This document contains information about a computer science examination from May 2017, including sections and questions. Section A contains 10 two-mark questions about topics like finite automata, regular expressions, pumping lemma, context-free grammars, pushdown automata, Turing machines, and Post correspondence problem. Section B has 5 five-mark questions. Section C contains 3 fifteen-mark questions. Section D has 1 ten-mark question. The document provides details about the exam format, sections, question types and marks for each question.
This document contains a worksheet for the Compiler Design course CS6660. It includes questions related to lexical analysis, syntax analysis, and code generation. Specifically, it asks students to construct symbol tables, finite automata, parse trees, and three-address code. The questions are meant to help students learn and practice different phases of compiler construction.
This document lists expected questions from the Theory of Computation subject for 5th semester CSE students. It includes short questions and long questions on topics such as the differences between DFAs and NFAs, regular expressions, grammars, Turing machines, complexity classes, decidability, and more. A total of 30 short questions and 19 long questions are provided to help students prepare for their exam.
This document contains a list of expected questions for the Theory of Computation subject in the 5th semester of the Computer Science branch. It includes short questions, long questions, and questions covering various topics like DFAs, NFAs, regular expressions, context-free grammars, pushdown automata, Turing machines, complexity classes, decidability, and more. The list was prepared by Assistant Professor Santosh Kumar Rath.
This document lists 30 short questions and 19 long questions related to the subject of Theory of Computation for 5th semester CSE students. The questions cover topics such as the differences between DFAs and NFAs, regular expressions, grammars, languages, automata, Turing machines, complexity classes, and decidability. Example problems include designing automata to recognize specific languages and proving properties of formal languages and grammars.
This document lists 30 short questions and 19 long questions related to the subject of Theory of Computation for 5th semester CSE students. The questions cover topics such as the differences between DFAs and NFAs, regular expressions, grammars, languages, automata, Turing machines, complexity classes, and decidability. Example problems include designing automata to recognize specific languages, proving languages are context-free, and determining the relationships between computational models such as finite automata and Turing machines.
Similar to Cs2303 theory of computation all anna University question papers (20)
This document discusses popular Python libraries for data visualization: Matplotlib, Seaborn, Bokeh, Altair, Plotly, and ggplot. It lists these six libraries and indicates that each can be used for data visualization in Python. The document provides a brief overview of options for visualizing data using Python.
Cs6660 compiler design may june 2017 answer keyappasami
This document contains an exam for a Compiler Design course. It includes 20 short answer questions in Part A and 5 long answer questions in Part B. The long answer questions cover topics like the phases of a compiler, lexical analysis, parser construction, type checking, code optimization, and code generation. Students are instructed to answer all questions and provide detailed explanations for the long answer questions.
Cs6660 compiler design may june 2016 Answer Keyappasami
The document describes the various phases of a compiler:
1. Lexical analysis breaks the source code into tokens.
2. Syntax analysis generates a parse tree from the tokens.
3. Semantic analysis checks for semantic correctness using the parse tree and symbol table.
4. Intermediate code generation produces machine-independent code.
5. Code optimization improves the intermediate code.
6. Code generation translates the optimized code into target machine code.
Cs6402 design and analysis of algorithms impartant part b questions appasamiappasami
This document outlines important questions from 5 units that could appear on the CS64O2 DESIGN AND ANALYSIS OF ALGORITHMS exam. Unit I covers algorithm problem types, problem solving fundamentals, asymptotic notations, and analyzing recursive/non-recursive algorithms. Unit II discusses closest pair, convex hull, TSP, KP, sorting algorithms, and binary search. Unit III is about dynamic programming, graph algorithms, OBST, and HMT. Unit IV is linear programming problems. Unit V covers complexity classes, backtracking, branch and bound, and approximation algorithms for NP-hard problems like TSP and KP. The document provides guidance on questions to study for the exam.
This document contains a lesson plan for the subject "Theory of Computation" taught to 5th semester Computer Science students. The lesson plan spans 9 weeks and covers 5 units - Finite Automata, Grammars, Pushdown Automata, Turing Machines, and Unsolvable Problems. It lists the topics to be covered in each class, the relevant textbook chapters and pages, and the faculty member responsible for teaching the subject. The lesson plan provides a comprehensive overview of the topics, readings, and schedule for the Theory of Computation course.
This document is a set of lecture notes for the course CS6503 - Theory of Computation from Dr. Paul's Engineering College. It contains an index listing 5 units of content that make up the syllabus, as well as additional sections on a question bank and prior university question papers. The document provides the curriculum and materials for the Theory of Computation course taught at Dr. Paul's Engineering College.
Cs6402 design and analysis of algorithms may june 2016 answer keyappasami
The document discusses algorithms and complexity analysis. It provides Euclid's algorithm for computing greatest common divisor, compares the orders of growth of n(n-1)/2 and n^2, and describes the general strategy of divide and conquer methods. It also defines problems like the closest pair problem, single source shortest path problem, and assignment problem. Finally, it discusses topics like state space trees, the extreme point theorem, and lower bounds.
Cs6702 graph theory and applications syllabusappasami
The document outlines the objectives and units of a course on Graph Theory and Applications. The 5 units cover topics such as graphs, trees, connectivity, planarity, matrices, coloring, permutations, combinations, and generating functions. Students will learn fundamental graph theory topics and results, techniques of proofs and analysis, and be able to write precise definitions, construct examples, and prove mathematical statements about graphs.
Cs6702 graph theory and applications title index pageappasami
This document is a lecture note for a course on Graph Theory and Applications from Dr. Paul's Engineering College. It contains an index listing the content which includes 5 units of lesson material, a question bank, and past university question papers. The document provides course material for a 4th year, 8th semester computer science course during the 2016-2017 academic year.
Cs6702 graph theory and applications lesson planappasami
This document contains a lesson plan for the subject "Graph Theory and Applications" taught to 8th semester Computer Science students. The lesson plan spans 14 weeks and covers 5 units: Introduction, Trees Connectivity and Planarity, Matrices Colouring and Directed Graph, Permutations and Combinations, and Generating Functions. It details the chapter topics to be covered in each class, the relevant textbook pages, and actual completion dates. Textbook references include Graph Theory by Narsingh Deo and Discrete and Combinatorial Mathematics by Grimaldi for the subject. The Head of Department and Principal are listed for sign-off on the lesson plan.
The document discusses the basic functional units of a computer:
- The input unit accepts coded data from devices like keyboards.
- Memory stores programs and data, with primary storage operating at fast electronic speeds.
- The arithmetic and logic unit (ALU) performs operations on data brought in from memory.
- The output unit sends processed results outside the computer to devices like printers.
- The control unit coordinates the other functional units and sequencing of operations.
artificial intelligence and data science contents.pptxGauravCar
What is artificial intelligence? Artificial intelligence is the ability of a computer or computer-controlled robot to perform tasks that are commonly associated with the intellectual processes characteristic of humans, such as the ability to reason.
› ...
Artificial intelligence (AI) | Definitio
Batteries -Introduction – Types of Batteries – discharging and charging of battery - characteristics of battery –battery rating- various tests on battery- – Primary battery: silver button cell- Secondary battery :Ni-Cd battery-modern battery: lithium ion battery-maintenance of batteries-choices of batteries for electric vehicle applications.
Fuel Cells: Introduction- importance and classification of fuel cells - description, principle, components, applications of fuel cells: H2-O2 fuel cell, alkaline fuel cell, molten carbonate fuel cell and direct methanol fuel cells.
Comparative analysis between traditional aquaponics and reconstructed aquapon...bijceesjournal
The aquaponic system of planting is a method that does not require soil usage. It is a method that only needs water, fish, lava rocks (a substitute for soil), and plants. Aquaponic systems are sustainable and environmentally friendly. Its use not only helps to plant in small spaces but also helps reduce artificial chemical use and minimizes excess water use, as aquaponics consumes 90% less water than soil-based gardening. The study applied a descriptive and experimental design to assess and compare conventional and reconstructed aquaponic methods for reproducing tomatoes. The researchers created an observation checklist to determine the significant factors of the study. The study aims to determine the significant difference between traditional aquaponics and reconstructed aquaponics systems propagating tomatoes in terms of height, weight, girth, and number of fruits. The reconstructed aquaponics system’s higher growth yield results in a much more nourished crop than the traditional aquaponics system. It is superior in its number of fruits, height, weight, and girth measurement. Moreover, the reconstructed aquaponics system is proven to eliminate all the hindrances present in the traditional aquaponics system, which are overcrowding of fish, algae growth, pest problems, contaminated water, and dead fish.
Software Engineering and Project Management - Introduction, Modeling Concepts...Prakhyath Rai
Introduction, Modeling Concepts and Class Modeling: What is Object orientation? What is OO development? OO Themes; Evidence for usefulness of OO development; OO modeling history. Modeling
as Design technique: Modeling, abstraction, The Three models. Class Modeling: Object and Class Concept, Link and associations concepts, Generalization and Inheritance, A sample class model, Navigation of class models, and UML diagrams
Building the Analysis Models: Requirement Analysis, Analysis Model Approaches, Data modeling Concepts, Object Oriented Analysis, Scenario-Based Modeling, Flow-Oriented Modeling, class Based Modeling, Creating a Behavioral Model.
Null Bangalore | Pentesters Approach to AWS IAMDivyanshu
#Abstract:
- Learn more about the real-world methods for auditing AWS IAM (Identity and Access Management) as a pentester. So let us proceed with a brief discussion of IAM as well as some typical misconfigurations and their potential exploits in order to reinforce the understanding of IAM security best practices.
- Gain actionable insights into AWS IAM policies and roles, using hands on approach.
#Prerequisites:
- Basic understanding of AWS services and architecture
- Familiarity with cloud security concepts
- Experience using the AWS Management Console or AWS CLI.
- For hands on lab create account on [killercoda.com](https://killercoda.com/cloudsecurity-scenario/)
# Scenario Covered:
- Basics of IAM in AWS
- Implementing IAM Policies with Least Privilege to Manage S3 Bucket
- Objective: Create an S3 bucket with least privilege IAM policy and validate access.
- Steps:
- Create S3 bucket.
- Attach least privilege policy to IAM user.
- Validate access.
- Exploiting IAM PassRole Misconfiguration
-Allows a user to pass a specific IAM role to an AWS service (ec2), typically used for service access delegation. Then exploit PassRole Misconfiguration granting unauthorized access to sensitive resources.
- Objective: Demonstrate how a PassRole misconfiguration can grant unauthorized access.
- Steps:
- Allow user to pass IAM role to EC2.
- Exploit misconfiguration for unauthorized access.
- Access sensitive resources.
- Exploiting IAM AssumeRole Misconfiguration with Overly Permissive Role
- An overly permissive IAM role configuration can lead to privilege escalation by creating a role with administrative privileges and allow a user to assume this role.
- Objective: Show how overly permissive IAM roles can lead to privilege escalation.
- Steps:
- Create role with administrative privileges.
- Allow user to assume the role.
- Perform administrative actions.
- Differentiation between PassRole vs AssumeRole
Try at [killercoda.com](https://killercoda.com/cloudsecurity-scenario/)
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...IJECEIAES
Medical image analysis has witnessed significant advancements with deep learning techniques. In the domain of brain tumor segmentation, the ability to
precisely delineate tumor boundaries from magnetic resonance imaging (MRI)
scans holds profound implications for diagnosis. This study presents an ensemble convolutional neural network (CNN) with transfer learning, integrating
the state-of-the-art Deeplabv3+ architecture with the ResNet18 backbone. The
model is rigorously trained and evaluated, exhibiting remarkable performance
metrics, including an impressive global accuracy of 99.286%, a high-class accuracy of 82.191%, a mean intersection over union (IoU) of 79.900%, a weighted
IoU of 98.620%, and a Boundary F1 (BF) score of 83.303%. Notably, a detailed comparative analysis with existing methods showcases the superiority of
our proposed model. These findings underscore the model’s competence in precise brain tumor localization, underscoring its potential to revolutionize medical
image analysis and enhance healthcare outcomes. This research paves the way
for future exploration and optimization of advanced CNN models in medical
imaging, emphasizing addressing false positives and resource efficiency.
Discover the latest insights on Data Driven Maintenance with our comprehensive webinar presentation. Learn about traditional maintenance challenges, the right approach to utilizing data, and the benefits of adopting a Data Driven Maintenance strategy. Explore real-world examples, industry best practices, and innovative solutions like FMECA and the D3M model. This presentation, led by expert Jules Oudmans, is essential for asset owners looking to optimize their maintenance processes and leverage digital technologies for improved efficiency and performance. Download now to stay ahead in the evolving maintenance landscape.
Cs2303 theory of computation all anna University question papers
1. Reg. No. :
B.E. / B.Tech. DEGREE EXAMINATION, NOVEMBER / DECEMBER 2010
Fifth Semester
Computer Science and Engineering
CS2303 – THEORY OF COMPUTATION
(Regulation 2008)
Time : Three hours Maximum : 100 marks
Answer ALL Questions
Part A – (𝟏𝟎 × 𝟐 = 𝟐𝟎 marks)
1. What is inductive proof?
2. Find the set of strings accepted by the finite automata.
3. Give the regular expression for set of all strings ending in 00.
4. State pumping lemma for regular set.
5. Write down the context free grammar for the language L = {an
bn
| ≥ 1 }.
6. Is the grammar E → E + E | id is ambiguous? Justify.
7. What is Turing machine?
8. Is the language L = {an
bn
cn
| 𝑛 ≥ 1 }is context free? Justify.
9. What is recursively enumerable language?
10. Mention the difference between decidable and undecidable problems.
Part B – (5 × 𝟏𝟔 = 𝟖𝟎 marks)
11. (a) (i) Construct the deterministic finite automata for accepting the set of all strings with
three consecutive 0‟s. (10)
(ii) Distinguish NFA and DFA with examples. (6)
Or
(b) (i) Consider the finite automata transition table shown below with {Q, Σ, δ, q0, F}
States
Inputs
0 1
q0 q2 q1
q1 q3 q0
q2 q0 q3
q3 q1 q2
Find the language accepted by the finite automata. (10)
(ii) What is ε-closure (q)? Explain with an example. (6)
12. (a) (i) Let r be a regular expression. Prove that there exists an NFA with ε -transitions
that accepts L(r). (10)
(ii) Is the language L = {an
bn
| ≥ 1 } is regular? Justify. (6)
Question Paper Code : xxxxx
2. Or
(b) (i) Construct the minimal DFA for the regular expression (b|a)*baa. (10)
(ii) Prove that regular sets are closed under substitution. (6)
13. (a) (i) Let G be the grammar
S → aB | bA
A → a | aS | bAA
B → b | bS | aBB
for the string baaabbabba. Find leftmost derivation, rightmost derivation and
parse tree. (9)
(ii) What is deterministic PDA? Explain with an example. (7)
Or
(b) (i) Construct the PDA for the Language L = {wcwR
| w is in (0+1)*}. (10)
(ii) Let L is a context free language. Prove that there exists a PDA that accepts L. (6)
14. (a) (i) Obtain a Greibach normal form grammar equivalent to the context free grammar
S → 0 | AA
A→ 1 | SS (8)
(ii) Construct the Turing machine for the language L = {an
bn
| ≥ 1 }. (8)
Or
(b) (i) Explain the closure properties of context free languages. (8)
(ii) Construct the Turing machine for the language L = {wwR
| w is in (0+1)*}. (8)
15. (a) (i) Explain the difference between tractable and intractable problems with examples.
(10)
(ii) What is halting problem? Explain. (6)
Or
(b) (i) Explain post correspondence problem with an example. (8)
(ii) Explain any four NP-Complete problems. (8)
All the Best – No substitute for hard work.
Mr. G. Appasami SET, NET, GATE, M.Sc., M.C.A., M.Phil., M.Tech., (P.hd.), MISTE, MIETE, AMIE, MCSI, MIAE, MIACSIT,
MASCAP, MIARCS, MISIAM, MISCE, MIMS, MISCA, MISAET, PGDTS, PGDBA, PGDHN, PGDST, (AP / CSE / DRPEC).
3. Reg. No. :
B.E. / B.Tech. DEGREE EXAMINATION, APRIL / MAY 2011
Fifth Semester
Computer Science and Engineering
CS2303– THEORY OF COMPUTATION
(Regulation 2008)
Time : Three hours Maximum : 100 marks
Answer ALL Questions
Part A – (𝟏𝟎 × 𝟐 = 𝟐𝟎 marks)
1. Differentiate between proof by contradiction and proof by contra positive.
2. Construct a DFA for the language over {0, 1}* such that it contains “000” as a substring.
3. Prove that the complement of a regular language is also regular.
4. Prove by pumping Lemma, that the language 0n
1n
is not regular.
5. Construct a CFG over {a,b} generating a language consisting of equal number of a‟s and b‟s.
6. Is the language of Deterministic PDA and Non - Deterministic PDA same? Justify.
7. What is the height of the parse tree to represent a string of length „n‟ using Chomsky normal
form?
8. Construct a Turing machine to compute „n mod 2‟ where n is represented in the tape in unary
form consisting of only 0‟s.
9. Prove that the complement of recursive language is recursive.
10. Define the classes P and NP.
Part B – (5 × 𝟏𝟔 = 𝟖𝟎 marks)
11 (a) (i) Show that a connected graph G with n vertices and n-1 edges (n>2) has at least
one leaf. (6)
(ii) Convert the following ε-NFA to a DFA using subset construction algorithm. (10)
ε a b c
→p Φ {p} {q} {r}
q {p} {q} {r} Φ
*r {q} {r} Φ {p}
Or
(b) (i) Prove that there exists a DFA for every ε - NFA . (8)
(ii) Show that the maximum number of edges in a graph (with no self-loops or
parallel edges) is given by (n(n-1))/2, where n is the number of nodes. (6)
12 (a) (i) Construct Regular expression for the following DFA using Kleene‟s theorem.(10)
0 1
→*A A B
B C B
C A B
(ii) Construct a ε - NFA for the following Regular expression. (6)
(0+1)*(00+11)(0+1)*
Or
Question Paper Code : 11262
4. (b) (i) Construct a minimized automata for the following automata to define the same
language. (10)
a b
→q0 q1 q0
q1 q0 q2
q2 q3 q1
*q3 q3 q0
q4 q3 q5
q5 q6 q4
q6 q5 q6
q7 q6 q3
(ii) Prove that “If two states are not distinguished by table filling algorithm then the
states are equivalent”. (6)
13 (a) (i) Prove that if „w‟ is a string of a language then there is a parse tree which yield „w‟
and also prove that if A => w then it implies that „w‟ is a string of the language L
defined by a CFG. (6)
(ii) Prove that the expression grammar is ambiguous. (4)
𝐸 → 𝐸 + 𝐸|𝐸 ∗ 𝐸|(𝐸)|𝑎
(iii) Construct a CFG for the set 𝑎𝑖
𝑏 𝑗
𝑐 𝑘
𝑖 ≠ 𝑗 or j≠ 𝑘}. (6)
Or
(b) (i) Prove that if there exists a PDA that accepts by final state then there exists an
equivalent PDA that accepts by Null state. (8)
(ii) Construct a PDA to accept language 0n
1
2n
by empty stack. (8)
14 (a) (i) Prove that every grammar with ε productions can be converted to an equivalent
grammar without ε productions. (4)
(ii) Reduce the following grammar to Chomsky normal form. (8)
𝑆 → 𝑎 | 𝐴𝐴𝐵 𝐴 → 𝑎𝑏 | 𝑎𝐵 | ∈ 𝐵 → 𝑎𝑏𝑎 | ∈
(iii) Convert the following grammar to Greibach normal form. (4)
𝑆 → 𝑎 | 𝐴𝐵 𝐴 → 𝑎 | 𝐵𝐶 𝐵 → 𝑏 𝐶 → 𝑏.
Or
(b) (i) Construct a Turing machine to accept the language an
bn
cn
. (8)
(ii) Construct a Turing machine to perform proper subtraction. (8)
15 (a) Prove that the universal language Lu is recursively enumerable but not recursive. Also
prove that the language Ld is not recursive or recursively enumerable. (12+4)
Or
(b) Prove that PCP problem is undecidable and explain with an example. (10+6)
All the Best – No substitute for hard work.
Mr. G. Appasami SET, NET, GATE, M.Sc., M.C.A., M.Phil., M.Tech., (P.hd.), MISTE, MIETE, AMIE, MCSI, MIAE, MIACSIT,
MASCAP, MIARCS, MISIAM, MISCE, MIMS, MISCA, MISAET, PGDTS, PGDBA, PGDHN, PGDST, (AP / CSE / DRPEC).
5. Reg. No. :
B.E. / B.Tech. DEGREE EXAMINATION, NOVEMBER / DECEMBER 2011
Fifth Semester
Computer Science and Engineering
CS2303 – THEORY OF COMPUTATION
(Regulation 2008)
Time : Three hours Maximum : 100 marks
Answer ALL Questions
Part A – (𝟏𝟎 × 𝟐 = 𝟐𝟎 marks)
11. What is structural induction?
12. State the difference between NFA and DFA.
13. Construct a DFA for the following :
(a) All strings that contain exactly 4 zeros.
(b) All strings that don't contain the substring 110.
14. Is the set of strings over the alphabet {0} of the form 0n
where n is not a prime is regular?
Prove or disprove.
15. Is the grammar below ambiguous S → SS | (S) | S(S)S | E?
16. Convert the following grammar into an equivalent one with no unit productions and no
useless symbols S → ABA A → aAA|aBC|bB B → A|bB|Cb C → CC|cC.
17. Design a TM that accepts the language of odd integers written in binary.
18. State the two normal forms and give an example.
19. How to prove that the Post Correspondence Problem is Undecidable.
20. Show that any PSPACE-hard language is also NP-hard.
Part B – (5 × 𝟏𝟔 = 𝟖𝟎 marks)
11 (a) (i) Prove that 2 is not rational. (8)
(ii) Construct a DFA accepting all strings w over {0, 1} such that the number of 1’s in
w is 3 mod 4. (8)
Or
(b) Construct a minimized DFA from the regular expression (𝑥 + 𝑦)𝑥(𝑥 + 𝑦) ∗. Trace
for a string 𝑤 = 𝑥𝑥𝑦𝑥. (16)
12 (a) State and explain the conversion of DFA into regular expression using Arden's
theorem. Illustrate with an example. (16)
Or
(b) (i) What are the closure property of regular sets? (8)
(ii) Define regular expression. Show that
(1+00*1)+(1+00*1)(0+10*1)*(0+10*1)=0*l(0+10*l)* (8)
Question Paper Code : 66281
6. 13. (a) (i) Is NPDA (Nondeterministic PDA) and DPDA (Deterministic PDA) equivalent?
Illustrate with an example. (8)
(ii) What are the different types of language acceptances by a PDA and define them.
Is it true that the language accepted by a PDA by these different types provides
different languages? (8)
Or
(b) (i) Convert the grammar 𝑆 → 𝑎𝑆𝑏|𝐴, 𝐴 → 𝑏𝑆𝑎|𝑆|€ to a PDA that accepts the same
language by empty stack. (10)
(ii) If 𝑆 → 𝑎𝑆𝑏|𝑎𝐴𝑏, 𝐴 → 𝑏𝐴𝑎, 𝐴 → 𝑏𝑎 is the context free grammar. Determine the
context free language. (6)
14. (a) (i) State the techniques for Turing machine construction? Illustrate with a simple
language. (6)
(ii) Explain the different models of Turing machines. (10)
Or
(b) (i) What are the closure properties of CFL? State the proof for any two properties.(8)
(ii) State the Pumping lemma for CFLs. What is its main application? Give two
examples. (8)
15. (a) (i) State the halting problem of TMs. Prove that the halting problem of Turing
Machine over {0, 1}* as unsolvable. (8)
(ii) Let Σ = {a, b}*. Let A and B he lists of three strings as given below:
𝐴 = (𝑏, 𝑏𝑎𝑏3, 𝑏𝑎) 𝐵 = {𝑏3, 𝑏𝑎 , 𝑎}
Does this instance of PCP have a solution? Justify your answer. (8)
Or
(b) Write short notes on:
(i) Recursive and recursively enumerable languages. (8)
(ii) NP hard and NP complete problems. (8)
All the Best – No substitute for hard work.
Mr. G. Appasami SET, NET, GATE, M.Sc., M.C.A., M.Phil., M.Tech., (P.hd.), MISTE, MIETE, AMIE, MCSI, MIAE, MIACSIT,
MASCAP, MIARCS, MISIAM, MISCE, MIMS, MISCA, MISAET, PGDTS, PGDBA, PGDHN, PGDST, (AP / CSE / DRPEC).
7. Reg. No. :
B.E. / B.Tech. DEGREE EXAMINATION, MAY / JUNE 2012
Fifth Semester
Computer Science and Engineering
CS2303/CS53/10144/CS1303/CS504 – THEORY OF COMPUTATION
(Regulation 2008)
Time : Three hours Maximum : 100 marks
Answer ALL Questions
Part A – (𝟏𝟎 × 𝟐 = 𝟐𝟎 marks)
21. What is proof by contradiction?
22. Define ε – closure (q) with an example.
23. Construct NFA for the regular expression a* b*.
24. Is the regular set closed under complementation? Justify.
25. Specify the use of context free grammar.
26. Define parse tree with an example.
27. State pumping lemma for CFL.
28. What is Chomsky normal form?
29. Mention the difference between P and NP problems.
30. What is meant by recursively enumerable language?
Part B – (5 × 𝟏𝟔 = 𝟖𝟎 marks)
11 (a) (i) Prove by mathematical induction on 𝑛 that 𝑖𝑛
𝑖=0 =
𝑛(𝑛+1)
2
(6)
(ii) Construct a DFA accepting binary strings such that the third symbol from the
right end is ⊥. (10)
Or
(b) (i) Convert an NFA without ε – transition for the NFA given below. (8)
(ii) Construct an NFA accepting binary strings with two consecutive o‟s. (8)
ε
q0 q1
0 1
Question Paper Code : 10270
8. 12 (a) (i) Obtain minimized finite automata for the regular expressions (b/a)*baa. (10)
(ii) Prove that there exists an NFA with ε – transitions that accepts the regular
expression 𝛾. (6)
Or
(b) (i) Which of the following languages is regular? Justify (8)
(1) L = {an
bm
/ 𝑛, 𝑚 ≥ ⊥}
(2) L = {an
bn
/ 𝑛 ≥ ⊥}.
(ii) Obtain the regular expressions for the finite automata. (8)
13 (a) (i) Is the grammar 𝐸 → 𝐸 + 𝐸/𝐸 ∗ 𝐸/𝑖𝑑 ambiguous? Justify. (6)
(ii) Find the context free languages for the following grammars. (10)
S → asbs / bsas / ε
S → asb / ab
Or
(b) (i) Construct PDA for the language L = {𝑤𝑤R
| 𝑤 is in (a+b)*}. (10)
(ii) Discuss the equivalence between PDA and CFG. (6)
14 (a) (i) Find the Greibach normal form for the grammar. (10)
S → AA / ⊥
A → SS / θ
(ii) Explain any two higher level techniques for Turing machines construction. (6)
Or
(b) (i) Construct Turing machines for 𝐿 = { ⊥ 𝑛
𝜃 𝑛
⊥ 𝑛
/ 𝑛 ≥⊥ }. (8)
(ii) Discuss the closure properties of CFLs. (8)
15 (a) (i) Explain undecidability with respect to post correspondence problem. (8)
(ii) Discuss the properties of recursive languages. (8)
Or
(b) (i) Explain any two undecidable problems with respect to Turing Machine. (8)
(ii) Discuss the difference between NP-complete and NP-hard problems. (8)
All the Best – No substitute for hard work.
Mr. G. Appasami SET, NET, GATE, M.Sc., M.C.A., M.Phil., M.Tech., (P.hd.), MISTE, MIETE, AMIE, MCSI, MIAE, MIACSIT,
MASCAP, MIARCS, MISIAM, MISCE, MIMS, MISCA, MISAET, PGDTS, PGDBA, PGDHN, PGDST, (AP / CSE / DRPEC).
bb
start q1 q3q2
a a
9. Reg. No. :
B.E. / B.Tech. DEGREE EXAMINATION, NOVEMBER / DECEMBER 2012
Fifth Semester
Computer Science and Engineering
CS2303/CS53/10144/CS504/CS1303 – THEORY OF COMPUTATION
(Regulation 2008/2010)
Time : Three hours Maximum : 100 marks
Answer ALL Questions
Part A – (𝟏𝟎 × 𝟐 = 𝟐𝟎 marks)
31. Define:
a) Finite Automaton (FA)
b) Transition diagram.
32. State the principle of induction.
33. Give regular expressions for the following.
LI = set of all strings of 0 and 1 ending in 00.
L2 = set of all strings of 0 and 1 beginning with 0 and ending with 1.
34. Differentiate regular expression and regular language.
35. What is an ambiguous grammar? Give example.
36. What are the different types of language accepted by a PDA and define them?
37. State the pumping lemma for CPIs.
38. What are the applications of Turing Machine?
39. When we say a problem is decidable? Give an example of undecidable problem.
40. What is recursively enumerable language?
Part B – (5 × 𝟏𝟔 = 𝟖𝟎 marks)
11 (a) (i) Explain the different forms of proof with examples. (8)
(ii) Provo that, if L is accepted by an NFA with ε-transitions, then L is accepted by an
NFA without ε-transitions. (8)
Or
(b) (i) Prove that if n is a positive integer such that n mod 4 is 2 or 3 then n is not a
perfect square. (6)
(ii) Construct a DFA that accept the following language.
{ x € {a, b}: |x|a = odd and |x|b = even }. (10)
Question Paper Code : 11278
10. 12 (a) (i) Using pumping lemma for the regular sets, prove that the language
L = { am
bn
| 𝑚 > 𝑛 } is not regular. (10)
(ii) Prove any two closure properties of regular languages. (6)
Or
(b) Construct a minimized DFA that can be derived from the following regular expression
0*(01)(0/111)*. (16)
13 (a) (i) Consider the following grammar for list structures : (10)
S → a/^/(T) T → T, S | S.
Find left most derivation, rightmost derivation and parse tree for
(((a , a) , ^ (a)),a).
(ii) Construct the FDA accepting the language {(ab)n
| 𝑛 ≥ 1}by empty stack. (6)
Or
(b) (i) Construct a transition table for PDA which accepts the language
L = {a2n
bn
| 𝑛 ≥ 1}. Trace your PDA for the input with n = 3. (10)
(ii) Find the PDA equivalent to the given CFG with the following productions.
S → A, A → BC, B → ba, C → ac. (6)
14 (a) (i) Convert the following grammar into CNF
S → cBA, S → A, A → cB, A→ AbbS, B → aaa. (10)
(ii) State and prove the pumping lemma for CFL. (6)
Or
(b) (i) Design a Turing machine which reverses the given string {abb}. (8)
(ii) Write briefly about the programming techniques for TM. (8)
15 (a) (i) If L1 and L2 are recursive language then L1 U L2 is a recursive language. (6)
(ii) Prove that the halting problem is undecidable. (10)
Or
(b) (i) State and prove the post's correspondence problem. (10)
(ii) Write a note on NP problems. (6)
All the Best – No substitute for hard work.
Mr. G. Appasami SET, NET, GATE, M.Sc., M.C.A., M.Phil., M.Tech., (P.hd.), MISTE, MIETE, AMIE, MCSI, MIAE, MIACSIT,
MASCAP, MIARCS, MISIAM, MISCE, MIMS, MISCA, MISAET, PGDTS, PGDBA, PGDHN, PGDST, (AP / CSE / DRPEC).
11. Reg. No. :
B.E. / B.Tech. DEGREE EXAMINATION, MAY / JUNE 2013
Fifth Semester
Computer Science and Engineering
CS2303/CS53/10144/CS504 – THEORY OF COMPUTATION
(Regulation 2008/2010)
Time : Three hours Maximum : 100 marks
Answer ALL Questions
Part A – (𝟏𝟎 × 𝟐 = 𝟐𝟎 marks)
41. What is meant by DFA?
42. Define the term Epsilon transition.
43. What is a regular expression?
44. Name any four closure properties of Regular languages.
45. What is a CFG?
46. Define the term Ambiguity in grammars.
47. What is meant by Greibach Normal Form?
48. List the closure properties of Context Free Languages.
49. What is meant by recursively enumerable language?
50. Define the class NP problem.
Part B – (5 × 𝟏𝟔 = 𝟖𝟎 marks)
11 (a) (i) Construct DFA to accept the language. (10)
𝐿 = { 𝑤 | 𝑤 is of even length and begins with 11 }
(ii) Write a note on NFA and compare with DFA. (6)
Or
(b) (i) Convert the following NFA to a DFA. (10)
δ a b
p {p} {p, q}
q {r} {r}
r {ϕ} { ϕ }
(ii) Discuss on the relation between DFA and minimal DFA. (6)
Question Paper Code : 21308
12. 12 (a) (i) Discuss on regular expressions (8)
(ii) Discuss in detail about the closure properties of regular languages. (8)
Or
(b) (i) Prove that the following languages are not regular. (8)
(1) {O2n
| 𝑛 ≥ 1}
(2) {am
bn
am+n
| 𝑚 ≥ 1 and 𝑛 ≥ 1}
(ii) Discuss on equivalence and minimization of automata. (8)
13 (a) (i) Explain about Parse trees. For the following grammar (8)
S → aB | bA
A → a | aS | bAA
B → b | bS | aBB
For the string aaabbabbba, Find
(1) Leftmost derivation
(2) Rightmost derivation
(3) Parse tree.
(ii) Construct PDA for the language L = {𝑤𝑤R
| 𝑤 in (a+b)*}. (8)
.
Or
(b) Explain in detail about equivalence of Pushdown automata and CFG. (16)
14 (a) (i) Construct the following grammar in CNF (8)
A → BCD | b
A → Yc | d
C → gA| c
D → dB | a
Y → f.
(ii) Discuss about programming techniques for Turing machines. (8)
Or
(b) (i) Explain about the closure properties of CFL. (8)
(ii) Explain in detail about Pumping lemma for CFL. (8)
15 (a) (i) Explain about “A language that is not Recursively Enumerable”. (8)
(ii) Prove Lne is recursively enumerable. (8)
Or
(b) (i) Discuss on undecidable problems about Turing Machine. (10)
(ii) Explain about the PCP. (6)
All the Best – No substitute for hard work.
Mr. G. Appasami SET, NET, GATE, M.Sc., M.C.A., M.Phil., M.Tech., (P.hd.), MISTE, MIETE, AMIE, MCSI, MIAE, MIACSIT,
MASCAP, MIARCS, MISIAM, MISCE, MIMS, MISCA, MISAET, PGDTS, PGDBA, PGDHN, PGDST, (AP / CSE / DRPEC).
13. Reg. No. :
B.E. / B.Tech. DEGREE EXAMINATION, NOVEMBER / DECEMBER 2013
Fifth Semester
Computer Science and Engineering
CS2303/CS53/10144/CS504/CS1303 – THEORY OF COMPUTATION
(Regulation 2008/2010)
Time : Three hours Maximum : 100 marks
Answer ALL Questions
Part A – (𝟏𝟎 × 𝟐 = 𝟐𝟎 marks)
51. Draw the transition diagram (automata) for an identifier.
52. What is a non deterministic finite automaton?
53. State the pumping lemma for regular languages.
54. Construct NFA equivalent to the regular expression : (0+1)01.
55. Construct the CFG for the language L = { an
𝑏n
| 𝑛 ≥ 1 }.
56. Compare NFA and PDA.
57. What are the closure properties of CFL?
58. List out the different techniques for Turing Machine construction.
59. What are (a) recursively enumerable languages (b) recursive sets?
60. What is universal Turing machine?
Part B – (5 × 𝟏𝟔 = 𝟖𝟎 marks)
11 (a) (i) Explain steps in conversion of NFA to DFA. Convert the following NFA to DFA.
(8)
(ii) Prove that, if L is accepted by an NFA with ε transition, then L is accepted by an
NFA without ε transition. (8)
Or
(b) (i) Prove the equivalence of NFA and DFA using subset construction. (8)
(ii) Give deterministic finite automata accepting the following languages over the
alphabet. (8)
(1) Number of 1‟s is a multiples of 3.
(2) Number of 1‟s is not a multiples of 3.
12 (a) (i) Convert the following NFA into regular expression. (8)
(ii) Discuss the closure properties of regular languages. (8)
Or
(b) (i) Discuss the applications of finite automaton. (6)
0+10start A CB
0, 1
0, 1
D
10start q0 q2q1
0, 1
Question Paper Code : 31308
14. (ii) Using pumping lemma for regular sets prove that the language
L = {0 𝑚
1 𝑛
0 𝑚+𝑛
| 𝑚 ≥ 1𝑎𝑛𝑑 𝑛 ≥ 1}) is not regular. (10)
13. (a) (i) Convert the following grammar into GNF. (8)
S → XY1 / 0
X → 00X / Y
Y → 1X1
(ii) Give formal pushdown automata that accepts { 𝑤𝑐𝑤R
| 𝑤 𝑖𝑛 0 + 1 ∗ } by empty
stack. (8)
Or
(b) (i) Show that the following grammars are ambiguous. (6)
{ S → aSbS / bSaS / λ } and
{ S → AB / aaB, A → a / Aa, B → b }
(ii) Prove the equivalence of PDA and CFL. (10)
14. (a) (i) Explain Turing machine as a computer of integer functions with an example. (10)
(ii) Remove ε productions from the given grammar. (6)
Or
(b) Write short notes on the following:
(i) Two-way infinite tape TM. (8)
(ii) Multiple tracks TM. (8)
15. (a) (i) Write the classes and definition of NP problems. (6)
(ii) Prove that for two recursive languages L1 and L2 their union and intersection is
recursive. (10)
Or
(b) (i) Prove that if a language is recursive if and only if it and its complement are both
recursively enumerable. (8)
(ii) Explain about undecidability of PCP. (8)
All the Best – No substitute for hard work.
Mr. G. Appasami SET, NET, GATE, M.Sc., M.C.A., M.Phil., M.Tech., (P.hd.), MISTE, MIETE, AMIE, MCSI, MIAE, MIACSIT,
MASCAP, MIARCS, MISIAM, MISCE, MIMS, MISCA, MISAET, PGDTS, PGDBA, PGDHN, PGDST, (AP / CSE / DRPEC).
15. Reg. No. :
B.E. / B.Tech. DEGREE EXAMINATION, MAY / JUNE 2014
Fifth Semester
Computer Science and Engineering
CS2303/CS53/10144/CS504 – THEORY OF COMPUTATION
(Regulation 2008/2010)
Time : Three hours Maximum : 100 marks
Answer ALL Questions
Part A – (𝟏𝟎 × 𝟐 = 𝟐𝟎 marks)
61. What is a finite automaton?
62. Enumerate the difference between DFA and NFA.
63. Construct a finite automaton for the regular expression 0*1*
64. Mention the closure properties of regular languages.
65. Construct a CFG for the language of palindrome strings over {a, b}.
66. What do you say a grammar is ambiguous?
67. State pumping Lemma for context free languages.
68. Define a turing machine.
69. When a language is said to be recursively enumerable?
70. Define the classes P and NP.
Part B – (5 × 𝟏𝟔 = 𝟖𝟎 marks)
11 (a) (i) Prove the following by the principle of induction: 𝑘2𝑛
𝑘=1 =
𝑛 𝑛+1 (2𝑛+1)
6
. (8)
(ii) Construct a DFA that accepts all strings on {0, 1} except those containing the
substring 101. (8)
Or
(b) (i) Construct a non-deterministic finite automaton accepting the set of strings over
(𝑎, 𝑏) ending in aba. Use it to construct a DFA accepting the same set of strings.
(10)
(ii) Construct NFA with ∈ moves which accepts a language consisting the strings of
any number of a's, followed by any number of b's, followed by any number of c's.
(6)
12 (a) (i) Design a finite automaton for the regular expression (0+1)*(00+11)(0+1*). (8)
(ii) Prove that L ={0𝑖2
/ i is an integer; 𝑖 ≥ 1 } is not regular. (8)
Or
(b) (i) Prove that the class of regular sets is closed under complementation. (6)
(ii) Minimize the finite automaton shown in figure below and show both the given
and the reduced one are equivalent. (10)
Question Paper Code : 51348
16. 13 (a) (i) If G is a grammar S → SbS / a, show that G is ambiguous. (6)
(ii) Let M= ({q0, q1}, {0, 1}, {x, z0}, δ, q0, z0, ϕ) where δ is given by (10)
δ(q0,0, z0) = {( q0, xz0)}
δ(q1,1, x) = {( q1, ∈)}
δ(q0,0, x) = {( q0, xx)}
δ(q1, ∈, x) = {( q1, ∈)}
δ(q0, 1, x) = {( q1, ∈)}
δ(q1, ∈, z0) = {( q1, ∈)}
Construct a CFG for the PDAM.
Or
(b) (i) Construct a Push down Automata to accept the language L = {an
bn
/ 𝑛 ≥ 1} by
empty stack and by final state. (10)
(ii) Convert the grammar S → 0S1 / A; A → 1A0 / S / ∈ into a PDA that accepts the
same language by empty stack. Check whether 0101 belongs to N(M). (6)
14 (a) (i) Define Chomsky normal form. Find an equivalent grammar in CNF for the
grammar G = ({S, A, B}, {a, b}, P, S) with productions S → bA / aB;
A → bAA / aS / a; B → aBB / bS / b. (8)
(ii) Show that the Language L = {ai
bi
ci
/ 𝑖 ≥ 1} is not contest free. (8)
Or
(b) (i) Design a Twinning machine to accept the language L = {0n
1n
/ 𝑛 ≥ 1} and
simulate its action on the input 0011. (12)
(ii) Write short note on checking off symbols (4)
15 (a) Define diagonalization language. Show that the language Ld is not a recursively
enumerable language. (16)
Or
(b) (i) Prove that the universal language is recursively enumerable. (10)
(ii) Define Post correspondence problem. Let Σ = {0, 1}. Let A and B be the lists of
three strings, each defined as
List A List B
i wi xi
1 1 111
2 10111 10
3 10 0
Does this PCP have a solution.
All the Best – No substitute for hard work.
Mr. G. Appasami SET, NET, GATE, M.Sc., M.C.A., M.Phil., M.Tech., (P.hd.), MISTE, MIETE, AMIE, MCSI, MIAE, MIACSIT,
MASCAP, MIARCS, MISIAM, MISCE, MIMS, MISCA, MISAET, PGDTS, PGDBA, PGDHN, PGDST, (AP / CSE / DRPEC).
q0
1
1
start
q1
q4
q3
1
q2
1
0
0,1
0
0 0
17. Reg. No. :
B.E. / B.Tech. DEGREE EXAMINATION, NOVEMBER / DECEMBER 2014
Fifth Semester
Computer Science and Engineering
CS2303/CS53/10144/CS504/CS1303 – THEORY OF COMPUTATION
(Regulation 2008/2010)
Time : Three hours Maximum : 100 marks
Answer ALL Questions
Part A – (𝟏𝟎 × 𝟐 = 𝟐𝟎 marks)
71. Define Deductive proof.
72. Design DFA to accept strings over Σ = (0,1) with two consecutive 0‟s
73. Prove or disprove that (r + s)* = r* + s* .
74. State the pumping lemma for regular languages.
75. Give the general forms of CNF.
76. Show that CFLs are closed under substitutions.
77. Let G be the grammar S→aB|bA A→a|aS|bAA B→b|S|aBB . For the string aaabbabbba, find
(a) LMD and (b) RMD
78. Define Diagonalization (Ld) Language.
79. Define multitape turing machine.
80. Give examples for NP-complete problems.
Part B – (5 × 𝟏𝟔 = 𝟖𝟎 marks)
11 (a) (i) Prove that every tree has 'e' edges and 'e + l' nodes. (6)
(ii) Prove that for every integer is n≥0 the number 42n+1
+ 3n+2
is a multiple of 13. (10)
Or
(b) (i) Let L be a set accepted by a NFA and then prove that there exists a DFA that
accepts L. (10)
(ii) Construct a DFA equivalent to the NFA. M=({a, b, c, d), (0,1), δ, a, {b, d}) where
δ is a defined as (6)
δ 0 1
a {b, d} {b}
b c {b, c}
c d a
d - a
12 (a) Construct a minimized DFA for the RE 10 + (0 +11) 0*1. (16)
Or
(b) (i) Show L ={0 𝑛2
/ is an integer, 𝑛 ≥ 1}) is not regular. (6)
(8)
(ii) Explain the DFA minimization algorithm with an example. (10)
Question Paper Code : 91350
18. 13. (a) (i) Write a grammar G to recognize all prefix expressions involving all binary
arithmetic operators. Construct a parse tree for the sentence '-* + abc/de' using G?
(6)
(ii) Show that the following grammar G is ambiguous S → SbS / a. (6)
(iii) Construct a context free grammar for {0m
1n
/ 1 ≤ 𝑚 ≤ 𝑛}. (4)
Or
(b) (i) If L is context free language prove that there exists a PDA M, such that
𝐿 = 𝑁(𝑀). (8)
(ii) Prove that If L is N(M1) (the language accepted by empty stack) for some PDA
M1, then L is N(M2) (the language accepted by final state) for some PDA M2. (8)
14. (a) (i) Find a grammar G' in CNF form equivalent to G,
S → a AD, A → aB / bAB, B → b, D → d. (6)
(ii) Convert to GNF the grammar G, G = ({A1, A2, A3), {a, b}, P, A1) where P
consists of the following A1→ A2A3, A2→ A3A1 /b, A3 → A1A2 / a . (10)
Or
(b) (i) Design a TM, M to implement the function "MULTIPLICATION" using the
subroutine "COPY'. (12)
(ii) Show that language {0n
1n
2 n
/ 𝑛 ≥ 1} is not context free language. (4)
15. (a) (i) Show that the union of two recursive language is recursive & union of two
recursively enumerable language is recursive. (12)
(ii) Define the language Lu and show that Lu is RE language. (4)
Or
(b) State and Prove Post Correspondence Problem and Give example. (16)
All the Best – No substitute for hard work.
Mr. G. Appasami SET, NET, GATE, M.Sc., M.C.A., M.Phil., M.Tech., (P.hd.), MISTE, MIETE, AMIE, MCSI, MIAE, MIACSIT,
MASCAP, MIARCS, MISIAM, MISCE, MIMS, MISCA, MISAET, PGDTS, PGDBA, PGDHN, PGDST, (AP / CSE / DRPEC).
19. Reg. No. :
B.E. / B.Tech. DEGREE EXAMINATION, APRIL / MAY 2015
Fifth Semester
Computer Science and Engineering
CS2303/CS53/10144/CS504/CS1303 – THEORY OF COMPUTATION
(Regulation 2008/2010)
Time : Three hours Maximum : 100 marks
Answer ALL Questions
Part A – (𝟏𝟎 × 𝟐 = 𝟐𝟎 marks)
81. Any set A, B and C, if 𝐴 ∩ 𝐵 = 𝜙 and C B then 𝐴 ∩ 𝐶 = 𝜙. Prove by induction.
82. Prove for every 𝑛 ≥ 1 by mathematical induction 𝑖2𝑛
𝑖 = n n + 1 (n + 2)/6.
83. Give the English description of the following language (0+10)*1*.
84. Construct NFA-^ for 1*(01)*.
85. Generate CFG for (011+1)*.
86. Construct a parse tree of (a + b)*c for the grammar E → E+E / E*E / (E) / id.
87. Differentiate PDA acceptance by empty stack method with acceptance by final state method.
88. Define – Pumping lemma for CFL.
89. Define RE language.
90. Differentiate recursive and non-recursively languages.
Part B – (5 × 𝟏𝟔 = 𝟖𝟎 marks)
11 (a) Design a DFA accept the following strings over the alphabets {0, 1}. The set of all
string that contains a pattern 11. Prove this using mathematical induction.
Or
(b) Design a NFA accepts the following strings over the alphabets {0, 1}. The set of all
string that begin with 01 and ends with 11. Check for the validity of 01111 and 0110
strings.
12 (a) Find the min-state DFA for (0+1)*10.
Or
(b) Find the regular expression of a language that consists of set of string starts with 11 as
well as ends with 00 using Rij formula.
Question Paper Code : 71386
20. 13 (a) Construct a PDA for the given grammar S → aSa | bSb | c.
Or
(b) Construct a PDA for the given language L = { x € {a, b}* | na(x) > nb(x) }.
14 (a) Construct a TM to perform copy operation.
Or
(b) Given the CFG G, find CFG G' in CNF generating the language L(G) – {^}.
S → AACD A → aAb | ^ C → aC | a D → aDa | bDb | ^
15 (a) Explain Post Correspondence Problems and decidable and undecidable problems with
examples.
Or
(b) Explain the class P and NP problems with suitable example.
All the Best – No substitute for hard work.
Mr. G. Appasami SET, NET, GATE, M.Sc., M.C.A., M.Phil., M.Tech., (P.hd.), MISTE, MIETE, AMIE, MCSI, MIAE, MIACSIT,
MASCAP, MIARCS, MISIAM, MISCE, MIMS, MISCA, MISAET, PGDTS, PGDBA, PGDHN, PGDST, (AP / CSE / DRPEC).
21. Reg. No. :
B.E. / B.Tech. DEGREE EXAMINATION, NOVEMBER / DECEMBER 2015
Fifth Semester
Computer Science and Engineering
CS2303/CS53/10144/CS504/CS1303 – THEORY OF COMPUTATION
(Regulation 2008/2010)
Time : Three hours Maximum : 100 marks
Answer ALL Questions
Part A – (𝟏𝟎 × 𝟐 = 𝟐𝟎 marks)
91. Define the term NFA.
92. What is meant by Epsilon transition?
93. List the operators used in the Regular Expression and their precedence.
94. Mention any four Closure properties of Regular Languages.
95. Define the term Parse tree.
96. What is meant by ambiguity in Grammars?
97. Define the term Chomsky Normal Form.
98. List the components of Turing Machine.
99. What is meant by recursively enumerable language?
100. Define PCP.
Part B – (5 × 𝟏𝟔 = 𝟖𝟎 marks)
11 (a) (i) Construct DFA to accept the language L ={ w | w is of even length and begins
with 10} (10)
(ii) Discuss on Finite Automata with Epsilon transitions. (6)
Or
(b) (i) Convert the following NFA to a DFA. (10)
0 1
p {p, q} {p}
q {r, s} {t}
r {p, r} {t}
*
s ϕ ϕ
*
t ϕ ϕ
(ii) Discuss on the relation between DFA and Minimal DFA. (6)
12 (a) (i) Explain about Finite Automata and Regular Expressions. (8)
(ii) Discuss about the closure properties of Regular Languages. (8)
Or
(b) (i) Prove that the following languages are not regular. (8)
{0n
1m
| 𝑛 ≤ 𝑚 }
{0n
12n
| 𝑛 ≥ 1 }
(ii) Discuss on equivalence and minimization of Automata. (8)
Question Paper Code : 21386
22. 13 (a) Discuss the following:
(i) CFG and Parse trees. (6)
(ii) Ambiguity in Context Free Grammars with example. (10)
Or
(b) (i) Construct PDA for the language. (10)
L = { wwR
| w is in {0, 1}*
}.
(ii) Discuss on deterministic PDA. (6)
14 (a) (i) Construct the following grammar in CNF. (8)
S → ABC | BaB
A → aA | BaC | aaa
B → bBb | a | D
C → CA | AC
D → ε.
(ii) Discuss on Turing Machine. (8)
Or
(b) (i) List and explain the closure properties of CFL. (8)
(ii) Explain in detail about the programming techniques for Turing Machines. (8)
15 (a) (i) Explain about “A language that is not Recursively Enumerable”. (8)
(ii) Prove that Lne is not recursive. (8)
Or
(b) (i) Discuss on undecidable problems about Turing Machine. (10)
(ii) Explain about the universal language. (6)
All the Best – No substitute for hard work.
Mr. G. Appasami SET, NET, GATE, M.Sc., M.C.A., M.Phil., M.Tech., (P.hd.), MISTE, MIETE, AMIE, MCSI, MIAE, MIACSIT,
MASCAP, MIARCS, MISIAM, MISCE, MIMS, MISCA, MISAET, PGDTS, PGDBA, PGDHN, PGDST, (AP / CSE / DRPEC).
23. Reg. No. :
B.E. / B.Tech. DEGREE EXAMINATION, MAY / JUNE 2016
Fifth Semester
Computer Science and Engineering
CS2303/CS53/10144/CS504/CS1303 – THEORY OF COMPUTATION
(Regulation 2008/2010)
Time : Three hours Maximum : 100 marks
Answer ALL Questions
Part A – (𝟏𝟎 × 𝟐 = 𝟐𝟎 marks)
101. Prove by mathematical induction that for 𝑛 ≥ 2, then 𝑛3
− 𝑛 is always divisible by 3.
102. Give two strings that are accepted and two strings rejected by the following finite
automata M = ({ q0, q1, q2}, {0, 1}, δ , q0, {q1}).
103. Find a string of minimum length in {x, y}* not in the language corresponding to the
given regular expression.
(a) x*(y + xy)*x*
(b) (x* + y*) (x* + y*) (x* + y*)
104. State whether Regular Languages are closed under intersection and complementation.
Give an example for intersection.
105. Show that the context free grammar with the following productions is ambiguous.
G = ({S, A, B}, {a, b}, {S → AB, A → aAB | ab, B → abB | λ}, S)
106. Define Push down Automata.
107. State the advantages of Turing machine over other automata.
108. State the pumping lemma for Context Free languages.
109. Differentiate between recursive and recursively enumerable languages.
110. State the class of P problem with an example.
Part B – (5 × 𝟏𝟔 = 𝟖𝟎 marks)
11 (a) Use mathematical induction to solve the problem of Fibonacci series and examine
the relationship between recursive definition and proof by induction. Also state
the inductive proofs. (16)
Or
(b) State the Thompson construction algorithm and subset construction algorithm.
Construct finite automata for generating any float point number with an
exponential factor for example numeric value of the form 1.23 e-10
. Trace for a
string. (16)
12 (a) Design a minimized DFA by converting the following regular expression to NFA,
NFA-λ and to DFA over the alphabet Σ = {a, b, c}*. RE=a(a+b+c)* (a+b+c). (16)
Or
0, 10, 1start q0 q1 q2
10
Question Paper Code : 21386
24. (b) (i) Determine whether the following languages are regular or not with proper
justification. (8)
(i) L1 = { an
𝑏𝑐3n
| 𝑛 ≥ 0 }
(ii) L2 = { a5n
| 𝑛 ≥ 0 }
(ii) Construct Deterministic finite Automata that recognize the regular expression
defined over the alphabet Σ = {0, 1}. RE = (1 + 110)*0. Trace for a string
acceptance and rejection. (8)
13 (a) Consider the following grammar:
E → E + T | T
T → T * F | F
F → (E) | id
(i) Give a rightmost derivation and leftmost derivation for the sentence
𝑤 = 𝑖𝑑 ∗ (𝑖𝑑 + 𝑖𝑑) ∗ 𝑖𝑑. (8)
(ii) Is the Grammar Ambiguous? Justify. (4)
(iii) Construct the parse tree for the sentence in 13 (a) (i). (4)
Or
(b) (i) Differentiate between Deterministic Push down Automata and Non-Deterministic
Push down Automata. (6)
(ii) Construct Push down Automata to recognize the grammar G with following
productions and trace for a string of acceptance and rejection. (10)
S → aSA | €
A→ bB | cc
B→ bd | €
14 (a) (i) Define the two normal forms that are to be converted from a Context Free
grammar (CFG). Convert the following CFG to Chomsky normal forms: (4+6)
S → A | B | C A → aAa | B
B → bB | bb C → aCaa | D
D → baD | abD | aa
(ii) Convert the following CFG G to Greibach normal form generating the same
language. (6)
S → ABA A → aA | λ B → bB | λ
Or
(b) (i) Design a Turing machine to recognize the language L = { an
𝑐𝑏n
| 𝑛 ≥ 0 }. (12)
(ii) State the closure properties of Context free languages. (4)
15 (a) What are the undecidable problems? Explain the same using Post Correspondence
Problem (PCP). Does a PCP solution exist for the following set? (16)
(10, 101), (01, 100), (0, 10), (100, 0), (1, 010)
Or
(b) (i) State any four applications of NP complete problems. (10)
(ii) Prove that if L1 and L2 are Recursively Enumerable language over Σ, then
L1 ∪ L2 and L1 ∩ L2 are also Recursively Enumerable. (6)
All the Best – No substitute for hard work.
Mr. G. Appasami SET, NET, GATE, M.Sc., M.C.A., M.Phil., M.Tech., (P.hd.), MISTE, MIETE, AMIE, MCSI, MIAE, MIACSIT,
MASCAP, MIARCS, MISIAM, MISCE, MIMS, MISCA, MISAET, PGDTS, PGDBA, PGDHN, PGDST, (AP / CSE / DRPEC).
25. Reg. No. :
B.E. / B.Tech. DEGREE EXAMINATION, MAY / JUNE 2016
Fifth Semester
Computer Science and Engineering
CS6503 THEORY OF COMPUTATION
(Regulation 2013)
Time : Three hours Maximum : 100 marks
Answer ALL Questions
Part A – (𝟏𝟎 × 𝟐 = 𝟐𝟎 marks)
111. Draw a non-deterministic finite automata to accept strings containing the substring 0101.
112. State the pumping lemma for regular languages.
113. What do you mean by null production and unit production? Give an example..
114. Construct a CFG fro set of strings that contain equal number of a‟s and b‟s over Σ={a,
b}.
115. Does a Push down Automata have memory? Justify.
116. Define Push down Automata.
117. What are the differences between a Finite automata and a Turing machine?
118. What is Turing machine?
119. When is a Recursively Enumerable language said to be Recursive?
120. Identify whether „Tower of Hanoi‟ problem is tractable or intractable. Justify your
answer.
Part B – (5 × 𝟏𝟔 = 𝟖𝟎 marks)
11 (a) (i) Construct a NFA that accepts all strings hat end in 01. Give its transition table and
extend transition function for the input string 00101. Also construct a DFA for the
above NFA using subset construction method. (10)
(ii) Prove the following by principle of induction. 𝑥2𝑛
𝑥=1 =
𝑛 𝑛+1 (2𝑛+1)
6
. (6)
Or
(b) (i) What is Regular Expression? Write a regular expression for set of strings that
consists of alternating 0‟s and 1‟s. (8)
(ii) Write and explain the algorithm for minimization of a DFA. Using the above
algorithm minimize the following DFA. (8)
A
0 1start
B C D
0
1
0
E
1 1
F G D
0
0
01
1
1
1 0
0
Question Paper Code : 57255
26. 12 (a) (i) Construct a reduced grammar equivalent to the grammar G = (N, T, P, S) where,
N = {S, A, C, D, E} (6)
T = {a, b}
P = { S → aAa, A → Sb, A → bCC, A → DaA, C → abb, C → DD, E → aC,
D → aDA}.
(ii) When is a grammar said to be ambiguous? Explain with the help of example. (5)
(iii) Show the derivation steps and construct derivation tree for the string „ababbb‟. (5)
by using left most derivation with the grammar.
S → AB | ε
A→ aB
B→ Sb
Or
(b) (i) What is the purpose of normalization? Construct the CNF and GNF for the
following grammar and explain the steps. (10)
S → aAa | bBb | ε
A→ C | a
B→ C | b
C→ CDE | ε
D→ A | B | ab
(ii) Construct a CFG for the regular expression (011+1) (01). (6)
13 (a) (i) Construct a Push down Automata to accept the following language L on Σ={a, b}
by empty stack. 𝐿 = {𝑤𝑤R
| 𝑤 ∈ 𝛴+
}. (10)
(ii) What is an instantaneous description that the PDA? How will you represent it?
Also give three important principles of ID and their transactions. (6)
Or
(b) (i) Explain acceptance by final state and acceptance by empty stack of a Push down
Automata. (8)
(ii) State the pumping lemma for CFL. Use pumping lemma to show that the
language 𝐿 = {𝑎i
𝑏j
𝑐k
| 𝑖 < 𝑗 < 𝑘} is not a CFL. (8)
14 (a) (i) Construct a Turing Machine to accept palindromes in an alphabet set Σ={a, b}.
Trace the string “abab” and “baab”. (8)
(ii) Explain the variations of Turing Machine. (8)
Or
(b) (i) Explain Halting problem. Is it solvable or unsolvable problem? Discuss. (8)
(ii) Describe the Chomsky hierarchy of languages with example. What are the
devices that accept these languages? (8)
15 (a) What is Universal Turing Machine? Bring out its significance. Also construct a
Turing Machine to add two numbers and encode it. (16)
Or
(b) What is post correspondence problem (PCP)? Explain with the help of an
example. (16)
All the Best – No substitute for hard work.
Mr. G. Appasami SET, NET, GATE, M.Sc., M.C.A., M.Phil., M.Tech., (P.hd.), MISTE, MIETE, AMIE, MCSI, MIAE, MIACSIT,
MASCAP, MIARCS, MISIAM, MISCE, MIMS, MISCA, MISAET, PGDTS, PGDBA, PGDHN, PGDST, (AP / CSE / DRPEC).
27. Reg. No. :
B.E. / B.Tech. DEGREE EXAMINATION, NOVEMBER / DECEMBER 2015
Fifth Semester
Computer Science and Engineering
CS6503 THEORY OF COMPUTATION
(Regulation 2013)
Time : Three hours Maximum : 100 marks
Answer ALL Questions
Part A – (𝟏𝟎 × 𝟐 = 𝟐𝟎 marks)
121. What is finite automaton?
122. Write a Regular Expression for the set of strings over {0, 1} that have at least one.
123. Let G be a grammar with
S → aB|bA,
A → a|aS|bAA,
B → b|bS|aAA.
for the string aaabbabbba, find the left most derivation.
124. Construct the context free grammar representing the set of palindrome over (0+1)*.
125. What are the different ways of language acceptance by a PDA and define them?
126. Convert the following CFG to a PDA.
S → aAA, A → aS|bS|a.
127. Define a Turing Machine.
128. What is a multi-tape turing machine?
129. State when a problem is said to be decidable and give an example of an undecidable
problem.
130. What is a universal language Lu.
Part B – (5 × 𝟏𝟔 = 𝟖𝟎 marks)
11 (a) (i) Prove that “A language L is accepted by some DFA if and only if L is accepted
by some NFA”. (10)
(ii) Construct Finite Automata equivalent to the regular expression (ab+a)*. (6)
Or
(b) (i) Consider the following ε – NFA for an identifier. Consider the ε – closure of
each state and find it‟s equivalent DFA. (10)
(ii) State the pumping lemma for Regular languages. Show that the set
𝐿={0i2
| 𝑖 ≥ 1}. is not regular. (6)
1 2 3 4
5 6
7 8
9 10letter ε
letter
digit
ε
ε
ε
ε
ε
ε
ε
ε
Question Paper Code : 27173
28. 12 (a) (i) Let G = (V, T, P, S) be a context free grammar then prove that if the recursive
procedure tells us that terminal string w is in the language of variable A, then
there is a parse tree with root A and yield w. (10)
(ii) Given the Grammar G = (V, Σ, R, E), where
V = {E, D, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, +, -, *, /, (, )},
Σ = {1, 2, 3, 4, 5, 6, 7, 8, 9, 0, +, -, *, /, (, )}, and R contains the following rules.
𝐸 → 𝐷|(𝐸)|𝐸 + 𝐸|𝐸 − 𝐸|𝐸 ∗ 𝐸|𝐸/𝐸
𝐷 → 0|1|2| … |9
Find the parse tree for the string 1 + 2 ∗ 3. (6)
Or
(b) (i) Construct a equivalent grammar G in CNF for the grammar G1 where
G1 = ({S, A, B}, {a, b}, { S → ASB|∈, A → aAS|a, B → SbS|A|bb}, S). (10)
(ii) What is an ambiguous grammar? Explain with an Example. (6)
13 (a) (i) Design a Push Down Automata to accept {0n
1n
| 𝑛 > 1}. Draw the transition
diagram for the PDA. Show by instantaneous description that the PDA accepts the
string „0011‟. (10)
(ii) State the pumping lemma for CFL and Show that the language
𝐿={𝑎n
𝑏n
𝑐n
| 𝑖 ≥ 1} is not a CFL. (6)
Or
(b) (i) Construct PDA to CFG. PDA is given by P = ({p, q}, {0, 1}, {X, Z}, δ , q, z), δ is
defined as δ(p, 1, Z) = {(p, XZ)}, δ(p, ∈, Z) = {(p, ∈)}, δ(p, 1, X) = {(p, XX)},
δ(q, 1, X) = {(q, ∈)}, δ(p, 0, X) = {(q, X)}, δ(q, 0, Z) = {(p, Z)}. (10)
(ii) What are deterministic PDA‟s? Give an Example for Non-deterministic PDA
deterministic PDA. (6)
14 (a) (i) Design a Turing Machine to accept L = {0n
1n
| 𝑛 ≥ 1}. Draw the transition
diagram. Also specify instantaneous description to trace the string 0011. (10)
(ii) State and describe the Halting problem for Turing Machine. (6)
Or
(b) (i) Explain the programming techniques for Turing Machine construction. (10)
(ii) Describe the Chomsky hierarchy of languages. (6)
15 (a) (i) Prove that “MPCP reduces to PCP”. (10)
(ii) Discuss about tractable and intractable problems. (6)
Or
(b) (i) State and explain rice theorem. (10)
(ii) Describe about Recursive languages and Recursively Enumerable languages with
examples. (6)
All the Best – No substitute for hard work.
Mr. G. Appasami SET, NET, GATE, M.Sc., M.C.A., M.Phil., M.Tech., (P.hd.), MISTE, MIETE, AMIE, MCSI, MIAE, MIACSIT,
MASCAP, MIARCS, MISIAM, MISCE, MIMS, MISCA, MISAET, PGDTS, PGDBA, PGDHN, PGDST, (AP / CSE / DRPEC).