Docstoc

CS402 Assignment No.6 idea solution

Document Sample
CS402 Assignment No.6 idea solution Powered By Docstoc
					                        Theory of Automata (CS402)

                                Assignment # 6



                                                                    Total marks = 20




Important Note:



Assignment comprises of 20 Marks. Note that no assignment will be accepted after
due date via email in any case (whether it is the case of load shedding or emergency
electric failure or internet malfunctioning etc.). Hence, refrain from uploading
assignment in the last hour of the deadline, and try to upload Solutions at least 02
days before the deadline to avoid inconvenience later on.



For any query please contact: CS402@vu.edu.pk




Q1. Convert the following FA into equivalent PDA.

                                                                       [Marks 7]
Q2. For which type of languages we must use Push and Pop in their corresponding
PDA’s?

                                                                                [Marks 3]




Q3. Construct a PDA that accepts the language of anbn+2.




                   Ammendment in labels of READS state



L = abb, aabbb, aaabbbbb, aaaabbbbbb …………………………..



Equal No of a and b puched second last b reads from read 1 to read2 and a loop starts at both
pop 1 and pop2 for all pushed a and b. Now last b reads from read 4 to read 5 . rest all options
rejects .



Sol.
                                                             [Marks 10]


             Start                                       a
                 ∆                                POP1                R EAD3
                                              a          a
         a             b
Push a       R EAD1         R EAD2
                                                         b
                                                  POP2                R EAD4
         b                                    b
Push b
                      ∆,a                                b
                                     ∆
                                                                               b
                                                         ∆,a
                                     Reject



                                                                               R EAD5




                                                                                   ∆


                                                                                POP3


                                                                                    ∆

                                                                               Accept

				
DOCUMENT INFO
Categories:
Tags:
Stats:
views:883
posted:7/4/2012
language:English
pages:3