Cooking Up Algorithms

Suggested time: 30 min

A computer algorithm is just like a recipe: it solves a problem (providing a meal) with a procedure that transforms some inputs (ingredients) into an output (a loaf of bread). Software engineers write these “recipes” using code that acts as instructions for computers to follow. We won’t write code in this learning circle, instead we will think about the steps in plain language as a recipe.


Solo activity (10 min)

In this activity, your job is to write out instructions for making chicken noodle soup using the template below. You can approach these instructions however you think is most effective.

1. List your ingredients:
  
2. Step-by-step recipe:

Step 1:
Step 2:
Step 3:
(...)


Share (10 min)

Take turns sharing your recipes. (For bigger groups, limit to 3–5 depending on time.) Authors can share the written text or read the recipes out loud.

For each recipe discussion, ask the author to answer the following questions:

  • For whom did you design this recipe?
  • What did you want to achieve with your recipe? (E.g., I wanted the soup to taste good, to not take too long to make, to have enough vegetables so as to be nutritious.)
  • What are the decisions you made as the designer of this recipe? How do they relate to your goals?

Facilitator tip: For groups larger than 6, consider using breakout sessions to create richer opportunities for participation.


Group discussion: Stakeholders and values (10 min)

Think about the recipes you’ve just explored. It’s likely that the same prompt (“write out instructions for making chicken noodle soup”) means different things to each person who answers it. Sometimes these differences are small (like the amount of seasonings used), and sometimes they’re vast (like if you’re a vegetarian)!

We can explore the impact of these differences on our decision making by thinking about stakeholders and values.

A stakeholder is an individual, a group, or an organization that may be affected by a decision, directly or indirectly. These effects can be positive or negative, depending on stakeholders’ values.

Building on our activity above, let’s consider an example of using one of our recipes to make chicken noodle soup for sale at a cafe. In that scenario, we may think of this list of stakeholders:

  • The chef who prepares the soup.
  • A consumer who buys a bowl of soup for lunch.
  • The owner of the cafe where the soup is sold.

As a group, explore the following question:

  • What do these stakeholders value that could impact which recipe we should choose? Match stakeholders with values in the form below. Are there any stakeholders or values missing from this example?
VAUES                                    STAKEHOLDERS
* Taste                                  
* Profit                                 * Consumer
* Nutritional value                      * Chef
* How ingredients are sourced            * Cafe owner
* Price                                  * (...)
* (...)

Whenever we decide to use an algorithm (like a recipe) in a context that affects people (like a cafe), the context we are in will have its own unique list of stakeholders and values. Let’s explore the following two questions:

  • Can any of the soup recipes be “the best”? What qualities would you look for to decide which recipe is “the best”? Who should decide which recipe is used?
  • Would a recipe chosen for the cafe scenario work in a different context? How would your recipe change if instead you were cooking at home (for yourself and your family) or at an elementary school cafeteria (to feed 300 kids at lunch)?

Previous submodule: