Function machines in sequence
Warm-upHumanLet and . Apply , then , to the input . What is the output?
Let and . Apply , then , to the input . What is the output?
Let be given by , , , , and by , , . Which inputs does “, then ” send to ? List them.
Which of these chains is defined for every integer input ? (Here accepts only inputs , and only inputs .)
A function is the chain “multiply by , then subtract ”. Which chain undoes it?
From Bhāskara II's Līlāvatī (1150): a number is multiplied by ; then three quarters of the result is added to it; the sum is divided by ; a third of the quotient is subtracted from it; the result is multiplied by itself; is subtracted; the square root is taken; is added; and the result is divided by . The answer is . What was the number?
Which of these functions from to can be undone by some function from to ? Choose all that apply.
For which integer do “add , then multiply by ” and “multiply by , then add ” give the same output for every integer input?
Let and be functions from a set to itself with inverse functions and . Undoing “, then ” in the wrong order means applying , then , so each input goes to . When does this give back for every input?
In the Lean section, Undoes g f means for every . Which Lean statement says “squaring on cannot be undone”?
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).