TOC 2 Marks Questions Answers
TOC 2 Marks Questions Answers
1. Concatenation (AB)
2. Union (A+B)
4. Parentheses ((A+B)C).
A: Precedence order:
1. Parentheses
3. Concatenation
4. Union (+).
A: Rules include:
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}.
Q: Illustrate a RE for strings over {a,b,c} with any number 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.
A: + closure (A+) requires at least one occurrence, while * closure (A*) allows zero or more
occurrences.
A: FA accepts 'a' followed by zero or more 'a's, and 'b' followed by zero or more 'b's.
A: Steps:
Page 2
Theory of Computation - 2 Marks Questions and Answers
A: Parse tree represents derivations visually. Derivations list rules applied step-by-step.
1. Regular
2. Context-Free
3. Context-Sensitive
4. Unrestricted.
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:
A: Components:
1. Input tape
2. Stack
A: An ID of PDA is a tuple (q, w, s) representing the current state, unread input, and stack contents.
A: Moves are push, pop, and no-operation, modifying stack based on input.
Page 3
Theory of Computation - 2 Marks Questions and Answers
A: PDA accepts context-free languages like balanced parentheses and nested structures.
A: Steps:
2. Match input.
Page 4