Question

In: Computer Science

Assignment #2 Total 43 pts (12pts) List at least 3 words in the language and write...

Assignment #2

Total 43 pts

  1. (12pts) List at least 3 words in the language and write regular expressions for the following:

  1. S = {a,b,c} L = {all words that have only one letter c in them}

  1. S = {a,b,c} L = {all words in which c’s appear in groups of two}

  1. S = {a,b,c} L = { all words that begin and end with the same letter}

  1. S = {a,b,c} L = { all words that begin and end with a different letter

  1. (5pts) Write a grammar for the language S = {a,b,c} L = {all words that have only one letter c in them}

  1. (5pts) Write a grammar for the language S = {a,b,c} L = {all words where every b is immediately followed by the letter c}

  1. (10pts) Using the grammar below show a leftmost derivation

for A = B * (C + A)

<assign> à<id> = <expr>

<id> à A | B|C

<expr>à <expr> + <term>

                | <term>

<term> à <term> * <factor>

    |<factor>

<factor> à ( <expr> )

               |<id>

  1. (5pts) Given the following grammar

Sà aScB | A | b

Aà cA | c

             Bà d | A

   Show a rightmost derivation for: acccc

  1. (6pts) Is the following grammar ambiguous? Explain your answer.

SàAB | BA

Aà AA | b

B à Bb | a

Solutions

Expert Solution


Related Solutions

Question 3, and 4 2.(50 pts) For the following list of nuclides, complete the following: List...
Question 3, and 4 2.(50 pts) For the following list of nuclides, complete the following: List the number of protons Hydrogen-1= 1 Iron-56 =26 Zirconium-91= 40 Gold-197 =79 Uranium-238: 92 List the number of neutrons Hydrogen-1 = 0 Iron-56 = 30 Zirconium-91 = 51 Gold-197 = 118 Uranium-238: 146 Write out the nuclide in the form   Hydrogen-1 = 1 H 1 Iron-56 = 56 Fe 26 Zirconium-91 = 91 Zr 40 Gold-197 = 197 Au 79 Uranium-238 = 238 U...
For this assignment, you are to write a 3-5 page paper (At least an outline) What...
For this assignment, you are to write a 3-5 page paper (At least an outline) What ethical issues are often faced in long-term care, and how are they resolved? Include examples.
For this assignment, you will write a 2–3-page paper (double-spaced, 1-inch margins) providing at least 1...
For this assignment, you will write a 2–3-page paper (double-spaced, 1-inch margins) providing at least 1 example of how government has overstepped biblical principles in some form of economic policy.
(10 pts) Draw the result of hashing 11, 22, 3, and 43 into a table using...
(10 pts) Draw the result of hashing 11, 22, 3, and 43 into a table using the following hash function, using separate chaining: h(x) = x % 4                0 1 2 3 (10 pts) Draw the result of hashing 11, 22, 3, and 43 into a table using the following hash function, using open addressing with linear probing: h(x) = x % 4 0 1 2 3
For Paper #2, write a 1-2 page (at least 300 words) reflection on: What was the...
For Paper #2, write a 1-2 page (at least 300 words) reflection on: What was the process that you used in writing your argumentative focus assignment? How did that process work for you? How did the revision process go for you? What did you revise? What were your goals for writing and understanding this project? Do you feel you met those goals? If you had additional time to work on this project, what else would you do?
1. For each item, write what is required using only English words. (a) (2 Pts.) The...
1. For each item, write what is required using only English words. (a) (2 Pts.) The converse, contrapositive, inverse and negation of \If George feels well, then George is is going to a movie or going dancing". (b) (2 Pts.) The converse, contrapositive, inverse and negation of \Anna is failing history and psychology, then Anna is not graduating". (c) (2 Pts.) The statement represented by the symbols below and the negation of such statement: 8s9c (M(s) ! (D(c) ^ T(s;...
List and explain at least three components of quality health care. Write 250 words please
List and explain at least three components of quality health care. Write 250 words please
Using C Language Write a program segment that computes 1 + 2 + 3 + ......
Using C Language Write a program segment that computes 1 + 2 + 3 + ... + ( n - 1) + n , where n is a data value. Follow the loop body with an if statement that compares this value to (n * (n + 1)) / 2 and displays a message that indicates whether the values are the same or different. Please give me code to just copy and paste
ACC 926 Assignment #1 (Chapter 2)        Select among the list of words the one that best...
ACC 926 Assignment #1 (Chapter 2)        Select among the list of words the one that best justifies the following accounting procedures.  A term may be used more than once, or not at all.  Choose the best answer. a. Historical cost f. Economic Entity l. Full disclosure g. Materiality m. Comparability b. Relevance h. Fair Value c. Monetary unit i. Periodicity n. Representational Faithfulness Timeliness d. Going concern j. Matching o. e. Control k. Revenue Recognition _____   1.  Recording significant subsequent events in the Notes...
Language for this question is Java write the code for the given assignment Given an n...
Language for this question is Java write the code for the given assignment Given an n x n matrix, where every row and column is sorted in non-decreasing order. Print all elements of matrix in sorted order.Input: The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. Each test case contains an integer n denoting the size of the matrix. Then the next line contains the n x n elements...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT