Question

2. A binary string is a finite sequence v = a1a2 . . . an, where each ai is either 0 or 1. In this case n is the length...

2. A binary string is a finite sequence v = a1a2 . . . an, where each ai is either 0 or 1. In this case n is the length of the string v. The strings a1, a1a2, . . . , a1 . . . an−1, a1 . . . an are all prefixes of v. On the set X of all binary strings consider the relations R1 and R2 defined as follows: R1 = {(w, v) | w and v have the same length }. R2 = {(w, v) | w is a prefix of v }.

(a) Prove that R1 is an equivalence relation.

(b) Write down the equivalence classes of the strings 0, 01, and 111.

(c) Consider the set Y of all binary strings of length 2 or 3. The relation R2 on the set Y is a partial ordering. Draw a Hasse diagram of the partial order R2 on the set Y . Identify maximal and minimal elements of the poset.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

(a)

Reflexive: let a \in X . then a is related to itself as length(a) = length(a). Hence R1 is reflexive.

Symmetric: let al EX and a2 \in X, and a1R1a2.

\implies length(a1) = length(a2)

\implies length(a2) = length(a1)

\impliesa2R1a1.

Hence R1 is symmetric.

Transitive: let al EX and a2 \in X and a3 \in X , and a1R1a2, a2R1a3.

\implies length(a1) = length(a2) and length(a2) = length(a3).

\implies length(a1) = length(a3)

\impliesa1R1a3.

Hence R1 is transitive.

Hence R1 is an equivalence relation.

(b)

Equivalence class of a is set of all elements in X related to a.

Equivalence class for 0 is {0, 1}.

Equivalence class for 01 is {00, 01, 10, 11}

Equivalence class for 111 is {000, 001, 010, 011, 100, 101, 110, 111}.

(c)

The set Y = {00, 01, 10, 11, 000, 001, 010, 011, 100, 101, 110, 111}.

R2 = {(w, v) | w is a prefix of v }.

Hasse Diagram:

Maximal Elements 110111 00o 0 11 100 2101 1 01 01 01 Minimal Elements

Add a comment
Know the answer?
Add Answer to:
2. A binary string is a finite sequence v = a1a2 . . . an, where each ai is either 0 or 1. In this case n is the length...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT