ICSCT - Algorithms and Computational Problems Lesson

Algorithms and Computational Problems Lesson

Computational problems involve some type of mathematical or logical computing. We do computations when we find the average of a set of numbers or find the area of a rectangle. Most computations we do today are by machine. Computers do not solve computational problems in the exact same way as humans. Humans are good at working with ambiguities, things that are not clear. When we are cooking we see terms such as "add a pinch of salt," or "season to taste."  A computer needs exact amounts in order to perform that action.    

Algorithms are developed to solve computational problems. The challenge to writing an algorithm is designing the solution to the problem so it can be translated into something a computer can understand and do.  

Let's review the functions of a computer. A computer has four main functions it performs over and over. This is called the information processing cycle.  

Input the instructions to solve the problem by following the algorithm, Processing - the instructions in the algorithm, Storage - Saving data, programs, or output for future use, Output - Verify the output solved the problem.

Input and Output Activity

Click each of the icons to explore the Input and Output Concepts.

We are going to use an IPO chart and the computational thinking strategies from previously in this lesson to solve a simple computational problem.  An IPO chart is a graphical tool used to help identify and record the input, processes, and output needed to solve a problem.  

Let's start with a simple computational problem. Find the average of three given numbers.

  1. Identify and Understand the Problem by Decomposition  

You first need to make sure you understand the problem and what output should be returned. You then need to identify the inputs that will be needed to produce the output. You always start with the output. In this case, the output will be the average of the numbers.  

Input Table
Processing
Output = Average

Next, determine the inputs you need to produce the output. This would involve analyzing the problem and breaking it into smaller pieces. The input will be three numbers.

Input table - number 1, number 2, number 3

Processing

Output = Average

  1. Analyze the Problem to Find Patterns to Help Determine How to Solve It

Is there a pattern or have you solved a similar problem? You find the average by adding all the numbers together and then dividing by how many numbers were entered.  

Input table

Processing sum

Output Average

  1. Use Abstraction to Hide Unnecessary Details

Recognize the parts that do not need to be solved and generalize the information that is necessary. You do not need to know which number is the largest or smallest to solve this problem.    

  1. Create Algorithms for the Solution

People solve problems in different ways.  An algorithm written to solve a problem may look a little different from another algorithm that solves the same problem.  As you learn more programming constructs you will be able to develop more efficient algorithms.    

Algorithm for finding the average of 3 numbers:

  1. enter number one
  2. enter number two
  3. enter number three  
  4. add all numbers to find the sum   (sum = number one + number two + number three)
  5. average = sum / how many numbers were entered
  6. output average

This is an example of the completed IPO chart.

IPOChartCompleted

[CC BY 4.0] UNLESS OTHERWISE NOTED | IMAGES: LICENSED AND USED ACCORDING TO TERMS OF SUBSCRIPTION