Finite Automata: Informal Finite Automata: Informal p.1/20 - - PowerPoint PPT Presentation

finite automata informal
SMART_READER_LITE
LIVE PREVIEW

Finite Automata: Informal Finite Automata: Informal p.1/20 - - PowerPoint PPT Presentation

Finite Automata: Informal Finite Automata: Informal p.1/20 Computational models The theory of computation should begin with the question: what is a computer? Finite Automata: Informal p.2/20 Computational models The theory of


slide-1
SLIDE 1

Finite Automata: Informal

Finite Automata: Informal – p.1/20

slide-2
SLIDE 2

Computational models

  • The theory of computation should begin with

the question: what is a computer?

Finite Automata: Informal – p.2/20

slide-3
SLIDE 3

Computational models

  • The theory of computation should begin with

the question: what is a computer?

  • Real computers are however quite

complicated so it is difficult to set up a manageable mathematical theory for them

Finite Automata: Informal – p.2/20

slide-4
SLIDE 4

Computational models

  • The theory of computation should begin with

the question: what is a computer?

  • Real computers are however quite

complicated so it is difficult to set up a manageable mathematical theory for them

  • Instead we can use an idealized computer

called computational model in order to begin the theory of computation

Finite Automata: Informal – p.2/20

slide-5
SLIDE 5

Finite automata

  • The simplest computational model is called a

finite state machine or a finite automaton

Finite Automata: Informal – p.3/20

slide-6
SLIDE 6

Finite automata

  • The simplest computational model is called a

finite state machine or a finite automaton

  • Before developing the mathematics of finite

automata we will examine the usage of a concrete finite automaton: the controller of an automatic door

Finite Automata: Informal – p.3/20

slide-7
SLIDE 7

The automatic door

  • Automatic doors are often found at

supermarket entrances and exits

Finite Automata: Informal – p.4/20

slide-8
SLIDE 8

The automatic door

  • Automatic doors are often found at

supermarket entrances and exits

  • An automatic door swing open when sensing

that a person is approaching

Finite Automata: Informal – p.4/20

slide-9
SLIDE 9

The automatic door

  • Automatic doors are often found at

supermarket entrances and exits

  • An automatic door swing open when sensing

that a person is approaching

  • An automatic door is controlled by a simple

automaton seen in Figure 1

Finite Automata: Informal – p.4/20

slide-10
SLIDE 10

Controller of an automatic door

pad Front pad Rear door

Figure 1: Controller of an automatic door

Finite Automata: Informal – p.5/20

slide-11
SLIDE 11

Behavior

  • An automatic door has a pad in front to detect

the presence of a person about to walk through the door

Finite Automata: Informal – p.6/20

slide-12
SLIDE 12

Behavior

  • An automatic door has a pad in front to detect

the presence of a person about to walk through the door

  • Another pad is located to the rear of the

doorway so that the controller can hold the door open long enough for the person to pass all the way through

Finite Automata: Informal – p.6/20

slide-13
SLIDE 13

Behavior

  • An automatic door has a pad in front to detect

the presence of a person about to walk through the door

  • Another pad is located to the rear of the

doorway so that the controller can hold the door open long enough for the person to pass all the way through

  • The rear pad also take care that the door

does not strike someone standing behind it as it opens

Finite Automata: Informal – p.6/20

slide-14
SLIDE 14

States of the controller

  • The controller is in either of two states:

Finite Automata: Informal – p.7/20

slide-15
SLIDE 15

States of the controller

  • The controller is in either of two states:
  • pen or closed

Finite Automata: Informal – p.7/20

slide-16
SLIDE 16

States of the controller

  • The controller is in either of two states:
  • pen or closed
  • There are four input conditions:

Finite Automata: Informal – p.7/20

slide-17
SLIDE 17

States of the controller

  • The controller is in either of two states:
  • pen or closed
  • There are four input conditions:

front, meaning that a person is standing on the front pad

Finite Automata: Informal – p.7/20

slide-18
SLIDE 18

States of the controller

  • The controller is in either of two states:
  • pen or closed
  • There are four input conditions:

front, meaning that a person is standing on the front pad rear, meaning that a person is standing on the rear pad

Finite Automata: Informal – p.7/20

slide-19
SLIDE 19

States of the controller

  • The controller is in either of two states:
  • pen or closed
  • There are four input conditions:

front, meaning that a person is standing on the front pad rear, meaning that a person is standing on the rear pad both, meaning that people are standing on both pads

Finite Automata: Informal – p.7/20

slide-20
SLIDE 20

States of the controller

  • The controller is in either of two states:
  • pen or closed
  • There are four input conditions:

front, meaning that a person is standing on the front pad rear, meaning that a person is standing on the rear pad both, meaning that people are standing on both pads neither, meaning that no one is standing on either pad

Finite Automata: Informal – p.7/20

slide-21
SLIDE 21

State transition diagram

The state transition diagram of the controller, Figure 2, depicts the movements of the controller depending upon the input it receives:

✫✪ ✬✩

closed

❥ ✫✪ ✬✩

  • pen

❨ ❄ ❄

Figure 2: Controller’s state transition diagram

Finite Automata: Informal – p.8/20

slide-22
SLIDE 22

State transition diagram

The state transition diagram of the controller, Figure 2, depicts the movements of the controller depending upon the input it receives:

✫✪ ✬✩

closed

❥ ✫✪ ✬✩

  • pen

❨ ❄

neither both rear

Figure 2: Controller’s state transition diagram

Finite Automata: Informal – p.8/20

slide-23
SLIDE 23

State transition diagram

The state transition diagram of the controller, Figure 2, depicts the movements of the controller depending upon the input it receives:

✫✪ ✬✩

closed

front

✫✪ ✬✩

  • pen

❨ ❄

neither both rear

Figure 2: Controller’s state transition diagram

Finite Automata: Informal – p.8/20

slide-24
SLIDE 24

State transition diagram

The state transition diagram of the controller, Figure 2, depicts the movements of the controller depending upon the input it receives:

✫✪ ✬✩

closed

front

✫✪ ✬✩

  • pen

neither

neither both rear

Figure 2: Controller’s state transition diagram

Finite Automata: Informal – p.8/20

slide-25
SLIDE 25

State transition diagram

The state transition diagram of the controller, Figure 2, depicts the movements of the controller depending upon the input it receives:

✫✪ ✬✩

closed

front

✫✪ ✬✩

  • pen

neither

neither both rear

both rear front

Figure 2: Controller’s state transition diagram

Finite Automata: Informal – p.8/20

slide-26
SLIDE 26

Interpretation

Door movement:

  • When the door is closed and there is somebody on the rear pad
  • r on both pads or there is no one on the pads, the door remains

closed

Finite Automata: Informal – p.9/20

slide-27
SLIDE 27

Interpretation

Door movement:

  • When the door is closed and there is somebody on the rear pad
  • r on both pads or there is no one on the pads, the door remains

closed

  • When the door is closed and somebody steps on the front pad the

door opens

Finite Automata: Informal – p.9/20

slide-28
SLIDE 28

Interpretation

Door movement:

  • When the door is closed and there is somebody on the rear pad
  • r on both pads or there is no one on the pads, the door remains

closed

  • When the door is closed and somebody steps on the front pad the

door opens

  • When the door is open and somebody is on the front pad, rear

pad, or on both pads the door stays open

Finite Automata: Informal – p.9/20

slide-29
SLIDE 29

Interpretation

Door movement:

  • When the door is closed and there is somebody on the rear pad
  • r on both pads or there is no one on the pads, the door remains

closed

  • When the door is closed and somebody steps on the front pad the

door opens

  • When the door is open and somebody is on the front pad, rear

pad, or on both pads the door stays open

  • When the door is open and nobody is on the pads the door closes

Finite Automata: Informal – p.9/20

slide-30
SLIDE 30

Interpretation

Controller movement:

  • When controller is in the state closed and the input is rear, both,
  • r neither the controller remains in the state closed

Finite Automata: Informal – p.10/20

slide-31
SLIDE 31

Interpretation

Controller movement:

  • When controller is in the state closed and the input is rear, both,
  • r neither the controller remains in the state closed
  • When controller is in the state closed and the input is front the

controller moves to the state open

Finite Automata: Informal – p.10/20

slide-32
SLIDE 32

Interpretation

Controller movement:

  • When controller is in the state closed and the input is rear, both,
  • r neither the controller remains in the state closed
  • When controller is in the state closed and the input is front the

controller moves to the state open

  • When the controller is in the state open and the input is one of

front, rear, both, the controller remains in the state open

Finite Automata: Informal – p.10/20

slide-33
SLIDE 33

Interpretation

Controller movement:

  • When controller is in the state closed and the input is rear, both,
  • r neither the controller remains in the state closed
  • When controller is in the state closed and the input is front the

controller moves to the state open

  • When the controller is in the state open and the input is one of

front, rear, both, the controller remains in the state open

  • When the controller is in the state open and the input is neither

the controller moves to the state closed

Finite Automata: Informal – p.10/20

slide-34
SLIDE 34

Tabular representation

The movement of the controller (and of the door) can also be represented by a table whose lines are labeled by

Finite Automata: Informal – p.11/20

slide-35
SLIDE 35

Tabular representation

The movement of the controller (and of the door) can also be represented by a table whose lines are labeled by the states

Finite Automata: Informal – p.11/20

slide-36
SLIDE 36

Tabular representation

The movement of the controller (and of the door) can also be represented by a table whose lines are labeled by the states and whose columns are labeled by

Finite Automata: Informal – p.11/20

slide-37
SLIDE 37

Tabular representation

The movement of the controller (and of the door) can also be represented by a table whose lines are labeled by the states and whose columns are labeled by the input, as seen in Table 1

Finite Automata: Informal – p.11/20

slide-38
SLIDE 38

Tabular representation

The movement of the controller (and of the door) can also be represented by a table whose lines are labeled by the states and whose columns are labeled by the input, as seen in Table 1

Table 1: Controller’s tabular representation

State/Input neither front rear both closed closed

  • pen

closed closed

  • pen

closed

  • pen
  • pen
  • pen

Interpretation: T(state,input) = NewState

Finite Automata: Informal – p.11/20

slide-39
SLIDE 39

Note

  • This controller is a computer that has just a single bit of

memory that is used to record the controller’s state

Finite Automata: Informal – p.12/20

slide-40
SLIDE 40

Note

  • This controller is a computer that has just a single bit of

memory that is used to record the controller’s state

  • Other similar devices need controllers with larger

memory.

Finite Automata: Informal – p.12/20

slide-41
SLIDE 41

Note

  • This controller is a computer that has just a single bit of

memory that is used to record the controller’s state

  • Other similar devices need controllers with larger

memory.

  • A state of the controller of an elevator may represent the floor

the elevator is on and the inputs may be signals received from

  • ther floors

Finite Automata: Informal – p.12/20

slide-42
SLIDE 42

Note

  • This controller is a computer that has just a single bit of

memory that is used to record the controller’s state

  • Other similar devices need controllers with larger

memory.

  • A state of the controller of an elevator may represent the floor

the elevator is on and the inputs may be signals received from

  • ther floors
  • Controllers of various household appliances may be more

complex.

Finite Automata: Informal – p.12/20

slide-43
SLIDE 43

Note

  • This controller is a computer that has just a single bit of

memory that is used to record the controller’s state

  • Other similar devices need controllers with larger

memory.

  • A state of the controller of an elevator may represent the floor

the elevator is on and the inputs may be signals received from

  • ther floors
  • Controllers of various household appliances may be more

complex.

  • However the methodology is the same: they are all

finite automata

Finite Automata: Informal – p.12/20

slide-44
SLIDE 44

Other applications

  • Finite automata and their probabilistic counterparts,

Markov chains, are useful tools for pattern recognition used in speech processing and optical character recognition

Finite Automata: Informal – p.13/20

slide-45
SLIDE 45

Other applications

  • Finite automata and their probabilistic counterparts,

Markov chains, are useful tools for pattern recognition used in speech processing and optical character recognition

  • Markov chains have been used to model and predict

price changes in financial applications

Finite Automata: Informal – p.13/20

slide-46
SLIDE 46

Generalizing the controller

  • All controllers of the applications mentioned

above have a common property: they are finite automata

Finite Automata: Informal – p.14/20

slide-47
SLIDE 47

Generalizing the controller

  • All controllers of the applications mentioned

above have a common property: they are finite automata

  • The mathematical theory of finite automata

must be done in abstract, without reference to any particular application

Finite Automata: Informal – p.14/20

slide-48
SLIDE 48

Generalizing the controller

  • All controllers of the applications mentioned

above have a common property: they are finite automata

  • The mathematical theory of finite automata

must be done in abstract, without reference to any particular application

  • Hence, the concept of a finite automaton,

Figure 3, without reference to application must be developed

Finite Automata: Informal – p.14/20

slide-49
SLIDE 49

The concept

✲ ✖✕ ✗✔

q1

❯ ❯

1

✖✕ ✗✔

q2

✒✑ ✓✏ ❯

1

❯ ■

0, 1 ✖✕

✗✔

q3

Figure 3: The finite automaton M1

Finite Automata: Informal – p.15/20

slide-50
SLIDE 50

The concept

✲ ✖✕ ✗✔

q1

❯ ❯

1

✖✕ ✗✔

q2

✒✑ ✓✏ ❯

1

❯ ■

0, 1 ✖✕

✗✔

q3

Figure 3: The finite automaton M1

Finite automaton M1 has:

Finite Automata: Informal – p.15/20

slide-51
SLIDE 51

The concept

✲ ✖✕ ✗✔

q1

❯ ❯

1

✖✕ ✗✔

q2

✒✑ ✓✏ ❯

1

❯ ■

0, 1 ✖✕

✗✔

q3

Figure 3: The finite automaton M1

Finite automaton M1 has:

  • A finite set of states Q = {q1, q2, q3}

Finite Automata: Informal – p.15/20

slide-52
SLIDE 52

The concept

✲ ✖✕ ✗✔

q1

❯ ❯

1

✖✕ ✗✔

q2

✒✑ ✓✏ ❯

1

❯ ■

0, 1 ✖✕

✗✔

q3

Figure 3: The finite automaton M1

Finite automaton M1 has:

  • A finite set of states Q = {q1, q2, q3}
  • A finite input alphabet Σ = {0, 1}

Finite Automata: Informal – p.15/20

slide-53
SLIDE 53

The concept

✲ ✖✕ ✗✔

q1

❯ ❯

1

✖✕ ✗✔

q2

✒✑ ✓✏ ❯

1

❯ ■

0, 1 ✖✕

✗✔

q3

Figure 3: The finite automaton M1

Finite automaton M1 has:

  • A finite set of states Q = {q1, q2, q3}
  • A finite input alphabet Σ = {0, 1}
  • A transition function δ : Q × Σ → Q

Finite Automata: Informal – p.15/20

slide-54
SLIDE 54

The concept

✲ ✖✕ ✗✔

q1

❯ ❯

1

✖✕ ✗✔

q2

✒✑ ✓✏ ❯

1

❯ ■

0, 1 ✖✕

✗✔

q3

Figure 3: The finite automaton M1

Finite automaton M1 has:

  • A finite set of states Q = {q1, q2, q3}
  • A finite input alphabet Σ = {0, 1}
  • A transition function δ : Q × Σ → Q
  • A start state and an accept state

Finite Automata: Informal – p.15/20

slide-55
SLIDE 55

Note

  • Figure 3 is the state diagram of the

automaton M1

Finite Automata: Informal – p.16/20

slide-56
SLIDE 56

Note

  • Figure 3 is the state diagram of the

automaton M1

  • The start state, q1, is indicated by an arrow

pointing to it from nowhere

Finite Automata: Informal – p.16/20

slide-57
SLIDE 57

Note

  • Figure 3 is the state diagram of the

automaton M1

  • The start state, q1, is indicated by an arrow

pointing to it from nowhere

  • The accept state, q2, is indicated by a double

circle

Finite Automata: Informal – p.16/20

slide-58
SLIDE 58

Note

  • Figure 3 is the state diagram of the

automaton M1

  • The start state, q1, is indicated by an arrow

pointing to it from nowhere

  • The accept state, q2, is indicated by a double

circle

  • The arrows going from one state to another

are called transitions

Finite Automata: Informal – p.16/20

slide-59
SLIDE 59

How does it work?

  • When the automaton receives an input string,

such as 1101, it processes that string and produces an output which is either accept or reject

Finite Automata: Informal – p.17/20

slide-60
SLIDE 60

How does it work?

  • When the automaton receives an input string,

such as 1101, it processes that string and produces an output which is either accept or reject

  • Processing begins in M1’s start state

Finite Automata: Informal – p.17/20

slide-61
SLIDE 61

How does it work?

  • When the automaton receives an input string,

such as 1101, it processes that string and produces an output which is either accept or reject

  • Processing begins in M1’s start state

Finite Automata: Informal – p.17/20

slide-62
SLIDE 62

How does it work?

  • When the automaton receives an input string,

such as 1101, it processes that string and produces an output which is either accept or reject

  • Processing begins in M1’s start state

Finite Automata: Informal – p.17/20

slide-63
SLIDE 63

Processing procedure

  • The automaton receives the input symbols
  • ne by one from left to right

Finite Automata: Informal – p.18/20

slide-64
SLIDE 64

Processing procedure

  • The automaton receives the input symbols
  • ne by one from left to right
  • After reading each symbol, M1 moves from
  • ne state to another along the transition that

has that symbol as its label

Finite Automata: Informal – p.18/20

slide-65
SLIDE 65

Processing procedure

  • The automaton receives the input symbols
  • ne by one from left to right
  • After reading each symbol, M1 moves from
  • ne state to another along the transition that

has that symbol as its label

  • When M1 reads the last symbol of the input it

produces the output: accept if M1 is in an accept state, or reject if M1 is not in an accept state

Finite Automata: Informal – p.18/20

slide-66
SLIDE 66

Processing procedure

  • The automaton receives the input symbols
  • ne by one from left to right
  • After reading each symbol, M1 moves from
  • ne state to another along the transition that

has that symbol as its label

  • When M1 reads the last symbol of the input it

produces the output: accept if M1 is in an accept state, or reject if M1 is not in an accept state

Finite Automata: Informal – p.18/20

slide-67
SLIDE 67

Example processing

Examine the work produced by M1, Figure 3, on the input 1101:

  • 1. M1 starts in state q1;
  • 2. M1 reads 1 and follows transition from q1 to q2;
  • 3. In state q2 M1 reads next symbol 1 and follows transition from q2

to q2;

  • 4. Then M1 reads next symbol, 0, and follows transition from q2 to q3
  • 5. In state q3 M1 reads 1 and follows transition to q3 to q2
  • 6. In state q2 the input was consumed, q2 is an accept state and M1
  • utputs accept

Finite Automata: Informal – p.19/20

slide-68
SLIDE 68

Example processing

Examine the work produced by M1, Figure 3, on the input 1101:

  • 1. M1 starts in state q1;
  • 2. M1 reads 1 and follows transition from q1 to q2;
  • 3. In state q2 M1 reads next symbol 1 and follows transition from q2

to q2;

  • 4. Then M1 reads next symbol, 0, and follows transition from q2 to q3
  • 5. In state q3 M1 reads 1 and follows transition to q3 to q2
  • 6. In state q2 the input was consumed, q2 is an accept state and M1
  • utputs accept

Finite Automata: Informal – p.19/20

slide-69
SLIDE 69

Example processing

Examine the work produced by M1, Figure 3, on the input 1101:

  • 1. M1 starts in state q1;
  • 2. M1 reads 1 and follows transition from q1 to q2;
  • 3. In state q2 M1 reads next symbol 1 and follows transition from q2

to q2;

  • 4. Then M1 reads next symbol, 0, and follows transition from q2 to q3
  • 5. In state q3 M1 reads 1 and follows transition to q3 to q2
  • 6. In state q2 the input was consumed, q2 is an accept state and M1
  • utputs accept

Finite Automata: Informal – p.19/20

slide-70
SLIDE 70

Example processing

Examine the work produced by M1, Figure 3, on the input 1101:

  • 1. M1 starts in state q1;
  • 2. M1 reads 1 and follows transition from q1 to q2;
  • 3. In state q2 M1 reads next symbol 1 and follows transition from q2

to q2;

  • 4. Then M1 reads next symbol, 0, and follows transition from q2 to q3
  • 5. In state q3 M1 reads 1 and follows transition to q3 to q2
  • 6. In state q2 the input was consumed, q2 is an accept state and M1
  • utputs accept

Finite Automata: Informal – p.19/20

slide-71
SLIDE 71

Note

  • M1 accepts strings that end with 1; Why?
  • M1 accepts strings that end with an even

number of 0-s following the last symbol 1; Why?

  • M1 rejects all other strings

Q: can you describe the language consisting from all strings accepted by M1?

Finite Automata: Informal – p.20/20

slide-72
SLIDE 72

Note

  • M1 accepts strings that end with 1; Why?
  • M1 accepts strings that end with an even

number of 0-s following the last symbol 1; Why?

  • M1 rejects all other strings

Q: can you describe the language consisting from all strings accepted by M1?

Finite Automata: Informal – p.20/20

slide-73
SLIDE 73

Note

  • M1 accepts strings that end with 1; Why?
  • M1 accepts strings that end with an even

number of 0-s following the last symbol 1; Why?

  • M1 rejects all other strings

Q: can you describe the language consisting from all strings accepted by M1?

Finite Automata: Informal – p.20/20

slide-74
SLIDE 74

Note

  • M1 accepts strings that end with 1; Why?
  • M1 accepts strings that end with an even

number of 0-s following the last symbol 1; Why?

  • M1 rejects all other strings

Q: can you describe the language consisting from all strings accepted by M1?

Finite Automata: Informal – p.20/20