Document 17543613

advertisement
Philadelphia University
Faculty of Information Technology
Lecturer : Dr. Nameer N. EL-Emam
Department of CS
Internal Examiner : Dr. Raad Alwan
marking Scheme
Computation Theory (750223)
First Exam Semester two of the academic year:2014-2015
Date: : 5/4/2015
Time 50 minutes
Basic Part
Objective: The aim of this part is to check student abilities to construct FSA
Q1/(6 marks)
Find regular expression (Type 3) from the following regular grammar:
G  {S, A , B}, {0 ,1}, P, S
where the final state is “A” and the set production rules P is defined in the following table:
state
S
A
B
input
0
S , B
-
1
A
A
A, B
In addition, we should check if the input string “00011” is a part of language L(G) by using sequence of
*
derivations ( S  00011 ).
Hint: To read a production rule from the above table, we should start with row of the source state, and then
the target state has been reached at the same row of the source state under the specific input.
Q2/(8 marks)
Build regular grammar for each of the following regular expression:
1-
a  (b  c* ) *  a (b a )  b
2-
(b  ( c  d ) )  a (b a ) 
* *
* *
Q3: (6 marks)
Construct CFG for the following CFL:
2


L(G )   M n a m N k a p A  {1,0}, B  {c, d}, n  2p, m  k , n, m, p, k  1 
3


Download