1 / 50

# Single Final State for NFAs and DFAs - PowerPoint PPT Presentation

Single Final State for NFAs and DFAs . Observation. Any Finite Automaton (NFA or DFA) can be converted to an equivalent NFA with a single final state. Equivalent NFA. Example. NFA. Equivalent NFA. Single final state. In General. NFA. Add a final state Without transitions.

Related searches for Single Final State for NFAs and DFAs

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.

## PowerPoint Slideshow about 'Single Final State for NFAs and DFAs' - carson

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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

### Single Final State for NFAs and DFAs

• Any Finite Automaton (NFA or DFA)

• can be converted to an equivalent NFA

• with a single final state

Example

NFA

Single

final state

In General

NFA

Without transitions

Extreme Case

NFA without final state

### Some Properties of Regular Languages

Concatenation:

Are regular

Languages

Star:

Properties

For regular languages and

we will prove that:

Concatenation:

Star:

We Say:

Regular languages are closed under

Regular language

NFA

NFA

Single final state

Single final state

• NFA for

NFA for

• NFA for

• NFA for

• NFA for

• NFA for

### Regular Expressions

• Regular expressions

• describe regular languages

• Example:

• describes the language

Are regular expressions

Recursive Definition

Primitive regular expressions:

Examples

A regular expression:

• : language of regular expression

• Example

• For primitive regular expressions:

• For regular expressions and

• Regular expression:

• Regular expression

• Regular expression

two consecutive 0 }

Example

• Regular expression

two consecutive 0 }

Example

• Regular expression

• Definition:

• Regular expressions and

• are equivalent if

are equivalent

regular expr.

Example

= { all strings with at least

two consecutive 0 }

### Regular ExpressionsandRegular Languages

Languages

Generated by

Regular Expressions

Regular

Languages

1. For any regular expression

the language is regular

Theorem - Part 1

Languages

Generated by

Regular Expressions

Regular

Languages

2. For any regular language there is

a regular expression with

Theorem - Part 2

Languages

Generated by

Regular Expressions

Regular

Languages

1. For any regular expression

the language is regular

Proof by induction on the size of

Proof - Part 1

regular

languages

Induction Basis

• Primitive Regular Expressions:

• Assume

• for regular expressions and

• that

• and are regular languages

• We will prove:

Are regular

Languages

Regular languages are closed under

union

concatenation

star

By inductive hypothesis we know:

and are regular languages

Are regular

languages

is a regular language

2. For any regular language there is

a regular expression with

Proof by construction of regular expression

Single final state

Example:

• Removing states: