Every function is a relation but converse is false.

Let $A$ be a set of $n(>0)$ elements. Let $N_r$ be the number of binary relations on $A$ and let $N_f$ be the number of functions from $A$ to $A$

- Give the expression for $N_r,$ in terms of $n.$
- Give the expression for $N_f,$ terms of $n.$
- Which is larger for all possible $n,N_r$ or $N_f$

### 1 comment

Every function is a relation but converse is false.

## 4 Answers

A. Consider a $2D$ matrix of $n\times n$ size where each dimension represent the $n$ elements of $A.$ So, we get $n^2$ elements where each one can be viewed as an ordered pair $(i,j), 1\leq i,j \leq n.$ Now if we consider a set with these $n^2$ elements, any subset of it will be a binary relation from $A$ to $A$.

So, no. of binary relations, $N_r = 2^{n^2}$

For a function from a set of $n$ elements to a set of $m$ elements we have $m$ choice for each of the $n$ elements of the domain. Thus, we get $m^n$ possibilities. Here, $m = n.$ So,

No. of functions, $N_f = n^n$

Now, number of functions must be smaller than the number of relations because every function is also a relation. We can prove this formally as follows:

$ \displaystyle \lim_{n\to \infty} \dfrac{2^{n^2}}{n^n} $

$\dfrac{\infty}{\infty} \text{ form}.$ So, applying L'Hopital's rule (Limit remains same after taking derivative of both numerator and denominator)

$= \displaystyle \lim_{n \to \infty} \dfrac{2n.\log 2. 2^{n^2}}{nn^{n-1}}$

We can continue like this applying L'Hopital's rule and we should eventually get $1$ in the denominator (as after each derivation power of $n$ decreases by $1$) which gives the limit value as $\infty.$ So, $2^{n^2}$ is faster growing than $n^n.$

So, for sufficiently large $n,$ $N_r > N_f$

### 6 Comments

@Ayush Upadhyaya functions is a subset of relations because one to many type of relations are excluded from being functions right?

$N_f = n^{n}$ Each element can map to any of the n elements.

Take log of both the $N_f = n^{n}$ and $N_r = 2^{n^{2}}$

we get $n* log n $ and $n^2 log2$ we know that $n^2 log2$ > $n* log n $ so $N_r$ > $N_f$