Category: Theory of Computation & Automata

Equivalence Of F.S.A (Finite State Automata)

An Automaton is a machine that has a finite number of states. Any Two Automaton is said to be equivalent if both accept exactly the same set of input strings. Two Automaton are equivalent if they satisfy the following conditions : 1. The initial and final states of both the automatons must be same.2. Every pair of […]

Continue Reading

Program to construct a DFA to check if a given integer is unsigned or not

  #include “bits/stdc++.h”using namespace std;  string digits = “0123456789”, sign = “+-“;string dot = “.”, ex = “eE”;int dfa[11][4];  void makeDFA(){            dfa[0][0] = 1;          dfa[1][0] = 1;    dfa[1][2] = 3;    dfa[1][3] = 2;    dfa[1][4] = 6;      dfa[3][0] = 4;      dfa[4][0] = 4;    dfa[4][3] = 5;    dfa[4][4] = 6;      dfa[6][0] = 8;    dfa[6][1] = 7;      dfa[7][0] = 8;      dfa[8][0] = 8;    dfa[8][3] = 9;}  void buildDFA(){            for (int i = 0; i < 11; i++)        for […]

Continue Reading