Problem solving--fundamentals

advertisement
Problem solving--fundamentals
In our programming courses, we focus on a lot of the nit-picky details of programming--something that
cannot be avoided so might as well be embraced. But, I don't want us to lose sight of the big picture, either.
Computer programming is a part of a larger domain we call problem solving. (This despite the feeling that
computer technology often creates more problems than it solves.) If you reflect for a moment, you can
probably think of a lot of problem solving skills that you have already developed.
Mathematics is probably the first thing that comes to mind as a problem solving domain you are already
acquainted with. No doubt you have done your share of calculation problems. Even more important from
the real-world perspective, you have done your share of "word problems"--to take a written statement of a
problem, sort out the essential from the non-essential, and calculate a meaningful result. You should also
have had some experience with using algebra to generalize arithmetical calculations in terms of variables,
knowns and unknowns, formulas, equations, and other relationships; and then to find solutions by
manipulating the algebraic constructs in various ways.
Computer technology evolved out of the quest for faster mathematical calculations--hence, the term
"computer". As you would expect, then, computer technology includes the facilities for doing basic
mathematical/arithmetic calculations. But, now that we have the computer to do the calculations for us,
when we do problem solving involving calculations, we have to step back a bit from a particular "word
problem". We still want to get the correct answer, but we want the computer to calculate the correct answer
for us.
That means we have to think about how to put together basic calculations in a way that will come up with
the correct results/output, given the correct parameters/input data. When your math teachers insisted that
you "show your work", they were trying to get you to think in a more general way about the problem, to
think in terms of the method or steps you would need to go through to solve the problem. Those same steps
could then be used to calculate the correct answer for any similar type of problem. Even better, you could
with practice use the same thought processes you went through in developing a solution method for one
type of problem to develop methods for solving types of problems you had never seen before.
Computer programming is all about putting solution methods into a form which can be automatically
executed by the computer. Algebra can still be helpful in solving tricky problems and in putting solutions
into more efficient forms. Whether they were aware of it or not, your math teachers were helping you
develop problems solving skills that you can use with computer programming.
Early on, computer technology adopted several foundational techniques for implementing mathematical
methods. These included sequence, which is used to determine the order in which things occur; conditional
(decision-based) and unconditional branches or jumps, which are used to implement selection and looping
(a.k.a., repetition or iteration); and branches or jumps to reusable out-of-line method modules. (In modern
programming languages that support structured programming, the selection and repetition aspects of a
method are now expressed in specialized forms or constructs.) These foundational techniques provide a
way to formally express and automatically execute mathematical methods. They also turn out to be useful
in expressing non-mathematical methods. In this respect they extend and go beyond basic arithmetic.
ARR (Summer, 2003; 1/23/2004; 5/15/2004)
Download