Finite Automata

Design context-free grammars for the following languages: the set of all strings with twice as many 0’s as 1’s.
JavaranchAsked:
Who is Participating?
 
GwynforWebConnect With a Mentor Commented:
It is a well known grammar

S --> S1S0S0S | S0S1S0S | S0S0S1S | e

proving it does the job of course is a different matter.
0
 
ozoCommented:
Is this homework?
0
 
SuperdaveCommented:
Also it doesn't have anything to do with finite automata, which are "regular languages" and can't do that.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
NeilHKCommented:
I can't claim this, I found it but take a look......

S --> S1S0S0 | S0S1S0 | S0S0S1 | e
  example
   generate this string      001001010100010
       S -->  S0S1S0
          --> S0S0S10S1S0
          --> 0010S1S0
          --> 0010S0S1S0S1S0
          --> 001001S0S1S00S1S0
          --> 00100101S0S1S000S1S0
          -->001001010100010
   Generate the string 111000000
        S --> S1S0S0
           --> S1S1S0S00S0
           --> S1S1S1S0S00S00S0
           --> 111000000
0
 
GwynforWebCommented:
NeilHK,  You have copied and pasted my answer?
0
 
NeilHKCommented:
GwynforWeb, Just an example of your answer Gwyn. As I said, I can not take credit for it.
0
 
a0vanc01Commented:
S  -> S1 | S2 | S3
S1 -> 001S | 001 (lambda)
S2 -> 010S | 010(lambda)
S3 -> 100S | 100(lambda)
0
 
EE_AutoDeleterCommented:
I've requested that this question be deleted for the following reason:

No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I have recommended this question be closed as follows:

Not enough information to confirm an answer.

If you feel this question should be closed differently, post an objection and a moderator will read all objections and then close it as they feel fit. If no one objects, this question will be closed automatically the way described above.

Experts-Exchange Auto Deleter
0
 
ozoCommented:
GwynforWeb's answer is correct.
0
All Courses

From novice to tech pro — start learning today.