0

Given contextfree Grammar G = ({S,A,B,C}, Σ, P, S) with Alphabet set of Σ = {a, b} and has following Production rules:

S → AA ∣ BA ∣ BB ,
A → a ∣ AC ∣ BC ,
B → b ∣ CS ,
C → b

Question is, how many prefix does word w = bbbaaa in the Language G have?

Using CYK Algorithm, I figured out that w is in the Lanuguage G. Total number of prefix that I figured out for this word are 4. They are b, bb, bbba, bbbaa. Can there be more prefix for this word?

enter image description here

viradia
  • 35
  • 1
  • 8
  • Welcome to Stack Overflow. Please take the [tour] to learn how Stack Overflow works and read [ask] on how to improve the quality of your question. Then check the [help/on-topic] to see which questions are on-topic on this site. You might want to delete this question and ask it on https://cs.stackexchange.com/ instead, but check the help pages there first. – Progman Jan 31 '23 at 20:13

0 Answers0