Rocky K. C. Chang September 11, 2018 What is computation? Rocky K. C. Chang September 11, 2018
Goals Understand how complex procedures can be developed from simple procedures. Understand three different ways of defining computations. Understand that problem solving involves (1) abstraction, (2) algorithm design, and (3) implementation.
A simple example: What is 53357 + 1897 + 764274 + …?
Let’s take a CS approach.
0. How to add 2 digits?
We start with an addition table.
PROC0 If we are given two digits (0, 1, …, 9), we look up the addition table to get the result which consists of two digits. The left digit is 0 if the result is less than 10.
1. How to add 3 digits?
Pseudocode
2. How to add two multidigit numbers?
Pseudocode
3. How to add any list of numbers?
Pseudocode
To be continued