Question

Perform the pairwise disjointness test for each of the following grammar rules. → aBc | bB...

Perform the pairwise disjointness test for each of the following grammar rules.

  1. → aBc | bB | Bbc
  2. → aBc | bA | aBbc
  3. → aaAc | b | caBc

Homework Answers

Answer #1

pairwise disjointness test is performed by finding the first of the RHS of each rule.

first is determined by finding the first non terminal.If the intersection of the firsts of any grammer is not null, then the grammar fails the test. else passes the test.

A -->aBc| bB | Bbc

first(aBc) = {a}

first(bB) = {b}

first(Bbc) = {a,b}

The grammar fails since there are intersecting non terminals(a and b).

B -->aBc | bA | aBbc

first(aBc) = {a}

firs(bA) = {b}

first(aBbc) ={a}

Grammar fails the test since there is a common non terminal {a}

C -->aaAc | b | caBc

first(aaAc) = a

first(b) = b

first(caBc)= c

grammar passes the test since the intersection is null

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
The following test cross produces the progeny shown: Aa Bb x aa bb Progeny are as...
The following test cross produces the progeny shown: Aa Bb x aa bb Progeny are as follows: 10 Aa Bb, 40 Aa bb, 40 aa Bb, 10 aa bb. We’re the A and B alleles in the Aa Bb parent in coupling or in repulsion? Please explain how this concept is understood and how the solution is found. I’m extremely confused about this, thank you!
Use MegaStat, MINITAB, or another software package to perform Tukey’s test for significant pairwise differences. Perform...
Use MegaStat, MINITAB, or another software package to perform Tukey’s test for significant pairwise differences. Perform the test using both the 5 percent and 1 percent levels of significance. Sales of People magazine are compared over a 5-week period at four Borders outlets in Chicago. Weekly Sales Store 1 Store 2 Store 3 Store 4 99 97 90 103 108 79 91 117 105 82 74 87 114 82 108 101 112 101 93 98 (a) Calculate the mean for...
Use MegaStat, MINITAB, or another software package to perform Tukey’s test for significant pairwise differences. Perform...
Use MegaStat, MINITAB, or another software package to perform Tukey’s test for significant pairwise differences. Perform the test using both the 5 percent and 1 percent levels of significance. One particular morning, the length of time spent in the examination rooms is recorded for each patient seen by each physician at an orthopedic clinic. Time in Examination Rooms (minutes) Physician 1 Physician 2 Physician 3 Physician 4 34 32 19 26 22 34 28 35 25 36 30 32 32...
Use MegaStat, MINITAB, or another software package to perform Tukey’s test for significant pairwise differences. Perform...
Use MegaStat, MINITAB, or another software package to perform Tukey’s test for significant pairwise differences. Perform the test using both the 5 percent and 1 percent levels of significance. One particular morning, the length of time spent in the examination rooms is recorded for each patient seen by each physician at an orthopedic clinic. Time in Examination Rooms (minutes) Physician 1 Physician 2 Physician 3 Physician 4 35 34 19 28 22 37 30 32 29 30 31 31 31...
1. Draw a GTG (generalized transition graph) for the following right-linear regular grammar. S -> abA...
1. Draw a GTG (generalized transition graph) for the following right-linear regular grammar. S -> abA A -> baB B->aA | bb a)  Find a left-linear grammar for the language in the previous question.
Automata Theory and Formal Languages Problems 1: Consider the following two grammars. Grammar G1- S →...
Automata Theory and Formal Languages Problems 1: Consider the following two grammars. Grammar G1- S → aSb / ∈ Grammar G2- S → aAb / ∈, A → aAb / ∈ a. is G1=G2 b. What is the grammar generated by the expression Problem 2: Let us consider the grammar. G2 = ({S, A}, {a, b}, S, {S → aAb, aA → aaAb, A → ε } ) Derive aaabbb Problem 3: Suppose we have the following grammar. G: N...
Try to write a BNF like Grammar for each one of the following constructs: - positive...
Try to write a BNF like Grammar for each one of the following constructs: - positive and negative integer numbers - floating point numbers - variable names. Notice: Recursion is needed here (use right recursion): here is an example (a grammar of two rules defines any positive integer) : Note the length in digits is not defined in this grammar, it can go recursively for ever. So we need to add another annotation (a semantic part). <positive_Number> -> <digit> |...
Write a BNF grammar for a new language called 4040. It should include the following rules:...
Write a BNF grammar for a new language called 4040. It should include the following rules: Variable definitions should start with var. There must be only single space after var. Variable names should come after the var and single space. Variable names should start with a letter or underscore(_). Starting with a digit is not allowed. Variable names can have digits after the first letter. There can be multiple variable names separated by comma. Between variables, spaces are allowed. There...
For each of the following regular expressions, give 2 examples of strings that are in the...
For each of the following regular expressions, give 2 examples of strings that are in the language described by the regular expression, and 2 examples of strings that are not in that language. In all cases the alphabet is {a,b}. ab*ba* (a ∪ ε)b* (a ∪ b)ε*(aa ∪ bb)
For each of the following regular expressions, give 2 examples of strings that are in the...
For each of the following regular expressions, give 2 examples of strings that are in the language described by the regular expression, and 2 examples of strings that are not in that language. In all cases the alphabet is {a, b}. ab*ba* (a ∪ ε)b* (a ∪ b)ε*(aa ∪ bb)
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT