0% found this document useful (0 votes)
12 views5 pages

hw3 Tex

The document discusses the subset construction and minimization of a DFA, proving that the language L(M) accepts strings with exactly one contiguous block of 'b's. It also uses the pumping lemma to demonstrate that the languages L = { ww : w ∈ {0, 1}} and L = {ww | w ∈ {0, 1}∗ } are non-regular. Additionally, it evaluates two statements about non-regular languages, providing counterexamples to show that the union and concatenation of non-regular languages can be regular.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views5 pages

hw3 Tex

The document discusses the subset construction and minimization of a DFA, proving that the language L(M) accepts strings with exactly one contiguous block of 'b's. It also uses the pumping lemma to demonstrate that the languages L = { ww : w ∈ {0, 1}} and L = {ww | w ∈ {0, 1}∗ } are non-regular. Additionally, it evaluates two statements about non-regular languages, providing counterexamples to show that the union and concatenation of non-regular languages can be regular.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Problem 1

(1) Subset construction


Let
ε-closure({A}) = {A, B}.
Call this DFA start state S0 = {A, B}. Computing transitions:

δ ′ (S0 , a) = ε-closure(δ(A, a) ∪ δ(B, a)) = {A, B} =⇒ S0 ,


δ ′ (S0 , b) = ε-closure(δ(A, b) ∪ δ(B, b)) = {C, D} =⇒ S1 .
Repeating for each subset

DFA-state on a on b
S0 = {A, B} (initial) S0 S1 = {C, D}
S1 = {C, D} S2 = {B, C, D} S3 = {D}
S2 = {B, C, D} S4 = {A, B, C, D} S1
S3 = {D} S3 S5 = ∅
S4 = {A, B, C, D} S4 S1
S5 = ∅ S5 S5
Accepting states that has D: {C, D}, {B, C, D}, {D}, {A, B, C, D}.

(2) Minimization
Initial partition:

{{S0 , S5 }, {S1 , S2 , S3 , S4 }} .
non-final final
Refinement steps:
[leftmargin=1.5cm]{S0 , S5 } 7→ {{S0 }, {S5 }} (on b, S0 → S1 final,
S5 → S5 non-final); {S1 , S2 , S3 , S4 } 7→ {{S3 }, {S1 , S2 , S4 }} (on b, only
S3 goes to non-final); {S1 , S2 , S4 } 7→ {{S1 }, {S2 , S4 }} (on b, S1 → S3 ,
S2 , S4 → S1 ).

No further splits occur. Thus the six original DFA states collapse to five
equivalence classes:

{S0 }, {S5 }, {S3 }, {S1 }, {S2 , S4 }.

1
Renaming these
Q′′ = {q0 , q∅ , qD , qCD , qBCD },
one obtains the minimized DFA M ′′ :

state a b accept?
q0 (= {A, B}) (initial) q0 qCD no
qCD (= {C, D}) qBCD qD yes
qBCD (= {B, C, D} ∪ {A, B, C, D}) qBCD qCD yes
qD (= {D}) qD q∅ yes
q∅ q∅ q∅ no
Start state q0 , accepting states {qCD , qBCD , qD }.

(3) English description of L(M )


It is possible to state that M only takes strings of as and bs that contain
exactly one contiguous block of bs, and that block can be 1, or 2. Similarly,

L(M ) = { a∗ (b | bb)a∗ }.

Problem 2
Use the pumping lemma to prove that L = { ww : w ∈ {0, 1}} is non-regular.
The language

L = ww w ∈ {0, 1}
is not regular.

• Proof. Assume (for contradiction) that L is regular. By the Pumping Lemma


for regular languages, there exists a pumping length p ≥ 1 such that every
string s ∈ L with |s| ≥ p can be written s = xyz with
1. |y| ≥ 1,
2. |xy| ≤ p, and
3. xy i z ∈ L for every i ≥ 0.
Let
w = 0p 1p , s = ww = 0p 1p 0p 1p .
The string s is in L and |s| = 4p ≥ p, so the Pumping Lemma applies.

2
Decompose s = xyz. Because |xy| ≤ p, the entire block xy lies within
the first 0p . Hence

y = 0k for some 1 ≤ k ≤ p.

Pump down (i = 0). Construct the string

s′ = x y 0 z = xz = 0p−k 1p 0p 1p .

The left half of s′ is 0p−k 1p , while the right half remains 0p 1p .

Reach a contradiction. Because p − k ̸= p, the two halves of s′ differ, so


s′ cannot be written in the form ww for any w. Thus s′ ∈ / L, contradicting
property (3) of the Pumping Lemma.
Therefore our original assumption that L is regular must be false. Hence
L is non-regular.

Problem 3
Prove that L = {ww | w ∈ {0, 1}∗ } is non-regular, where w is the bitwise
binary complement of w. For example, 0001 = 1110, so 00011110 ∈ L.
The language
L = {ww | w ∈ {0, 1}∗ }
is not regular.

Proof. Assume for contradiction that L is regular. Then, by the Pumping


Lemma, there exists a pumping length p ≥ 1 such that any string s ∈ L
with |s| ≥ p can be decomposed as s = xyz, where:
1. |y| ≥ 1,

2. |xy| ≤ p, and

3. for all i ≥ 0, the string xy i z ∈ L.


Let w = 0p , so w = 1p and s = ww = 0p 1p ∈ L.
|s| = 2p ≥ p, so the Pumping Lemma applies.

Decompose s = xyz. Since |xy| ≤ p and the first p characters of s are all
0s, both x and y consist of only 0s. In particular,

y = 0k for some k ≥ 1.

3
Pump down (i = 0).
s′ = xy 0 z = xz = 0p−k 1p .
Now s′ does not belong to L, because it is no longer of the form ww — the
second half of the string is still 1p , but the first half is shorter than p 0s.
In fact, 0p−k = 1p−k ̸= 1p , so there is no string w such that s′ = ww.

Contradiction. This contradicts the Pumping Lemma, which states that


xy 0 z must still be in L. Therefore, our original assumption that L is regular
must be false.
Hence, L is not regular.

Problem 4
Prove or disprove each of the following two statements:
1. Statement: If L1 and L2 are nonregular, then L1 ∪ L2 must be non-
regular.

Counterexample: Let
L1 = { an bn | n ≥ 0 }, L2 = { an bn | n ≥ 1 }.
Both L1 and L2 are nonregular (can be shown using the Pumping
Lemma). But:
L1 ∪ L2 = { an bn | n ≥ 0 } ∪ { an bn | n ≥ 1 } = { an bn | n ≥ 0 } = L1 ,
which is still nonregular. So this doesn’t yet disprove it.
Let’s try a better example.
Let
L1 = { ap | p is prime }, L2 = { an | n is not prime }.
Then both L1 and L2 are nonregular.
But
L1 ∪ L2 = { an | n ≥ 2 }
which is regular (a regular expression: aa(a)∗ ).
Therefore, L1 ∪ L2 can be regular even if L1 and L2 are nonregular.
Therefore, the statement is false.

4
2. Statement: If L1 and L2 are nonregular, then L1 · L2 must be non-
regular.

Counterexample: Let Σ = {0, 1, 2} and define

L1 = {0m 1n 2n | m, n ≥ 0},
L2 = {0n 2n 1m | m, n ≥ 0}.

• L1 and L2 are both non-regular. If L1 were regular, intersecting


it with 1∗ 2∗ yields {1n 2n | n ≥ 0}, which is non-regular; similarly
for L2 .
• Their concatenation is
′ ′ ′
L1 L2 = {0m 1n 2n 0n 2n 1m | m, n, n′ , m′ ≥ 0},

which is described by the regular expression

0∗ 1∗ 2∗ 0∗ 2∗ 1∗ .

This language is regular, as a finite automaton can recognize this


structure.

Therefore, even though L1 and L2 are non-regular, their concatenation


L1 · L2 is regular. This disproves the proposition.

You might also like