Questions tagged [context-free-language]

In formal language theory, a context-free language (CFL) is a language generated by some context-free grammar (CFG). The set of regular languages is a subset of the set of context-free languages.

183 questions
-2
votes
1 answer

How do I find the language for a context free grammar?

I am having trouble determining the language from a given context free grammar. I've been given a hint that there are 2 parts to the language but cant figure either out. G= ({S,A,B,C,D,E,Z},(0,1),R,S), S→E|Z E→A|C A→01B|0A|e B→1B|10A…
jordan neely
  • 39
  • 1
  • 6
-2
votes
1 answer

Is this languages REGULAR / CONTEXT FREE but not REG / Nothing?

(1) {((a^2)(b^4)ab)^(3k) : k>=0} (2) {a^(2n)b^(3n) : n >= 7} (3) {a^(2n)b^(3n) : n <= 7} No clue for this one. I think it's contextFree cause there is no limitation on n, unlike 3) we can't build a finite automate but we can build a Grammar: S…
-2
votes
1 answer

Provide a context-free grammar that generates odd length language {w = 0*1* : |w| is odd}

Provide a context-free grammar that generates the following language over Σ = {0,1}: {w = 0*1* : |w| is odd} My Solution: S->AB|0|1 A->0A|^ B->1B|^ But using this grammar we are able to create an even number of string. I want grammar that produces…
1 2 3
12
13