Question

1. Who are language descriptions intended for? Consider the following grammar: ab b | b a...

1. Who are language descriptions intended for?

Consider the following grammar: ab b | b a | a

Which of the following sentences are in the language generated by this grammar? (DONE)

a) baab ==> YES

b) bbbab ==> NO

c) bbaaaaaS ==> NO

d) bbaab ==> YES

2. Write a BNF grammar for the language consisting of binary strings (any combination of 0s and 1s) of at least 2 digits.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Hello, please comment if there is any more requirement from the question. I will be happy to help. Please give a thumbs up if the solution helped you.

Please comment if help needed with first question.

Answer 2 :

BNF for binary string or at least 2 digits would be :

<BS> ::= 0 0 <BS> | 0 1 <BS> | 1 0 <BS> | 1 1 <BS> | 0 0 | 0 1 | 1 0 | 1 1

BS denotes binary string.

Add a comment
Know the answer?
Add Answer to:
1. Who are language descriptions intended for? Consider the following grammar: ab b | b a...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Consider the following grammar: <S> → <A> a <B> b <A> → <A> b | b...

    Consider the following grammar: <S> → <A> a <B> b <A> → <A> b | b <B> → a <B> | a Which of the following sentences are in the language generated by this grammar? baab bbbab bbaaaaaS bbaab Please explain why

  • Consider the following grammar: <S> → <A> a <B> b <A> → <A> b | b...

    Consider the following grammar: <S> → <A> a <B> b <A> → <A> b | b <B> → a <B> | a             Is the following sentence in the language generated by this grammar?             baab Consider the following grammar: <S> → a <S> c <B> | <A> | b <A> → c <A> | c <B> → d | <A>             Is the following sentence in the language generated by this grammar? acccbcc SHOW WORK

  • 1. Consider the following grammar A - aB B-Sb (a) Show a derivation tree for the...

    1. Consider the following grammar A - aB B-Sb (a) Show a derivation tree for the string aabbbb using the grammar. (b) Give an English description of the language generated by the grammar 2. Let G be the grammar below: S-ASB ab | SS (a) Show that G is ambiguous. (b) Construct an unambiguous grammar equivalent to G. 3. Find a context free grammar for the language L3- fa"b"c+m :n,m21) 4. Find a context free grammar for the language L4...

  • 13.) Write a grammar for the language consisting of strings that have n copies of the...

    13.) Write a grammar for the language consisting of strings that have n copies of the letter a followed by one more number of copies of the letter b, where n>0. For example, the strings abb, aaaabbbbb, and aaaaaaaabbbbbbbbb are in the language but a, ab, ba, and aaabb are not. Answer the aaaaaabbbbbbbh are in the languagebr 14.) Draw parse trees for the sentences abb and aabbb, as derived from the grammar of Problem 13. Answer:

  • For each of the following, create an NFA that recognizes exactly the language described. (1) The...

    For each of the following, create an NFA that recognizes exactly the language described. (1) The set of binary strings with at most three 0s or at least four 1s. (2) The set of binary strings that contain the substring 000 and whose third to last digit is 1.

  • Give English descriptions of the languages represented by the following regular expressions. The descriptions should be...

    Give English descriptions of the languages represented by the following regular expressions. The descriptions should be simple, similar to how we have been defining languages in class(e.g., “languages of binary strings containing 0 in even positions. . .”). Note: While describing your language, you don’t want to simply spell out the conditions in your regular expressions. E.g., if the regular expression is 0(0 + 1)∗, an answer of the sort “language of all binary strings that start with a 0”...

  • Consider the following grammar (S, A, B, and C are nonterminal symbols; S is the start...

    Consider the following grammar (S, A, B, and C are nonterminal symbols; S is the start symbol; 0 and 1 are terminal symbols): S → AA A → BCB B → B0 | B1 | 0 | 1 C → 00 | 11 Which of the following sentences are in the language generated by the grammar? Show derivations for the sentences that can be generated. If a sentence cannot be generated by the grammar, explain why. a) 10010001 b) 01101101...

  • 3. For each of the following languages, . State whether the language is finite or infinite....

    3. For each of the following languages, . State whether the language is finite or infinite. . State whether the language is regular or nonregular. . If you claim the language is regular: give a DFA (graphical representation) that recog- nizes the language. . If you claim that the language is not regular, describe the intuition for why this is so. Consider the following languages (a) [8 marks] The language of 8 bit binary strings that begin and end with...

  • Question 9 (10 points) Consider the following EBNF grammar for a "Calculator Language": <calculation> <expr> =...

    Question 9 (10 points) Consider the following EBNF grammar for a "Calculator Language": <calculation> <expr> = <expr> > <term> (+1-) <expr> <term <term> <factor> (* ) <term> <factor> <factor> > (<expr>) value> <value> → [<sign> ] <unsigned [. <unsigned> ] <unsigned> <digit> { <digit> } <digit → 011121314151617189 <sign → + - which of the following sentences is in the language generated by this grammar? Whx.2 a. 3/+2.5 = b. 5- *3/4= c. (3/-2) + 3 = d. 5++3 =

  • Use left-factoring to find an equivalent LL(k) grammar for the following grammar where k is as...

    Use left-factoring to find an equivalent LL(k) grammar for the following grammar where k is as small as possible. Fill out the following blanks S rightarrow abA A rightarrow ab| Lambda Solution: The language generated by the given grammar is: L = _____ The given grammar is _____ By factoring ab out from S rightarrow abA | abcS, the given grammar can be converted to _____ _____ _____ (1) This grammar can also be written as _____ _____ _____ (2)...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT