1.2.4 Functions
We often need the concept of functions in probability. A function is a rule that takes an input from a specific set, called the domain, and produces an output from another set, called co-domain. Thus, a function maps elements from the domain set to elements in the co-domain with the property that each input is mapped to exactly one output. For a function , if is an element in the domain, then the function value (the output of the function) is shown by . If is the domain and is the co-domain for the function , we use the following notation:
Example
- Consider the function , defined as . This function takes any real number and outputs . For example, .
- Consider the function , defined as and . This function can only take two possible inputs or , where is mapped to $0$ and is mapped to $1$.
The output of a function always belongs to the co-domain . However, not all values in the co-domain are always covered by the function. In the above example, , the function value is always a positive number . We define the range of a function as the set containing all the possible values of . Thus, the range of a function is always a subset of its co-domain. For the above function , the range of is given by
Figure 1.14 pictorially shows a function, its domain, co-domain, and range. The figure shows that an element in the domain is mapped to in the range.

Fig.1.14 - Function , the range is always a subset of the co-domain.
