Algorithms Introduction

Algorithms are at the heart of computational thinking.  Once you have broken down a problem, identified patterns, and created abstractions, you are ready to put those back together into an algorithm.  An algorithm is a set procedure that, given a known input, will produce a predictable output.   A common example is that an algorithm is like a recipe:

pizza_brownie_recipe.png

 

The modern world is replete with known algorithms that you use but may not even be aware of.  For example, have you ever clicked on a list on your computer to order it from A-Z, Z-A or by increasing value?  Can you think of the algorithm that you might use to make this sort work?  Computer scientists have actually discovered dozens of different sorting algorithms, all of which have their pros and cons.  Here's a 2-minute YouTube video that one coder created to show 24 different sorting algorithms: Visualization of 24 Sorting Algorithms In 2 Minutes Links to an external site.Visualization of 24 Sorting Algorithms In 2 Minutes

Perhaps it's more fun to watch the sorting happen as a dance.  There's a Romanian group that has created a series of videos showing different sorting algorithms in action, like this video of a quick sort:

Quick-sort with Hungarian (Küküllőmenti legényes) folk dance Links to an external site.Quick-sort with Hungarian (Küküllőmenti legényes) folk dance

But probably, you're more interested in simpler, more personalized algorithms.  For example, do you have an algorithm for classroom procedures?  What about the "clean up" procedure?  It might go something like this:

  1. Stop what you are working on;
  2. listen to the teacher;
  3. show that you're listening by looking at the teacher and putting down whatever is in your hands;
  4. once the teacher has finished telling you what to clean up, put each item in its pre-chosen storage location;
  5. repeat step 4 until there are no more items at your desk to put away;
  6. return to desk and sit quietly until the teacher calls on you.

Equations

When you (slope, y-intercept, meaning of units).  All come together to form an algorithm that you can use to make predications and check your outcomes.  Some common algorithms in science are...

The goal of science is often to come up with an algorithm.  Difference between relationship and equation/algorithm. Newton's law of gravity.