instagram

Students discover functions as an abstraction over an arithmetic pattern, applying the Design Recipe to traditional word problems.

Prerequisites

Relevant Standards

Select one or more standards from the menu on the left (⌘-click on Mac, Ctrl-click elsewhere).

Common Core State Statements
7.EE.B.4

Use variables to represent quantities in a real-world or mathematical problem, and construct simple equations and inequalities to solve problems by reasoning about the quantities.

8.F.B

Use functions to model relationships between quantities.

HSF.IF.A.2

Use function notation, evaluate functions for inputs in their domains, and interpret statements that use function notation in terms of a context.

Older Statements
BS-DR.2

The student can derive test cases for a given contract and purpose statement

Lesson Goals

Students will be able to:

  • Understand how to use the Design Recipe to break down word problems.

  • Create a strong purpose statement that details in their own words what the function should do.

Student-Facing Lesson Goals

  • I can use the Design Recipe to break down word problem when writing a function.

  • I can identify the domain and range and other quantities in a word problem when writing a function.

  • I can create and revise a strong purpose statement that explains what the function is doing.

Materials

Preparation

  • Make sure all materials have been gathered

  • Decide how students will be grouped in pairs

Supplemental Resources

Key Points for the Facilitator

  • The purpose statement is a comment in the code - something the computer doesn’t read. It is important for readability of their code - there may be other people looking at their code and using their functions!

  • Remind students that the domain and range of a function must be one or more of the three data types (Number, String, Image) they’ve learned so far.

  • If students struggle with creating the examples, use the Circle of Evaluation mapping activity or use role-playing to help students build up their understanding around the concept.

Glossary
contract

a statement of the name, domain, and range of a function

datatypes

a way of classifying values, such as: Number, String, Image, Boolean, or any user-defined data structure

design recipe

a sequence of steps that helps people document, test, and write functions

domain

the type or set of inputs that a function expects

function

a mathematical object that consumes inputs and produces an output

purpose statement

a brief description of what a function does

range

the type or set of outputs that a function produces

Warmup

Students should have their workbook, pencil, and be logged into WeScheme on their computer.

Writing Linear Functions 25 minutes

Overview

Students are given a non-working program, which uses a linear function to determine the height of a rocket after a given length of time. The "broken" code is provided to lower cognitive load, allowing students to focus on comprehension (reading the code) and making use of structure (identifying where it’s broken).

Launch

Ask students to open the

rocket-height Starter File and click "Run". By typing (start rocket-height), they will see the simulation start to run on their computer.

Notice and Wonder

What do you notice about this program? What do you wonder?

Survey the class on their "Notices" and "Wonders" and record on the board before moving on to the discussion.

  • Is rocket-height working?

  • Why do you think it’s not working?

  • What do you think the purpose of this function is? How do you know?

  • What is the domain of rocket-height? Number

  • What is the range of rocket-height? How do you know? Number, we can tell by looking at the contract for the function.

  • As the program is currently written, what happens when I give the function an input of 5? 15? One million? It always returns 0.

You’ve started to master most of the steps of the Design Recipe, but there’s one part you haven’t seen yet: writing a purpose statement. Programmers and Mathematicians alike find it helpful to restate a problem in their own words. After all, if you can’t explain a problem to someone else, you probably don’t understand it yourself!

Investigate

Let’s use the Design Recipe to fix rocket-height, and get comfortable with writing purpose statements.

Have students turn to the rocket-height Design Recipe (Page 30) and read the problem statement with their partner.

Strategies for English Language Learners

MLR 6: Three Reads
Students will access the problem statement three times, looking and listening for different relevant information for the function. Students will document their work in the Purpose Statement organizer (Page 31).

* 1st Read: Teacher reads the word problem aloud. Students discuss: What is the problem about? * 2nd Read: Partner A reads. Students discuss: What are the quantities? * 3rd Read: Partner B reads. Students discuss: What is a good purpose statement?

MLR 1: Stronger and Clearer Each Time
Using the Purpose Statement organizer (Page 31), students will switch partners three times. The purpose of this exercise is for students to read, listen and comprehend while also improving their own language in their purpose statement.

* 1st new partner: Read their purpose statements to each other & revise the purpose statement to be stronger and clearer. * 2nd new partner: Repeat. * 3rd new partner (if needed): Repeat.

  • Now that the students have revised and refined their purpose statement, have them write the Contract and purpose statement on the Design Recipe (Page 30) worksheet.

  • Given the contract and purpose statement, write 2 examples of how rocket-height should work.

  • Circle and label what’s changing in the two examples, just as they did with their green triangle function before.

  • Choose a good variable name for what’s changing.

  • Write the function definition using the variable name.

  • Once the Design Recipe has been completed in the workbook, students can type the code into the rocket-height program, replacing any incorrect code with their own code.

Synthesize

  • What was the problem?

  • What mistake did the programmer make?

  • Where in the Design Recipe did they first go astray?

The Design Recipe allows us to trace mistakes back to the source!

More Interesting Functions flexible

Overview

For teachers who cover quadratic and exponential functions, this activity deepens students' understanding of functions and extends the Design Recipe to include those. This can also be a useful activity for students who finish early, or who need more of a challenge.

Launch

Now that rocket-height is working correctly, explore the rest of the file and try the following:

  • Remove the comment from before the (start rocket-height) and test the program.

  • Put the comment back in front of (start rocket-height), remove the comment from (graph rocket-height), and test the program.

  • Try out (space rocket-height)

  • Try out (everything rocket-height)

Investigate

  • Can you make the rocket fly faster? Slower?

  • Can you make the rocket sink down instead of fly up?

  • Can you make the rocket accelerate over time, so that it moves faster the longer it flies?

  • Can you make the rocket blast off and then land again?

  • Can you make the rocket blast off, reach a maximum height of exactly 1000 meters, and then land?

  • Can you make the rocket blast off, reach a maximum height of exactly 1000 meters, and then land after exactly 100 seconds?

  • Can you make the rocket fly to the edge of the the universe?

Synthesize

Debrief - what did students try? Have students share their experiments with one another!

Additional Exercises:

  • Define a function ‘purple-star’, that takes in the size of the star and produces an outlined, purple star of the given size.
    Design Recipe: purple-star

  • Define a function ‘spot’, that takes in a color and produces a solid circle of radius 50, filled in with that color. (Design Recipe: spot)

  • Define a function ‘average’, which takes in two numbers and produces their average. (Design Recipe: average)

  • Do Examples Have the Same Contracts? (1) (original , answers)

  • Do Examples Have the Same Contracts? (2) (original , answers)

  • Matching Contracts and Examples (1) (original , answers)

  • Matching Contracts and Examples (2) (original , answers)

These materials were developed partly through support of the National Science Foundation, (awards 1042210, 1535276, 1648684, and 1738598). CCbadge BS:Games by Jen Poole, Emmanuel Schanzer, Ed Campos Jr, and Dorai Sitaram is licensed under a Creative Commons 4.0 Unported License. Based on a work at www.BootstrapWorld.org. Permissions beyond the scope of this license may be available by contacting schanzer@BootstrapWorld.org.