Solution
Solution
Solution
Σ = {0,1,2}
Note: Cardinality means the total number of elements in the given set.
88209
Q2: Design a Finite Automaton (DFA or NFA) for the following language. [3 Marks]
Note: Pick a suitable sub-category from FA and design the machine accordingly.
L → ALB | AABB
A → aAb | aaabbb
B → ccBd | ˄
Note: You are required to write answer in a proper format. For Example, see Q1 statement. You are
expected to write a proper answer based on CFG given above. Lengthy Statements are not required here.
Q5: Design the transition diagram of a PDA for the following Language? [4 Marks]
L = {an bm ; n + m = even }
A B A
B B C
C D C
D D D
Note: Use State Elimination Method for extraction of Regular Expression. Write Final Regular Expression in the
space provided below. Delete the given states in the following order, first State A then B then C & then D.
Regular Expression:
X is on tape 1 and Y is on tape 2. Y slides over the X with the step of 1. Each time it computes the exclusive
nor (XNOR) of the corresponding overlapping bits and note down the number of 1’s (only) in tape 3 as
shown below:
A B A XNOR B
0 0 1
0 1 0
1 0 0
1 1 1
Truth Table for XNOR for inputs A and B
Tape 1:
Δ 0 1 1 1 1 0 0 Δ
X
Tape 2:
Δ 1 0 1 Δ Δ Δ Δ Δ
Y
Tape 3:
Δ Δ Δ Δ Δ Δ Δ Δ Δ
Output
Y will slide 5 times on X (in this example)
Provide the algorithm first that will explain your logic in simple statement and then draw TM:
Note: Be clear and to the point. Clearly mention where your pointers are. No marks if algorithm is
incorrect.
Answer:
What is TM doing? (Explain in not more than 2 lines. Be brief and to the point. No mark for stories)
Minimized DFA:
A -
B -
C -
D -
E -
F -
j=4 S - - -
j=3 - B,C - -
j=2 S - B,C -
a b b a