Deepa Mam
Deepa Mam
```
a b
→(q0) ──▶ (q1) ──▶ (q2) (Accepting state)
```
4. Here is a DFA that accepts all strings generated with "a" and "b"
but start with "ba":
- States: {q0, q1, q2}
Assignment -1
- Alphabet: {a, b}
- Start state: q0
- Accepting state: q1
- Transition function:
- δ(q0, b) = q1
- δ(q1, a) = q2
- δ(q1, b) = q1
- δ(q2, a) = q2
- δ(q2, b) = q2
```
a b
→(q0) ──▶ (q1) ──▶ (q2) (Accepting state)
```
```
a b
→(q0) ──▶ (q1) ──▶ (q2) (Accepting state)
```
Regular expression of q4: The regular expression for the DFA in question 4
is "ba(a+b)*".
DFA of ab(a+b)*a:
- States: {q0, q1, q2}
- Alphabet: {a, b}
- Start state: q0
- Accepting state: q2
- Transition function:
- δ(q0, a) = q1
- δ(q1, b) = q2
- δ(q2, a) = q2
- δ(q2, b) = q2
```
a b
→(q0) ──▶ (q1) ──▶ (q2) (Accepting state)
```
This PDA pushes an 'A' onto the stack for each 'a' it reads. When it
encounters a 'b', it pops an 'A' from the stack. If the input string is
reversible (can be read the same forwards and backwards), the PDA
will continuously loop between states q0 and q2, ultimately reaching
the accepting state q0.