Students use the Design Recipe to define functions that consume rows, developing a structured approach to answering questions by transforming tables.
Lesson Goals |
Students will be able to…
|
Student-facing Lesson Goals |
|
Materials |
|
Preparation |
|
Key Points for the Facilitator |
|
🔗The Design Recipe
Overview
In this lesson students build on what they already know about multiple representations of functions (contracts, examples and definitions) to write purpose statements and gain fluency with the Design Recipe.
Launch
We might want to define functions to help us filter rows, build columns, or represent data with images. We can say what we want the function to do pretty easily, but it can be surprisingly hard to see the computation behind those words.
The struggle is real.
Anyone who has dealt with a word problem knows this challenge! It’s easy to read a word problem and get what it’s asking, but it can be surprisingly hard to see the computation behind those words.
We are going to learn a strategy for breaking down word problems, called the Design Recipe.
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!
In the Design Recipe we call this first step Writing a Purpose Statement.
We write Purpose Statements, because Contracts don’t provide enough details to generate examples and write a function definition.
For example, the Contract for bar-chart
says it needs a Table and a String, but that’s not the whole story!
-
The Table has to have at least one data row.
-
The String has to be the name of a column in the table.
-
The data in that column has to be categorical.
The Purpose Statement includes all the stuff we need that’s missing from the Contract.
-
On Matching Data Science Problems and Purpose Statements, we see four data science problems and four purpose statements.
-
Take 2 minutes to read them and identify pairs that describe the same thing and should be matched to each other.
-
What pairs did you come up with?
-
What do you Notice about those purpose statements? Do they have anything in common?
Purpose statements should have enough details to allow us to write examples without looking at the word problem!
Investigate
-
Turn to Writing Examples from Purpose Statements, read the purpose statements, and write examples that satisfy each of the contracts and purpose statements.
-
When you’re finished, see if you can write the function definition!
-
For more practice, complete Writing Examples from Purpose Statements (2).
A good Purpose Statement must have three things:
-
A description of what the function consumes
-
A description of what the function produces
-
All the relevant information about how to produce that output
But what does "relevant information" really mean?
-
What information do we need, in order to write our examples?
-
The name of the function
-
The name of the row we’re using in the example
-
The name of the column(s) we use in the example
-
What we do with the information contained in that row
-
Turn to Fixing Purpose Statements.
-
An AI chatbot (like ChatGPT) has produced a purpose statement for each word problem… but ran into some difficulties.
-
Fix the chatbot’s purpose statements, and then identify:
-
What important information was missing from each purpose statement that you would need to solve the problem?
-
What extra information was included, that wasn’t needed to solve the problem?
-
Synthesize
What are the important elements of purpose statements? Why are purpose statements useful?
The Design Recipe in your Classroom
The three steps of the Design Recipe are designed to mirror best practices that you may already be using in your classroom. It’s merely a collection of those practices, assembled in a structured way with great care taken to connecting each practice with the others.
Writing the Contract and Purpose Statement is where students understand the word problem. If you have your students restate the problem in their own words, draw pictures, or underline the inputs and outputs in the word problem, you’re already using this practice!
Writing examples and circling-and-labeling what changes is where students apply their understanding to concrete inputs. If you have your students work through some concrete examples before jumping straight to variables and formulas, and ask them "what’s the rule?" or "what’s the pattern?", you’re already using this practice!.
Writing the definition is where students formalize and abstract this understanding to work with any input. This is where they identify the structure of the rule or pattern, independently of any specific inputs.
The order of the recipe is a recommendation based on 20+ years of research about what works for most students, but that doesn’t mean this order works best for every student! Some may find it easier to work through a concrete example or two before thinking about Domain and Range, and there’s nothing wrong with that. We encourage you to use the Recipe in your classroom as often as possible, teaching students to be flexible with the tools and representations it includes.
🔗Design Recipe Telephone
Overview
Students work in teams to collaboratively define multiple Table Functions. When these functions are composed in different ways, they can be used to do much more sophisticated analysis!
Launch
Why would it be challenging to make the following visualizations?
-
a dot plot showing the distribution of kilograms across old cats at the shelter
-
a scatter plot showing the relationship between kilograms of young dogs at the shelter, and how many days it took to be adopted
There would be a lot of steps involved!
Most computer programs are written by huge teams! It is critical that each team member records their thinking with enough detail for other team members to be able to pick up where they left off.
We’re going to practice collaborative programming and try writing some other Table Functions using the Design Recipe, through an activity called Design Recipe Telephone.
Investigate
-
Divide the class into groups of three.
-
Choose which set of word problems you are going to start with and give each student within each group a different word problem from the set.
Word Problem Set 1: | Word Problem Set 2: |
---|---|
Note that many of these word problems are the "function-version" of the expressions students wrote in Lookup Expressions!
-
In this activity, each person in your group will start with a different word problem. You will each be doing one step of each Design Recipe problem. After you complete your step, you will fold your paper to hide the part that you were looking at so that only your work and the rest of the recipe are visible. Then you will pass your work to the person to your right.
-
The person who has received your paper will review your work and complete the next step based solely on what you wrote down for them. If they don’t have the information they need, they will give the paper back to you for revision.
-
Meanwhile, you will receive a different problem from the person to your left. If at any point your realize that the person before you didn’t provide enough information, you may hand the paper back to them for revision.
-
HINT: All of the word problems here will use code that looks a lot like the code you wrote in Lookup Expressions! If you get stuck, refer back to your answers on that page!
Round 1:
You should have a page with a Word Problem.
-
Write the Contract and Purpose Statement.
-
Fold your paper to hide the Word Problem.
-
Pass your paper to the person to your right.
Round 2:
You should have just received a new page, that has been folded to hide the Word Problem.
-
Write Examples from the Contract and Purpose Statement.
-
Circle the Variables.
-
Then fold your paper to hide the Contract and Purpose Statement.
-
Pass your paper to the person to your right.
Round 3:
You should have just received a new page that has been folded so that the Examples are at the top.
-
Write a Definition from the Examples you just received.
-
When you’re done, pass your paper to your right to return it to the person it started with.
Round 4:
You should now be holding the page you started with.
-
Unfold the page and type the full Design Recipe into the Definitions Area of the Animals Starter File.
-
If your function is a Boolean-producing function, make sure that at least one of the examples should produce true and at least one should produce false. If not, add an additional example.
-
Click "Run" and confirm that all tests pass.
-
If not, collaborate with your team to identify which steps of the Design Recipe need to be reworked.
This activity can be repeated several times, or done as a timed competition between teams. The goal is to emphasize that each step - if done correctly - makes the following step incredibly simple.
Synthesize
The Design Recipe is a way of slowing down and thinking through each step of a problem.
-
If we already know how to get the answer, why would it ever be important to know how to do each step the slow way?
-
Someday we won’t be able to get the answer, and knowing the steps will help
-
So we can help someone else who is stuck
-
So we can work with someone else and share our thinking
-
So we can check our work
-
Why is it helpful to use each of these steps in the Design Recipe?
-
What step do you find the most challenging right now? The easiest?
-
What are some functions you might want to define for your own analysis?
These materials were developed partly through support of the National Science Foundation, (awards 1042210, 1535276, 1648684, 1738598, 2031479, and 1501927).
Bootstrap 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.