Home :: Books :: Computers & Internet  

Arts & Photography
Audio CDs
Audiocassettes
Biographies & Memoirs
Business & Investing
Children's Books
Christianity
Comics & Graphic Novels
Computers & Internet

Cooking, Food & Wine
Entertainment
Gay & Lesbian
Health, Mind & Body
History
Home & Garden
Horror
Literature & Fiction
Mystery & Thrillers
Nonfiction
Outdoors & Nature
Parenting & Families
Professional & Technical
Reference
Religion & Spirituality
Romance
Science
Science Fiction & Fantasy
Sports
Teens
Travel
Women's Fiction
Logical Problem SOlving

Logical Problem SOlving

List Price: $67.00
Your Price: $67.00
Product Info Reviews

<< 1 >>

Rating: 3 stars
Summary: Good Concept but Mediocre Implementation
Review: This book purports to teach problem solving skills, that is, how to come up with a solution to a problem that we have not encountered before. The author's thesis is that it's easy to "solve" a problem when we are given an equation or formula, because all we're really doing is plugging in numbers and performing a computation. The object of the book is to learn how to solve the problem without having the formula given. To assist in doing this, the author provides a number of rules, such as:
Rule 1: The Clarity Rule.
1. Be clear about what information you have to work with.
2. Be clear about what information you are trying to discover.
Rule 3: The Picture Rule.
Whenever possible draw a picture.
He also gives many example problems with the solution design worked out and displayed in pseudocode and as a flowchart. There is generally a good clear description of how the solution was achieved, and the inclusion of both pseudocode and a flowchart makes the text accessible to readers with differing learning styles. For each problem there is also an implementation as a C++ program in text mode and as a Visual Basic program, each with comments describing how it works.
Unfortunately, the devil is in the details and in this book the details do not live up to the promise. Take, for example, Problem 1.3: "What Celsius temperature is equivalent to a given Fahrenheit temperature." If we were given the formula C = (5/9)(F-32) all we would need to do is substitute the Fahrenheit temperature for F and perform the indicated arithmetic. The point of this book, however, is to find a solution without being given the formula.
To demonstrate the problem solving process, the author supposes that we don't know the formula but do know the freezing and boiling points of water in both Celsius and Fahrenheit. He lists as "initial data" these "commonly known facts" and then explains how the formula can be deduced. Unfortunately he leaves unstated one crucial assumption, namely that the relationship is linear. In this case it is linear, but there are plenty of other relationships in the world, such as the distance a marble falls through air in a given period of time, that are not linear. If the relationship between Celsius and Fahrenheit temperature were not actually linear we could still follow the procedure outlined by the author but we would deduce a totally invalid formula.
In the C++ implementation and the accompanying discussion the author again stumbles. He correctly states that writing
Ctemp = 5 / 9 * ( Ftemp - 32 ) ;
in line 11 of the program, while it is legal C++ code, will not get the job done correctly and why. He suggests three possible ways to make it work correctly, but ignores a fourth way that is probably the most simple, namely rewriting the line as:
Ctemp = ( Ftemp - 32 ) * 5 / 9 ;
Many other problems solved in the book likewise have issues. For example, it is certainly true that correctness of the solution is more important than efficiency, but it would be nice to have a reasonably efficient solution. In problem 2.2 the C++ implementation uses the power function three times to calculate the same value. The power function is expensive in terms of the computer's time, so it would be much better to calculate the value once and store it rather than calculate it three times. In fact, in this particular case the value is used inside a loop and the same result can be obtained by multiplying the value by two each time through the loop and avoiding the power function entirely.
Problem 3.4 deals with finding estimates of the solutions of a fifth order polynomial equation. After introducing Rule 11, The Function Rule, the author proceeds to write C++ code that evaluates the polynomial in four different places. This is an ideal situation to apply the rule just stated on the previous page by writing a function to evaluate the polynomial at the required value, but the author doesn't do this. Instead he inserts the complete code to evaluate the polynomial in each of the four places in the program. (He also uses a very inefficient method to evaluate the polynomial, but that's a different issue.)
In short, if I were using this book as a text for a course that I teach, I would end up spending time almost every class period explaining why the author's discussion is incomplete, what assumptions he failed to mention, and how his C++ code can and should be improved. I realize that this book is intended for an introductory problem solving course, or as an accompaniment to an introductory programming course. Novice programmers would not be expected, in general, to think of some of these issues on their own. On the other hand, novice programmers learn to write good code in part by reading and analyzing good code, so I find it unfortunate that the author has provided so many examples of poor code.


<< 1 >>

© 2004, ReviewFocus or its affiliates