Give CFG and PDA for the words that start and end with the same symbol
A DFA is simple: From start state $A$ on 0 go to $B$, from $B$ with 0 go to $C$ (final), from $B$ with 1 stay in $B$, from $C$ with 0 stay in $C$, from $C$ with 1 go to $B$. Use a mirror for 1.

The PDA is just the DFA which essentially ignores the stack (rewrite the stack start symbol with itself on each move).

A CFG is just:
$$
\begin{align*}
S &amp;\rightarrow 0 A 0 \mid 1 A 1 \mid 0 \mid 1 \\
A &amp;\rightarrow 0 A \mid 1 A \mid \epsilon
\end{align*}
$$
A CFG more in line with the DFA is:
$$
\begin{align*}
S &amp;\rightarrow 0 A \mid 1 B \mid 0 \mid 1 \\
A &amp;\rightarrow 0 A \mid 1 A \mid 0 \\
B &amp;\rightarrow 0 B \mid 1 B \mid 1
\end{align*}
$$