93.8k views
5 votes
Suppose that the universal set is U = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }. Express each of these sets with bit strings, where the ith bit in the string is 1 if i is in the set and 0 otherwise:

a){ 3, 4, 5 }
b){ 1, 3, 6, 10 }
c){ 2, 3, 4, 7, 8, 9 }

User Nilesh
by
5.7k points

1 Answer

6 votes

Answer:

a.0011100000

b.1010010001

c.0111001110

Explanation:

We are given that a universal set

U={1,2,3,4,5,...10}

We have to express each given set with bit strings , where the ith bit in the string is 1 if i is in the set and 0 otherwise

a.{3,4,5}

For 1=0 because 1 is not in the given set

For 3=1, For 4=2 , For 5=1 because 3,4 and 5 are in the set

For 2=0

For 6=0

For 7=0

For 8=0

For 9=0

For 10=0

Therefore, bit string=0011100000

b.{1,3,6,10}

For 1,3,6 and 10 write 1 because these elements are present in the set and for 2,4,5,7,8,9 write 0 because these elements are not present in the set

Bit string =1010010001

c.{2,3,4,7,8,9}

Similarly

Those elements which are present in the set then for those elements write 1 otherwise 0.

Bit string =0111001110

User Ropeney
by
5.0k points
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.