Theoretical Computer Science
Theoretical Computer Science
(f) State True or False: DFA does not have multiple final
states.
(d) Write down the ε-closure of each state from the given
FA.
S → aSa | bSb
S → a | b | aa | bb
CNF Form:
S → aA | bB | C | D
A→Sa
B→Sb
C → aa
D → bb
DFA NFA
e) What is Reduction?
Answer: Reduction is the process of transforming one
problem into another problem in such a way that a
solution to the second problem can be used to solve the
first problem.
1. Nullable variables: B
2. Eliminating 𝜖-productions involves removing nullable
variables and updating the productions accordingly.
Let's solve the questions from the uploaded Theoretical
Computer Science (TOC) April 2022 exam paper one by
one.
Q1) Attempt any Eight of the following (out of TEN) [8 × 1 = 8]
1. Memory:
FA: No memory (no stack).
PDA: Uses a stack to store intermediate symbols.
2. Language:
FA: Regular languages.
PDA: Context-free languages.
L1∩L2:
L1: Strings starting with 'a'.
L2: Strings not containing 'ab' as a substring.
Combine both conditions to build the DFA.
Push "0"s to the stack, pop for "1"s, and then check the
combined count for "2"s.