Draw a CFG (context-free-grammar) that starts and ends with the same symbol yet has odd number of 1's

I figured out that the CFG that starts and ends with the same symbol in alphabet $$\Sigma=\{0,1\}$$ will be : S -> 0A0|1A1|0|1|

A -> 0A|1A|𝜖

How can i interpret the odd number of 1's also?

• Let $B$ be the set of all strings with an even number of 1's, and $C$ the set of all strings with an odd number of 1's. Write productions for $B$ and $C$ (depending on each other). Then figure out how to modify the $S$ you already wrote. Nov 23 '20 at 22:39
• Your language is regular. Construct a regular expression and convert it to a context-free grammar. Nov 23 '20 at 22:51