Lesson 2 - Four Steps of CT

Overview

  1. Introduction to Lesson 2
  2. The Elements of Computational Thinking
  3. Examples of Computational Thinking
    1. The Busy Landlord (video)
    2. Anagrams (video)
    3. Grocery Shopping
    4. Which Music is More Violent?

An Introduction to Computational Thinking - Lesson 2

Now that we know a little bit about Computational Thinking, let's take a look at four elements, or four problem-solving strategies, that we can use in "thinking computationally" about a problem, analyzing the problem and coming up with a solution.

The Elements of Computational Thinking

There are a number of different ways of considering Computational Thinking. One useful strategy is to approach a problem with these four aspects in mind.

Four Aspects of Computational Thinking

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

Even if you've never used this particular vocabulary when problem-solving, most of us have occasion to use some of these strategies on a fairly regular basis. By formally recognizing these steps and identifying their use, we put ourselves in a better position to understand Computational Thinking processes.

Let's get on to some real problem solving!

Examples of Computational Thinking

EXAMPLE 1. COMPUTATIONAL THINKING ANALYSIS (Abstract)

Take a moment to watch the 5-minute video presentation here. Be sure to pause the video so that you can consider the questions being asked before going on to see the answer.

EXAMPLE 2. COMPUTATIONAL THINKING ANALYSIS (Applied)

Take a moment to watch the 5-minute video presentation here. Be sure to pause the video so that you can consider the questions being asked before going on to see the answer.

EXAMPLE 3. COMPUTATIONAL THINKING ANALYSIS (Applied)

1.c. Shopping for Groceries

Shopping for a list of groceries at the supermarket is a common task, and it can occupy a lot of time. What's the best way to go about shopping for groceries?

Consider the problem in terms of our Computational Thinking steps before looking at the solutions below.

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

Here's one Computational Thinking Analysis:

1. Problem Decomposition
There is a list of items, and those items are located in different parts of the grocery store.

2. Pattern Recognition
I have a random list of items to buy that aren't in any particular order. Items at the store do seem to be organized somewhat: dairy items are all in one area, cheeses are in another, and fruits and vegetables are in their own section. But those sections aren't located in consistent locations from store to store.

3. Abstraction/Model
There isn't much abstraction necessary for this analysis. The grocery list of items can be considered as a List or Array, a data structure that is used all the time in programming. The map of the store is simply an arrangement of locations that need to be visited.

4. Algorithm Design
There are two possible strategies that we might develop for doing our grocery shopping:

  1. Go down through the shopping list one item at a time, travelling to that part of the supermarket where that item can be found, and getting that item to put in the shopping cart. In this strategy, the list we're consulting is "in order"--we'll be assured of looking at each item on the list--but our visits to the various parts of the store are "disordered."
  2. Travel up and down the aisles of the supermarket, picking up items from the list as they are encountered. In this strategy, our traversal of the aisles is ordered--we're sure to visit each location in the supermarket--but our use of the grocery list itself is disordered.

1.d. Algorithm Efficiency

Which of these strategies is more efficient? Does the strategy that you choose depend on the length of the shopping list? The size of the store? The number of people you have helping you shop?

Searching algorithms don't just apply to things like buying groceries.

This graphic shows some of the different search strategies that might be employed when looking for an avalanche victim.

It's interesting that the Single Searcher pattern in this graphic looks just like my shopping strategy when I have a long list of items. Fortunately, the results of my shopping—finding where they keep the peanut butter—are a lot less critical then the results for rescue personnel.

Case Study: Violent Music

EXAMPLE 4. COMPUTATIONAL THINKING ANALYSIS (Applied)

1.e. Violence in music: Rap vs Metal

Which type of music is more violent: rap or metal? This is a loaded question, purposefully vague, that we're going to try to solve with a computational thinking approach.

This is a good time to point out that the 1-2-3-4 steps that we've been following might not always be addressed in that order. For instance, in this example, we might being by thinking about our abstraction of the problem first.

3. Abstraction/Model
What does it mean to say that "music is violent?" The question itself is open to some interpretation. Is it the music itself that the questioner thinks might be violent? Is it the lyrics that are violent? The images evoked by the lyrics? Are the artists violent? How does one measure "violence?" For the purposes of this exploration, let's say that we're going to consider the lyrics of the music as a measure of the music's violence. The more violent lyrics there are, the more violent we'll consider the music.

1. Problem Decomposition
In our consideration of how we're going to measure violent music, we've decided to look at the lyrics in a song, or—because we're looking at an entire genre of music—a collection of songs. So all we really need to do is get the lyrics from, say, twenty songs in each genre, and look at the lyrics of those songs.

4. Algorithm Design
We'll get the top twenty songs in each genre of music, and get the lyrics for those songs, and then identify words that are associated with violence: death, war, kill, shoot, gun, etc. We'll count how many times each of those words appear in the songs of each genre, and then come up with an average value per song. The highest average of violent words will be the more violent music.

2. Pattern Recognition
Again, we're a little out of order here because in this case, we'll probably want to look at our results and see if we're getting good information. Are we missing some important "violent words" that we didn't think of when we made our original list? Maybe we should add those to our list and re-run our investigation. Are there violent acts that are described in the music that are not getting picked up by our "violent word" filter? Should we consider adding "curse words" to our analysis? Do those kinds of words indicate some degree of aggression or violence? We'll need to figure out a way to account for these things, or at least acknowledge that our algorithm isn't picking up everything.

In any event we know that our measurement won't be perfect. That shouldn't keep us from doing the analysis, we just need to be honest about reporting our methodology so that other people can see how we arrived at our results.

No results are presented here! Are you disappointed?! ;)

This is the kind of problem that you can easily solve yourself. If you want to analyze lots of songs, or lots of genres, you would almost certainly want to use a computer to assist in that analysis. In fact, some people have done that very thing, to examine patterns in the lyrics of certain types of songs.

Summary of Computational Thinking - Lesson 2

In this second lesson we've continued to develop the concept of Computational Thinking, and developed four tenets of CT problem-solving that we can use to help solve specific problems.

Those steps include (not necessarily in this order):

  1. Breaking the problem down into sub-problems that will lead us to a solution (Problem Decomposition)
  2. Identifying any patterns in the problem or its analysis that we can use to improve our ability to solve the problem, improve our solution, or better understand our results.
  3. Identifying an abstraction or model of the problem that we can use to better understand its most important aspects.
  4. Designing an algorithm—a series of steps—that can be used to solve this problem and others like it.

Next time, we'll be examining more closely how we can uses Models and Simulations to assist us in developing solutions to problems.

Assignment: Computational Thinking - Lesson 2

Assignment: Lesson 2

To complete this lesson:

  1. Go to the Bebras Challenge, click the "Start" button, and then take a few moments to solve any two of the problems listed there (A problems are easiest, C problems are most challenging). Attempt to reason a solution to the answer before clicking on your response.
  2. Once you've arrived at a correct solution for each problem, (however many attempts it takes):
    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.)
  3. Embed this screenshot in a blogpost. In the blogpost, include 1-4 sentences explaining how Computational Thinking might inform a solution to your problem. Be sure to use vocabulary developed in this lesson as you clearly identify how each of the four parts of Computational Thinking apply the solution.
  4. Remember: Do two blogposts, one for each Bebras Challenge you solved.