Theory:

In this section, let us look at a few key terminologies relating to functions.
 
For that matter, let us consider the function \(f : X \rightarrow Y\).
 
1. Domains and co-domains:
 
In the function \(f : X \rightarrow Y\), the set \(X\) is the domain, and the set \(Y\) is the co-domain.
 
3.svg
 
Domain \(=\) Set \(X\) \(=\) \(\{x_1\), \(x_2\), \(x_3\), \(x_4\), \(x_5\),\(...\}\)
 
Co-domain \(=\) Set \(Y\) \(=\) \(\{y_1\), \(y_2\), \(y_3\), \(y_4\), \(y_5\),\(...\}\)
 
2. Images and preimages:
 
If \(f(x) = y\), the image of \(x\) is '\(y\)' and the pre-image of \(y\) is '\(x\)'.
 
3.svg
 
From the figure given above, we can come to the following inferences.
 
For the image \(y_1\), \(x_1\) is its preimage.
 
For the image \(y_2\), \(x_2\) is its preimage.
 
For the image \(y_3\), \(x_3\) is its preimage.
 
For the image \(y_4\), \(x_4\) is its preimage.
 
For the image \(y_5\), \(x_5\) is its preimage.
 
3. Describing domain of a function:
 
Let \(f(x)\) be \(\frac{1}{x^2 - 5x + 20}\).
 
The function mentioned above holds for all real numbers except for \(4\) and \(5\).
 
In such cases, we can write \(f(x)\) as \(\frac{1}{x^2 - 5x + 20}\), where \(x \in R - \{4, 5\}\).
 
4. Conditions to be a function:
 
\(f : X \rightarrow Y\) can be called a function, only if:
 
  • Every preimage of \(f\) has an image.
  • Each of the images is unique.
4.svg
  
In figure 1, each of the preimages has unique images. Hence, figure 1 depicts a function.
 
Similarly, figure 2 is also a function.
 
But in figure 3, the preimage \(x_3\) has the images \(y_2\) and \(y_3\). Since a preimage can only have one unique image, figure 3 does not represent a function. Also, \(x_2\) does not have an image.
 
5. Range:
 
The set of images of \(f\) is the range of that function.
 
3.svg
 
From the image given above, Range \(=\) \(\{y_1\), \(y_2\), \(y_3\), \(y_4\), \(y_5\}\)
 
Important!
Let \(n(K) = t\), and \(n(L) = s\).
 
Then the total number of functions between \(K\) and \(L\) is \(s^t\).
 
For \(f : X \rightarrow Y\), \(n(X)\) \(=\) \(2\) and \(n(Y)\) \(=\) \(3\).
 
The total number of elements in \(f\) \(=\) \(n(Y)^{n(X)}\) \(=\) \(3^2\)