Skip to content
The Lumenary

Practice · Grades 6–8

Function machines in sequence

Function machines in sequence

Warm-upHuman

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?

Function machines in sequence

CoreHuman

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.

Write elements separated by commas. Order and repeats don’t matter — just like in a set!

Function machines in sequence

CoreHuman

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.)

Choose one

Function machines in sequence

CoreHuman

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

Choose one

Function machines in sequence

StretchHuman

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?

Function machines in sequence

CoreHuman

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.

Choose all that apply

Function machines in sequence

CoreHuman

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?

Function machines in sequence

StretchHuman

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?

Choose one

Function machines in sequence

CoreFormal

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”?

Choose one

Function machines in sequence

StretchComputational

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).

Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.