Skip to content
The Lumenary

Each worksheet prints cleanly on A4 or Letter. Answer keys are on a separate page.

The Lumenary · Grades 6–8

Function machines in sequence

Name: ______________________

Date: ______________________

You will learn to

  • Compute the result of applying one function and then another, using tables, arrow diagrams and formulas
  • Decide whether a chain is possible, by checking that every output of the first function is an allowed input of the second
  • Recognise the identity function and explain why chaining it before or after any function changes nothing
  • Find the inverses of simple bijections such as x↦x+3x \mapsto x + 3 and x↦2xx \mapsto 2x on Q\Q, and undo a chain by undoing its steps in reverse order
  • Explain why a function that sends two inputs to the same output, such as x↦x2x \mapsto x^2 on Z\Z, cannot be undone
  1. 1.

    Let f(x)=3x−1f(x) = 3x - 1 and g(x)=x2g(x) = x^2. Apply ff, then gg, to the input 22. What is the output?

  2. 2.

    Let f:{1,2,3,4}→{a,b,c}f : \{1, 2, 3, 4\} \to \{a, b, c\} be given by f(1)=af(1) = a, f(2)=cf(2) = c, f(3)=af(3) = a, f(4)=bf(4) = b, and g:{a,b,c}→{x,y}g : \{a, b, c\} \to \{x, y\} by g(a)=yg(a) = y, g(b)=xg(b) = x, g(c)=yg(c) = y. Which inputs does “ff, then gg” send to yy? List them.

  3. 3.

    Which of these chains is defined for every integer input xx? (Here x\sqrt{x} accepts only inputs x≥0x \ge 0, and 1x\tfrac{1}{x} only inputs x≠0x \neq 0.)

    • A.“square, then take the square root”
    • B.“subtract 11, then take the reciprocal 1x\tfrac{1}{x}”
    • C.“add 11, then take the square root”
    • D.“square and change the sign (x↦−x2x \mapsto -x^2), then take the square root”
  4. 4.

    A function is the chain “multiply by 44, then subtract 77”. Which chain undoes it?

    • A.add 77, then divide by 44
    • B.divide by 44, then add 77
    • C.subtract 77, then divide by 44
    • D.add 77, then multiply by 44
  5. 5.

    From Bhāskara II's Līlāvatī (1150): a number is multiplied by 33; then three quarters of the result is added to it; the sum is divided by 77; a third of the quotient is subtracted from it; the result is multiplied by itself; 5252 is subtracted; the square root is taken; 88 is added; and the result is divided by 1010. The answer is 22. What was the number?

  6. 6.

    Which of these functions from Z\Z to Z\Z can be undone by some function from Z\Z to Z\Z? Choose all that apply.

    • A.x↦x+10x \mapsto x + 10
    • B.x↦3xx \mapsto 3x
    • C.x↦x2x \mapsto x^2
    • D.x↦∣x∣x \mapsto |x| (the distance from 00)
    • E.x↦−xx \mapsto -x
  7. 7.

    For which integer aa do “add aa, then multiply by 55” and “multiply by 55, then add aa” give the same output for every integer input?

  8. 8.

    Let ff and gg be functions from a set to itself with inverse functions f−1f^{-1} and g−1g^{-1}. Undoing “ff, then gg” in the wrong order means applying f−1f^{-1}, then g−1g^{-1}, so each input aa goes to g−1(f−1(g(f(a))))g^{-1}\big(f^{-1}(g(f(a)))\big). When does this give back aa for every input?

    • A.Exactly when g(f(a))=f(g(a))g(f(a)) = f(g(a)) for every aa — that is, when the order of ff and gg does not matter
    • B.Only when f=gf = g
    • C.Only when ff or gg is the identity
    • D.Never
  9. 9.

    In the Lean section, Undoes g f means g(f(a))=ag(f(a)) = a for every aa. Which Lean statement says “squaring on Z\Z cannot be undone”?

    • A.¬ ∃ g : Int → Int, Undoes g (fun x => x * x)
    • B.∃ g : Int → Int, ¬ Undoes g (fun x => x * x)
    • C.¬ ∃ g : Int → Int, Undoes (fun x => x * x) g
    • D.∀ g : Int → Int, Undoes g (fun x => x * x)
  10. 10.

    A function on a finite set can be stored as a dictionary, such as {1: 'a', 2: 'b'}. Write invert(table) that returns a dictionary undoing table — sending each output back to its input — or None if two inputs share an output (so the function cannot be undone).

    Computational — Practice

Code: Apache-2.0 · Content: CC BY-SA 4.0