Question

Compute First and Follow sets for the nonterminals of the following gramar: 1) S --> aSe...

Compute First and Follow sets for the nonterminals of the following gramar:

1) S --> aSe

2) S --> B

3) B --> b B e

4) B --> C

5) C --> cC e

6) C --> d

Homework Answers

Answer #1

Solution:

Explanation:

Calculating first of S:

=>first(S) = {first(aSe), first(B)}

=>first(S) = {a, b, c, d}

Calculating first of B:

=>first(B) = {first(bBe), first(C)}

=>first(B) = {b, c, d}

Calculating first of C:

=>first(C) = {first(cCe), first(d)}

=>first(C) = {c, d}

Calculating follow of S:

=>follow(S) = {$, first(e)}

=>follow(S) = {$, e}

Calculating follow of B:

=>follow(B) = {follow(S), first(e)}

=>follow(B) = {$, e, e}

=>follow(B) = {$, e}

Calculating follow of C:

=>follow(C) = {follow(B), first(e)}

=>follow(C) = {$, e, e}

=>follow(C) = {$, e}

I have explained each and every part with the help of statements attached to the answer above.

Know the answer?
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
Similar Questions
For the given grammar below, find the first and follow function sets. Then, construct the parsing...
For the given grammar below, find the first and follow function sets. Then, construct the parsing table. By using the LL(1) parser and the parsing table, find if the given string “acfh” is accepted or rejected. S → aBDh B → cC | ε C → bC | ε D → EF E → g | ε F → f | ε
. Do the following problems: a. Find the sets A and B, if A – B...
. Do the following problems: a. Find the sets A and B, if A – B = {1, 5, 7, 8}, B – A = {2, 10} and A ꓵ B = {3, 6, 9}. b. Draw a Venn Diagram for the Symmetric Difference of the sets A and B. c. Find and list all the partitions of S = {a, b, c, d, e}.
1. Write the following sets in list form. (For example, {x | x ∈N,1 ≤ x...
1. Write the following sets in list form. (For example, {x | x ∈N,1 ≤ x < 6} would be {1,2,3,4,5}.) (a) {a | a ∈Z,a2 ≤ 1}. (b) {b2 | b ∈Z,−2 ≤ b ≤ 2} (c) {c | c2 −4c−5 = 0}. (d) {d | d ∈R,d2 < 0}. 2. Let S be the set {1,2,{1,3},{2}}. Answer true or false: (a) 1 ∈ S. (b) {2}⊆ S. (c) 3 ∈ S. (d) {1,3}∈ S. (e) {1,2}∈ S (f)...
For each of the following sets of results, compute the appropriate test statistic, test the indicated...
For each of the following sets of results, compute the appropriate test statistic, test the indicated alternative hypothesis, and compute the effects size(s) indicating their magnitude: set Hypothesis μ0 σ n α a) μ ≠ μ0 49 50.8 4.4 44 0.20 b) μ > μ0 43.9 40.8 7.5 48 0.10 c) μ < μ0 35.7 30 8.6 40 0.15 a) Compute the appropriate test statistic(s) to make a decision about H0. critical value =__________ ; test statistic = ________________ Decision:  ***(choose...
19. Which of the following sets of quantum number is not allowed? A. n = 4,...
19. Which of the following sets of quantum number is not allowed? A. n = 4, ℓ = 2, mℓ = -2 B. n = 5, ℓ = 0, mℓ = 0 C. n = 6, ℓ = 3, mℓ = 1 D. n = 3, ℓ = 1, mℓ = −1 E. A–D are all allowed sets of quantum numbers
(c) Compute the sample correlation coefficient r for each of the following data sets and show...
(c) Compute the sample correlation coefficient r for each of the following data sets and show that r is the same for both. (Use 3 decimal places.) (i) x 6 5 9 y 2 1 5 (ii) x 2 1 5 y 6 5 9 r (i) (ii)
All necessary steps much show for these problems, please. Write the first 6 values in the...
All necessary steps much show for these problems, please. Write the first 6 values in the sequence T(0) = 1 T(1) = 2 T(2) = 4 T(n) = 3T(n – 1) + T(n – 2) – 4T(n – 3) for n ≥ 3 Let X = {a, c, e, g} Y={a,b,c} Z={b,c,d,e,f} be sub sets of S={a,b,c,d,e,f,g} Find a) ?⋃? b) ? ⋃ (? – ?) c) ?′ ⋂ ?′ d) (? ⋂ ?′)′ Determine B2 if B = {4,...
Compute the sample correlation coefficient r for each of the following data sets and show that...
Compute the sample correlation coefficient r for each of the following data sets and show that r is the same for both. (Use 3 decimal places. (i) x 8 6 9 y 3 4 5 (ii) x   3 4 5 y 8 6 9 r (i)= (ii)=
Which of the following sets are a basis for the row space of [1 3                                &n
Which of the following sets are a basis for the row space of [1 3                                                                                                 1 1                                                                                                 3 1] ? A. { [1 3] , [1 1] , [3 1] } B. { [1 -1] , [0 1] } C. { [1 -1] , [1 1] } D. { [1 2] , [2 1] } Select from the following: 1. Only A. 2. Only B, C and D. 3. Only B and C. 4. All of A, B, C and...
Compute the indicated operation involving the following permutations in S6: δ = ( 1 2 3...
Compute the indicated operation involving the following permutations in S6: δ = ( 1 2 3 4 5 6 3 1 4 5 6 2 ) σ = ( 1 2 3 4 5 6 2 4 5 1 6 3 ) µ = ( 1 2 3 4 5 6 5 2 4 3 1 6 ) a. δ2σ-2 b. µ23 c. Find the order of µ, |〈µ〉|. d. Write σ as product of disjoint cycles, and as product...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT