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\\}=0011100000" Â (As there are 3 1's which means only 3,4,5 are present in both universal set and subset)
3,4,5 take 3rd, 4th, 5th positions in U, so there are '1's on these positions in bit string
b)
Similarly,
"\\{1, 3, 6, 10\\} = 1010010001"
1,3,6,10 take 1st, 3rd, 6th, 10th positions in U, so there are '1's on these positions in bit string
Comments
Leave a comment