Lesson 3 - Algorithms

Overview

  1. Introduction to Lesson 3
  2. Lightbot - An Intro to Algorithms
  3. More Algorithms in:
    1. Lightbot
    2. Scratch
    3. Python

An Introduction to Computational Thinking, Lesson 3

In Lesson 2 of this series we looked at four tenets of Computational Thinking.

Four Aspects of Computational Thinking

  • Problem Decomposition
    Breaking down data, processes, or problems into smaller, more manageable parts
  • Pattern Recognition
    Observing and recognizing patterns or trends in data
  • Abstraction/Model
    Identifying the general rules or principles that are responsible for those patterns or trends
  • Algorithm Design
    Developing instructions or procedures that can be used to solve this problem and others like it

The thing that distinguishes Computational Thinking from simple Problem-Solving is the Algorithm.

Definition: Algorithm

An algorithm is a series of steps used to solve a problem, particularly steps that can be adapted for use in a computer program.

In the previous lesson, we examined an algorithm to assemble a peanut-butter-and-jelly sandwich. While that process was fine for a conceptual introduction to the idea of an algorithm, and perhaps it could be implemented by a robot of sufficient complexity, it isn't the very best example of an algorithm that a computer would actually use.

In this lesson, we're going to look at algorithms that computers do use. As you work through Part 1 and Part 2 of the assignments below, be sure to document your work as indicated. You'll be creating a blogpost as indicated for each part.

Assignment 1: Working with Algorithms - Lightbot

For this assignment you'll create a blogpost, which will include a screencapture (described below) of your game of Lightbot, along with 1-3 sentences explaining the algorithm or procedure you used to solve the puzzle.

Assignment: Lightbot

  1. On your computer, point your browser at http://lightbot.com/flash.html.
  2. If your browser has Flash installed you can click on the Online Flash (in-Browser) link to get started playing. You can also download the free app to play Lightbot on your iPhone or Android smartphone.
  3. Work your way through the 8 levels of the Basic exercises.
    (If you have questions or run into difficulty while completing the exercises, don't hesitate to contact Ms. Holmgren or Mr. White.)
  4. Work your way through the 6 levels of the Procedures exercises.
    (If you have questions or run into difficulty while completing the exercises, don't hesitate to contact Ms. Holmgren or Mr. White.)
  5. Once you've arrived at a correct solution for Procedure 3, 4, 5, or 6:
    1. Arrange your browser window and re-size it so that your problem solution is plainly visible on the left three-fourths of your screen.
    2. On the right one-fourth of your screen you Desktop background and/or Desktop files should be plainly visible.
    3. Take a screenshot of the entire screen, including the browser window where you've been doing your work as well as part of your Desktop background. (This helps to identify your work.
  6. Embed your screenshot in a blogpost, and include a 1-3 sentence explanation of how you determined the solution to that problem, using Computational Thinking vocabulary where appropriate.

By the time you get done with the Procedures exercises, you should be familiar with the process of giving the Lightbot instructions, and organizing those instructions into procedures (Proc1 and Proc2), and using procedure calls (P1 and P2) to make those instructions happen.

Assignment 2: Working with Algorithms - Programming

For this assignment you'll have your choice of completing one of the activities described below, in which you'll be following instructions to write a simple program. You'll then create another blogpost describing the activity. This blogpost will include a screenshot and a recorded video screencapture of your final program.

Read the description of each activity carefully before you decide which one you want to pursue.

Option 1. Scratch

You may be familiar with Scratch. It's a simple programming language developed at the Massachusetts Institute of Technology to teach about algorithms and programming.

To complete this option:

  1. Go to https://scratch.mit.edu and learn a little about Scratch by clicking on the About menu item.
  2. Click on the Explore menu item at the top of the page, and select a random script that you want to examine. Click on the green flag to run the script, and then click on the button to examine the script (program) that creates that program.
  3. When you're ready to write your own program, click on the Create menu item at the top of the page, and use the Script items provided to make the cat move in a pattern.
    NOTE: You can just click around a little to see what you can make happen, or if you want a little instruction, follow the Getting Started with Scratch tutorial on the right side of the screen.
  4. Once you've come up with a program that you're satisfied with:
    1. Arrange your browser window and re-size it so that your problem solution is plainly visible on the left three-fourths of your screen.
    2. On the right one-fourth of your screen, your Desktop background and/or Desktop files should be plainly visible.
    3. Take a screenshot of the entire screen, including the browser window where you've been doing your work as well as part of your Desktop background. (This helps to identify your work.)
  5. Create a live screencapture video ("screencast") of your program in operation. Include a voice-over in your video in which you explain how the program's algorithm works.
  6. Embed both your screenshot and your screencast in a blogpost. Include a 1-3 sentence written description of your program and its algorithm.

Option 2. Python

Python is an actual programming language that is used "in the real world" at Google, Yahoo!, NASA, CERN, and at high school and college campuses around the world.

In this option, you'll learn to write a little Python code that operates a graphical Turtle on-screen.

To complete this option:

  1. Go to https://hourofpython.trinket.io/a-visual-introduction-to-python#/welcome/an-hour-of-code.
  2. Using the left-side menu as a guide, work your way through the Welcome, Turtles!, and Repeating with Loops and Lists activities.
  3. Once you've worked your way through the activities:
    1. Arrange your browser window and re-size it so that your problem solution is plainly visible on the left three-fourths of your screen.
    2. On the right one-fourth of your screen, your Desktop background and/or Desktop files should be plainly visible.
    3. Take a screenshot of the entire screen, including the browser window where you've been doing your work as well as part of your Desktop background. (This helps to identify your work.)
  4. Create a live screencapture video ("screencast") of your program in operation. Include a voice-over in your video in which you explain how the program's algorithm works.
  5. Embed both your screenshot and your screencast in a blogpost. Include a 1-3 sentence written description of your program and its algorithm.