Unit (14.2) Pattern Recognition
Unit (14.2) Pattern Recognition
Looking at the nouns, we see that some of them translate into objects (circle and
line), while the rest are properties of those objects (radius, position, line
thickness). Line and circle are specific instances of shapes. Hence, ‘shape’ is a
generalization of line and circle.
The verbs are straightforward – there’s only one. Drawing appears to be a
fundamental operation in this solution. Operations often need supplying with
things to work with. Data given to an operation when it is triggered is called a
parameter. In this case, drawing doesn’t make any sense without having a shape to
draw, so the draw operation should be given a shape parameter.
جامعة تبوك
The adjectives red and black are specific cases of the more general concept of
color. The word ‘filled’, being derived from a verb, actually suggests another
operation which we could formalize: filling a shape with a color. Such an operation
would then have two parameters.
All the numbers match up with object properties. In other words, these properties
(posi¬tion, radius, thickness) have values that can vary.
Imagine these animals were used in a ‘Twenty Questions’ style game where your
oppo¬nent thinks of an animal and you may ask them a limited number of yes/no
questions to work out which animal they’re thinking of. Use your tree structures to
guide your questioning strategy. Which one of the three structures would minimize
the number of questions you would have to ask? Try dividing groupings into sub-
groupings to see if that helps to red