0% found this document useful (0 votes)
15 views30 pages

Automata Lec#5

Chapter 5 discusses finite automata (FA), which are deterministic machines that transition between a finite number of states based on input, with no choices involved. It defines the concept of states, final states, and the language recognized by an FA, illustrating these concepts with examples and transition diagrams. The chapter also touches on various types of FA, including those that accept specific strings and those that accept no language at all.

Uploaded by

wajeehaasad02
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views30 pages

Automata Lec#5

Chapter 5 discusses finite automata (FA), which are deterministic machines that transition between a finite number of states based on input, with no choices involved. It defines the concept of states, final states, and the language recognized by an FA, illustrating these concepts with examples and transition diagrams. The chapter also touches on various types of FA, including those that accept specific strings and those that accept no language at all.

Uploaded by

wajeehaasad02
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 30

CHAPTER 5

FINITE
AUTOMATA
Finite Automata
• Play a board game in which two players move
pieces around different squares.
• Throw dice to determine where to move.
• Players have no choices to make when making
their move. The move is completely determined
by the dice.
• A player wins if after 10 throws of the dice, his
piece ends up on a certain square.
• Note that no skill or choice is involved in the
game.
• Each possible position of pieces on the board is
called a state.
• Every time the dice are thrown, the state changes
according to what came up on the dice.
• We call the winning square a final state (also
known as a halting state, terminal state, or
accepting state).
• There may be more than one final state.
Deterministic Computer
• The computer is deterministic, i.e., on reading
one particular input instruction, the machine
converts itself from one given state to some
particular other state (which is possibly the
same), where the resultant state is completely
determined by the prior state and the input
instruction.
• No choice is involved.
Finite Automata (FA)
• A finite automaton:
– “Finite" because the number of possible states and number
of letters in the alphabet are both finite
– “Automaton" because the change of states is totally
governed by the input.
• It is automatic (involuntary and mechanical) not willful,
just as the motion of the hands of a clock is automatic
while the motion of the hands of a human is
presumably the result of desire and thought.
• "Automaton“ comes to us from the Greek, so its correct
plural is "automata."
FA: Definition

It is also called a finite acceptor because its sole


job is to accept certain input strings and run on
them.
FA-Definition
• Suppose that the input alphabet has only the two letters a
and b.
• Let us also assume that there are only three states, x, y, and z.
• Let the following be the rules of transition:
1. From state x and input a go to state y.
2. From state x and input b go to state z.
3. From state y and input a go to state x.
4. From state y and input b go to state z.
5. From state z and any input stay at state z.
• Let us also designate state x as the starting state and state z
as the only final state.
Language Recognizer
• The set of all strings that do leave us in a final state is
called the language defined by the finite automaton.
• The set of all strings accepted is the language associated
with the FA.
• We say, this FA accepts the language L, or L is the language
accepted by this FA.
• When we wish to be anthropomorphic, we say that L is
the language of the FA.
• The only job an FA does is define the language it accepts
which is a fine reason for calling it an acceptor, or better
still a language recognizer.
What is the Regular Expression of Describe
Scenario?

(a + b)*b(a + b)*
The transition table for the FA
Transition Diagram from Transition Table
Paths generated by the input
strings aaaabba and bbaabbbb
Example

The language accepted by this machine is the set of all strings except .
^
This has the regular expression definitions
Example
One of the many FA's that accepts all words is:
Example
• FA's that accept no language. These are of two types:
– FA's that have no final states, such as

• FA's in which the circles that represent the final states


cannot be reached from the start state.
Example
• FA's in which the circles that represent the
final states cannot be reached from the start
state.
Example
• Suppose we want to build a finite automaton
that accepts all the words in the language

OR
a four-state
machine
Example
A five-state machine
Example
Example

• This machine will accept all words with b as the third letter and reject all other
words. The first couple of states are only waiting states eating up the first two
letters of input.
• A word that has fewer than three letters cannot qualify, and its path ends in one of
the three lefthand states, none of which is designated +.

OR
Example
• FA, one that accepts only the word baa.

L = {baa}
Example
• FA accepts exactly the two strings baa and ab.
Example
Example
Example

• FA accepts only the word


^
Example

• When we read an a we go to the righthand state and when are read a b we go to


the left-hand state.
• Any input string that ends in the + state must end in the letter a, and any string
ending in a must end in +. Therefore, the language accepted by this machine is
Example

If we add A we get the language of all words that do not


end in b.
Example

The language accepted by this machine is all words with an odd number of a's.
Example

This machine will accept the language of all words with a double a in them somewhere.
Example
• FA accepts all words that have different first
and last letters.
• If the word begins with an a, to be accepted it
must end with a b and vice versa.
EVEN-EVEN FA

You might also like