- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Composition of Functions of Set
Two functions f: A → B and g: B → C can be composed to give a composition g o f. This is a function from A to C defined by (g o f)(x) = g(f(x))
Let f(x) = x + 2 and g(x) = 2x + 1, find (f o g)(x) and (g o f)(x).
(f o g)(x) = f(g(x)) = f(2x + 1) = 2x + 1 + 2 = 2x + 3
(g o f)(x) = g (f(x)) = g(x + 2) = 2 (x+2) + 1 = 2x + 5
Hence, (f o g)(x) ≠ (g o f)(x)
Some Facts about Composition
If f and g are one-to-one then the function (g o f) is also one-to-one.
If f and g are onto then the function (g o f) is also onto.
Composition always holds associative property but does not hold commutative property.
- Functions of Set
- Composition attribute in HTML5 Canvas?
- Composition vs Aggregation in C#
- Inheritance vs Composition in C#
- What is composition in C#?
- Composition vs inheritance in React.js
- Difference between composition and aggregation
- Difference Between Aggregation and Composition
- Functions of the Network Layer
- Z-Transform of Exponential Functions
- What is composition in HTML5 Canvas?
- Association, Composition and Aggregation in Java
- Association, Composition and Aggregation in C#
- What is a composition in Java?
- Benefits of inline functions in C++?