To lec 04

365
-1

Published on

Published in: Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
365
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

To lec 04

  1. 1. Theory of Automata By Amjad Khan Khalil amjad@aup.edu.pk
  2. 2. Examples: Construct an FA for the language defined over Σ={a,b} where each string is of even length.
  3. 3. Continue Σ={a,b} States: x and y where x is the initial and final state Transitions: 1. At state x while reading a or b go to state y. 2. At state y while reading a or b go to state x.These transitions can also be expressed by the following transition table.
  4. 4. Examples Construct the FA for the language defined over Σ={a,b} where each string starts with b.
  5. 5. Con’t Construct an FA for the language defined over Σ={a,b} where each string ends with a.
  6. 6. Con’tConstruct the FA for the following languages defined over Σ={a,b}.L1= Language of strings beginning with aL2= language of strings not beginning with b
  7. 7. Con’t Construct an FA for the language defined over Σ={a,b} where each string is of length two or more while beginning and ending with the same letter.
  8. 8. Con’t Construct an FA for the language defined over Σ={a,b} where each string is of length two or more while beginning and ending with different letter.
  9. 9. Con’t Construct an FA for the language defined over Σ={a,b} where each string consist of any number of a’s or b’s including NULL.Or we can also write this FA in the following fashion.
  10. 10. Con’t Construct an FA for the language defined over Σ={a,b} where each string consist of any number of a’s or b’s excluding NULL.
  11. 11. Con’t Construct the FA for the following languages defined over Σ={a,b}.  Where each string have exactly single a.  Where each string consist of exactly triple b’s.  Where each string have at least one a.  Where each string have at most one b.  Where each string ends with double a’s or double b’s.
  12. 12. Con’t  Where each string containing double a’s.  Language defined over Σ={0,1} where each string consist of double 0’s or double 1’s.  Language defined over Σ={a,b} where each string consist of triple a’s or triple b’s.  Construct the FA for the language defined over Σ={a,b} where each string consists of even number of a’s or even number of b’s  Where each string is exactly of length two, starting and ending with different letter.
  13. 13. Example of vending machine Vending Machine: That machine in which we give currency in the form of coins as input and give us the output in the form of chocolate, toffees or drinks is called vending machine. Construct the Vending machine for the following specifications. INPUT: Σ={5,10} OUTPUT: Soft drinks at af.20 Assumption: The machine will not return the change
  14. 14. Example of Man, Wolf, Goat and cabbage Construct the FA for the following specification Σ={M,W,G,C} Input: Maximum two letters at a time Output: When all four reach to final state. Assumption:  Wolf and goat should not be alone together  Goat and cabbage should not be alone together
  15. 15. Assignment-01 Construct the FA for the IQ test game. Each student can receive this game from your respective Cr’s. Also write down the programming code for vending machine in any visual programming language.
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×