Using JFLAP

Given the alphabet of input symbols {a,b,c}. Use JFLAP to construct a PDA to recognize strings for which the number of a’s is twice the number of c’s. please take screen shots of important steps when you are using JFLAP, and briefly explain each step and your result.

## Expert Answer

A = {Q, ∑, Γ, δ, q_{0}, z_{0}, F} where

Q = {q_{0}, q_{1}, q_{2}, q_{3}, q_{4}} = set of states

∑ = {a, b, c} = input alphabet

Γ = {a, b, c, z_{0}} = stack alphabet

F = {q_{4}}

The PDA should accept input strings with symbols a, b and c where number of a’s is twice that of c’s.

The transition function δ is

δ(q_{0}, c, z_{0}) = {(q_{1}, az_{0})}

δ(q_{1}, c, c) = {(q_{1}, cc)}

δ(q_{1}, a, c) = {(q_{2}, c)}

δ(q_{2}, a, c) = {(q_{3}, λ)}

δ(q_{3}, a, c) = {(q_{2}, c)}

δ(q_{2}, b, c) = {(q_{3}, λ)}

δ(q_{3}, λ, z_{0}) = {(q_{4}, z0)}

Consider an input string aaaacc, the transitions are

δ(q_{0}, c, z_{0}) = {(q_{1}, cz_{0})}

δ(q_{1}, c, c) = {(q_{1}, cc)}

δ(q_{1}, a, c) = {(q_{2}, c)}

δ(q_{2}, a, c) = {(q_{3}, λ)}

δ(q_{3}, a, c) = {(q_{2}, c)}

δ(q_{2}, a, c) = {(q_{3}, λ)}

δ(q_{3}, λ, z0) = {(q_{4}, z_{0})}

Since it halts in final state, the string is accepted.