Skip to main content
MathJaxified and a bit of grammar.
Source Link
rici
  • 12.1k
  • 22
  • 39

So, I have an excersiceexercise in which I have to write thea context free grammar for this language:

L = {x ∈ L(a∗b∗c∗) : |x|a > |x|c; |x|b > 0; |x|c ≥ 0},$$L = \{x \in L(a^∗b^∗c^∗) : |x|_a > |x|_c; |x|_b > 0; |x|_c ≥ 0\}$$

meaning every string with any number of a's$a$'s, b's$b$'s and c's$c$'s in that order, with the amount of a's$a$'s greater thatthan the amount of c's$c$'s and the amount of b's$b$'s greater than zero.

I am having trouble figuring out the rule that makes sure that the a'sthere are more $a$s than the c's$c$s.

I have:

S -> aABC | ab



A -> aA | a



B -> bB | b



C -> cC | c

I $$\begin{align}S&\to aABC | ab\\ A&\to aA | a\\ B&\to bB | b\\ C&\to cC | c\\ \end{align}$$ I know this is wrong because I sholudshould be adding an a everytime$a$ every time I add a c$c$, but I don't know how to write that.

So, I have an excersice in which I have to write the context free grammar for this language

L = {x ∈ L(a∗b∗c∗) : |x|a > |x|c; |x|b > 0; |x|c ≥ 0}, meaning every string with any number of a's, b's and c's in that order, with the amount of a's greater that the amount of c's and the amount of b's greater than zero.

I am having trouble figuring out the rule that makes sure that the a's are more than the c's.

I have:

S -> aABC | ab



A -> aA | a



B -> bB | b



C -> cC | c

I know this is wrong because I sholud be adding an a everytime I add a c, but I don't know how to write that.

So, I have an exercise in which I have to write a context free grammar for this language:

$$L = \{x \in L(a^∗b^∗c^∗) : |x|_a > |x|_c; |x|_b > 0; |x|_c ≥ 0\}$$

meaning every string with any number of $a$'s, $b$'s and $c$'s in that order, with the amount of $a$'s greater than the amount of $c$'s and the amount of $b$'s greater than zero.

I am having trouble figuring out the rule that makes sure there are more $a$s than $c$s.

I have: $$\begin{align}S&\to aABC | ab\\ A&\to aA | a\\ B&\to bB | b\\ C&\to cC | c\\ \end{align}$$ I know this is wrong because I should be adding an $a$ every time I add a $c$, but I don't know how to write that.

deleted 1 character in body
Source Link

So, I have an excersice in which I have to write the context free grammar for this language

L = {x ∈ L(a∗b∗c∗) : |x|a > |x|c; |x|b > 0; |x|c ≥ 0}, meaning every string with any number of a's, b's and c's in that order, with the amount of a's greater that the amount of c's and the amount of b's greater than zero.

I am having trouble figuring out the rule that makes sure that the a's are more than the c's.

I have:

S -> aAbBCaABC | ab



A -> aA | a



B -> bB | b



C -> cC | c

I know this is wrong because I sholud be adding an a everytime I add a c, but I don't know how to write that.

So, I have an excersice in which I have to write the context free grammar for this language

L = {x ∈ L(a∗b∗c∗) : |x|a > |x|c; |x|b > 0; |x|c ≥ 0}, meaning every string with any number of a's, b's and c's in that order, with the amount of a's greater that the amount of c's and the amount of b's greater than zero.

I am having trouble figuring out the rule that makes sure that the a's are more than the c's.

I have:

S -> aAbBC | ab



A -> aA | a



B -> bB | b



C -> cC | c

I know this is wrong because I sholud be adding an a everytime I add a c, but I don't know how to write that.

So, I have an excersice in which I have to write the context free grammar for this language

L = {x ∈ L(a∗b∗c∗) : |x|a > |x|c; |x|b > 0; |x|c ≥ 0}, meaning every string with any number of a's, b's and c's in that order, with the amount of a's greater that the amount of c's and the amount of b's greater than zero.

I am having trouble figuring out the rule that makes sure that the a's are more than the c's.

I have:

S -> aABC | ab



A -> aA | a



B -> bB | b



C -> cC | c

I know this is wrong because I sholud be adding an a everytime I add a c, but I don't know how to write that.

Source Link

Help with context free grammar excercise

So, I have an excersice in which I have to write the context free grammar for this language

L = {x ∈ L(a∗b∗c∗) : |x|a > |x|c; |x|b > 0; |x|c ≥ 0}, meaning every string with any number of a's, b's and c's in that order, with the amount of a's greater that the amount of c's and the amount of b's greater than zero.

I am having trouble figuring out the rule that makes sure that the a's are more than the c's.

I have:

S -> aAbBC | ab



A -> aA | a



B -> bB | b



C -> cC | c

I know this is wrong because I sholud be adding an a everytime I add a c, but I don't know how to write that.