Function Composition:

How to use function composition on how to work out the composition of two given functions.

  • Composition of two functions (f o g) where o I assume is the composition operator
  • Note that function composition is NOT COMMUTATIVE

Give two functions f and g

  • (f o g)(x) is then equal to f(g(x)). This can be worked out in two stages, you first plug in the value of x into the function of g(x) and then you take this output and plug that as your input for f(x)

Example: f(x) = 2x and g(x)=x^2:

  • So (f o g)(x) = f(g(x)) = 2(x^2)
  • Plugging in for when x=2 then (f o g) = 8

Visualization of function composition:

Pasted image 20261020142012.png

Example with real none arbitrary values:

Pasted image 20261020142056.png

Notice that given this, the output of the function inside of the outer function is the co-domain of the inner function, but the domain of the outer function. So basically for an example like f: A → B and g: B → C, then notice that the for (g O f) that the domain is A and that the co-domain is C, so we end up with A→C, and then for (f O g) it is undefined, because we do not know how A correlates to C, given they are different sets then some values might come back undefined

Composition is NOT commutative

Therefore, given two functions f and g, we can say that (f O g) ≠ (g O f), this is logically true given the order of operations.

The following is an example:

Pasted image 20261020142252.png


Bijective Functions

Definition of a bijective (invertible function), basically means that it is both injective and surjective, and therefore has an inverse representation.

Pasted image 20261020144916.png

The following function is obviously bijective, this is because it is injective (one-to-one, meaning each output has only one input) and also surjective (onto, meaning that it has a range equal to that of it’s co-domain)

Therefore, to show that a function is in fact bijective, we just need to show that the function is both surjective and injective.

Pasted image 20261020150543.png


Exercise I did in the homework: f: R -> R f(x)=2x+3

Injective Proof:
Pasted image 20261020150823.png

Surjective Proof:
Pasted image 20261020150917.png

Therefore we are a bijective function


Inverse Functions

Definition:

Let f: A → B, If f is bijective / invertible then the inverse function f^-1, exists, and is defined as follows:

  • f^-1: B → A, this basically just swaps the domain and the co-domain, and then in all reality would you then need to transform the function in terms of the co-domain, which is kind of done during the surjective step.

Pasted image 20261020151242.png
Pasted image 20261020151408.png

So you basically just reverse the effect of the original function, and this is what therefore becomes your inverse function

Pasted image 20261020151731.png

This is basically the identity function which just says that the combination of a function with it’s inverse is just equal to x no matter which way the combination happens. This therefore makes sense that the curves of f and it’s inverse are symmetric with respect to the function of f(x) = x


Exponential Functions

An exponential function: The function f defined by f: ℝ→ℝ and f(x)=b^x where b > 0 and b is not 1. This is called an exponential function with then a base b. Think of , this is an exponential function with a path 2.

If 1 > b > 0, then this is a function of exponential decay, so it is always decreasing.
If ∞ > b > 1, then this is a function of exponential growth, and so it is always increasing.

Properties of exponential functions:
Pasted image 20261020163224.png


Logarithms

The logarithmic function is a function denoted by a function with a base b where b>0 and b≠1.

  • It is defined by if and only if , and by outright definition, the logarithm of an exponential function is the inverse of it.

This is because the exponential function, with the given things outlined above on the range of all real numbers, is bijective, meaning it is both surjective and injective. Thus this means that it must have an inverse function. This is what the logarithmic function is.

Pasted image 20261020164207.png

Given this, we understand that (f O g) and (g O f) is equal to that of x for functions that are inverses of each other, this means that basically they cancel each other out. So if you have an exponential function raised to a logarithmic power of the same base, then these cancel out and all you are left with is the variable.

Similarly, if you have a logarithmic function with a given base, and you perform this operation on a exponential function, you end up with the value of x

Below are some of the algebraic rules for logarithms:
Pasted image 20261020164239.png


Floor and Ceiling Functions

The floor function is a function that is defined by the domain and co-domain: f: ℝ → ℤ. It takes in any real number x as the input, and then returns that largest integer that is less than or equal to x, as denoted by floor(x) = ⌊x⌋. Basically, it rounds down to the nearest whole number.
Pasted image 20261020165624.png

  • Note that negative values like ⌊-1.1⌋ would be equal to -2

The ceiling function is a function that is defined by the domain and co-domain: f: ℝ → ℤ. It takes in any real number x as the input, and then returns that lowest integer that is greater than or equal to x, as denoted by ceil(x) = ⌈x⌉. Basically, it rounds up to the nearest whole number:

Exercise:

Let n be an integer and x be a real number. Show that ⌊x+n⌋ = ⌊x⌋+n

Proof

  • Let m = ⌊x⌋
  • Hence, m ≤ x ≤ m+1 by the definition of the ceiling function
  • Now add n to both sides of this inequality, you get: m+n ≤ x+n ≤ m+1+n.
  • This showcases that the addition of n did not change the inequality, meaning that ⌊x+n⌋ = ⌊x⌋+n

Given that the value of an integer gets truncated whenever you perform a ceiling operation on it, then it does not matter if this truncation on the real number happens before, or after the addition has occurred.


Exercises

“Tutorial-topic2-functions.pdf” could not be found.


Book Reading:

Read the following extract to consolidate your knowledge on these topics: function composition; bijections; and the floor and ceiling functions.

Once you’ve finished the reading, attempt the following exercises:

  • pp.134 exercises 1–3, 5, 6, 10, 11.
  • pp.155 exercises 1–8, 13, 15, 16.

Several exercises have solutions at the back of the book under the section, ‘Solutions to Odd-Numbered Exercises’. Please consult this section to check the answer to your exercises. If you got the answer wrong, take a look back at the question and see how you can arrive at the right answer this time.


Book Notes

For the first portion of this reading, pages 125-128, these notes were actually already taken in week three of this course I believe, so see Week 3 for the notes there.

As for the rest:

Composition of Functions:

You can add or multiply functions just fine, but there is another thing called composition. Consider functions f, g: ℝ→ℝ defined by f(x)=2x+3 and g(x)=x^2. We understand that given the function definition and any basic real logic, that you can input any real number into the function of f and then get any number such that it is an element in the set of all real numbers.

This means that the input for the function of f can then actually be used as the input for the function of g. This would then be g(f(x)), and this can be defined as a new function, you can also then see the logical set example of this is the image below:

Pasted image 20261021155939.png

Now that was of course rather simple, but now image two different functions: f: X → Y and g: Y→Z. The composition of this function can be noted as (g O f) and is obviously then equal to g(f(x)).

For this to be the case, it should be noted that the domain of g does not need to be the same as the co-domain of f, all that is needed is that the range(f) ⊆ dom(g). This means for example if we have all integers as the range of f, then we would need something like all real numbers to be the domain of g.

For the example of f(x)=2x+3 and g(x)=x^2, if we foil out:

  • (g O f) = g(f(x)) = (2x+3)^2
  • (f O g) = f(g(x)) = 2x^2+3

This shows that (g O f) ≠ (f O g), and so composition is not commutative. Think of it as washing clothes. Putting clothes in a washing machine and then a dryer is not the same as putting them in the dryer and then a washing machine.

  • As a matter of fact, the only time that it would be commutative is if the two functions were inverses of one another, and in such a case the answer would just be the value of x.

Properties of function composition:

Pasted image 20261021160819.png
Pasted image 20261021160905.png

Inverse Functions:

Pasted image 20261021161039.png


Week 5 Exercises:

Now it’s time to put into practice the concepts you have learnt so far in Week 5. Attempt the following exercises. If you get stuck, you can refer to the hints and tips on the next page.

Please note that these exercises are optional, further practice – but we strongly recommend that you engage with them in order to test your knowledge and see where you might need to do additional study.

  1. A bowl contains 10 red balls and 10 blue balls. A woman selects balls at random without looking at them.

    1. How many balls must she select to be sure of having at least three balls of the same colour? At least 5
    2. How many balls must she select to be sure of having at least three blue balls? 13 balls
  2. Show that if seven distinct integers are selected from the first 10 positive integers, there must be at least two pairs of these integers with the sum of 11.

    • We can define the set of the first 10 positive integers in the set of {1, 2, 3, 4, 5 ,6, 7, 8, 9, 10}. All possible subsets that when their elements are added are (10, 1) (9, 2) (8, 3) (7, 4) (6, 5). We have a total of 7 distinct integers as our pigeons, and then 5 pairs as our pigeonholes, thus we have ⌈7/5⌉ = 2 meaning there would have to be at least 2 pairs that sum up to 11.

    • CLAUDE: Each box can hold at most 2 of the selected numbers. Suppose at most one box were full. Then that box holds 2 numbers and the other four hold at most 1 each, for a total of at most numbers. But we selected 7, which is a contradiction. So at least two boxes are full, and each full box is a pair summing to 11. Therefore there are at least two such pairs.

  3. Show that if there are 30 students in a class, then at least two have last names that begin with the same letter.

    1. The total distinct number of letters in the English alphabet are 26. This means that we have 30 students as the pigeons and 26 pigeon holes as the letters, so ⌈30/26⌉ = 2
  4. Suppose that there are nine students in a class at a small college.

    1. Show that the class must have at least five male students or at least five female students.
      1. A student is either male or female, thus we have ⌈9/2⌉ = 5 by the generalized pigeonhole principle, meaning we must have at least 5 students of either category.
    2. Show that the class must have at least three male students or at least seven female students.
      1. Using the previous proof of ⌈9/2⌉ = 5 meaning that there is at least 5 students belonging to a group, we can showcase that in the event that the 5 are female, then at 4 would be male. However we cannot say that at least 7 are female.
      2. PROOF BY CONTRADICTION: Suppose that the class has at most 2 male students and at most 6 female students. This means that 6+2=8, But there are 9 students, so this is a contradiction, meaning there is at least 3 male students or 7 female students.

Weekly Practice:

“Basic combinatorial principles part 1.pdf” could not be found.


Book Reading

This essential reading covers the subjects that you have studied in Week 5. It contains detailed explanations and a variety of examples to enable you to understand concepts such as counting principles, inclusion–exclusion and the Pigeonhole Principle. We strongly recommend that you to first watch the videos and then study the essential reading.