Question:
Define NFA for the following languages :
- $L_1=\{\sigma w \sigma\big| \sigma\in\{a,b,c\},w\in\{a,b,c\}^*\}$
- $L_n=\{w\in\{0,1\}^* \big| the \ n^{th} \ from \ last \ char\ is\ 1\}$
$Solution.A.$ we define NFA for $L_1$. Let $$A=( Q,\Sigma ,q_{0} ,\delta ,F)$$such that,$$ \begin{array}{l} Q=\{q_{0} ,q_{1} ,q_{2}\}\\ \Sigma =\{a,b,c\}\\ F=\{q_{2}\} \end{array}$$ and let $\displaystyle \delta :( Q\times \Sigma )\rightarrow \mathcal{P}( Q)$ the transition function such that: $$\forall \sigma \in \Sigma :\delta (\{q_{0}\} ,\sigma ) =\{q_{1}\} \land \delta (\{q_{2}\} ,\sigma ) =\{q_{1} ,q_{2}\} \land \delta ( q_{2} ,\Sigma \backslash \{\sigma \}) =\{q_{1}\}$$ $Solution.B. $ we define NFA for $L_n$. Let $$A=( Q,\Sigma ,q_{0} ,\delta ,F)$$such that, $$ \begin{array}{l} Q=\{q_{0} ,q_{1} ,q_{2} ,\dotsc ,q_{n}\}\\ \Sigma =\{0,1\}\\ F=\{q_{n}\} \end{array}$$and let $\delta :( Q\times \Sigma )\rightarrow \mathcal{P}( Q)$ the transition function such that:$$ \begin{array}{l} \delta (\{q_{0}\} ,0) =\{q_{0}\} \ \\ \delta (\{q_{0}\} ,1) =\{q_{0} ,q_{1}\}\\ \forall n\geq 2,i\in [ 2,n] :\delta (\{q_{i-1}\} ,\sigma ) =\{q_{i}\} \end{array}$$
I am not sure whether I wrote the definition properly in terms of formally. Therefore, I will be glad to see what you think about it. Thanks!