8

CS in Algebra | Lesson 8

Composite Functions


Lesson time: 30-60 Minutes

Lesson Overview

In the past lessons students have defined variables which will allow them to easily write expressions that refer to the same value repeatedly. In this stage, they will write simple functions that, like variables, allow students to abstract out repetitious elements of their programs.

Lesson Objectives

Students will:

Anchor Standard

Common Core Math Standards

Additional standards alignment can be found at the end of this lesson

Teaching Summary

Getting Started

1) Vocabulary
2) Introduction

Activity: Composite Functions

2) Online Puzzles

Teaching Guide

Getting Started

1) Vocabulary

This lesson has one new and important word:

  • Parameter - A value or expression belonging to the domain.

2) Introduction

Defining a reusable value is helpful when a program has lots of identical expressions. Sometimes, however, a program has expressions that aren’t identical, but are just very similar. A program that has fifty solid, green triangles can be simplified by defining a single value, as long as they are all the same size. But what if a program has fifty solid, green triangles of different sizes?

Think about the Image functions you have already used, like star and circle. They take inputs and produce images. Similarly, we might want a green-triangle function that takes the size as an input and produces a green triangle. The programming language doesn’t provide this function, but it does let you define your own functions. We want to define our own function (let’s call it gt, for green triangle) that takes in a Number as the size parameter and produces a solid green triangle of whatever size we want. For example: and so on...

Activity: Composite Functions

2) Online Puzzles

In this stage you'll define simple functions. Head to CS in Algebra stage 8 in Code Studio to get started programming.

Standards Alignment

Common Core Math Standards

  • 5.OA.1 - Use parentheses, brackets, or braces in numerical expressions, and evaluate expressions with these symbols.
  • 5.OA.2 - Write simple expressions that record calculations with numbers, and interpret numerical expressions without evaluating them. For example, express the calculation “add 8 and 7, then multiply by 2” as 2 × (8 + 7). Recognize that 3 × (18932 + 921) is three times as large as 18932 + 921, without having to calculate the indicated sum or product.
  • 7.G.1 - Solve problems involving scale drawings of geometric figures, including computing actual lengths and areas from a scale drawing and reproducing a scale drawing at a different scale.
  • 8.F.1 - Understand that a function is a rule that assigns to each input exactly one output. The graph of a function is the set of ordered pairs consisting of an input and the corresponding output.1
  • 8.F.2 - Compare properties of two functions each represented in a different way (algebraically, graphically, numerically in tables, or by verbal descriptions). For example, given a linear function represented by a table of values and a linear function represented by an algebraic expression, determine which function has the greater rate of change.
  • A.SSE.1 - Interpret expressions that represent a quantity in terms of its context.
  • A.SSE.2 - Use the structure of an expression to identify ways to rewrite it. For example, see x4 – y4 as (x2)2 – (y2)2, thus recognizing it as a difference of squares that can be factored as (x2 – y2)(x2 + y2).
  • A.CED.1 - Create equations and inequalities in one variable and use them to solve problems. Include equations arising from linear and quadratic functions, and simple rational and exponential functions.
  • A.CED.2 - Create equations in two or more variables to represent relationships between quantities; graph equations on coordinate axes with labels and scales.
  • F.IF.1 - Understand that a function from one set (called the domain) to another set (called the range) assigns to each element of the domain exactly one element of the range. If f is a function and x is an element of its domain, then f(x) denotes the output of f corresponding to the input x. The graph of f is the graph of the equation y = f(x).
  • F.IF.2 - Use function notation, evaluate functions for inputs in their domains, and interpret statements that use function notation in terms of a context.
  • F.IF.3 - Recognize that sequences are functions, sometimes defined recursively, whose domain is a subset of the integers. For example, the Fibonacci sequence is defined recursively by f(0) = f(1) = 1, f(n+1) = f(n) + f(n-1) for n ≥ 1.
  • F.IF.4 - For a function that models a relationship between two quantities, interpret key features of graphs and tables in terms of the quantities, and sketch graphs showing key features given a verbal description of the relationship. Key features include: intercepts; intervals where the function is increasing, decreasing, positive, or negative; relative maximums and minimums; symmetries; end behavior; and periodicity.★
  • F.IF.5 - Relate the domain of a function to its graph and, where applicable, to the quantitative relationship it describes. For example, if the function h(n) gives the number of person-hours it takes to assemble n engines in a factory, then the positive integers would be an appropriate domain for the function.★
  • F.IF.6 - Calculate and interpret the average rate of change of a function (presented symbolically or as a table) over a specified interval. Estimate the rate of change from a graph.★
  • F.LE.1 - Distinguish between situations that can be modeled with linear functions and with exponential functions.

Common Core Math Practices

  • MP.1 - Make sense of problems and persevere in solving them.
  • MP.2 - Reason abstractly and quantitatively.
  • MP.3 - Construct viable arguments and critique the reasoning of others.
  • MP.4 - Model with mathematics.
  • MP.5 - Use appropriate tools strategically.
  • MP.6 - Attend to precision.
  • MP.7 - Look for and make use of structure.
  • MP.8 - Look for and express regularity in repeated reasoning.

Derived from