Algorithms
Time 2 hrs

Difficulty Beginner
Prerequisites Data Types
Player Controls
Randomization
Departments Science
Authors Sandra Kuipers
Groupings Individual
Pairs
Minimum Year Group None

Blurb

Algorithms: What are they? How can we use them in our code?

License

This work is shared under the following license: Creative Commons BY-SA-NC

Outline

Learner Outcomes
Students will:
  • ...
Competency Focus
  • ...
Interdisciplinary Connections
  • ...
Reflection
What was successful? What needs changing? Alternative Assessments and Lesson Ideas? What other Differentiation Ideas/Plans could be used?
  • ...
Credits
Any CC attribution, thanks, credit, etc.

This page requires you to be logged in to access it. Please login and try again.
5 mins
Introduction
Getting Started
  • Algorithms are all around you.
  • Well... unless you're camping in the wilderness with no technology.
  • So, aside from escaping to the great outdoors, chances are you've interacted with several algorithms today.
    • They're in Google, grabbing your search results.
    • They're in Netflix, recommending shows.
    • They're on websites, tracking which links you click.
    • They're unlocking your phone, using fingerprint and face detection.
    • They're in elevators, deciding which floor to go to.
    • They're in maps, giving you directions.
    • This list could get really long ...
  • Where are some places you've noticed algorithms?
10 mins
What are they?
Theory
  • What are algorithms, and how can we use them to take over the world?

  • This video may not have answered the second question, but keep reading ...
5 mins
Thinking in Algorithms
Digging In
  • Consider a simple procedural algorithm for making a PB&J:
    • Get two slices of bread
    • Spread peanut butter on one side
    • Put jam on the other side
    • Squish them together
  • Notice how there weren't any decisions to make? Sometimes an algorithm is just a set of steps.
10 mins
Decision-Making
Digging In
  • However, sometimes we need a decision-making algorithm.
  • Consider the same algorithm, but we don't know what ingredients are available:
    • Get two slices of bread
    • If we have peanut butter
      • Put peanut butter on one side
    • Otherwise, if we have chocolate spread
      • Put chocolate spread on one side
    • Then, if we have jam
      • Put jam on the other side
    • Otherwise, if we have bananas
      • Put bananas on the other side
    • Squish them together
  • This algorithm is making two different decisions.
  • How many different kinds of sandwiches can it create? Think for a second ... then scroll down.

  • If you guessed four, you're on the right track ...
  • However, what if there is no peanut butter and no nutella?
  • When we account for no toppings, each decision has three possible outcomes.
  • There are now more than four possible sandwiches we could make here.
  • Including one very sad sandwich with nothing but bread :(

10 mins
Types of Algorithms
Theory

20 mins
Are they taking over the world?
Consider
  • Algorithms are already part of our civilization. The next 20 years will determine just how much they take over ...

  • Are there places that algorithms shouldn't go?
  • Here's a look into how some schools are putting algorithms in the classroom:

60 mins
Your Algorithm
Evidence

  • Imagine you have a platter of sushi. In fact, you own a whole restaurant that sells sushi!
    • Rolls are 10$
    • Sashimi are 20$
    • Everything else is 12$
    • If a platter has more than 10 sushi, it gets a free tempura.
    • If a platter has more than 20 sushi, it gets a 20% discount.

  • Given any platter, no mater what sushi are on it, you could use these rules to figure out the cost.
  • Your goal is to write an algorithm in pseudocode (regular english) to calculate the cost of any platter. If you're stuck, try and think of what you, a human, would do to solve this problem.
  • Write your sushi-sorting algorithm in a Google doc.
  • Then at the bottom, answer a hypothetical question: If you had the most powerful computer in the world, what problem would you solve with an algorithm?
  • Submit your doc as your evidence of learning in this unit.
There are no records to display.
Powered by Gibbon v27.0.00dev

Founded by Ross Parker at ICHK Secondary | Built by Ross Parker, Sandra Kuipers and the Gibbon community
Copyright © Gibbon Foundation 2010-2024 | Gibbon™ of Gibbon Education Ltd. (Hong Kong)
Created under the GNU GPL | Credits | Translators | Support