Skip to content

Function Machine

Run the Function Machine MicroSim Fullscreen

Edit the Function Machine MicroSim with the p5.js editor

About This MicroSim

The Function Machine visualizes how a mathematical function works: you feed in an input value, the machine applies a rule (the function), and exactly one output emerges. This "one input, one output" property is the defining characteristic of a function.

How to Use

  1. Set the Input: Use the slider to choose an input value from -10 to 10
  2. Select a Function: Click one of the function buttons (2x, x², |x|, or sin)
  3. Process: Click "Process" to watch the input flow through the machine
  4. Observe: Watch the calculation displayed inside the machine and the output that emerges
  5. Explore: The history table tracks your last 5 input-output pairs

Embedding

Place the following line in your website to include this MicroSim:

1
<iframe src="https://dmccreary.github.io/calculus/sims/function-machine/main.html" height="482px" width="100%" scrolling="no"></iframe>

Lesson Plan

Learning Objective

Students will explain how a function processes inputs to produce outputs, demonstrating the "one input, one output" rule.

Bloom's Taxonomy Level

Understand (L2) - Students interpret and explain the concept of a function as a rule that assigns exactly one output to each input.

Warm-Up Activity (5 minutes)

Ask students: "If I tell you a mystery number machine doubles every number you put in, what comes out when you put in 5? What about -3?"

Guided Exploration (10 minutes)

  1. Start with f(x) = 2x selected
  2. Process several inputs: 0, 1, 5, -3
  3. Ask: "What pattern do you notice in the history table?"
  4. Switch to f(x) = x² and repeat with the same inputs
  5. Ask: "Why does -3 give the same output as 3 for x²?"

Key Questions for Discussion

  • Can you find any input that gives more than one output? Why not?
  • For f(x) = |x|, which inputs give the same output?
  • For f(x) = sin(x), what's special about input 0?

Independent Practice

Have students: 1. Predict the output before pressing "Process" 2. Test their prediction 3. Record any surprising results

Assessment

Students demonstrate understanding by: - Explaining why every function input produces exactly one output - Predicting outputs for untested inputs - Identifying which functions give different/same outputs for positive and negative inputs

References