1 of 13

Function Composition

2 of 13

Functions

  • Recall: what is a function?

2

3 of 13

Functions

  • Recall: what is a function?
  • A rule from one set to another set (not necessarily different sets!)
  • Can only have (at most!) one output for any input
  • A function is an action

3

4 of 13

Functions

  • Functions can be simple
    • Add one to the input number
  • Functions can be complicated
    • Find the nth prime number
  • Functions can be really complicated
    • Determine the position of all particles in the universe for any time.

4

5 of 13

Chain Functions Together

  • Like in life, functions (actions) can be chained together
  • Called composition

  • Range of output becomes domain of next input

5

6 of 13

Scenarios

  • Imagine two activities where the order of the activity matters
    • “I do … then I do …”
  • Imagine two activities where the order of the activity doesn’t matter
    • “I do … then I do …”
  • Share in your groups then as whole class

6

7 of 13

Scenario Where Order Matters

  • Let f(x) be “leave house at time f given day x”
      • f(August 5) = 9:30am
      • f(Sept 7) = 6:00am
  • Let g(x) be “arrive at school at time g given time x”
      • g(6:00am) = 6:10am
      • g(7:40am) = 8:00am

7

8 of 13

Scenario Where Order Matters

  • Let f(x) be “leave house at time f given day x”
  • Let g(x) be “arrive at school at time g given time x”
  • What makes sense?
    • f(g(x))
    • g(f(x))

8

9 of 13

Scenario Where Order Matters

  • Let f(x) be “leave house at time f given day x”
  • Let g(x) be “arrive at school at time g given time x”
  • What makes sense?
    • f(g(x)) - doesn’t make sense
    • g(f(x)) - makes sense
  • Output of f(x) is time which is input of g(x)
  • Composition is from the inside out
  • g(f(x)) is only one that makes sense

9

10 of 13

Function Composition

Notation:

  • Evaluate from inside out
  • g first then f
  • Range of g becomes domain of f

10

11 of 13

Examples

Let

Evaluate:

11

12 of 13

Examples

  • Write the functions using composition
  • Make new function names for the compositions

  • How can you check if you’re correct?

12

13 of 13

Transformations as Composition

  • Compare
  • Against
  • What is the same? What is different?
  • Compare
  • Against
  • What is the same? What is different?

13