Professional Documents
Culture Documents
FINAL EXAMINATION
SEMESTER I 2019/2020
[Jawab semua soalan di dalam buku soalan yang diberikan. Markah setiap soalan
adalah seperti yang dinyatakan.]
Name
Name of Lecturer
Question 1 [8 marks]
In each part below, write down three strings in the language generated by the expression,
one shortest string that NOT in the language and give short description of the language
using your own word.
Question 2 [4 marks]
2
Question 3 [10 marks]
In each of the following, draw a finite automata and define the regular expression accepting
the indicated language over {a, b}.
Regular Expression:
Regular Expression:
Regular Expression:
Regular Expression:
3
Question 4 [10 marks]
(a) Give a state diagram for the formal definition given above. (2 marks)
4
Question 5 [10 marks]
M2 :
5
Question 6 [10 marks]
(a) The transition function of an automatic door controller, M3 can be described as follows:
NEITHER FRONT REAR BOTH
CLOSE CLOSE OPEN CLOSE CLOSE
OPEN CLOSE OPEN OPEN OPEN
NEITHER – no one is standing on either pad, FRONT – a person is standing on the pad in front of the
doorway, REAR – a person is standing on the pad to the rear of the doorway, BOTH – people are
standing on both pads
Draw a state diagram of an automatic door controller M3 as defined above. (3 marks)
(b) Design a state diagram of a canned drink vending machine, M4 that will determine the
combination of old and new Malaysian Ringgit; RM0.10, RM0.20, RM0.50 coins and
RM 1 note. The can drink selected should be dispensed at the total of RM1.
6
Question 7 [8 marks]
c) Build the derivation tree for the derivation from part (b). (2 marks)
7
b) Trace computations of strings aabbbc, abbcc in M. (4 marks)
d) Write the shortest strings that are IN and NOT IN the language L(M),
besides . ______________________________________ (2 marks)
c) Show that aabcdd L(M), while bcd do not belong to L(M). (3 marks)
8
Question 10 [20 marks]
Consider the following PDAs. Match them with the suitable definition of the languages and grammars. Write your answer in the blank column of
the table below: (2 marks/each)
Matched
No Pushdown Automata Matched PDA (No.) Language PDA (No.) Grammar
(a,/X) (b,X/) (c,/)
S → aS | aA
A (b,X/) (c,/) {anbmcn | n > 0, m >= 0}
q0 q1 q2 A → bAc | λ
- END OF QUESTIONS -