You are on page 1of 30

DISCRETE

MATH
Relations, functions
RELATION

• Relation is a set of ordered pair of numbers.


• {(1,2), (2,3), (3,4)}
• X R Y→ x<y or x/y
GRAPHICAL REPRESENTATION
Draw the graphical representation of relation ‘less than’ for {1, 2, 3, 4}
RELATION MATRIX
Relation Matrix for ‘less than’ with values {1, 2, 3, 4}
𝐹 𝑇 𝑇 𝑇
𝐹 𝐹 𝑇 𝑇
𝐹 𝐹 𝐹 𝑇
𝐹 𝐹 𝐹 𝐹
PRACTICE PROBLEM

Write a relation matrix representing x>y (‘greater than’) for the set
of values {1, 2, 3, 4, 5, 6}
CATEGORIES OF RELATION
• Reflexive: Every element relates to itself. For example, equality.
Every element is equal to itself
• Symmetric: if one element relates to another element, then the
second element also relates to the first element. For example,
friendship. X is a friend of Y, so Y is a friend of X also.
• Transitive: if one element relates to another element and the
second element relates to the third, then first also relates to the
third
EXAMPLES
Categorize the following relations:
1) ‘is less than or equal to’
• 𝑥 ≤ 𝑥 is always true, so reflexive
• 𝑥 ≤ 𝑦 𝑎𝑙𝑠𝑜 𝑖𝑠 𝑦 ≤ 𝑥? , not symmetric
• 𝑥 ≤ 𝑦, 𝑦 ≤ 𝑧 𝑡ℎ𝑒𝑛 𝑥 ≤ 𝑧, so transitive
PRACTICE PROBLEMS
1) ‘is divisible by’
2) ‘has the same parity as’ [is the same integer whether odd or
even]
3) ‘is a sister of’
4) ‘is a father of’
5) ‘has the same parents’
PRACTICE PROBLEM
PRACTICE PROBLEM
FUNCTION

A function is a relationship between two sets of numbers. We may think


of this as a mapping; a function maps a number in one set to a number in
another set. Notice that a function maps values to one and only one
value. Two values in one set could map to one value, but one value must
never map to two values: that would be a relation, not a function.
DOMAIN, RANGE, CODOMAIN
• Domain: The set of all students in your school.
• Codomain: The set of all possible grades that a student can
receive (e.g., A, B, C, D, F).
• Range: The set of all grades that are actually given to students in
your school.
• Note that the range of a function is always a subset of the
codomain. This is because the range is only the set of outputs
that the function actually produces, while the codomain is the
set of all possible outputs that the function could produce
EXAMPLES
• f(x) = 1/x
• Solution: The domain of this function is all real numbers except
for 0, because the function is undefined when x = 0. The range of
this function is all real numbers except for 0, because the
function can never output the value 0. The codomain of this
function is all real numbers, because the function could output
any real number except for 0.
EXAMPLES
f(x) = 𝑥 2 − 4𝑥 + 4

Solution: The domain of this function is all real numbers. The range
of this function is all real numbers greater than or equal to 0,
because the square of any real number is always greater than or
equal to 0. The codomain of this function is all real numbers,
because the function could output any real number.
EXAMPLES
f(x) = {2x + 1 if x < 0
-x^2 + 3 if x >= 0}
Solution:

The domain of this function is all real numbers. The range of this function
is all real numbers greater than or equal to -1, because the minimum
value of the function is -1 (which is achieved when x = 0). The codomain
of this function is all real numbers, because the function could output any
real number.
ONTO, ONE-TO-ONE
• A function is onto if its range is equal to its codomain.
• A function is one-to-one if no two distinct elements of the
domain have the same image.
COMPOSITE FUNCTION
EXAMPLE
SOLUTION
SOLUTION
EXAMPLE
SOLUTION
INVERSE FUNCTION
EXAMPLE
SOLUTION
PRACTICE
PROBLEMS
PRACTICE PROBLEM
PRACTICE
PROBLEM
PRACTICE
PROBLEM

You might also like