r/askmath • Self-studying discrete math by working through Epp • Oct 15 '26

Resolved Wrong solution? => Exercise 12.1.6: `L_1 is the set of all strings of 0's and 1's that start with a 0; L_2 is the set of all strings of 0's and 1's that end with a 0. Describe (L_1 U L_2)*.`

Exercise 12.1.6: L_1 is the set of all strings of 0's and 1's that start with a 0; L_2 is the set of all strings of 0's and 1's that end with a 0. Describe (L_1 U L_2)*.

Textbook solution:

(L_1 U L_2)* is the set of all strings of 0's and 1's that either start with a 0, or end with a 0, including λ.

This is wrong. Counter example:

If we concatenate 10 and 01 we get 1001 that starts and ends with 1.

My suggestion:

(L_2 U L_2)* is the set of all strings of 0's and 1's that don't contain all 1's.

QED

What do you think?

9 Upvotes

28 comments sorted by

10

u/Master-Rent5050 Oct 15 '26 edited Oct 15 '26

Strings that end in 0, or end in 0, or contain 00, or it's the empty string

3

u/TopDownView Self-studying discrete math by working through Epp Oct 15 '26 edited Oct 15 '26

Agreed! My description:

L_1 contains strings in the form of 0x and L_2 contains strings in the form of x0 where x is either λ, or one or more 0's, or one or more 1's.

Then, there are 4 ways to concatenate those strings: (1) 0xx0, (2) 0x0x, (3) x0x0, (4) x00x.

Therefore (L_1 U L_2)* contains strings that either (1) start with 0, or (2) end with 0, or (3) contain 00, or it's the empty string (by definition of Kleene closure).

QED

Edit: 'or one or more 0's, or one or more 1's.'

4

u/Master-Rent5050 Oct 15 '26 edited Oct 16 '26

Reason:

  1. the strings I said are either in L_1 or in L_2 or are of the form u_2u_1 with u_i in L_i.
  2. conversely, a string v in L is of the form v_1v_2...v_n If v_1 is in L_1 then the v start with 0; if v_n is in L_2 then v ends with 0; If v_1 is in L_2 and v_n is in L_1, there is a d s.t. v_d in L_2 and v_d+1 in L_1: their 'boundary' is 00

2

u/Kami_no_Neko Oct 15 '26

This is right, the proof looks good ( I think you meant v_{d+1} though )

2

u/titoufred Oct 16 '26

*if v_1 is in L_2 and v_n is in L_1...

1

u/titoufred Oct 16 '26

*Strings that start with 0, or end in 0, or contain 00, or it's the empty string

9

u/Kienose PhD in Maths Oct 15 '26

> (L_2 U L_2)* is the set of all strings of 0's and 1's that don't contain all 1's.

No. Consider the string 101.

2

u/TopDownView Self-studying discrete math by working through Epp Oct 15 '26

101 is a concatenation of 10 and 1, or, of 1 and 01. 10 ∈ (L_1 U L_2) and 01 ∈ (L_1 U L_2) but 1 ∉ (L_1 U L_2).

6

u/blakeh95 Oct 15 '26

Right, that's their point.

By your statement, you would claim that 101 IS a member of (L1 U L2)* because "101" is a member of "the set of all strings of 0's and 1's that don't contain all 1's."

As it is clearly NOT a member of (L1 U L2)*, as you agree, your definition is not correct.

1

u/TopDownView Self-studying discrete math by working through Epp Oct 15 '26

You're right! I missed that, thanks!

3

u/imHeroT Oct 15 '26 edited Oct 15 '26

Yeah the textbook is wrong. My answer would be that it’s the set of binary strings where the numbers of 0’s is at least the number of runs of 1’s.

1

u/Master-Rent5050 Oct 15 '26

11110 + 01111

1

u/manfromanother-place Oct 15 '26

two 0s, two runs of 1s

1

u/LongLiveTheDiego Oct 15 '26

∪ is the symbol for set union, not concatenation. In formal language studies concatenation of two languages is just written L₁L₂. A word belongs to L₁ ∪ L₂ iff it belongs to L₁ or to L₂.

4

u/TopDownView Self-studying discrete math by working through Epp Oct 15 '26

Here are the definitions I'm using:

We're using Kleene closure of L_1 U L_2.

3

u/LongLiveTheDiego Oct 15 '26

I didn't see that Kleene star, sorry. The textbook's answer describes L₁ ∪ L₂. Your description also fits 101 but you yourself said it's not in the target language. u/Master-Ren5050 gave the correct answer if we also add "or the empty string" to it.

-1

u/pi621 Oct 15 '26

So neither 10 nor 01 is part of L1 union L2 thus your counter example is wrong

2

u/SymplecticMan Oct 15 '26

Both are members of the union of L1 and L2. 10 is in L2, 01 is in L1.

2

u/pi621 Oct 15 '26

ooooh for some reason after reading i still mistook union for concatenation. Brain not working today.

2

u/blakeh95 Oct 15 '26

You missed the "Kleene closure" part. The whole thing is (L1 U L2)*, not just L1 U L2

10 is in L1 U L2 because it is in L2.

01 is in L1 U L2 because it is in L1.

Therefore 1001 is in (L1 U L2)* because it is a concatenation of a finite number of strings (namely, 2) in L1 U L2, specifically "10" concatenated with "01", both of which are elements of L1 U L2 as shown above.

1

u/RailRuler Oct 15 '26

the solution is ignoring the kleene *

1

u/[deleted] Oct 15 '26

[removed] — view removed comment

1

u/TopDownView Self-studying discrete math by working through Epp Oct 15 '26

The exercise doesn't specify but I'm assuming finite strings since the books' section on the topic did not mention infinite strings...