Answer to Question #128637 in Discrete Mathematics for Manoj

Question #128637
A set is a fundamental building block in mathematics, and it is defined as a collection of well-defined objects.A set is always defined in a computer program with respect to an underlying universal set, and the elements in the universal set are listed in a finite order.By giving examples, discuss on how does computer representation of sets.
1
Expert's answer
2020-08-06T17:30:35-0400

A set is a well defined collection of distinct objects. The objects that make up a set (also known as the elements or members of a set) can be anything: numbers, people, letters of the alphabet, other sets, and so on.


Computer Representation of Sets


   Method for storing elements using an arbitrary ordering of the elements of the universal set.Specify an arbitrary ordering of the elements of U, for instance a1, a2, . . . , an.

Represent a subset A of U with the bit string of length n, where the ith bit in the string is 1 if ai belongs to A and is 0 if ai​ does not belongs to A.


Example: 

– Let U = {1,2,3,4,5,6,7,8,9,10}, and the ordering of elements of U has the elements in increasing order.


i)What bit string represents the subset of all odd integers in U?

The bit string that represents the set of odd integers in U, {13579}, has a one bit in the first, third, fifth, seventh, and ninth positions. It is 10 1010 1010

Solution: 10 1010 1010


ii)What bit string represents the subset of all even integers in 

U?

The bit string that  represent the subset of  even integers in U,{246810}.

 It is 01 0101 0101.




iii)What bit strings represent the subset of integers not exceeding 5 in U? 


    The set of all integers in that do not exceed 5, {12345}is represented by the

 string 11 1110 0000.


To find the bit string for the complement of a set from the bit string for that set, change each 1 to 0 and each 0 to 1.


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS