Question

In: Computer Science

Is the L(r1) = L(r2) where r1 = (ab*+c)(λ+∅) and r2 = (a+c)(b*+∅)? what are the...

Is the L(r1) = L(r2) where r1 = (ab*+c)(λ+∅) and r2 = (a+c)(b*+∅)? what are the languages of L(r1), L(r2)? show the definition's using regular expression, assume Σ = (a,b,c)

Solutions

Expert Solution

Answer:   No, L(r1) is not equal to L(r2)

  • L(r1) L(r2)
  • Language accepted by r1 and Language accepted by r2 are not same.
  • L(r1) = { c , a ,ab ,abb, abbb,...............}
  • L(r2) = { c , a ,ab ,abb, abbb,.... ,cb,cbb,cbbb, ...........................}
  • L(r1) L(r2)
  • L(r1)   L(r2)
  • r2 is accepting some more strings
  • r1 is accepting less number of strings

Input Alphabet Given  Σ = (a,b,c)

Regular Expression -1

r1 = (ab*+c)(λ+)

r1 = (ab* λ + ab* + c λ + c )

r1 = (ab* λ + ab* + c λ + c )

r1 = (ab* λ + + c λ + )

r1 = (ab* λ +  c λ )

r1 = (ab* +  c ) // either single c or a followed by any number of b's (including zero b's)

L(r1) = { c , a ,ab ,abb, abbb,...............}

Regular Expression -2

r2 = (a+c)(b*+)

r2 = (a b*+a ∅ + c b*+c )

r2 = (a b*+ ∅ + c b*+ )

r2 = (a b*+ c b*)

// either  c followed by any number of b's (including zero b's) or a followed by any number of b's (including zero b's)

L(r2) = { c , a ,ab ,abb, abbb,.... ,cb,cbb,cbbb, ...........................}

Rule-1

  • Anything x   =  
  • ab* =  

Rule-2

  • Anything x  λ  ( means epsilon ε) =  Anything
  • ab* λ =  λ

Definition: A Regular Expression RE can be defined as;

If X is a RE denoting the language L(X) and Y is a RE denoting the language L(Y), then

  1. X + Y is a RE   corresponding to the language L(X) ∪ L(Y)     
  2. X . Y is a RE corresponding to the language L(X) . L(Y)
  3. R* is a RE corresponding to the language L(R*)

Note:

  • L (ε) = { ε } // epsilon ε is a RE indicates the language containing an empty string.

  • L ( ) = { } // null symbol    is a RE denoting an empty language.

  • L = {x} // x is a RE where


Related Solutions

Consider the following relations: R1 = {(a, b) ∈ R2 ∣ a > b}, the greater...
Consider the following relations: R1 = {(a, b) ∈ R2 ∣ a > b}, the greater than relation R2 = {(a, b) ∈ R2 ∣ a ≥ b}, the greater than or equal to relation R3 = {(a, b) ∈ R2 ∣ a < b}, the less than relation R4 = {(a, b) ∈ R2 ∣ a ≤ b}, the less than or equal to relation R5 = {(a, b) ∈ R2 ∣ a = b}, the equal to relation...
let r1 and r2 be the relations represented as r1 (ABC) and r2 (ADE) .Assume the...
let r1 and r2 be the relations represented as r1 (ABC) and r2 (ADE) .Assume the corresponding domains of both the tables are same.r1 has 2000 tuples and r2 has 4500 tuples 1.common tuples between r1 and r2 are 500, what would be the resultant number of tuples for r1-r2, justify your answer 2.assuming 500 as the common tuples between r1 and r2,what is the maximum number of tuples that results in ]] A( r1) U ]] A r2. justify...
A. Consider two concentric spherical structures of radius r1 and r2 such that r1 < r2...
A. Consider two concentric spherical structures of radius r1 and r2 such that r1 < r2 and full load Q and -2Q respectively. Calculate the magnitude of the field on ́ectrico in all three regions, i.e. within the smaller sphere, between the spheres and outside the sphere of the larger radius. Where does the electric field point to for this system? (no matter what material these concentric spherical are made of) B. Two cylindrical coaxial shells with radius r1 and...
say R1, R2,...., Rn are commutative rings with unity. Show that U(R1 + R2 +.... +...
say R1, R2,...., Rn are commutative rings with unity. Show that U(R1 + R2 +.... + Rn) = U( R1) + U(R2)+ .... U(Rn). Where U - is the units of the ring.
Prove the following using the properties of regular expressions: (ab)* + c + c* = Λ...
Prove the following using the properties of regular expressions: (ab)* + c + c* = Λ + ab + (ab)* + c(Λ + c*)   Λ+ab+abab+ababab(ab)* = Λ + ∅* + (ab)* a(b+c*) + (d+e)* = ab + ac*c* + d + e + (d+e)* a*b + a*a*bc* + d* + ab = d* + ab + a*bc* + Λ a(b+cd*) = a(b+c) + acdd* (a+b)* = ∧* + ∅* + (a*b*)* (ab)*(c*+d*) = (ab)*(c+c*) + (ab)*( ∧ + d*)
Consider the following sets. (i) All vectors (a, b) in R2 such that ab ≠ 0....
Consider the following sets. (i) All vectors (a, b) in R2 such that ab ≠ 0. (ii) All matrices A in M22 such that AT  =  −A. (iii) All polynomials a0 + a1x + a2x2 in P2 such that a0 = 0. Determine whether each of the above sets is closed under addition or NOT closed under addition .
What is the arithmetic mean for the following stock returns: R1=6.3%, R2=4%, R3=7.2%? A) 17.5% B)...
What is the arithmetic mean for the following stock returns: R1=6.3%, R2=4%, R3=7.2%? A) 17.5% B) 4.375% C) 5.833% D) 5.825% E) 18.512%
The consecutive liquid phase reactions k1 ,r1 k2 ,r2 k3 ,r3 . Estimate A −−→ B...
The consecutive liquid phase reactions k1 ,r1 k2 ,r2 k3 ,r3 . Estimate A −−→ B −−→ C −−→ D with first-order kinetics occur in a steady state CSTR. The feed composition for the CSTR is: CA0 > 0, CJ0 = 0, J = B, C, D. (a). Write mass balances for A, B, C, and D. From these, deduce that CJ’s, J = A, B, C, D, are related by a linear equation. Obtain expressions for CJ, J =...
Two hoops have the same mass M. Their radii are R1 and R2 = 2 R1....
Two hoops have the same mass M. Their radii are R1 and R2 = 2 R1. Similarly, two uniform disks also have mass M and the radii, R1 and R2. Which of these objects has the largest moment of inertia about the axis perpendicular to the screen and through the center of the hoop or disk? The moment of inertia of a uniform disk of mass mand radius r about its center is (1/2)mr2; for a hoop it is mr2....
(12 pts) Suppose r0 = 0xFFFFFFFF, r1 = 0x00000001, r2 = 0x00000000 Initially N, Z, C,...
(12 pts) Suppose r0 = 0xFFFFFFFF, r1 = 0x00000001, r2 = 0x00000000 Initially N, Z, C, V flags are zero. Find the value of the N, Z, C, V flags of the following instructions. (Assume each instruction runs individually, i.e. these instructions are not part of a program.). Hint: This time remember what the default flag are values for the N, Z, C, V flags. The default flag values might vary based on the flag type. • ADD r3, r0,...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT