انت هنا الان : شبكة جامعة بابل > موقع الكلية > نظام التعليم الالكتروني > مشاهدة المحاضرة

Construct an equivalent DFA from NFA:

الكلية كلية العلوم للبنات     القسم قسم الحاسبات     المرحلة 2
أستاذ المادة محمد عبيد مهدي الجبوري       3/18/2011 10:11:17 PM

Construct an equivalent DFA from NFA:

 

 

Every DFA is an NFA, it is clear that the class of languages accepted by NFA’s includes the languages accepted by DFA’s.

 

To convert NFA to DFA we can carry out  the following algorithm:

 

1-   begin with {q0}, start state, and calculate d({q0},a) for all a in S this gives a number of new states Q-.

 

2-   For each new states Q-, we again calculate d(Q-,a) for all a in S and introduce new states if  necessary.

 

3-   Repeat step2 until there are no new states.

 

4-   Final states of new DFA are the states that contain any final state of the previous NFA.

 

Example:

 

Convert the following NFSA into equivalent FSA

 

     

qo

 

  

q2

 

 

q1

 

 


   a                             b                              c

 

                        a                          b  

 

 

 

 

 

 

M=(Q,S,q0, d,F)

 

Q={q0,q1,q2}

 

S={a,b,c}

 

q0={q0}

 

F={q1,q2}

 

 

 

 

 

 

 

M-=(Q-,S,q0, d-,F-}

 

 

 

 

 

 

 

 

 

 

1-   d(q0,a)®{q0,q1}

 

2-   d({q0,q1},a)®{q0,q1}

 

3-   d({q0,q1},b) ® {q1,q2}

 

4-   d({q1,q2},b)   ® {q1,q2}

 

5-     d({q1,q2},c) ® {q2}

 

6-     d({q2},c) ® {q2}

 

 

c

 


 

b

  

a

 

b

 

c

 

a

   

q0,q1

 

 

q1,q2

 

     

q2

 

   

qo

 

                                         

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

DONE

 

Instructor: Mohamed U. Mahdi

 


المادة المعروضة اعلاه هي مدخل الى المحاضرة المرفوعة بواسطة استاذ(ة) المادة . وقد تبدو لك غير متكاملة . حيث يضع استاذ المادة في بعض الاحيان فقط الجزء الاول من المحاضرة من اجل الاطلاع على ما ستقوم بتحميله لاحقا . في نظام التعليم الالكتروني نوفر هذه الخدمة لكي نبقيك على اطلاع حول محتوى الملف الذي ستقوم بتحميله .