Single final state for nfas and dfas
Download
1 / 50

Single Final State for NFAs and DFAs - PowerPoint PPT Presentation


  • 91 Views
  • Updated On :

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

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

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


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.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

Single Final State for NFAs and DFAs


Observation
Observation

  • Any Finite Automaton (NFA or DFA)

  • can be converted to an equivalent NFA

  • with a single final state


Single final state for nfas and dfas

Equivalent NFA

Example

NFA


Single final state for nfas and dfas

Equivalent NFA

Single

final state

In General

NFA


Single final state for nfas and dfas

Add a final state

Without transitions

Extreme Case

NFA without final state


Some properties of regular languages

Some Properties of Regular Languages


Properties

Union:

Concatenation:

Are regular

Languages

Star:

Properties

For regular languages and

we will prove that:


We say

Union:

Concatenation:

Star:

We Say:

Regular languages are closed under


Single final state for nfas and dfas

Regular language

Regular language

NFA

NFA

Single final state

Single final state



Union
Union

  • NFA for


Example1
Example

NFA for


Concatenation
Concatenation

  • NFA for


Example2
Example

  • NFA for



Example3
Example

  • NFA for



Regular expressions1
Regular Expressions

  • Regular expressions

  • describe regular languages

  • Example:

  • describes the language


Recursive definition

Given regular expressions and

Are regular expressions

Recursive Definition

Primitive regular expressions:


Examples

Not a regular expression:

Examples

A regular expression:


Languages of regular expressions
Languages of Regular Expressions

  • : language of regular expression

  • Example


Definition
Definition

  • For primitive regular expressions:


Definition continued
Definition (continued)

  • For regular expressions and


Example4
Example

  • Regular expression:


Example5
Example

  • Regular expression


Example6
Example

  • Regular expression


Example7

= { all strings with at least

two consecutive 0 }

Example

  • Regular expression


Example8

= { all strings without

two consecutive 0 }

Example

  • Regular expression


Equivalent regular expressions
Equivalent Regular Expressions

  • Definition:

  • Regular expressions and

  • are equivalent if


Example9

and

are equivalent

regular expr.

Example

= { all strings with at least

two consecutive 0 }


Regular expressions and regular languages

Regular ExpressionsandRegular Languages


Theorem
Theorem

Languages

Generated by

Regular Expressions

Regular

Languages


Single final state for nfas and dfas

1. For any regular expression

the language is regular

Theorem - Part 1

Languages

Generated by

Regular Expressions

Regular

Languages


Single final state for nfas and dfas

2. For any regular language there is

a regular expression with

Theorem - Part 2

Languages

Generated by

Regular Expressions

Regular

Languages


Proof part 1

1. For any regular expression

the language is regular

Proof by induction on the size of

Proof - Part 1


Induction basis

NFAs

regular

languages

Induction Basis

  • Primitive Regular Expressions:


Inductive hypothesis
Inductive Hypothesis

  • Assume

  • for regular expressions and

  • that

  • and are regular languages


Inductive step
Inductive Step

  • We will prove:

Are regular

Languages



Single final state for nfas and dfas

We also know:

Regular languages are closed under

union

concatenation

star

By inductive hypothesis we know:

and are regular languages


Single final state for nfas and dfas

Are regular

languages


Single final state for nfas and dfas

is a regular language


Proof part 2
Proof – Part 2

2. For any regular language there is

a regular expression with

Proof by construction of regular expression


Single final state for nfas and dfas

Single final state


Single final state for nfas and dfas

Example:





In general
In General

  • Removing states: