## Design a DFA for Language: “Starting with ‘a’ “

∑ = {a, b}

Procedure to design a machine form given Language:

1. First write some set of strings accepted by the machine: L = {a, aa, aab, aabb, ….}.

2. Design the machine for the smallest accepted string (Here ‘a’).

3. Here we will design DFA so, every input move is compulsory for all states. Now assign the rest of the inputs moves to corresponding states as per the language given.

L(${{\mathbit{M}}}_{{\mathbf{1}}}$) = a(a + b)* (Regular expression)

Now we calculate grammar from the above machine:

Taking a variable name for each node like for ${{\mathbit{q}}}_{{\mathbf{0}}}$ we assign S and ${{\mathbit{q}}}_{{\mathbf{1}}}$ as A. We cannot consider trap state at time of grammar construction.

Now we check from S (${{q}}_{{0}}$)  where we can go. From S we can go A (${{q}}_{{1}}$)  by input a.

So, we can write S → aA.

From S (${{q}}_{{0}}$) we can go ${{q}}_{{t}}$ by input bBut we do not consider this move as grammar because it is a trap state.

Now, same way we can calculate all moves of A (${{q}}_{{1}}$).

From A (${{q}}_{{1}}$) we can go A (${{q}}_{{1}}$) itself by input self-loop a. So, A → aA.

From A (${{q}}_{{1}}$) we can go A (${{q}}_{{1}}$) itself by input self-loop bSo, A → bA

And because of A (${{q}}_{{1}}$) is the final state λ is also allowed to remember all final states accept λ.

So, A → λ.

All together we can write production for A:

A → aA | bA | λ

Now grammar of the above machine:

S → aA

A → aA | bA | λ