So I have this problem in my logic homework that requires me to create a right-linear grammar. One of these problems is listed below with my current answer. The problem I'm having is how to make an emty set while still creating a right-linear grammar. If you guys could check it that would be awesome.
Write a right-linear grammar for each of the following languages.
0∗ 1∗
A language that has zero more instances of 0 followed by zero more instances of 1.
S → 0A
A → 0A
A → 1A
A → 1
A → 0
Note: I wrote out the language in simple English to make life easier for me.
You just have the add the following production rule
$S \rightarrow \epsilon$
where $\epsilon$ denotes the empty string. Sometime $\lambda$ is used in place for $\epsilon$.
$\textbf{EDIT:}$ Your production rules do not satisfy your language since $0^*1^*$ means any amount of zeros followed by any amount of ones. Your production rules allow for any binary string, such as 0110.
First build up the zeros and then the ones:
$S \rightarrow 0S \, | \, A$
$A \rightarrow 1A \, | \, 1 \, | \, \epsilon$
Notice how you can go from the start symbol to the empty string symbol without including any zeros or ones.