In algebra, a relation is any association between the elements of one set to another i.e. domain and co-domain. Usually relation is denoted by R and it is a subset of the Cartesian product of two given sets. Elements of a relation is defined as the ordered pairs like (a,b).
The most important type of relation is function. A function is a relation in which every element from domain is mapped with exactly one element to co-domain. The elements of domain and co-domain are said to be independent and dependent variables respectively. Generally, function denoted by f.

Now we will discuss moreover about relations, functions, dependent and independent variables.

From an applications point of view, an independent variable is a variable, which is selected by the experimenter to determine its relationship to an observed phenomenon. It can be manipulated by a person(researcher). The dependent variable is the outcome of experiment.
The most common independent value, is time.
In study or in an experiment, where one variable causes the other, the independent variable is the cause and dependent variable is the effect.

In mathematical language a dependent variable is a function of the independent variable(s).
For example, consider the following equation: y = 7x + 3

Here 'x' and 'y' are variables. A change in the value of variable 'x', will change the value of 'y'.
So 'y' is dependent on 'x' or 'y' is a function of 'x'. In mathematical language, this is written as:
y = f(x) = 7x + 3

So if we take certain random values of variable 'x' we find the values of dependent variable 'y' captured in table below.


Here every value of y depends on value of x, so we can say x is independent variable and y is dependent variable.