0% found this document useful (0 votes)
41 views

Bcs503 Module 2

Uploaded by

hannir77600
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views

Bcs503 Module 2

Uploaded by

hannir77600
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 46

THEORY OF COMPUTATION (BCS503)

MODULE – 2

Regular Expressions, Finite Automata and Regular Expressions, Proving Languages not to be Regular.
Closure Properties of Regular Languages, Equivalence and Minimization of Automata, Applications of
Regular Expressions.

1. REGULAR EXPRESSIONS
A Regular Expression (RE) is a formal notation used to describe a set of strings over a given alphabet.
It is a concise way to define regular languages, which are a class of languages that can be recognized by
finite automata. Regular Expressions serve as the input language for many systems that process
strings.

Examples:

Search commands such as the UNIX grep or equivalent commands for finding strings that one sees in
Web browsers or text-formatting systems. These systems use a regular-expression-like notation for
describing patterns that the user wants to find in a file. Different search systems convert the regular
expression into either a DFA or an NFA, and simulate that automaton on the file being searched.

The Operators of Regular Expressions


The three operations on languages that the operators of regular expressions represent, they are:
(1) The union of two languages L and M, denoted L ∪ M, is the set of strings that are in either L or
M, or both.
For example, if L = {ϵ, 001, 10, 111} and M = {ϵ, 001}, then L ∪ M = {ϵ, 001, 10, 111}.

(2) The concatenation of languages L and M is the set of strings that can be formed by taking any
string in L and concatenating it with any string in M. Denote concatenation of languages either
with a dot or with no operator at all.
For example, if L = {001, 10, 111} and M = {ϵ, 001}, then L · M, or just LM, is {001, 10, 111,
001001, 10001, 111001}.

(3) The closure (or star, or Kleene closure) of a language L is denoted L* and represents the set of
those strings that can be formed by taking any number of strings from L, possibly with
repetitions (i.e., the same string may be selected more than once) and concatenating all of
them.
For instance, if L = {0, 1}, then L* is all strings of 0's and 1's.
If L = {0, 11}, then L* consists of those strings of 0's and 1's such that the 1's come in pairs, e.g.,
011, 11110, and ε, but not 01011 or 101.
More formally, L* is the infinite union ∪i≥0 Li, where L⁰ = *ε+, L¹ = L, and Li, for i > 1 is LLL ...
L (the concatenation of i copies of L)."

Building Regular Expressions


For each Regular Expressions E, the language is represented by L(E).
BASIS: The basis consists of three parts:
1. The constants ϵ and Ø are regular expressions, denoting the languages *ϵ} and Ø, respectively.
That is, L(ϵ) = *ϵ}, and L(Ø) = Ø.
2. If a is any symbol, then a is a regular expression. This expression denotes the language {a}. That
is, L(a) = {a}. Note that we use boldface font to denote an expression corresponding to a
symbol. The correspondence, e.g. that a refers to a, should be obvious.
3. A variable, usually capitalized and italic such as L, is a variable, representing any language.

INDUCTION: There are four parts to the inductive step, one for each of the three operators and one for
the introduction of parentheses.

1. If E and F are regular expressions, then E + F is a regular expression denoting the union of L(E)
and L(F). That is, L(E+F) = L(E) U L(F).
2. If E and F are regular expressions, then EF is a regular expression denoting the concatenation
of L(E) and L(F). That is, L(EF) = L(E)L(F).
3. If E is a regular expression, then E* is a regular expression, denoting the closure of L(E). That
is, L(E*) = (L(E))*.
4. If E is a regular expression, then (E), a parenthesized E, is also a regular expression, denoting
the same language as E. Formally; L((E)) = L(E).

EXAMPLES:

1) Write a regular expressions for the set of strings that consist of alternating 0's and 1's.

 The basic rule for regular expressions tells us that 0 and 1 are expressions denoting the
languages {0} and {1}, respectively. If we concatenate the two expressions, we get a regular
expression for the language {01}; this expression is 01.
 As a general rule, if we want a regular expression for the language consisting of only the string
‘w’, we use ‘w’ itself as the regular expression.
 Note that in the regular expression, the symbols of ‘w’ will normally be written in boldface, but
the change of font is only to help you distinguish expressions from strings and should not be
taken as significant.
 To get all strings consisting of zero or more occurrences of 01, we use the regular expression
(01). Note that we first put parentheses around 01, to avoid confusing with the expression 01.
 However, L((01)*) is not exactly the language that we want. It includes only those strings of
alternating 0's and 1's that begin with 0 and end with 1.
 We also need to consider the possibility that there is a 1 at the beginning and/or a 0 at the end.
One approach is to construct three more regular expressions that handle the other three
possibilities.
 That is, (10)* represents those alternating strings that begin with 1 and end with 0, while
0(10)* can be used for strings that both begin and end with 0 and 1(01)* serves for strings that
begin and end with 1. The entire regular expression is
(01)* + (10)* + 0(10)* + 1(01)*

2) Obtain a regular expression to accept a language consisting of strings of 0’s and 1’s with at most
one pair of consecutive 0’s.

From the given statement that the string consisting of at most one pair of consecutive 0’s may
a) Begin with combination of any number of 1’s and 01’s represented by (1+01)*.
b) End with any number of 1’s represented by 1*.
So, the complete regular expression which consists of strings 0’s and 1’s with at most one pair of
consecutive 0’s is given by
(1+01)* 00 1*
3) Obtain a regular expression to accept a language containing at least one ‘a’ and at least one ‘b’
where ∑ = *a, b, c+

Strings of a’s, b’s and c’s can be generated using the regular expression (a+b+c)*
But this string should have at least one ‘a’ and at least ‘b’. There are two cases to be considered:
a) First ‘a’ preceding ‘b’ which can be represented using c*a(a+c)*b
b) First ‘b’ preceding ‘a’ which can be represented using c*b(b+c)*a
The regular expression (a+b+c)* can be represented by one of the regular expressions considered in
the two cases. So, the final regular expression is c*a(a+c)*b(a+b+c)* + c*b(b+c)*a(a+b+c)*
This expression can also be written as shown below:
[c*a(a+c)*b + c*b(b+c)*a] (a+b+c)*

4) Obtain a regular expression to accept a language consisting of strings of a’s and b’s of even length.
String of a’s and b’s of even length can be obtained by the combination of the strings aa, ab, ba and bb.
The language may even consist of an empty string by ϵ. So, the regular expression can be of the form
(aa + ab + ba + bb)*
The * closure includes the empty string.

5) Obtain a regular expression to accept a language consisting of strings of a’s and b’s of odd length.

String of a’s and b’s of even length can be obtained by the combination of the strings aa, ab, ba and bb
followed by either a or b. So, the regular expression can be of the form

(aa + ab + ba + bb)* (a+b)


String of a’s and b’s of even length can be obtained by the combination of the strings aa, ab, ba and bb
preceded by either a or b. So, the regular expression can be of the form

(a + b) (aa + ab + ba + bb)*

6) Obtain a regular expression such that L(R) = * w | w ϵ *0, 1+*+ with at least three consecutive 0’s.
An arbitrary string consisting of 0’s and 1’s can be represented by the regular expression
(0 + 1)*
This arbitrary string can precede three consecutive zeros and can follow three consecutive zeros. So,
the regular expression can be written as
(0 + 1)* 000 (0+1)*

7) Obtain a regular expression to accept strings of a’s and b’s ending with ‘b’ and has no substring aa.
The statement “strings of a’s and b’s ending with ‘b’ and has no substring aa” can be restated as “string
made up of either b or ab”. The substring aa will never occur in the string and the string ends with ‘b’.
So, the regular expression can be of the form:
(b + ab)*
But, because of * closure, even null string is also included. But, the string should end with ‘b’. So,
instead of * closure, we can use positive closure ‘+’. So, the regular expression to accept strings of a’s
and b’s ending with ‘b’ and has no substring aa can be written as:
(b + ab)+
The above regular expression can also be written as:
(b + ab) (b + ab)*
8) Obtain a regular expression to accept a language consisting of 0’s and 1’s such that every pair of
adjacent 0’s appears before any pair of adjacent 1’s.
Strings of 0’s and 1’s having no two consecutive zeroes is given by
(1 + 01)* (0 + ϵ)
Strings of 0’s and 1’s having no two consecutive ones is given by
(0 + 10)* (1 + ϵ)
The string having no two consecutive ones followed by string having no two consecutive zeroes is
obtained by concatenating the first with the second regular expression as shown below:
(0 + 10)* (1 + ϵ) (1 + 01)* (0 + ϵ)

9) Obtain a regular expression to accept string of a’s and b’s whose tenth symbol from the right end is
a.
The regular expression:
a (a + b) (a + b) (a + b) (a + b) (a + b) (a + b) (a + b) (a + b) (a + b)
It is clear from the above expression that the string has a strings of a’s and b’s whose tenth symbol
from the right end is a. But, the string can be preceded by any number of a’s and b’s. So, the regular
expression can be written as:
(a + b)* a (a + b) (a + b) (a + b) (a + b) (a + b) (a + b) (a + b) (a + b) (a + b)

10) Obtain a regular expression to accept strings of a’s and b’s whose length is either even or
multiples of 3 or both.
The regular expression whose length is even can be obtained using
((a + b) (a + b))*
The regular expression whose length is multiples of 3 can be obtained using
((a + b) (a + b) (a + b))*
Thus, the regular expression whose length is either even or multiples of 3 or both is given by
((a + b) (a + b))* + ((a + b) (a + b) (a + b))*

Precedence of Regular – Expression Operators


For regular expressions, the following is the order of precedence for the operators:
 The star operator is of highest precedence. That is, it applies only to the smallest sequence of
symbols to its left that is a well-formed regular expression.
 Next in precedence comes the concatenation or "dot" operator. After grouping all stars to their
operands, we group concatenation operators to their operands. That is, all expressions that are
juxtaposed (adjacent, with no intervening operator) are grouped together. Since concatenation
is an associative operator it does not matter in what order we group consecutive
concatenations, although if there is a choice to be made, you should group them from the left.
For instance, 012 is grouped (01)2.
 Finally, all unions (+ operators) are grouped with their operands. Since union is also
associative, it again matters little in which order consecutive unions are grouped, but we shall
assume grouping from the left.
2. FINITE AUTOMATA AND REGULAR EXPRESSIONS

Converting DFA’s to Regular Expressions by Eliminating States

 The approach to constructing regular expressions involves eliminating states. When we


eliminate a state s, all the paths that went through s no longer exist in the automaton.
 If the language of the automaton is not to change, we must include, on an arc that goes directly
from q to p, the labels of paths that went from some state q to state p, through s.
 Since the label of this arc may now involve strings, rather than single symbols, and there may
even be an infinite number of such strings, we cannot simply list the strings as a label.
 Fortunately, there is a simple, finite way to represent all such strings: use a regular
expression.
 Thus, we are led to consider automata that have regular expressions as labels.
 The language of the automaton is the union over all paths from the start state to an accepting
state of the language formed by concatenating the languages of the regular expressions along
that path.
 Note that this rule is consistent with the definition of the language for any of the varieties of
automata we have considered so far.
 Each symbol a, or ε if it is allowed, can be thought of as a regular expression whose language is
a single string, either *a+ or *ε+.

Figure: A state s about to be eliminated

The above figure shows a generic state s about to be eliminated. We suppose that the automaton of
which s is a state has predecessor states q₁, q₂, ..., qₖ for s and successor states p₁, p₂, ..., pm for s. It is
possible that some of the q's are also p's, but we assume that s is not among the q's or p's, even if there
is a loop from s to itself. We also show a regular expression on each arc from one of the q's to s;
expression Qi labels the arc from qi. Likewise, we show a regular expression Pi labeling the arc from s
to pi, for all i. We show a loop on s with label S. Finally, there is a regular expression Rij on the arc
from qi to pj, for all i and j. Note that some of these arcs may not exist in the automaton, in which case
we take the expression on that arc to be ϕ.

Figure: Result of eliminating state s from DFA

The above figure shows what happens when we eliminate state s. All arcs involving state s are deleted.
To compensate, we introduce, for each predecessor qi of s and each successor pj of s, a regular
expression that represents all the paths that start at qi, go to s, perhaps loop around s zero or more
times, and finally go to pj. The expression for these paths is QiS*P;. This expression is added (with
the union operator) to the arc from qi to pj. If there was no arc qi → pj, then first introduce one with
regular expression ϕ.

The strategy for constructing a regular expression from a finite automaton is as follows:

1. For each accepting state q, apply the above reduction process to produce an equivalent
automaton with regular-expression labels on the arcs. Eliminate all states except q and the
start state q0.
2. If q ≠ q0, then we shall be left with a two-state automaton that looks like in the below figure.

Figure: A generic two-state automaton

The regular expression for the accepted strings can be described in various ways. One is

(R + SU*T)*SU*. In explanation, we can go from the start state to itself any number of times,
by following a sequence of paths whose labels are in either L(R) or L(SU*T). The expression
SU*T represents paths that go to the accepting state via a path in L(S), perhaps return to the
accepting state several times using a sequence of paths with labels in L(U), and then return to
the start state with a path whose label is in L(T). Then we must go to the accepting state, never
to return to the start state, by following a path with a label in L(S). Once in the accepting state,
we can return to it as many times as we like, by following a path whose label is in L(U).

3. If the start state is also an accepting state, then we must also perform a state-elimination from
the original automaton that gets rid of every state but the start state. When we do so, we are
left with a one-state automaton that looks like Figure. The regular expression denoting the
strings that it accepts is R*.

Figure: A generic one – state automaton

4. The desired regular expression is the sum (union) of all the expressions derived from the
reduced automata for each accepting state, by rules (2) and (3).

Example 1:

Convert the following NFA to a regular expression, using the state-elimination technique.

Let us consider the NFA in figure that accepts all strings of 0’s and 1’s such that either the second or
third position from the end has a 1.

First step is to convert it to an automaton with regular expression labels. Since no state elimination
has been performed, all we have to do is replace the labels “0,1” with the equivalent regular
expression 0 + 1. The result is shown:
Converting Regular Expressions to Automata
Theorem: Every language defined by a regular expression is also defined by a finite automaton.

PROOF: Suppose L = L(R) for a regular expression R. We show that L = L(E) form some ϵ-NFA E with :

a) Exactly one accepting state.


b) No arcs into the initial state.
c) No arcs out of the accepting state.

BASIS: There are three parts to the basis.

The figure (a) shows how to handle the expression ϵ. The language of the automaton is easily seen to
be {ϵ}, since the only path from the start state to an accepting state is labeled ϵ.

The figure (b) shows the construction for ∅. Clearly there are no paths from start state to accepting
state, so ∅ is the language of this automaton.

The figure ( c) shows the automaton for a regular expression a. The language of this automaton
evidently consists of the one string a, which is also L(a). It is easy to check that these automata all
satisfy conditions (1), (2), and (3) of the inductive hypothesis.

INDUCTION: The three parts of the induction are shown in Figure (a, b & c). We assume that the
statement of the theorem is true for the immediate subexpressions of a given regular expression; that
is, the languages of these subexpressions are also the languages of e-NFA's with a single accepting
state. The four cases are:
1. The expression is R + S for some smaller expressions R and S. Then the automaton of Figure
(a) serves. That is, starting at the new start state, we can go to the start state of either the
automaton for R or the automaton for S. We then reach the accepting state of one of these
automata, following a path labeled by some string in L(R) or L(S), respectively. Once we reach
the accepting state of the automaton for R or S, we can follow one of the e-arcs to the accepting
state of the new automaton. Thus, the language of the automaton in Figure(a) is L(R) U L(S).

2. The expression is RS for some smaller expressions R and S. The automaton for the
concatenation is shown in Figure (b). Note that the start state of the first automaton becomes
the start state of the whole, and the accepting state of the second automaton becomes the
accepting state of the whole. The idea is that the only paths from start to accepting state go first
through the automaton for R, where it must follow a path labeled by a string in L(R), and then
through the automaton for S, where it follows a path labeled by a string in L(S). Thus, the paths
in the automaton of Figure (b) are all and only those labeled by strings in L(R)L(S).

3. The expression is R* for some smaller expression R. Then we use the automaton of Figure (c).
That automaton allows us to go either:
 Directly from the start state to the accepting state along a path labeled ε. That path lets us
accept ε, which is in L(R*) no matter what expression R is.
 To the start state of the automaton for R, through that automaton one or more times, and then
to the accepting state. This set of paths allows us to accept strings in L(R), L(R)L(R),
L(R)L(R)L(R), and so on, thus covering all strings in L(R*) except perhaps ε, which was
covered by the direct arc to the accepting state mentioned in (3a).
4. The expression is (R) for some smaller expression R. The automaton for R also serves as the
automaton for (R), since the parentheses do not change the language defined by the
expression.

Example 1:

Convert the regular expression (0+1)*1(0+1) to an ϵ-NFA.

Construct automata for 0 + 1.

Construct automata for (o + 1)*

Construct automata for (O+1)*1(0+1)


3. PROVING LANGAUGES NOT TO BE REGULAR
A regular language is a type of formal language that can be expressed using a regular expression or
defined by a finite automaton. A regular language can be recognized by DFA’s by NFA’s and by ϵ-NFA’s.

Introduce a powerful technique, known as the “pumping lemma”, for showing certain languages not
be regular.

THE PUMPING LEMMA FOR REGULAR LANGAUGES

Theorem: Let L be a regular language. Then there exists a constant n (which depends on L) such that
for every string w in L such that |w| ≥ n, we can break w into three strings, w = xyz, such that:

1) y ≠ €.
2) |xy| ≤ n.
3) For all k ≥ 0, the string xykz is also in L.
That is, we can always find a nonempty string y not too far from the beginning of w that can be
"pumped"; that is, repeating y any number of times, or deleting it (the case k = 0), keeps the resulting
string in the language L.

Proof: Suppose L is regular. Then L = L(A) for some DFA A. Suppose A has n states. Now, consider any
string w of length n or more, say w = a₁a₂...am, where m ≥ n and each aᵢ is an input symbol. For i = 0,
1, ..., n, define state pᵢ to be δ(q₀, a₁a₂...aᵢ), where δ is the transition function of A, and q₀ is the start
state of A. That is, pᵢ is the state A is in after reading the first i symbols of w. Note that p₀ = q₀.

By the pigeonhole principle, it is not possible for the n+1 different pᵢ's for i = 0, 1, ..., n to be distinct,
since there are only n different states. Thus, we can find two different integers i and j, with 0 ≤ i < j ≤
n, such that pᵢ = pⱼ.

Now, we can break w = xyz as follows:

1. x = a₁a₂...aᵢ.
2. y = aᵢ₊₁aᵢ₊₂...aⱼ.
3. z = aⱼ₊₁aⱼ₊₂...aₘ.
That is, x takes us to pᵢ once; y takes us from pᵢ back to pᵢ (since pᵢ is also pⱼ); and z is the balance of w.
The relationships among the strings and states are suggested by Figure. Note that x may be empty, in
the case that i = 0. Also, z may be empty if j = n = m. However, y cannot be empty, since i is strictly
less than j.

Figure: Every string longer than the number of states must cause a state to repeat.
Now, consider what happens if the automaton A receives the input xyzk for any k ≥ 0. If k = 0, then the
automaton goes from the start state q₀ (which is also p₀) to pᵢ on input x. Since pᵢ is also pⱼ, it must be
that A goes from pᵢ to the accepting state shown in Figure on input z. Thus, A accepts xz.

If k > 0, then A goes from q₀ to pᵢ on input x, circles from pᵢ to pᵢ k times on input yk, and then goes to
the accepting state on input z. Thus, for any k ≥ 0, xyzk is also accepted by A; that is, xyzk is in L.

APPLICATIONS OF THE PUMPING LEMMA

All languages are not regular. A nonregular language is that language for which a FA cannot be
constructed. So, to prove that certain languages are not regular, we use pumping lemma. The typical
applications of Pumping Lemma are:

1. To prove that certain languages are not regular. The pumping lemma cannot be used to prove
that a given language is regular.
2. To check whether the language is infinite. If there is a string x such that |x| ≥ the number of
states accepted by DFA M, then L(M) is infinite. Otherwise, L(M) is finite. So, using Pumping
lemma we can check whether the language is finite or infinite.

The general strategy used to prove that certain language is not regular is shown below:

1. Assume that the language L is regular and the number of states in FA be n.


2. Select the string say x and break it into substrings u, v, and w such that x = uvw with the
constraints |x| ≥ n, |uv| ≤ n, and |v| ≥ 1.
3. Find any i such that uviw ∉ L. According to pumping lemma, uviw ∈ L. So, the result is a
contradiction to the assumption that the language is regular. Therefore, the given language L is
not regular.

Examples:
4. CLOSURE PROPERTIES OF REGULAR LANGUAGES
Prove several theorems of the form "if certain languages are regular, and a language L is formed from
them by certain operations (e.g., L is the union of two regular languages), then L is also regular." These
theorems are often called closure properties of the regular languages, since they show that the class of
regular languages is closed under the operation mentioned. Closure properties express the idea that
when one (or several) languages are regular, then certain related languages are also regular.
Here is a summary of the principal closure properties for regular languages:
1) The union of two regular languages is regular.
2) The intersection of two regular languages is regular.
3) The complement of a regular language is regular.
4) The difference of two regular languages is regular.
5) The reversal of a regular language is regular.
6) The closure (star) of a regular language is regular.
7) The concatenation of regular languages is regular.
8) A homomorphism (substitution of strings for symbols) of a regular language is regular.
9) The inverse homomorphism of a regular language is regular.

Closure of Regular Languages Under Boolean Operations


Our first closure properties are the three boolean operations: union, intersection, and
complementation:
1. Let L and M be languages over alphabet Σ. Then L ∪ M is the language that contains all strings
that are in either or both of L and M.
2. Let L and M be languages over alphabet Σ. Then L ∩ M is the language that contains all strings
that are in both L and M.
3. Let L be a language over alphabet Σ. Then L', the complement of L, is the set of strings in Σ* that
are not in L.
It turns out that the regular languages are closed under all three of the boolean operations. The proofs
take rather different approaches though, as we shall see.

CLOSURE UNDER UNION


Theorem: If L and M are regular languages, then so is L ∪ M.
Proof: This proof is simple. Since L and M are regular, they have regular expressions; say L = L(R) and
M = L(S). Then L ∪ M = L(R + S) by the definition of the + operator for regular expressions.

CLOSURE UNDER COMPLEMENTATION


Theorem: If L is a regular language over alphabet Σ, then L = Σ* - L is also a regular language.
PROOF: Let L = L(A) for some DFA A = (Q, Σ, δ, q₀, F). Then L = L(B), where B is the DFA (Q, Σ, δ, q₀, Q
- F). That is, B is exactly like A, but the accepting states of A have become nonaccepting states of B, and
vice versa. Then w is in L(B) if and only if δ (q₀, w) is in Q - F, which occurs if and only if w is not in
L(A).
CLOSURE UNDER INTERSECTION

Theorem 4.8: If L and M are regular languages, then so is L∩M.

Proof: Let L and M be the languages of automata AL=(QL,Σ,δL,qL,FL) and AM=(QM,Σ,δM,qM,FM). Notice
that we are assuming that the alphabets of both automata are the same; that is, Σ is the union of the
alphabets of L and M, if those alphabets are different. The product construction actually works for
NFA's as well as DFA's, but to make the argument as simple as possible, we assume that AL and AM are
DFA's.

For L∩M, we shall construct an automaton A that simulates both AL and AM. The states of A are pairs of
states, the first from AL and the second from AM. To design the transitions of A, suppose A is in state
(p,q), where p is the state of AL and q is the state of AM. If a is the input symbol, we see what AL does on
input a; say it goes to state s. We also see what AM does on input a; say it makes a transition to state t.
Then the next state of A will be (s,t). In that manner, A has simulated the effect of both AL and AM .

The start state of A is the pair of start states of AL and AM. Since we want to accept if and only if both
automata accept, we select as the accepting states of A all those pairs (p, q) such that p is an accepting
state of AL and q is an accepting state of AM. Formally, we define:

CLOSURE UNDER DIFFERENCE

There is a fourth operation that is often applied to sets and is related to the boolean operations: set
difference. In terms of languages, L−M, the difference of L and M, is the set of strings that are in
language L but not in language M. The regular languages are also closed under this operation, and the
proof follows easily from the theorems just proven.

Theorem: If L and M are regular languages, then so is L - M.


PROOF: Observe that L – M = L ∩ M. By Theorem , M is regular, and by Theorem, L ∩ M is regular.
Therefore L - M is regular.
REVERSAL

Theorem: If L is a regular language, so is LR.


Example: Let L be defined by the regular expression (0+1)0*. Then LR is the language of (0*)R(0+1)R,
by the rule for concatenation. If we apply the rules for closure and union to the two parts, and then
apply the basis rule that says the reversals of 0 and 1 are unchanged, we find that L R has regular
expression 0*(0+1).

HOMOMORPHISMS
A string homomorphism is a function on strings that works by substituting a particular string for each
symbol.
Example:
5. EQUIVALENCE AND MINIMIZATION OF AUTOMATA
EXAMPLE:
6. APPLICATIONS OF REGULAR EXPRESSIONS

You might also like