Learning Math: Patterns, Functions, and Algebra
Functions and Algorithms Part C: Function Machines (35 minutes)
Session 3, Part C
In This Part
- About Function Machines
- Running a Function Machine
- Function Machines and Undoing
About Function Machines
When thinking about inputs and outputs, you are thinking about algorithms as functions: You input a number into the algorithm, follow the prescribed steps, and get an output. To be a function, there are two requirements. First, the algorithm must be consistent — that is, every time you give it the same input, you get the same output. Second, each input must produce exactly one possible output.
Some people picture the steps in an algorithm or function as little machines. An addition machine would look like this:
If you put a 5 in the left hopper and a 4 in the right hopper, what would come out of the bottom? Take a few minutes to practice drawing your own machines.
Sometimes we want our machine to add the same thing each time. If we wanted our machine to add 3 each time, we could represent it with the 3 locked in position, like this:
We can also connect two different machines together to make a network, so that that the output hopper from one machine goes right into the input hopper on the next machine. Consider this network of function machines:
Try running a few numbers through this network. Remember to perform each step in order. For example, if you start with zero, you will get 3 as an output from the first machine. After running 3 though the second machine, your output will be 6, which is the output of the network.
Now try pulling a number back up through the machine in the reverse order — that is, begin with the output and work backward to the input.
Running a Function Machine
Running a Function Machine
Take a look at this algorithm (let’s call it Algorithm C):
- Pick a number (that’s the input)
- Multiply it by 2
- Add 3 to the answer
- Multiply that answer by 10
- Add 6
- Finally, divide by 2
Draw a function machine network or print out a copy of the function machine network below to help you answer Problems C1 – C5.
If the input to Algorithm C is 3, what is the output?
If the output to Algorithm C is 88, can you determine what the input was? How did you do it?
Use the Interactive Activity to build Algorithm D, which undoes Algorithm C. How would this help with Problem C2?
Imagine that Algorithm C and Algorithm D are connected to form one large network. What would happen to a number used as an input in this network? Think about it for a few minutes, and try a few numbers if you need to.
Connecting the two networks gets you back to your original number. Going through all these steps turns out to be a complicated way of doing nothing to a number!
Take It Further
See if you can use the function machines network to produce the following outputs: 59, 216, 15625, 7280, 0.12345. As an additional challenge, use the fewest possible machines to do so.
Function Machines and Undoing
Think back for a minute to Algorithm A, which we worked with in Part B. Take a look at the following picture of Algorithm A and answer Problems C6-C10 below.
Imagine dropping a 7 into this network. What comes out the bottom?
Imagine that an 8 came out the bottom. Pull it back through the network and figure out what had to go in the top.
Tip: Try to think of an efficient way of solving this problem.
Imagine that a 100 came out the bottom. Pull it back through the network and figure out what had to go in the top.
Draw a picture using machines to show Algorithm B, the algorithm that “undoes” Algorithm A.
Imagine connecting the output spout of Algorithm A to the input hopper of Algorithm B. Now you have a huge network. What does it do to a number?
Tip: Problem C10 is a lot like Problem C4.
In this segment, Deanna and Lolita present the combined network built by connecting Algorithms A and B. Watch the segment after you have completed Problem C10. If you get stuck on the problem, you can watch the video segment to help you.
Do you think every network built by function machines can be “undone”?
You can find this segment on the session video, approximately 13 minutes and 1 second after the Annenberg Media logo.
Problem C11: Write and Reflect
Suppose someone hands you an algorithm. Describe a general process that will allow you to construct a new algorithm that undoes the one you are given. Can you imagine an algorithm for which your method doesn’t work?
We mentioned earlier that moving from arithmetic to algebra involves a focus on operations rather than numbers. Think about an operation like addition. What do you see when you think about addition? Don’t think of an addition problem like 4 + 5, but just plain addition with no numbers — focus on the operation rather than on the numbers themselves.
Next, go through the descriptions of input/output machines. After looking at the first example, be creative in coming up with drawings of machines.
Groups: Share drawings with the whole group.
Some machines add the same thing each time. Machines like this can be connected together, so that the output hopper from one machine goes right into the input hopper on the next machine. The two connected machines are really a single function that takes an input, runs it through the network inside, and produces an output. Read through the next written description of an algorithm and go through the exercises.
The two connected machines are really a single function that takes an input, runs it through the network inside, and produces an output.
Read through the next written description of an algorithm and go through the exercises.
Groups: Answer Problems C1-C11 in pairs or small groups.
The number 48 will come out at the bottom.
Try to undo the steps. The original number was 7.
The order of operations is: multiply by 2, subtract 6, divide by 10, subtract3, divide by 2. Algorithm D is the inverse of Algorithm C, so using 88 as the input for Algorithm D would answer Problem C2.
The huge Algorithm CD doesn’t do anything; its output numbers will equal its input numbers.
All of them are possible in multiple ways.
- 59 = 10 x 5 + 9
- 216 = 6 x 6 x 6
- 15625 = 5 x 5 x 5 x 5 x 5 x 5
- 7280 = 9 x 9 x 9 x 10 – 10
- 0.12345 = [(1 / 9) / 9] x 10
The output will be 4
Use Algorithm B, which undoes Algorithm A. The input was 8.
Using Algorithm B, the input was 31.
It will leave the number unchanged, since A and B undo each other.
If you can list the algorithm as a series of steps involving unchanging numerical operations (like “add 6”), then they can be undone by an algorithm which performs the inverse operation, and where the steps are performed in reverse order. Unfortunately, some operations do not have inverses, like squaring or throwing a water balloon. Think of Mr. Lewis’s rule from Session 2 — this is a rule that cannot be undone.
Session 1 Algebraic Thinking
In this initial session, we will explore algebraic thinking first by developing a definition of what it means to think algebraically, then by using algebraic thinking skills to make sense of different situations.
Session 2 Patterns in Context
Explore the processes of finding, describing, explaining, and predicting using patterns. Topics covered include how to determine if patterns in tables are uniquely described and how to distinguish between closed and recursive descriptions. This session also introduces the idea that there are many different conceptions of what algebra is.
Session 3 Functions and Algorithms
In Session 1, we looked at patterns in pictures, charts, and graphs to determine how different quantities are related. In Session 2, we used patterns and variables to describe relationships in tables and in situations like toothpicks and triangles. This session extends the exploration of relationships to include the concepts of algorithm and function. Note1
Session 4 Proportional Reasoning
Look at direct variation and proportional reasoning. This investigation will help you to differentiate between relative and absolute meanings of "more" and to compare ratios without using common denominator algorithms. Topics include differentiating between additive and multiplicative processes and their effects on scale and proportionality, and interpreting graphs that represent proportional relationships or direct variation.
Session 5 Linear Functions and Slope
Explore linear relationships by looking at lines and slopes. Using computer spreadsheets, examine dynamic dependence and linear relationships and learn to recognize linear relationships expressed in tables, equations, and graphs. Also, explore the role of slope and dependent and independent variables in graphs of linear relationships, and the relationship of rates to slopes and equations.
Session 6 Solving Equations
Look at different strategies for solving equations. Topics include the different meanings attributed to the equal sign and the strengths and limitations of different models for solving equations. Explore the connection between equality and balance, and practice solving equations by balancing, working backwards, and inverting operations.
Session 7 Nonlinear Functions
Continue exploring functions and relationships with two types of non-linear functions: exponential and quadratic functions. This session reveals that exponential functions are expressed in constant ratios between successive outputs and that quadratic functions have constant second differences. Work with graphs of exponential and quadratic functions and explore exponential and quadratic functions in real-life situations.
Session 8 More Nonlinear Functions
Investigate more non-linear functions, focusing on cyclic and reciprocal functions. Become familiar with inverse proportions and cyclic functions, develop an understanding of cyclic functions as repeating outputs, work with graphs, and explore contexts where inverse proportions and cyclic functions arise. Explore situations in which more than one function may fit a particular set of data.
Session 9 Algebraic Structure
Take a closer look at "algebraic structure" by examining the properties and processes of functions. Explore important concepts in the study of algebraic structure, discover new algebraic structures, and solve equations in these new structures.
Session 10 Classroom Case Studies, Grades K-2
Explore how the concepts developed in Patterns, Functions, and Algebra can be applied at different grade levels. Using video case studies, observe what teachers do to develop students' algebraic thinking and investigate ways to incorporate algebra into K-8 mathematics curricula. This video is for the K-2 grade band.
Session 11 Classroom Case Studies, Grades 3-5
Explore how the concepts developed in Patterns, Functions, and Algebra can be applied at different grade levels. Using video case studies, observe what teachers do to develop students' algebraic thinking and investigate ways to incorporate algebra into K-8 mathematics curricula. This video is for the 3-5 grade band.
Session 12 Classroom Case Studies, Grades 6-8
Explore how the concepts developed in Patterns, Functions, and Algebra can be applied at different grade levels. Using video case studies, observe what teachers do to develop students' algebraic thinking and investigate ways to incorporate algebra into K-8 mathematics curricula. This video is for the 6-8 grade band.