Table of Contents

Set

A well-defined unordered collection of distinct elements is called a set.

Example -

  1. is a valid set even if the data types are different.
  2. is not well-defined as and sets can’t have any repeated elements. Thus it is not a set.

Notations -

  1. is the roster form.
  2. is the set builder form.

Types of sets -

  1. Equal Sets - Two sets and are said to be equal if all elements of A are in B and vice versa.
  2. Equivalent Sets - Two sets and are equivalent if their cardinalities are same. In other words there exists a bijective mapping between and .
  3. Universal Set - A set containing all elements corresponding to the problem at hand.
  4. Subset - is a subset of if every element of set is in .
  5. Superset - is a superset of if every element of is in .
  6. Proper Subset - is a proper subset of if is a subset of but not equal to .
  7. Power Set or - A set of all subsets of is a power set of . A power set only contains sets, not elements.

The total number of elements in a power set can be calculated using Binomial Theorem -

Mutually Exclusive Sets

A collection of sets is called mutually exclusive iff,

Collectively Exhaustive Sets

A collection of sets is called collectively exhaustive iff,

****# Set Operations

  1. Union
  2. Intersection
  3. Complement
  4. Set Difference - Elements in A but not in B.
  1. Symmetric Difference or - Elements in either A or B, but not in both. Similar to XOR.

Properties -

OpeartionIdempotentIdentityDominationComplementationAbsorption
Union
Intersection

Principle of Inclusion and Exclusion

See Question 2 for a bigger example.

Multiset

A well-defined unordered collection of elements that allows multiple occurrences of an element.

Here the numbers are multiplicities of each element and a multiset can be written this way as well. Multiplicities and must be integers.

We can say a set is a multiset where each element’s multiplicity is restrict to be or .

Cardinality of a Multiset - The summation of the multiplicities of a multiset.

Suppose an element occurs times in multiset and times in multiset . Under this context the count of that element under operations would be -

See Question 3 for a cardinality example.

Cartesian Product

Let and be two finite sets, then their Cartesian Product is a set of all ordered pairs such that and .

  • Cardinality of a Cartesian Product -
  • , only when either or either one is .

Relations

A relation from to defines how elements of are related to elements of .

  • Cartesian Product is a universal relation.
  • Number of relations possible between and No. of subsets of

Types of Relations

Defined from A to A -

  1. Diagonal Relation (Identity Relation)
  2. Reflexive Relation -
  3. Irreflexive Relation
  4. Symmetric Relation
  5. Anti-symmetric Relation
  6. Asymmetric Relation
  7. Transitive Relation

Defined between any two sets and -

  1. Complement of a Relation
  2. Inverse of a Relation
  3. Composite of Relations

Diagonal Relation (Identity Relation)

Any set of the form - is a diagonal relation.

Eg - is not a diagonal relation over due to .

A diagonal order pair is - .

Called diagonal relation because if you arrange all elements of in an grid, all pairs lie on the diagonal.

Reflexive Relation

Any relation whose elements satisfy is a reflexive relation.

All diagonal order pairs of the set should exist in the relation.

Eg - is reflexive over .

Here there are no constraints over the set structure. Only the elements need to fulfill the criteria.

  1. Every diagonal relation is reflexive, but not vice versa.
  2. The smallest reflexive relation on is the diagonal relation on .

Check Question 4 for the total number of reflexive relations in a set.

Irreflexive Relation

Any relation whose elements satisfy is an irreflexive relation.

No diagonal order pairs of the set exist in the relation.

Eg - is irreflexive over as are not present.

  1. Smallest irreflexive relation on any set is the empty relation.

Symmetric Relation

If then , then is said to be a symmetric relation.

Eg - over , is symmetric but isn’t.

There are a total of non-diagonal symmetric ordered pairs over some set of elements.

Anti-Symmetric Relation

If and then , then is said to be a anti-symmetric relation.

If the only symmetric ordered pairs in a relation are also diagonal, the relation is said to be anti-symmetric.

Eg - Over -

  • is anti-symmetric.
  • is anti-symmetric.
  • is not anti-symmetric.

One visual trick of checking if a relation is symmetric is to write the ordered pairs in an grid and check whether all pairs of the relation lie in the upper triangle or lower triangle of the grid.

Asymmetric Relation

If then , even if then is said to be a asymmetric relation.

If there exist no symmetric ordered pairs in a relation, the relation is said to be asymmetric.

  • is symmetric, anti-symmetric, and asymmetric.
  • Every asymmetric relation is anti-symmetric.

Eg - Over -

  • is asymmetric.
  • is not asymmetric.

Transitive Relation

If and then , is said to be a transitive relation.

Eg - Over -

  • is not transitive as and but .

Equivalence Relation

A relation on is an equivalence relation if and only if -

  1. is reflexive
  2. is symmetric
  3. is transitive

Closures

Let be a relation on set .

  1. Reflexive Closure - A reflexive closure of is the smallest reflexive relation on containing .
  2. Symmetric Closure - A symmetric closure of is the smallest symmetric relation on containing .
  3. Transitive Closure - A transitive closure of is the smallest transitive relation on containing .
    • Warshall’s Algorithm can be used to find the Transitive Closure of a relation.

Partitions and Equivalence Class

Partitions

A partition of a set is the grouping of all elements of into non-empty subsets if and only if -

  1. , where

A partition of a set is the grouping of all elements of into non-empty subsets such that every element only occurs in one subset.

A partition is a collection of subsets of such that the subsets are both mutually exclusive and collectively exhaustive.

  1. Partition of is .

Check Question 5 to see how to count the number of partitions of a set.

Equivalence Class

An equivalence class of an element with respect to an equivalence relation is a set of all such that in that relation.

Notes -

  1. even if .
  2. Set of all distinct equivalence classes of elements of set define a partition of set w.r.t the given equivalence relation .
  3. Union of self cross product of each subset in a partition will give back the equivalence relation . Check Question 6 for an example.

There is a one-to-one correspondence between the partitions of set and the equivalence relations of set .

Bell Number

Bell number gives the number of partitions (and thus number of equivalence relations) of set , where .

Number of partitions are shown by the first column of the Bell Triangle -

How to form the Bell Triangle -

  1. Start with .
  2. To create some row , check the last number of row and add it as the first number of .
  3. Repeat Step(3) until there’s a number in current row with no number above it in previous row . For each number in if there is a number above it in say , the next number of will be .

Example - In we can see that has above it, so next number if .

Refinement

Let be any finite set and and be any two partitions of . Partition is a refinement of partition if every subset inside is a subset of subsets in .

Example - Let and and . Here we can see that every subset in is a subset of subsets in .


Questions

Q1) What is -

, , thus


Q2) What is -

Without drawing the Venn Diagram, we can still visualize the basic structure of it. To get , we’d need to firstly include all regions of and correct for all overlapping regions as the elements inside them would be counted multiple times.

Count of Venn diagram regions with elements belonging to only -

  1. 1 set = , regions are -
  2. 2 sets = , regions are -
  3. 3 sets = , regions are -
  4. 4 sets = , region is -

Steps -

  1. Do as the initial step.
  2. After Step (1) elements that lie in the intersection of sets are counted twice. Thus needs to be done.
  3. After Step (2) elements that lie in the intersection of sets are being counted times in Step (1) and removed from the count times in Step (2). Thus net count is . Thus they need to be added once by doing .
  4. After Step (3) elements that lie in the intersection of sets are being counted times, thus need to be removed once by doing .

Thus total count is -

This alternating process of addition and subtraction ensures that each element is counted exactly once, which is the essence of the Principle of Inclusion–Exclusion.


Q3) How many multisets are possible for elements of {1,2,3,...,n}?

as even a single element of the multiset can be repeated times to form multisets.


Q4) How many reflexive relations exist for set A = {1,2,...,n}?

Number of ordered pairs in is . Out of these, pairs like would be diagonal ordered pairs.

Any reflexive relation of must have these ordered pairs along with some combination of non-diagonal ordered pairs.

  1. We can pick pairs from diagonal ordered pairs in way.
  2. We can pick pairs from the rest ordered pairs these many times -

So total number of ways is ways.


Q5) How many partitions are possible for {1,2,3,4,5}?

A partition of 5 elements can be created with subsets of following cardinalities -

  1. 1,1,1,1,1
  2. 1,1,1,2
  3. 1,1,3
  4. 1,4
  5. 5
  6. 2,3
  7. 1,2,2

Count of sets of subsets of the above cardinalities is -

  1. (1,1,1,1,1) - After picking elements in required quantities, we can arrange the subsets in ways, such that each set of subsets is equivalent. Subsets of equal size are indistinguishable, so we divide by the factorial of their multiplicity Because such partitions are equivalent, they shouldn’t be counted multiple times. Thus the total number in which we can pick elements in required quantities needs to be divided by 5!.
    • and so on…
  1. (1,1,1,2) - Subsets of equal size are indistinguishable, so we divide by the factorial of their count. There are subsets of size , so we need to divide by here.
  1. (1,1,3) - subsets of size , so we need to divide by here.
  1. (1,4) - Here there are no subsets of equal sizes, thus no need for division.
  1. (5) - No subsets of equal sizes.
  1. (2,3) - No subsets of equal sizes.
  1. (1,2,2) - subsets of size , so we need to divide by here.

If there were subsets of size and subsets of size , we would have divided the permutations by .

Total number of partitions .


Q6) If the partition set for some set A is S , what is its corresponding equivalence relation?

There are 3 subsets in - and . Take a self cross product of each -

Union of the above cross products would give -