Cramster.com - Homework Solutions, Lecture Notes, Exams, and Free Online Homework Help
Sign Up Now! Login Customer Support Cramster Blog
McAfee Secure sites help keep you safe from identity theft, credit card fraud, spyware, spam, viruses and online scams
Problem Solved.
    Home    
    Homework Help    
   Answer Board   
    Resources (Beta)    
   
Member's Topic Headline:

CFG

Know the answer? Have a better solution? Share it.
Get Help Now.
View homework problems
explained for free!
Member Testimonials

Question:

Advertisement:

Answer | Ask New Question | Customize Profile | Leaderboards | 
FAQ

Member's Avatar

Rookie
Karma Points: 0
Respect (20%):
Date Posted: 7/14/2008 9:21:26 PM  Status: Live
CFG
Course Textbook Chapter Problem
N/A theory of automata N/A N/A
Question Details:
 

Question  Give context free grammars generating the following languages.

           {w#w | wR is a substring of x for w, x ? {0, 1}*}

Answers:

Member's Avatar

Mentor
Karma Points: 527
Date Posted: 7/14/2008 9:50:48 PM  Status: Live
Asker's Rating: None Provided    Moderator's Rating: Somewhat Helpful
Response:
hi frnd,

Give unambiguous context-free grammars for each of the following languages:
  1. The language of identifiers, whose elements are sequences of letters or digits, starting with a letter
  2. The language of natural numbers, whose elements are sequences of digits, starting with a digit different from 0
  3. The language of real numbers, in which either the integer part or the fractional part can be empty, but not both. Thus the grammar must allow 12., 1.2, .12, but not a decimal point by itself.




Cramster Expert

Member's Avatar

(Cramster SME)
Cramster In-House Subject Matter Expert
Date Posted: 7/24/2008 5:44:40 AM  Status: Live
Asker's Rating: None Provided    Moderator's Rating: N/A
Response:
Dear User,

Context free grammar :

         S AB
         A 0A0|1A1|X
         B 0B|1B0|0|1|ε
         X X0|X1|$



By reading or posting messages on these forums, you are agreeing to the Answer Board's Terms of Service and Conduct (TSC).


About Cramster | Terms of Use | Privacy Policy | Contact Us | Press Room | Site Map | Support | Anti-Cheating Policy

Cramster.com is not affiliated with any publisher. Book covers, title and author names appear for reference only.
Copyright © 2008 Cramster, Inc.