@akash.dinkar12
3. Let R be an Equivalence relation on set A with m equivalence classes Si,1≤i≤m then Cardinality of R
is :
$|R|=|S1|^2+|S2|^2....+|Sm|^2$
Why this is true ?
let analyses a sample input A = {1,2,3,4,5}
if i want to say, there are 2-equivalence classes with $\color{red}{[1]_{R} \; = \;[2]_{R}\; = \;[3]_{R}}$ and $\color{green}{[4]_{R}\; =\; [5]_{R}}$
Actually, $[x]_{R}$ = { y | x R y }
if $[1]_{R}$ = $[2]_{R}$ means, $[1]_{R}$ should contains 2 ==> (1,2) should be in relation
if $[1]_{R}$ = $[3]_{R}$ means, $[1]_{R}$ should contains 3 ==> (1,3) should be in relation
if $[2]_{R}$ = $[3]_{R}$ means, $[1]_{R}$ = $[1]_{R}$ should contains 3 ==> (2,3) should be in relation
∴ due to symmetric property, (2,1) and (3,1) and (3,2) should be in the relation
∴ due to reflexivity property, (1,1), (2,2) and (3,3) should be in the relation.
with three elements, we can get 3*3 = 9 ordered pairs !
(1,1) (2,1) (3,1)
(1,2) (2,2) (3,2)
(1,3) (2,3) (3,3)
All these pairs should be in my R, if i want to say $[1]_{R}$ = $[2]_{R}$ = $[3]_{R}$ ==> S$_1$ with 3 elements
like that, with three elements, we can get 3*3 = 9 ordered pairs !
(4,4) (5,4)
(5,4) (5,5)
All these pairs should be in my R, if i want to say $[4]_{R}$ = $[5]_{R}$ ==> S$_2$ with 2 elements