1 / 40

Finite Automata

Finite Automata. Definition. A finite automaton is a collection of three things: 1- A finite set of states, one of which is designed as the initial state, called the start state , and some (maybe none) of which are designed as final states . 2- An alphabet  of possible input letters.

merrill
Download Presentation

Finite Automata

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Finite Automata Dr. Shakir Al Faraji

  2. Definition A finite automaton is a collection of three things: 1- A finite set of states, one of which is designed as the initial state, called the start state, and some (maybe none) of which are designed as final states. 2- An alphabet  of possible input letters. Dr. Shakir Al Faraji

  3. Definition – Cont. 3- A finite set of transitions that tell for each state and for each letter of the input alphabet which state to go to next. Dr. Shakir Al Faraji

  4. FA – mathematical notation A deterministic finite automaton (or DFA) can be formally defined as a 5-tuple ( Q ,  , T, qD, F ) where Q is a finite set of states.  is the alphabet (defining what set of input strings the automaton operates on). Dr. Shakir Al Faraji

  5. FA – mathematical notation T:QQ is the transition function. qD Q is the starting state. FQ is a set of final (or accepting states). Operation of the DFA begins at qD, and movement from state to state is governed by the transition function T. T must be defined for every possible state in and every possible symbol in Q. Dr. Shakir Al Faraji

  6. FA – mathematical notation A DFA can be represented visually as a directed graph. Circular vertices denote states, and the set of directed edges, labeled by symbols in  , denotes T. The transition function takes the first symbol of the input string as, and after the transition this first symbol is removed. Dr. Shakir Al Faraji

  7. FA – mathematical notation If the input string is  (the empty string), then the operation of the DFA is halted. If the final state when the DFA halts is in F, then the DFA can be said to have accepted the input string it was originally given. The starting state qD is usually denoted by an arrow or (minus sign) pointing to it that points from no other vertex. States in F are usually denoted by double circles or plus sign. Dr. Shakir Al Faraji

  8. FA – Examples DFAs represent regular languages, and can be used to test whether any string is in the language it represents. Consider the following regular language over the alphabet  = { a, b } (represented by the regular expression aa*b Dr. Shakir Al Faraji

  9. FA – Examples This language can be represented by the following DFA. Dr. Shakir Al Faraji

  10. FA – Examples If given the string aaab as input, operation of the DFA above is as follows: • The first a is removed from the input string, so the edge from 0 to 1 is followed. • The resulting input string is aab. For each of the next two as, the edge is followed from 1 to itself. • Finally, b is read from the input string and the edge from 1 to 2 is followed. Dr. Shakir Al Faraji

  11. FA – Examples Since the input string is now  , the operation of the DFA halts. Since it has halted in the accepting state 2, the string aaab is accepted as a sentence in the regular language implemented by this DFA. Dr. Shakir Al Faraji

  12. FA – Examples Now let us trace operation on the string aaaba. Execution is as above, until state 2 is reached with a remaining in the input string. The edge from 2 to 3 is then followed and the operation of the DFA halts. Since 3 is not an accepting state for this DFA, aaaba is not accepted(rejected). Dr. Shakir Al Faraji

  13. FA – Examples the following regular language over the alphabet  = { a, b } (represented by the regular expression (a+b)*b(a+b)* Dr. Shakir Al Faraji

  14. FA – Examples Consider the following transition table Dr. Shakir Al Faraji

  15. a Y X- a b b Z+ a b FA – Examples Dr. Shakir Al Faraji

  16. a + a,b - b FA – Examples Dr. Shakir Al Faraji

  17. a + a,b - b FA – Examples (a+b)(a+b)* Dr. Shakir Al Faraji

  18. y a,b b - a Z+ a,b FA – Examples a(a+b)* Dr. Shakir Al Faraji

  19. FA – Examples (a+b)*(aa+bb)(a+b)* Dr. Shakir Al Faraji

  20. 2 a a a,b 4+ a b 1- b 3 b FA – Examples (a+b)*(aa+bb)(a+b)* Dr. Shakir Al Faraji

  21. a,b a,b 4 a a,b a,b 1- 2 3 b 5+ FA – Examples Dr. Shakir Al Faraji

  22. FA – Examples (aab+abb+bab+bbb)(a+b)* Dr. Shakir Al Faraji

  23. FA – Examples (aab+abb+bab+bbb)(a+b)* (a+b)(a+b)b(a+b)* Dr. Shakir Al Faraji

  24. FA – Examples a*(a*ba*ba*ba*)*(a+a*ba*ba*ba*) Dr. Shakir Al Faraji

  25. a b 1- 2 b a b a b 4 a 3+ FA – Examples a*(a*ba*ba*ba*)*(a+a*ba*ba*ba*) Dr. Shakir Al Faraji

  26. FA – Examples (a+b)*a Dr. Shakir Al Faraji

  27. a a b + - b FA – Examples (a+b)*a Dr. Shakir Al Faraji

  28. FA – Examples (a+b)*a +  Dr. Shakir Al Faraji

  29. b a ± a b FA – Examples Dr. Shakir Al Faraji

  30. FA – Examples b*ab*(ab*ab*)* Dr. Shakir Al Faraji

  31. a b + - a b FA – Examples Dr. Shakir Al Faraji

  32. FA – Examples (a+b)*aa(a+b)* Dr. Shakir Al Faraji

  33. a a a,b b + - b FA – Examples Dr. Shakir Al Faraji

  34. FA – Examples a(a+b)*b + b(a+b)*a Dr. Shakir Al Faraji

  35. a b b a + b b a - b a + a FA – Examples Dr. Shakir Al Faraji

  36. FA – Examples [aa+bb+(ab+ba)(aa+bb)*(ab+ba)]* Dr. Shakir Al Faraji

  37. a 2 1± a b b b b a 4 3 a FA – Examples Dr. Shakir Al Faraji

  38. FA – Examples Consider the set of all strings that, viewed as natural numbers in unsigned binary notation, represent numbers divisible by 3. Dr. Shakir Al Faraji

  39. 1 0 R=1 ± 1 R=0 0 0 R=2 1 FA – Examples Dr. Shakir Al Faraji

  40. END Dr. Shakir Al Faraji

More Related