0% found this document useful (0 votes)
25 views4 pages

TOC 2 Marks Questions Answers

The document provides a series of questions and answers related to the Theory of Computation, covering topics such as regular expressions, finite automata, context-free grammars, and pushdown automata. Key concepts include operators of regular expressions, closure properties, the Pumping Lemma, and definitions of various types of grammars and languages. It also outlines the components and moves of pushdown automata and provides examples of context-free grammars for specific languages.

Uploaded by

Jaswanth Raj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views4 pages

TOC 2 Marks Questions Answers

The document provides a series of questions and answers related to the Theory of Computation, covering topics such as regular expressions, finite automata, context-free grammars, and pushdown automata. Key concepts include operators of regular expressions, closure properties, the Pumping Lemma, and definitions of various types of grammars and languages. It also outlines the components and moves of pushdown automata and provides examples of context-free grammars for specific languages.

Uploaded by

Jaswanth Raj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Theory of Computation - 2 Marks Questions and Answers

Q: List the operators of the Regular Expression.

A: The operators are:

1. Concatenation (AB)

2. Union (A+B)

3. Kleene star (A*)

4. Parentheses ((A+B)C).

Q: Explain a finite automaton for the regular expression 0*1*.

A: An FA for 0*1* has:

1. State for 0s.

2. Transition to accept 1s.

3. Accepting state for 1s.

Q: Illustrate a regular expression for the set of all strings of 0s.

A: The RE is 0*, representing zero or more occurrences of 0.

Q: State the precedence of RE operators.

A: Precedence order:

1. Parentheses

2. Kleene star (*)

3. Concatenation

4. Union (+).

Q: List down the rules for defining the regular expressions.

A: Rules include:

1. Use union, concatenation, and Kleene star.

2. Start with valid symbols or .

Q: Name the four closure properties of RE.

A: Closure properties are:

1. Union

Page 1
Theory of Computation - 2 Marks Questions and Answers

2. Concatenation

3. Kleene star

4. Complementation.

Q: Illustrate a RE for strings starting with 1 and ending with 0 over {0,1}.

A: RE: 1(0+1)*0. Strings start with 1 and end with 0.

Q: Illustrate an FA for the Regular expression (00+(0+1))1*.

A: FA processes 00 or 0+1 and transitions to accept 1s.

Q: Identify the language generated by the RE (0+1)*.

A: The language includes all strings over {0,1}, including .

Q: Illustrate a RE for strings over {a,b,c} with any number of as, bs, and cs.

A: RE: a*b*c*. Allows sequences of as, bs, and cs.

Q: Define Homomorphism.

A: It is a mapping replacing symbols in one alphabet with symbols or strings in another alphabet.

Q: Express a RE for any number of as and bs.

A: RE: (a+b)*, allowing any combination of as and bs.

Q: Differentiate between + closure and * closure.

A: + closure (A+) requires at least one occurrence, while * closure (A*) allows zero or more

occurrences.

Q: Illustrate a FA for the RE aa*bb*.

A: FA accepts 'a' followed by zero or more 'a's, and 'b' followed by zero or more 'b's.

Q: Describe the steps in Pumping Lemma?

A: Steps:

1. Assume a string in the language.

2. Split the string.

3. Repeat parts to show violations.

Q: Define parse tree and derivation.

Page 2
Theory of Computation - 2 Marks Questions and Answers

A: Parse tree represents derivations visually. Derivations list rules applied step-by-step.

Q: Define Grammar and its types.

A: Grammar defines string rules. Types:

1. Regular

2. Context-Free

3. Context-Sensitive

4. Unrestricted.

Q: Define ambiguous grammar?

A: A grammar is ambiguous if it generates more than one parse tree for a string.

Q: State the different types of languages accepted by PDA and define them?

A: PDA accepts:

1. Context-free languages - CFG generated.

2. Regular languages - DFA recognized.

Q: Identify a CFG for the language L={0*1*}.

A: CFG: S 0S | 1S | . Generates 0s followed by 1s.

Q: List the components of PDA?

A: Components:

1. Input tape

2. Stack

3. Finite control unit.

Q: Define Pushdown automata.

A: PDA is an automaton with a stack to recognize context-free languages.

Q: Define the instantaneous Description of PDA.

A: An ID of PDA is a tuple (q, w, s) representing the current state, unread input, and stack contents.

Q: List the moves of PDA.

A: Moves are push, pop, and no-operation, modifying stack based on input.

Page 3
Theory of Computation - 2 Marks Questions and Answers

Q: Construct CFG for the language L={w wr/ w {0,1}*}.

A: CFG: S 0S0 | 1S1 | . Generates palindromes over {0,1}.

Q: Identify the language generated by the Grammar: S -> 0A/0, A -> .

A: Language contains strings starting with 0 followed by 0 or empty.

Q: List the languages accepted by PDA?

A: PDA accepts context-free languages like balanced parentheses and nested structures.

Q: Describe a CFG for L={0n | n>=1}.

A: CFG: S 0S | 0. Generates one or more 0s.

Q: Describe a CFG for L={0n 10n | n >=1}.

A: CFG: S 0S0 | 10. Generates equal 0s before and after 1.

Q: List the rules for converting CFG to PDA.

A: Steps:

1. Push symbols onto stack.

2. Match input.

3. Transition based on rules.

Page 4

You might also like