instagram

Students take a closer look at how functions can work together by investigating the relationship between revenue, cost, and profit.

Prerequisites

Relevant Standards

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

Common Core Math Standards
6.EE.B.6

Use variables to represent numbers and write expressions when solving a real-world or mathematical problem; understand that a variable can represent an unknown number, or, depending on the purpose at hand, any number in a specified set.

7.EE.A.2

Understand that rewriting an expression in different forms in a problem context can shed light on the problem and how the quantities in it are related.

7.EE.B

Solve real-life and mathematical problems using numerical and algebraic expressions and equations.

HSF.BF.A

Build a function that models a relationship between two quantities.

HSF.BF.A.1

Write a function that describes a relationship between two quantities.

HSF.BF.A.1.C

Compose functions.

HSF.BF.B

Build new functions from existing functions.

MP.1

Make sense of problems and persevere in solving them

MP.3

Construct viable arguments and critique the reasoning of others

MP.4

Model with mathematics

MP.6

Attend to precision

CSTA Standards
1B-AP-11

Decompose (break down) problems into smaller, manageable subproblems to facilitate the program development process.

2-AP-11

Create clearly named variables that represent different data types and perform operations on their values.

2-AP-13

Decompose problems and subproblems into parts to facilitate the design, implementation, and review of programs

2-AP-17

Systematically test and refine programs using a range of test cases

2-AP-19

Document programs in order to make them easier to follow, test, and debug.

3A-AP-17

Decompose problems into smaller components through systematic analysis, using constructs such as procedures, modules, and/or objects.

3B-AP-14

Construct solutions to problems using student-created components, such as procedures, modules and/or objects.

3B-AP-21

Develop and use a series of test cases to verify that a program performs according to its design specifications.

Oklahoma Standards
OK.A1.A.3.1

Solve equations involving several variables for one variable in terms of the others.

Lesson Goals

Students will be able to:

  • Write a function that explicitly uses another function.

  • Explain the benefits and drawbacks of functions that depend on each other.

  • Explain the difference between bottom-up and top-down strategies.

Student-Facing Lesson Goals

  • I can explain the benefits and drawbacks of functions that use other functions.

  • I can write a function that uses another function.

Materials

Preparation

  • Make sure all materials have been gathered

  • Decide how students will be grouped in pairs

Key Points for the Facilitator

  • There are several ways to write the profit function - use this opportunity for discussion and to promote higher-order critical thinking.

  • If students are struggling with understanding the basics of the problem, start by coming up with examples of cost and revenue. If Sally sells one glass, what is her total revenue? How much does it cost her to produce that one glass?

  • Ensure students understand the difference between "revenue" and "profit", and that "cost" refers to the cost of making the lemonade, not the amount Sally is charging.

Language Table

Types

Functions

Values

Number

+, -, *, /, expt, sqr, sqrt

4, -1.2, 2/3, pi

String

string-length, string-repeat, string-contains?

"hello", "91"

Boolean

<, <>, <=, >=, string<?, string>?, string=?, string<>?, string>=?

true, false

Image

star, triangle, circle, square, rectangle, rhombus, ellipse, regular-polygon, radial-star, text, overlay, above, beside, rotate, scale, flip-horizontal, flip-vertical

🔵🔺🔶

Glossary
function

a mathematical object that consumes inputs and produces an output

🔗Problem Decomposition 30 minutes

Overview

Students are introduced to word problems that can be broken down into multiple problems, the solutions to which can be composed to solve other problems. They adapt the Design Recipe to handle this situation.

Launch

Students should have their workbook, pencil, and be logged into WeScheme and have their workbooks with a pen or pencil.

Display the following image:

Lemonade Stand Ideas Lemonade Stand Ideas🖼Show image

Notice and Wonder

Have students share everything they notice about the situations described above. Then, separately, have them share what they wonder.

One example of a relationship we can find in this situation is that Sally takes in $1.75 for every glass she sells: revenue = \$1.75 × glasses

What other relationships can you find here?

(Give students a chance to discuss and brainstorm)

  • Every glass sold brings in $1.75 in revenue

  • Every glass sold costs $0.30 in costs, such as lemonds, sugar and water

  • Every glass sold brings in some amount of profit: it costs a certain amount to make, but it brings in another amount in revenue

Investigate

Students form groups and brainstorm their ideas for functions. Students can use any strategies they’ve learned so far.

Strategies for English Language Learners

MLR 7 - Compare and Connect There are several correct ways to write the functions needed for Sally’s Lemonade. Have students compare methods and develop understanding and language related to mathematical representation and methods. What are the advantages of the different solutions? What are some drawbacks?

  • What is the difference between revenue and profit? Revenue is the total amount of money that comes in, profit is the remaining money after cost has been subtracted.

  • How could Sally increase her profits? By decreasing her costs, raising her prices (which increases revenue), by selling more lemonade.

  • What is the relationship between profit, cost, and revenue? Profit = Revenue - Cost

Students work with their partners to develop their function models for revenue (Page 65), and profit (Page 66), using the Design Recipe.

While students are working, walk the room and gauge student understanding. There is more than one correct way to write the profit function! Encourage discussion between students and push students to develop their thinking on the advantages and disadvantages of each correct solution.

Synthesis

This activity started with a situation, and students modeled that situation with functions. One part of the model was profit, which can be written several ways, for example:

(define (profit g) (- (* 1.75 g) (* 0.30 g)))
(define (profit g) (* (- 1.75 0.30) g))
(define (profit g) (* 1.45 g))
(define (profit g) (- (revenue g) (cost g)))
  • Which way is "best", and why?

  • If lemons gets more expensive, which way requires the least amount of change?

  • If sugar gets less expensive, which way requires the least amount of change?

Big Ideas

  1. profit can be decomposed into a simple function that uses the cost and revenue functions.

  2. Decomposing a problem allows us to solve it in smaller pieces, which are also easier to test!

  3. These pieces can also be re-used, resulting in writing less code, and less duplicate code.

  4. Duplicate code means more places to make mistakes, especially when that code needs to be changed.

🔗Top-Down vs. Bottom-Up 20 minutes

Overview

Students explore problem decomposition as an explicit strategy, and learn about two ways of decomposing.

Launch

Top-Down and Bottom-Up design are two different strategies for problem decomposition.

Bottom-Up: start with the small, easy relationships first and then build our way to the larger relationships. In the Lemonade Stand, you defined cost and revenue first, and then put them together in profit.

Top-Down: start with the "big picture" and then worry about the details later. We could have started with profit, and made a to-do list of the smaller pieces we’d build later

Investigate

Consider the following situation:

Jamal’s trip requires him to drive 20mi to the airport, fly 9,000mi, and then take a bus 6mi to his hotel. His average speed driving to the airport is 40mph, the average speed of an airplane is 575mph, and the average speed of his bus is 15mph.

Aside from time waiting for the plane or bus, how long is Jamal in transit?

This can be decomposed via Top-Down or Bottom-Up design. What functions would you define to solve this, and in what order? For extra credit, you can actually compute the answer!

Synthesize

Make sure that students see both strategies, and have them discuss which they prefer and why.

These materials were developed partly through support of the National Science Foundation, (awards 1042210, 1535276, 1648684, and 1738598). CCbadge Bootstrap:Algebra by the Bootstrap Community is licensed under a Creative Commons 4.0 Unported License. This license does not grant permission to run training or professional development. Offering training or professional development with materials substantially derived from Bootstrap must be approved in writing by a Bootstrap Director. Permissions beyond the scope of this license, such as to run training, may be available by contacting contact@BootstrapWorld.org.