I am trying to figure out the CFG of the given language.
The language is:
(number of b) = (number of a) + (number of c)
eg: bbac, bbbabcac ...
When I only consider the (number of b) = (number of a). I find a CFG something like this.
S -> aSbS | bSaS | €
But I cannot upgrade this CFG to the triple equality.
Any help is appreciated.
How about:
\begin{align} S &\gets XSbS \mid bSXS \mid \varepsilon\\ X &\gets a \mid c \end{align}