My Computer Forum Computer Science Forum

Go Back   My Computer Forum > Computer Science Forum > Computer Science

Computer Science Computer Science is the scientific and practical approach to computation and its applications.


Reply
 
LinkBack Thread Tools Display Modes
November 3rd, 2010, 07:16 PM   #1
 
Joined: Nov 2010
Posts: 1
CFG

I am sabrina, year 10 at school. I have question of how to write Context free grammar >

The set of all strings beginning with a string of occurrences of the first
(alphabetically) letter specified above, and ending with a string of occurrences
of the second letter specified above. In the middle is a string of the character
c. If the number of occurrence of the first letter is n and the number of
occurrence of the second letter is m, then the number of occurrences of c is x.n
+ y.m + 1.
For example, if your login was ab036, the language is a^n c^x.n + y.m + 1b^m, with x=1, y=2,
and includes accccccbb and aacccccb.

And this is what I actually wrote below to write the context free grammar:

S -> ABC
A - > Aa
A - > a
B - > Bb
A - > b
C - > c

is this correct? Please I need help and i am trying to learn my best. Thank you for your help.

Regards

Sabrina
sabrina1234 is offline  
 

My Computer Forum is free to register and we welcome everyone!

Reply

  My Computer Forum > Computer Science Forum > Computer Science

Tags
cfg



Thread Tools
Display Modes






Copyright © 2018 My Computer Forum Forum. All rights reserved.