ScholarQuill logoScholarQuillUniversity Notes
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
Study Tools
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
Contact
ScholarQuill logo
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
ScholarQuill logoScholarQuillUniversity Notes
Study PortalGE-167Compositions
Ctrl + K
Login
Explore
Search
Semester
Papers
CGPA
    GE-167

    Discrete Structures

    Progress0 / 67 done
    Topics67
    1Propositional and Predicate Logic
    2Logical Operators3Translations Between Symbolic Expressions and Formal English Expression4Logical Equivalences
    5Quantifiers6Nested Quantification7Equivalences in Predicate Logic8Translations Between Symbolic Forms and Formal English
    9Proof Methods and Strategies10Direct Proof11Proof by Contraposition12Proof by Induction13Proof by Implication14Existence Proof15Uniqueness Proofs16Trivial Proofs17Vacuous Proofs
    18Notations and Set Operations19Venn Diagrams20Countable and Uncountable Sets
    21Equivalence Relations and Partitions22Partial Orderings23Recurrence Relations51Reflexive, Symmetric, Transitive, and Antisymmetric52Equivalence Relations and Equivalence Classes53Partial Orders
    24Injective, Surjective, Bijective25Special Types of Functions26Function Composition27Inverse Functions28Recursive Functions29Compositions
    30Sequences and Series
    31Inclusion and Exclusion Principle32Pigeonhole Principle33Permutations and Combinations46Product Rule and Sum Rule47Principle of Inclusion-Exclusion48Binomial Coefficients49Pascal's Identity and Pascal’s Triangle50Binomial Theorem
    34Division Theorem35Modular Arithmetic36LCM and GCD37Euclidean and Extended Euclidean Method38Finding Solutions to Congruence
    39Fundamental Theorem of Arithmetic40Characterizations of Primes41Mersenne Primes
    42Weak Induction43Strong Induction
    44Formulation of Recurrences45Closed Formulas
    54Terminologies55Elements of Graph Theory56Planar Graphs57Graph Coloring58Euler Graph59Hamiltonian Path60Rooted Trees61Graph Traversals62Handshaking Lemma and Corollary63Special Families of Graphs64Graph Isomorphism65Planarity in Graphs66Eulerian and Hamiltonian Graphs67Trees in Graph Theory
    14 min read
    Topic 29 of 67
    Topic Study Note Illustration
    29

    Compositions

    In mathematics, composition of functions refers to the process of combining two functions to create a new function. If you have two functions f : A →...

    Compositions of Functions

    In mathematics, composition of functions refers to the process of combining two functions to create a new function. If you have two functions f:A→Bf: A \to Bf:A→B and g:B→Cg: B \to Cg:B→C, their composition, denoted g∘fg \circ fg∘f, is a new function that maps elements from set AAA to set CCC through the intermediate set BBB. The composition g∘fg \circ fg∘f is defined as:

    (g∘f)(x)=g(f(x)),(g \circ f)(x) = g(f(x)),(g∘f)(x)=g(f(x)),

    where f(x)f(x)f(x) is applied first, and then ggg is applied to the result of f(x)f(x)f(x). In other words, the output of f(x)f(x)f(x) becomes the input to g(x)g(x)g(x).


    1. Formal Definition of Function Composition

    Let’s consider two functions:

    • f:A→Bf: A \to Bf:A→B is a function from set AAA to set BBB,
    • g:B→Cg: B \to Cg:B→C is a function from set BBB to set CCC.

    The composition of ggg and fff, denoted by g∘fg \circ fg∘f, is defined as:

    (g∘f)(x)=g(f(x)),(g \circ f)(x) = g(f(x)),(g∘f)(x)=g(f(x)),

    where f(x)f(x)f(x) is applied first, and then g(x)g(x)g(x) is applied to the result.

    Conditions for Composition:

    • The domain of the composition g∘fg \circ fg∘f is the domain of fff, and the codomain is the codomain of ggg.
    • For g∘fg \circ fg∘f to be defined, the codomain of fff must be the same as the domain of ggg, i.e., f:A→Bf: A \to Bf:A→B and g:B→Cg: B \to Cg:B→C.

    2. Properties of Function Composition

    Several important properties govern the composition of functions. Here are some of them:

    a. Associativity of Composition

    Function composition is associative. This means that for any three functions fff, ggg, and hhh, the composition of f∘(g∘h)f \circ (g \circ h)f∘(g∘h) is the same as (f∘g)∘h(f \circ g) \circ h(f∘g)∘h:

    f∘(g∘h)=(f∘g)∘h.f \circ (g \circ h) = (f \circ g) \circ h.f∘(g∘h)=(f∘g)∘h.

    This property allows for multiple compositions to be grouped in any way without changing the result.

    b. Identity Function

    The identity function III on a set AAA is a function that always returns the same value as its input, i.e., I(x)=xI(x) = xI(x)=x for all x∈Ax \in Ax∈A. The identity function has a special property with respect to composition:

    f∘I=fandI∘f=f.f \circ I = f \quad \text{and} \quad I \circ f = f.f∘I=fandI∘f=f.

    That is, composing any function fff with the identity function leaves fff unchanged.

    c. Composition is not Commutative

    In general, function composition is not commutative, meaning that the order of composition matters:

    g∘f≠f∘g.g \circ f \neq f \circ g.g∘f=f∘g.

    For example, if f(x)=x+1f(x) = x + 1f(x)=x+1 and g(x)=x2g(x) = x^2g(x)=x2, then:

    (g∘f)(x)=g(f(x))=(x+1)2,(g \circ f)(x) = g(f(x)) = (x + 1)^2,(g∘f)(x)=g(f(x))=(x+1)2, (f∘g)(x)=f(g(x))=x2+1.(f \circ g)(x) = f(g(x)) = x^2 + 1.(f∘g)(x)=f(g(x))=x2+1.

    Clearly, (x+1)2≠x2+1(x + 1)^2 \neq x^2 + 1(x+1)2=x2+1, so g∘f≠f∘gg \circ f \neq f \circ gg∘f=f∘g.


    3. Examples of Function Composition

    Let’s explore some concrete examples to better understand the composition of functions.

    Example 1: Basic Composition

    Consider two functions:

    f(x)=2x+3andg(x)=x2.f(x) = 2x + 3 \quad \text{and} \quad g(x) = x^2.f(x)=2x+3andg(x)=x2.

    The composition g∘fg \circ fg∘f is:

    (g∘f)(x)=g(f(x))=g(2x+3)=(2x+3)2.(g \circ f)(x) = g(f(x)) = g(2x + 3) = (2x + 3)^2.(g∘f)(x)=g(f(x))=g(2x+3)=(2x+3)2.

    So the composition g∘fg \circ fg∘f is (2x+3)2(2x + 3)^2(2x+3)2.

    Now, let’s compute f∘gf \circ gf∘g:

    (f∘g)(x)=f(g(x))=f(x2)=2x2+3.(f \circ g)(x) = f(g(x)) = f(x^2) = 2x^2 + 3.(f∘g)(x)=f(g(x))=f(x2)=2x2+3.

    Thus, the composition f∘gf \circ gf∘g is 2x2+32x^2 + 32x2+3, which is clearly different from g∘fg \circ fg∘f.

    Example 2: Identity Function Composition

    Let’s say we have the function f(x)=3x−5f(x) = 3x - 5f(x)=3x−5. The identity function I(x)=xI(x) = xI(x)=x satisfies:

    (f∘I)(x)=f(I(x))=f(x)=3x−5,(f \circ I)(x) = f(I(x)) = f(x) = 3x - 5,(f∘I)(x)=f(I(x))=f(x)=3x−5, (I∘f)(x)=I(f(x))=f(x)=3x−5.(I \circ f)(x) = I(f(x)) = f(x) = 3x - 5.(I∘f)(x)=I(f(x))=f(x)=3x−5.

    In this case, composing fff with the identity function leaves f(x)f(x)f(x) unchanged.

    Example 3: Composition with Piecewise Functions

    Let’s define two piecewise functions:

    • f(x)={x+1if x≥0,2xif x<0.f(x) = \begin{cases} x + 1 & \text{if } x \geq 0, \\ 2x & \text{if } x < 0. \end{cases}f(x)={x+12x​if x≥0,if x<0.​
    • g(x)={x2if x≥0,∣x∣if x<0.g(x) = \begin{cases} x^2 & \text{if } x \geq 0, \\ |x| & \text{if } x < 0. \end{cases}g(x)={x2∣x∣​if x≥0,if x<0.​

    Now let’s compute the compositions for x≥0x \geq 0x≥0:

    • (g∘f)(x)=g(f(x))=g(x+1)=(x+1)2(g \circ f)(x) = g(f(x)) = g(x + 1) = (x + 1)^2(g∘f)(x)=g(f(x))=g(x+1)=(x+1)2.
    • (f∘g)(x)=f(g(x))=f(x2)=x2+1(f \circ g)(x) = f(g(x)) = f(x^2) = x^2 + 1(f∘g)(x)=f(g(x))=f(x2)=x2+1.

    Thus, for x≥0x \geq 0x≥0, g∘f≠f∘gg \circ f \neq f \circ gg∘f=f∘g. The compositions give different results.


    4. Composition of More Than Two Functions

    It is possible to compose more than two functions. If you have three functions fff, ggg, and hhh, the composition h∘g∘fh \circ g \circ fh∘g∘f is defined as:

    (h∘g∘f)(x)=h(g(f(x))).(h \circ g \circ f)(x) = h(g(f(x))).(h∘g∘f)(x)=h(g(f(x))).

    Since composition is associative, you can write this as:

    h∘(g∘f).h \circ (g \circ f).h∘(g∘f).

    For example, if f(x)=2xf(x) = 2xf(x)=2x, g(x)=x+1g(x) = x + 1g(x)=x+1, and h(x)=x2h(x) = x^2h(x)=x2, the composition h∘g∘fh \circ g \circ fh∘g∘f is:

    h(g(f(x)))=h(g(2x))=h(2x+1)=(2x+1)2.h(g(f(x))) = h(g(2x)) = h(2x + 1) = (2x + 1)^2.h(g(f(x)))=h(g(2x))=h(2x+1)=(2x+1)2.

    This demonstrates that compositions can be extended to multiple functions in a straightforward manner.


    5. Applications of Function Composition

    Composition of functions is widely used in many areas of mathematics and its applications:

    • In Calculus: Composition is crucial in the chain rule for differentiating composite functions. If h(x)=g(f(x))h(x) = g(f(x))h(x)=g(f(x)), the derivative of hhh is: h′(x)=g′(f(x))⋅f′(x).h'(x) = g'(f(x)) \cdot f'(x).h′(x)=g′(f(x))⋅f′(x).
    • In Computer Science: Function composition is a common technique in programming, especially in functional programming languages where functions are often composed to build more complex functions.
    • In Probability and Statistics: Composition is used in probability theory when working with conditional probabilities, and in statistical transformations.
    • In Physics: In certain physical models, transformations of variables can be expressed using the composition of functions, such as when converting between coordinate systems.

    6. Conclusion

    The composition of functions is a fundamental operation in mathematics where two functions are combined to produce a new function. It involves applying one function to the result of another. Composition is associative but generally not commutative. Understanding how to compose functions and the properties of function composition is important in areas ranging from algebra to calculus and computer science.

    ← Previous topic 28
    Recursive Functions
    Next topic 30 →
    Number Theory: Sequences and Series

    Past Papers

    Open this section to view and download past papers

    Click on Show Past Papers to load available exam papers.

    Reading Progress
    0%
    14mremaining
    2.4kwords
    Intermediatelevel
    On This Page

    No headings found

    Study Toolkit

    Subject Portal

    Discrete Structures