Abstract

This document provides formal definitions for both the DFAs provided for HW1 assignment, and includes generated state diagrams.


DFA Definition

We define a DFA as a 5 tuple:

Where:

  • is a finite set of states
  • is a finite set of symbols
  • is the transition function
  • is the start state
  • is the Set of accepting states

DFA 1: Recognizing Bit Strings Starting and Ending with Different Symbols

Purpose: To recognize all binary strings that begin and end with different symbols

Formal Definition

For this case we define the DFA variables as:

Q:

:

(Transition Function) Stats:

:

:

State Definition

Start State

First bit is 0

First bit is 1

Accept State when starting with 1 and ending with 0

Accept State when starting with 0 and ending with 1

Diagram

Made with mermaid


DFA 2: Recognize All Bit Strings Ending in 0 or Having a Length that is a Multiple of 3

Purpose: To accept all binary strings that either end with 0 or have a length that is divisible by 3

Formal Definition

For this case we define the DFA variables as:

Q:

:

(Transition Function) Stats:

:

:

State Definition

Start State AND Accept State when string has length divisible by 3.

When the string is of length

When the string is of length

Accept State when string ends in 0

Diagram

made with mermaid