5
CS in Algebra | Lesson 5

# Writing Contracts

Lesson time: 30-60 Minutes

## Lesson Overview

Students will work their way through a number of new functions, first using each to solve a problem, and then writing a contract which describes it.

## Lesson Objectives

### Students will:

• Decompose existing functions.

• Write contracts that describe functions.

• Experiment with basic geometric transformations.

## Anchor Standard

### Common Core Math Standards

• 8.G.1: Verify experimentally the properties of rotations, reflections, and translations:

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

# Teaching Guide

## Getting Started

### 1) Vocabulary

This lesson has three new and important words:

• Rotate - to turn a shape about a point.
• Scale - to increase the dimensions of a shape by the same factor in all directions. Also known as dilate.
• Translate - to move a shape from one location to another. The offset function performed this transformation.

### 2) Introduction

Review with students the purpose of a Contract:

• Describes three elements of a function
• Name (what is the function called)
• Domain (what inputs does it take)
• Range (what does it output)
• As a class, describe the Contracts for some basic mathematical operators
• Addition (name +, domain Number Number, range Number)
• Subtraction (name -, domain Number Number, range Number)
• Multiplication (name *, domain Number Number, range Number)
• Power of two (name sqr, domain Number, range Number)

## Activity: Writing Contracts

### 3) Online Puzzles

In this stage you'll be looking at some functions, some of which you've seen before and some which are brand new. For each function you'll first get a chance to use the function, and then you'll write a Contract for it. Make sure to document any new Contracts on your Contract Log. Head to CS in Algebra stage 5 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.
• 6.NS.8 - Solve real-world and mathematical problems by graphing points in all four quadrants of the coordinate plane. Include use of coordinates and absolute value to find distances between points with the same first coordinate or the same second coordinate.
• 6.EE.9 - Use variables to represent two quantities in a real-world problem that change in relationship to one another; write an equation to express one quantity, thought of as the dependent variable, in terms of the other quantity, thought of as the independent variable. Analyze the relationship between the dependent and independent variables using graphs and tables, and relate these to the equation. For example, in a problem involving motion at constant speed, list and graph ordered pairs of distances and times, and write the equation d = 65t to represent the relationship between distance and time.
• 7.EE.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.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.G.1 - Verify experimentally the properties of rotations, reflections, and translations:
• 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).
• 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.

### 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