Copyright © 2007 Gradiance Corporation.
Gradiance Online Accelerated Learning
Regular Expressions --- Algebra and FA Equivalence
1.
When we convert an automaton to a regular expression, we need to build expressions for the labels along paths from one state to another state that do not go through certain other states. Below is a nondeterministic finite automaton with three states. For each of the six orders of the three states, find regular expressions that give the set of labels along all paths from the first state to the second state that never go through the third state.
Then identify one of these expressions from the list of choices below.
a)
10* represents the paths from C to A that do not go through B.
b)
0+ represents the paths from B to A that do not go through C.
c)
0(10)* represents the paths from B to A that do not go through C.
d)
1(0+1010)* represents the paths from C to A that do not go through B.
2.
Apply the construction in Figure 3.16 (p. 104) and Figure 3.17 (p. 105) to convert the regular expression (0+1)*(0+ε) to an epsilon-NFA. Then, identify the true statement about your epsilon-NFA from the list below:
There are 10 states.
There are 14 states.
There are 12 states with more than one arc in.
There are 16 states.
3.
In this question you are asked to consider the truth or falsehood of six equivalences for regular expressions. If the equivalence is true, you must also identify the law from which it follows. In each case the statement R = S is conventional shorthand for "L(R) = L(S)." The six proposed equivalences are:
Identify the correct statement from the list below.
Note: we use φ for the empty set, because the correct symbol is not recognized by Internet Explorer.
01+01 = 01 is false.
(0* + 1*)0 = 0*0 + 1*0 follows from the distributive law of concatenation over union.
(0* + 1*)0 = 0*0 + 1*0 follows from the associative law for concatenation.
(0*1)0* = 0*(10*) follows from the idempotent law for union.
4.
Converting a DFA such as the following:
to a regular expression requires us to develop regular expressions for limited sets of paths --- those that take the automaton from one particular state to another particular state, without passing through some set of states. For the automaton above, determine the languages for the following limitations:
Then, identify a correct regular expression from the list below. Note: there are several different regular expressions possible for each of these languages. However, each of the correct answers can be thought of as built from more limited components. For example, the regular expression 1 is the set of path labels that go from A to B without passing through any of the four states.
LBB = (00*1)*
LBA = 0(00*10)*
LAB = 0*1(01+10)*
LBB = (0(00*10)*)*
5.
Consider the following identities for regular expressions; some are false and some are true. You are asked to decide which and in case it is false to provide the correct counterexample.
(a) R(S+T)=RS+RT (b) (R*)*=R* (c) (R*S*)*=(R+S)* (d) (R+S)*=R*+S* (e) S(RS+S)*R=RR*S(RR*S)* (f) (RS+R)*R=R(SR+R)*
(d) is true
(e) is true
(d) is false and a counterexample is: R={a,ε},T={b}, S={a,ε}
(e) is false and a counterexample is: R={a},T={a}, S={b}