TOC_2_Mark_Answers
TOC_2_Mark_Answers
A constant (e.g., integer) can be recognized by a finite automaton with states for digits 0-9. For a
decimal constant:
q0 --digit--> q1
q1 --digit--> q1
((0*10*1)*)0(00)*
For any regular language L, there exists a constant p such that any string s in L with |s| >= p can be
A grammar is ambiguous if a string in the language has more than one parse tree.
Example:
S -> S + S | S * S | a
Using grammar:
S -> aB
B -> aBB -> aB -> bS -> bA -> bAA -> bAa -> baaa
GNF (Greibach Normal Form): Rules are of form A -> aalpha where a is terminal, alpha is (possibly
A language is recursively enumerable (RE) if there exists a Turing Machine that accepts all strings in
A Universal Turing Machine can simulate any Turing Machine. It takes as input the description of a
1. Compiler design
Transitions:
q0 --1--> q1
q1 --1--> q2
q2 --1--> q0
Accept at q0.
Regular Language is the set of strings accepted by a finite automaton or described by a regex.
Assume it is regular. Let s = 0^p1 2^p. Pump and break 0s, resulting in unequal number of 0s and
A CFL is a language generated by a context-free grammar (CFG), where each production is of the
A grammar is ambiguous if at least one string has more than one leftmost derivation or parse tree.
Recursive subset RE
1. Union
2. Concatenation
3. Kleene star
Not closed under: Intersection, Complement