(i) Number of relations from B to G.
A relation from B to G is, by definition, any subset of B×G. First count B×G:
∣B×G∣=∣B∣×∣G∣=3×2=6,
the six pairs (b1,g1),(b1,g2),(b2,g1),(b2,g2),(b3,g1),(b3,g2). A set with 6 elements has 26 subsets, because each of the six pairs is independently either in the relation or out of it. So
number of relations=2∣B∣×∣G∣=23×2=26=64.
(ii) Number of functions from B to G.
A function must give each element of B exactly one image in G. So build one by deciding, boy by boy, which girl he is sent to: b1 has 2 choices, b2 has 2 choices, b3 has 2 choices, and the three decisions are independent. Hence
number of functions=∣G∣∣B∣=23=8.
So 8 of the 64 relations are functions; the remaining 56 fail, because they either leave some boy with no image or give some boy two images.
(iii) R is an equivalence relation.
R is a relation on the single set B={b1,b2,b3}. All three members of B are boys, so every pair of members of B consists of two students of the same sex. Hence
R=B×B,
all 3×3=9 ordered pairs. This is the universal relation on B. Check the three properties:
- Reflexive: for every x∈B, x and x are of the same sex, so (x,x)∈R.
- Symmetric: if (x,y)∈R, then x and y are of the same sex, so y and x are too, and (y,x)∈R.
- Transitive: if (x,y)∈R and (y,z)∈R, then x has the same sex as y, and y the same sex as z, so x and z are of the same sex and (x,z)∈R.
R is reflexive, symmetric and transitive, so R is an equivalence relation. (Since everyone in B is related to everyone, there is just one equivalence class, B itself.)
OR
f is not injective.
The given function is f={(b1,g1),(b2,g1),(b3,g2)}, that is
f(b1)=g1,f(b2)=g1,f(b3)=g2.

A function is injective (one-one) when distinct elements of the domain always have distinct images. Here b1 and b2 are distinct elements of B, yet
f(b1)=f(b2)=g1.
Two different boys have been given the same girl as image, so f is not injective.
In fact no function from B to G can be injective. An injective function needs a separate image for each element of the domain, so it needs the codomain to have at least as many elements as the domain. Here ∣B∣=3 and ∣G∣=2, and 3>2, so by the pigeonhole principle at least two of the three boys must share a girl in every one of the 8 functions counted in part (ii).