A Relation is basically a set or combination of requested sets. An arranged pair, normally called as a point. A relation is a group of pair of input and output values, which is shown in an ordered pair.
It is an interrelation between sets of data.
A Relation = (Input value, Output value)
Consider this example of a relation: The relationship between favorite colors of students and their names.
(x, y) = (student’s name, favorite color)
Set A = {(Pink, Marry), (Green, Ron), (Red, Steve), (Red, Paul), (Pink, Daemon)}
Notice the set carefully, the same color is loved by more than one student. So, they also allow for one input value to have more than one corresponding output value.
Function
A function is a set of arranged pairs where each input component has just ONE output component related with it.
The previous example of a relation is not a function because the same colour is liked by more than one student.
As the same input is associated with more than one output, it can NOT be a function.
Note: A function may have two input values assigned to the same output value but can NOT have two output values assigned to the same input value.
IS A FUNCTION | NOT A FUNCTION |
{ (1,5) , (4,5) } | { (5,1) , (5,4) } |
Interval and its notation
The Interval is subsets to be presented on the number line.
Example: All the real numbers in range of 1 and 6 is an interval like 2.5, 3, 4.567, and so on till 6.
Do we include 1 and 6 in the interval?
Interval notation is a method of composing subsets of the real number line.
Example: (0, 20], [1, 2], (4, 7), [4, 8), [-3, 0].
Types of Interval
There are two types of Intervals on a number line:
- Open interval
- Closed interval
Open Interval do not include the end points in the set. ( ) brackets represents the open interval.
Example: (4, 6), (6, 9), (-3, 2)
Closed interval includes the end points in the set. It is represented by [ ] brackets.
Example: [3, 5], [-4, 0], [6, 9]
Example – Set A= {x : -4 < x <= 5 }. Here 4 is not included in the set but 5 is included as x.
So, the set is represented as x = (-4,5].
Domain and Range
Domain – All of the values that go into a relation or a function are called the domain.
Range – All of the entities (output) which emerge from a relation or a function are called the range.
All input values that are used (independent values) forms the Domain set.
All output values that are used (dependent values) forms the Range set.
Example: Given Function:- f = 2x+1 , Find the domain, range if 1<=x<=5.
Solution:
The values of x lies from 1 to 10.
So, domain is {1, 2, 3, 4, 5}.
The values of f obtained by putting domain elements in the function will be range.
So, if x=1 then f = 2(1)+1 = 3,
if x=2 then f = 2(2)+1 = 5,
if x=3 then f = 2(3)+1 =7,
if x=4 then f = 2(4)+1 = 9,
if x=5 then f = 2(5)+1 = 11.
So, range is {3,5,7,9,11}.
Example: Given function:- F = x^{2 }-5 , Find the domain, range?
Solution:
The value of x is squared and then 5 is subtracted by 5. Any real number can be squared and 5 can be subtracted from it, so there are no restrictions on the domain of this function. The domain is the set of real numbers. The interval form of domain set will be (-∞,∞).
Example: Given function:- F= (x+1)/(1-x), Find the domain?
Solution:
Here, the denominator is present in the function , so we have to restrict our input so that denominator do not become zero. so, we find the value of x where the denominator will be zero by equating it with 0.
1 – x = 0
1 = x
x = 1
So, we will exclude 1 from our domain set. Domain set is all real numbers except 1. The interval form of domain set will be (-∞,1)∪(1,∞). where ∪ is symbol of union.
Domain and Range on a Graph
In a graph, the x-coordinates (abscissa) are domain ad the y-coordinates (ordinates) are range.
The abscissa is the domain value, when we put it into the function, the value we get as an output will lie on y-axis.
Example: In the given figure, the line y=1 is a function where all values of x belongs to domain set and for every value of x , we get only 1 as an answer. So, 1 is range.
Example: Find the domain and range of the function f(x) = x^{2} where -1<x<1.
Solution:
As given in the example, x has a restriction from -1 to 1, so the domain of the function in the interval form is (-1,1).
Domain values are abscissa and as f is a function of x so, the values of f (ordinates) we get by putting values of abscissa will make our range. It is difficult to find value of y manually for every x, so it will be easy if we draw a graph and find the range (output) of function.
We know that output is positive value for the function including 0 and excluding 1. From the graph, we can conclude that the range of the function in the interval form is [0, 1).
Note: As the value of x for which we get 1 as output is not included in the domain, So, we do not include 1 in the range.
We din’t use ‘[‘ or ‘]’ brackets in domain as -1 and 1 are not included for the value of x. And we used ‘[‘ for 0 as it is included in the values of range.
What is Co-Domain?
The Set in which the elements may come out as an output is called Co-domain.
The elements which are the output value by giving input into function forms a set called Range.
All elements which are possible as output but not the outcome of function and range elements together makes a set called Co-domain.
Example: Given a function y = 2x and given if x>=1 , x<=7.
Then, Set A = { 1,2,3,4,5,6,7} is domain,
Set B = {2,4,6,8,10,12,14} is range,
Set C = { 1,2,4,6,7,8,10,12,14,15} or {all real numbers} is Co-domain.
Importance of co-domain
Is square root a function? NO, because when we put 16 as an input, we get 4,-4 as an output.
We know that function is single-valued and we can not get two values from one input. But if we define co-domain as all positive integers then range will be limited to positive integers.
Hence, only 4 will be considered as output. So, square root will be a function if co-domain is defined or limited.
Co-Domain affects whether the given relation is a function or not.
Relation and Function on a Graph
As we know that the x-coordinates are domain ad the y-coordinates are range, then only one value of y is allowed for any x values then only the curve or relation will be considered as a function.
Vertical line test to check for functions: If any vertical line can meet the outline of a relation in only ONE point then the connection is called as a function.
If any vertical line intersect any graph of a relation at more than one value, then that relation can not be said as a function.
Here in the below figure, the line (y=c),where c is any constant is a function as any vertical line can intersect the horizontal line at only one point.
This graph of the parabola is not considered as a function as a vertical line intersects this graph at two points.
Types of Relations
- Universal relation
- Empty relation
- Identity relation
- Symmetric relation
- Inverse relation
- Reflexive relation
- Transitive relation
Universal Relations:
A relation is called as an universal connection if each component of a set is identified with one another.
Consider set A = {a, b, c}. The universal relations will be R if R = {m, n} where, |m-n| ≥ 0.
Empty Relations:
The relation wherein there is no connection between any components of a set. An empty relation is also called void relation.
Consider if set A = {2, 3} then, void relation is R = {m,n} where, |m-n| = 8.
Identity Relations:
The relation where each component of a set is identified with itself
Consider a set A = {1,2,3}, the identity relation will be I = {1,1}, {2,2}, {3,3}. I = {(m,m), m ∈ A}
Symmetric Relations:
A relation is symmetric if a=b holds true then b=a also holds true. A connection R is symmetric just if (b, a) ∈ R is genuine when (a,b) ∈ R.
R = {(1, 2), (2, 1)} is symmetric relation set for a set A = {1, 2}.
Inverse Relations:
Inverse relation occurs when a set has inverse pairs of another set.
Consider if set A = {(1,2),(3,4)}, then inverse relation will be R-1 = {(2,1), (4,3)}. R-1 = {(n, m): (m, n) ∈ R}
Reflexive Relations:
A relation where each component find itself.
For set A = {-1, 4}. Reflexive relation = R = {(-1, -1), (4, 4), (-1, 4), (4, -1)}. (x,x) ∈ R
Transitive Relations:
If (m,n) ∈ R, (n,p) ∈ R, then (m,p) ∈ R.
Consider aRb and bRc ⇒ aRc ∀ a, b, c ∈ A
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.