Cramster.com - Homework Solutions, Lecture Notes, Exams, and Free Online Homework Help
Sign Up Now! Login Customer Support
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:

Computer Science (Theory of Automata)

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 (0%):
Date Posted: 7/14/2008 10:40:18 AM  Status: Live
Computer Science (Theory of Automata)
Course Textbook Chapter Problem
N/A N/A N/A N/A
Question Details:
 

Question 2:   a. Give the context free grammars that generate the following languages. In both parts the alphabet S = {0, 1}

(i)                  {w | w contains at lest three 1’s}

(ii)                {w | the length of w is odd and its middle symbol is a 0}

b. Give context free grammars generating the following languages.

            (i) The set of strings over the alphabet {a, b} with more a’s than b’s

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

Answers:

Member's Avatar

Scholar
Karma Points: 208
Date Posted: 7/14/2008 8:35:35 PM  Status: Live
Asker's Rating: None Provided    Moderator's Rating: N/A
Response:
hi, here is your answre no.1

i)       Generating the strings aabbaa

 

   S => XS

       aaXS

       aabbXS

       aabbaaL

      aabbaa

 

ii) Generating the strings bbaabb

   S => XS

       bbXS

       bbaaXS

       bbaabbL

       bbaabb


Cramster Expert

Member's Avatar

(Cramster SME)
Cramster In-House Subject Matter Expert
Date Posted: 7/24/2008 5:38:30 AM  Status: Live
Asker's Rating: None Provided    Moderator's Rating: N/A
Response:
Dear User,
 
a)
1) Context free grammar :
      
      S U111V
      U0U|1U|ε
      V0V|1V|ε
 
2) Context free grammar:  
     
      SASA|0
      A0|1
 
b)
Context free grammar :

1)     
S SAB|BAB
         A aA|a
         B BbBa|BaBb|ε 

Context free grammar :
2)     
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.