a.) Exhibit an algorithm that, given any three regular languages, L,L1,L2, determines whether or not L = L1L2.
b.) Describe an algorithm by which one can decide whether two regular expressions are equivalent.
b) algorithm for testing the equivalence of regular expression.
Two regular expressions R, S ∈ R(Σ) are equivalent, denoted as R ∼= S, iff L[R] = L[S].
example
((R1 + R2) + R3) ∼= (R1 + (R2 + R3)),
((R1R2)R3) ∼= (R1(R2R3)),
(R1 + R2) ∼= (R2 + R1),
(R ∗R ∗ ) ∼= R ∗ ,
R ∗∗ ∼= R ∗ .
1. There is an algorithm to test the equivalence of regular expressions, but its complexity is exponential.
2. an algorithm uses the conversion of a regular expression to an NFA, and the subset construction for converting an NFA to a DFA.
3. Then the problem of deciding whether two regular expressions R and S are equivalent is reduced to testing whether two DFA D1 and D2 accept the same languages.
4. L(D1) − L(D2) = ∅ and L(D2) − L(D1) = ∅.
5.the equivalence problem for regular expressions reduces to the problem of testing whether a DFA D = (Q, Σ, δ, q0, F) accepts the empty language, which is equivalent to Qr ∩ F = ∅.
a.) Exhibit an algorithm that, given any three regular languages, L,L1,L2, determines whether or not L...
2. If L1 and L2 are regular languages, which of the following are regular languages? Provide justification for your answers. a. L1 U L2 b. L1L2 c. L1 n L2
If L1 and L2 are Regular Languages, then L1 ∪ L2 is a CFL. Group of answer choices True False Flag this Question Question 61 pts If L1 and L2 are CFLs, then L1 ∩ L2 and L1 ∪ L2 are CFLs. Group of answer choices True False Flag this Question Question 71 pts The regular expression ((ac*)a*)* = ((aa*)c*)*. Group of answer choices True False Flag this Question Question 81 pts Some context free languages are regular. Group of answer choices True...
3. Show that the family of regular languages is closed under the given operations below The nor of two languages by nor(L, L2) = {w: w E L1 and w E L2} The cor (complementary) of two languages by cor(Li, L2) = {w: w E L1 or w E L2} a. b. 3. Show that the family of regular languages is closed under the given operations below The nor of two languages by nor(L, L2) = {w: w E L1...
Given two capacitors (in Farads) and two inductors (in Henries). C1=10, C2=14, L1=18, and L2=14. a) Determine an equivalent C for C1 and C2 in parallel. b) Determine an equivalent C for C1 and C2 in series. c) Determine an equivalent L for L1 and L2 in parallel. d) Determine an equivalent L for L1 and L2 in series. ans:4
6. Show that there exists an algorithm to determine whether L = ?* for any regular language L
Question 1: Every language is regular T/F Question 2: There exists a DFA that has only one final state T/F Question 3: Let M be a DFA, and define flip(M) as the DFA which is identical to M except you flip that final state. Then for every M, the language L(M)^c (complement) = L( flip (M)). T/F Question 4: Let G be a right linear grammar, and reverse(G)=reverse of G, i.e. if G has a rule A -> w B...
6. Determine whether or not the following languages on Σ-(a) are regular (a) L = {an : n > 2, is a prime number) (b) L fa"n : n is not a prime number. (c) L-(an . Ti--k3 for some k 20} Tt . L={an : n = 2k for some k > 0} (e) L an: n is the product of two prime numbers). (f) L = {an : n is either prime or the product of two or...
Exercise 3: Searching Applications Design and implement an algorithm that determines whether or not a given array of integers, list1, is completely contained within another given array of integers, list2. Consider two different scenarios: (1) Both arrays are unsorted and (2) both arrays are sorted and write functions unsortedSearch and sortedSearch for (1) and (2), respectively. Your algorithm for (2) is expected to be more efficient than the one for (1). Please Answer in c++ and show the algorithm working
Give regular expressions generating the languages of 1. {w over the alphabet of {0, 1} | w is any string except 11 and 111} 2. {w over the alphabet of {0, 1} | w contains at least two 0’s and at most one 1} 3. {w over the alphabet of {0, 1} | the length of w is at most 9} 4. {w over the alphabet of {0, 1} | w contains at least three 1 s} 5. {w over...
L2 B r3 L1 T 12 r Consider the torsion spring above. The shafts have shear moduli of Gen- ?? ksi, GAn 15,000 ksi, and consists of a solid inner shaft CB which is surrounded by and attached to a tube AB using a rigid ring at B. The ring at A can also be assumed rigid and is fixed from rotating. The geometry is given as r, 0.50 in, r, 1.0 in, r-0.8 in, and L, 12 in and...