Go Back   TestMagic Forums > Test preparation > GRE Subject Tests > GRE Computer Science
Register FAQForum Rules Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 08-12-2008, 05:53 PM   #1 (permalink)
kenshinofkin
Trying to make mom and pop proud
 
Join Date: Aug 2008
Posts: 1
kenshinofkin just joined TestMagic.
Context-Free

Hello all! I am having a problem with this one context-free grammar if some one could help that would be great!

Create a context-free grammar that generates the language a^nb^(n m)c^m.

I came up with this so far:

S -> aAc
A -> bb

But this only does the case with abbc. Can anyone help with this one?
kenshinofkin is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Google Bookmark this Post!Reddit!
Reply With Quote
Old 11-01-2008, 08:49 PM   #2 (permalink)
azk
Eager!
 
Join Date: Oct 2008
Location: Vietnam
Posts: 33
azk has disabled reputation
is it a^n b^(n+m) c^m ? because it accepts abbc
if it is so then we can use
S -> LR
L -> aLb |e
R -> bRc |e
azk is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Google Bookmark this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

What you can do
You cannot post new threads
You cannot post replies
You cannot post attachments
You cannot edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 06:04 PM.

Contact TestMagic   TestMagic Forums      Archive   

Link to TestMagic   TestMagic Locations   Legal   Privacy

Partner Sites: GMAT Sentence Correction   SAT 2400

Content Relevant URLs by vBSEO 3.0.0
Copyright © 1998-2008 TestMagic
Ad Management by RedTyger

Scroll Up