Representing finite sets

  • Suppose we want to represent a set . Example:
  • It can be represented with a bit vector where if and only if

Example

  • Consider the above set,
  • It can be encoded by the vector, . Notice that

Set union and intersection operations

  • Boolean operations | and & correspond to set union and intersection operations when a set is encoded by vectors as shown above.

Example

  • Consider two sets:
    • encoded by
    • encoded by
  • Then the operation encodes

Sources