Suppose you are good friends with a neighbor who makes unique, mouth-watering cakes but refuses to share his recipe.

At one of his parties, he presents a strawberry cake that is the best ever. Hands down. No competition.  But he won’t share the recipe. What do you do?

Write an algorithm, of course, but first you must put your computational thinking cap on your head and follow these steps:

Step 1: Decomposition

Break the problem into smaller, more manageable parts, such as the steps listed below.

The Problem: To figure out how your neighbor makes his secret-recipe strawberry cake.

Step 2: Gather Data

Ask your neighbor for an extra slice to take home to your spouse. Next, you and your spouse taste half of the cake together and take notes about its special qualities and likely ingredients. Then you freeze the rest in case you need it for further research.

Next, pull out your cook books and/or conduct Internet searches to find recipes for strawberry cakes that bear a reasonable resemblance to your neighbor’s cake.

Bake three of the most likely competitors to determine which one is most like your neighbors in taste and texture.

Step 3: Pattern Recognition

Based on your research in Step 2, make a list of common ingredients among the top contending recipes, and study how those ingredients are assembled for each.  This will reveal the common patterns among those recipes.

Gather Data: Research the ingredients found in recipes for similar kinds of cakes.

Step 5: Algorithm

Based on the previous steps, write a recipe: a step-by-step guide for making the cake that includes the ingredients, how each ingredient is to be handled, and in what order.

Step 5: Test Your Recipe

Make the cake. If it is a success, share it with your neighbor’s friends to get some real-world feedback. If it is not a success, determine why not (another computational thinking challenge?), and try again. Experimentation and testing are essential to the development of any effective algorithm – or cake recipe!

However, if this seems like too much trouble, humble yourself, concede defeat and ask your neighbor for another slice.

 

Algorithms: Fortunately, cake recipes (which are in fact algorithms) are not as complicated as this purported Facebook algorithm.