Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

TCS Question Paper-2

a) Unit production of a grammar: A unit production in a grammar is a production rule


where a non-terminal symbol is replaced by a single non-terminal symbol. In other
words, it is of the form A -> B, where A and B are non-terminal symbols.
b) A Mealy machine that toggles its input can be constructed as a finite state machine
with two states, representing the two possible outputs (0 and 1). The machine starts
in one state, and upon receiving an input, it transitions to the other state, effectively
toggling the output.

c) Proper Suffix and Prefix of a string: A proper prefix of a string is any prefix of the
string except the string itself. Similarly, a proper suffix of a string is any suffix of the
string except the string itself. For example, for the string “abc”, “a” and “ab” are
proper prefixes, and “c” and “bc” are proper suffixes.
d) Pushdown Automata: A Pushdown Automaton (PDA) is formally defined as a 7-
tuple (Q, Σ, Γ, δ, q0, Z0, F) where: - Q is a finite set of states. - Σ is a finite set of
input symbols. - Γ is a finite set of stack symbols. - δ is a transition function mapping
Q x (Σ U {ε}) x Γ to a finite subset of Q x Γ*. - q0 is the initial state. - Z0 is the initial
stack symbol. - F is the set of accepting states.

e) Left linear and right linear grammar: A grammar is called left linear if all its
production rules are of the form A -> αB or A -> α, where A and B are non-terminal
symbols and α is a string of terminal symbols. Similarly, a grammar is called right
linear if all its production rules are of the form A -> Bα or A -> α.

f) False. A Finite Automaton, by definition, has a finite number of states.


g) The types of normal forms of grammar include Chomsky Normal Form (CNF) and
Greibach Normal Form (GNF).
h) The tuples of a Linear Bounded Automaton (LBA) are defined as an 8-tuple (Q, Σ,
Γ, δ, q0, Z0, F, b) where: - Q is a finite set of states. - Σ is the input alphabet. - Γ is the
tape alphabet. - δ is the transition function. - q0 is the initial state. - Z0 is the initial
stack symbol. - F is the set of final states. - b is the blank symbol.
i) True. The Pumping Lemma is often used to show that a language is not context-
free.
j) The smallest possible string accepted by the regular expression 10 + (0 + 11)0* is
0. This is because the + operator denotes a choice between the expressions on its

TCS Question Paper-2 1


left and right, and 0 is the shortest string that can be generated from the choices
provided.

Criteria Finite Automata (FA) Pushdown Automata (PDA)

FA doesn’t have any space to store PDA has an additional stack for
Memory
input alphabets storing long sequence of alphabets

FA is less powerful as it can only PDA is more powerful as it can


Power
recognize regular languages recognize context-free languages

TCS Question Paper-2 2

You might also like