Chapter 2 review. Are the following statements true or false? Explain why or why not.
a)
"Elementary, my dear Watson," alludes to Holmes'
analytical approach to problem solving.
True. a mysterious solution proves elementary when Holmes
explains the analytical steps he has taken. (See page 24.)
b) Hacking is a
common but not a recommended problem solving strategy for
novices.
True. Blind hacking is a slow and cumbersome way to program and
produces awkward programs. (See page 25.)
c) Analogical
reasoning involves breaking a problem down into smaller problems.
False. That's analytical reasoning--analogical
reasoning exploits similarities. (See page 24-25.)
d) A recipe is
analogous to a well-defined solution to a problem.
True. It tells precisely how to achieve the desired goal (the
dish to be prepared). (See page 26.)
e) Sentences and
programs are both essentially sequential structures.
False. Although they have a sequential appearance, they both have
underlying non-sequential structures. (See page 25-26.)
f) Famous
detectives and expert hackers ignore considering the givens and
goals of a problem.
False. Understanding the givens and goals is essential for good
problem solving. (See page 24-25.)
g) Turing kept the
resources of Turing machines in his head.
False. The resources of a Turing machine were made
explicit--move, read, write, etc. (See page 10-11, 27.)
h) The resources of Knobby's World are its walls and characters.
False. These are the givens--the resources are the moves Knobby can make. (See page 29.)
i) The givens of
Knobby's World are defined in its situation file.
True. The situation file shows the givens--the walls and
characters. (See page 29.)
j) Real world
problems usually start out well-defined.
False. Making the definition clear is a crucial first step in
problem solving. (See page 29.)
k) A
"blinder" effect can cause us to miss important givens,
goals or resources of a problem.
True. The "blinder" effect keeps us focussed on the
familiar, thus overlooking important novel features of a problem.
(See page 30.)
l) Preliminary
analysis begins the implementation of a program.
True. After perhaps a few earlier orientation questions,
preliminary analysis is a crucial early step in problem solving.
(See page 32-33.)
m) In the
fox-goose-corn problem, the location of the boat is a variant,
accounted for in our notation.
False.. Though the boat moves from shore to shore, it's always on
the same side of the river as you (the rower), thus it requires
no additional notation.. (See page 35.)
n) A blind hacking
approach can get "blind-sided" by a combinatorial
explosion.
True. Although the fox-corn-goose program is a relatively simple
case, it's easy to find much more complicated ones. (See page
37-38.)
o) Informed
hacking relies on knowledge of a problem domain to get through a
problem space.
True. Informed hackers know the characteristics of the problem
space well--that's why it's called "informed hacking."
(See page 37.)
p) Interacting
subgoals is something that only happens in toy, "blocks
world" problems.
False. Think of scheduling classes, for instance. (See page 42.)
q) Decomposition
is an excellent way to tackle problems about which one has little
knowledge.
True. Thinking about the parts of a problem is an easy way to
understand it better. (See page 44.)
r) Analogical
problem solving is just copying an old solution, as is, into a
new problem.
False. There are often important differences to take into
account. (See page 48.)
s) Object-oriented
programming combines analogical and bottom-up problem solving
strategies.
True. Object-oriented approaches emphasize reusing standard task
"packages" in similar situations. (See page 49-50.)
t) Knobby's macros
can facilitate either top-down decomposition or bottom-up
composition.
True. You can use macros in breaking down a task or combine them
in building up an algorithm. (See page 56.)
u) Knobby's
identifiers can include any combination of lower and upper case
letters and digits.
False. Almost true, but reserved words are illegal as
identifiers! (See page 58.)
v) Syntax rules
and syntax diagrams can describe the same kinds of structures.
True. They both define and explain the structure of programs and
their components. (See page 58-61.)
w) In a nested if
instruction, the last else is always the alternative of the first
if.
False. Each else goes with the most recent unpaired if. (See page
64.)
x) A while loop
keeps executing until its test is true, then exits.
False. It executes while its test is true (or until
its test is false), and then exits. (See page 66.)
y) Knobby keeps
some handy, reusable instructions for composition of programs in
his head.
False. His head can only store up to two characters, in its
"blackboards". But you can load reusable instructions
in Knobby's World programs.