Properties
-
Associative Property
The associative property states that if f,g, and h are composable functions, then f ∘ (g ∘ h) = (f ∘ g) ∘ h. Due to this property, generally, parenthesis is omitted as the result remains the same.
-
Commutative Property
Any two functions, f and g, are said to commute with each other if g ∘ f = f ∘ g. Only some particular functions follow this property.
-
If two functions f and g are injective(one-to-one), then the function obtained by their composition is also injective.
-
If two functions f and g are surjective(onto), then the function obtained by their composition is also surjective.
- From the previous two properties, the composition of two bijective(both injective and surjective) functions is also bijective.
Examples
Let’s solve a problem based on the composition of functions to gain more clarity.
Consider three functions f, g and h, such that f (x) =x2, g (x) = x + 1 and h (x) = x.
Determine (i) h ∘ f ∘ g (ii) g ∘ f ∘ h (iii) f ∘ g ∘ h
-
h ∘ f ∘ g
h ∘ f ∘ g = h( f( g(x)))
Putting g(x) = x+1, we get →
h( f( g(x))) = h(f(x+1))
Putting f(x+1) = (x+1)2 we get →
h( f( g(x))) = h(f(x+1)) = h((x+1)2)
Finally, putting h((x+1)2) = (x+1)2 we get →
h ∘ f ∘ g = h( f( g(x))) = h(f(x+1)) = h((x+1)2) = (x+1)2
-
g ∘ f ∘ h
g ∘ f ∘ h = g( f( h(x)))
Putting h(x) = x, we get →
g( f( h(x))) = g(f(x))
Putting f(x) = x2 we get →
g( f( h(x))) = g(f(x)) = g(x2)
Finally, putting g(x2), we get →
g ∘ f ∘ h =g( f( h(x))) = g(f(x)) = g(x2) = x2 + 1
-
f ∘ g ∘ h
f ∘ g ∘ h = f( g( h(x)))
Putting, h(x)=x we get →
f( g( h(x))) = f(g(x))
Putting g(x)=x+1 we get →
f( g( h(x))) = f(g(x)) = f(x+1)
Finally, putting f(x+1)=(x+1)2 we get →
f ∘ g ∘ h = f( g( h(x))) = f(g(x)) = f(x+1) = (x+1)2
FAQs
-
What is the domain of a composite function?
The domain of a composite function f(g(x)) is the set of those inputs x in the domain of g for which g(x) is in the domain of f.
-
Are composite functions commutative?
The fact that we can have g∘h≠h∘g, for some functions g,h, says that the composition of functions is not commutative.
-
What is the necessary condition to find the composite function of two functions?
When two functions combine so that the output of one function becomes the input of the other, the function is a composite function.
-
What is a bijective function?
A function that is both surjective and injective is called bijective.
-
What is an injective function?
An injective function (also known as injection, or one-to-one function) is a function f that maps distinct elements to distinct elements; that is, f(x1) = f(x2) implies x1 = x2.
Key Takeaways
In this article, we have extensively discussed the Composition of functions, their properties, along with examples of composite functions.
We hope that this blog has helped you enhance your knowledge regarding the Composition of functions. If you would like to learn more, check out our articles on Cauchy’s mean value theorem, Prosecutor’s fallacy, Poisson distribution, Rolle’s mean value theorem.
Refer to our guided paths on Coding Ninjas Studio to learn more about DSA, Competitive Programming, JavaScript, System Design, etc.
Enrol in our courses and refer to the mock test and problems available.
Take a look at the interview experiences and interview bundle for placement preparations.
Do upvote our blog to help other ninjas grow.
Happy Learning!