0% found this document useful (0 votes)
37 views2 pages

Unit (14.2) Pattern Recognition

This document discusses pattern recognition in problem solving and computing. It provides guidelines for recognizing simple patterns, including looking for repeatedly used nouns and verbs. An example algorithm is examined to illustrate these patterns. Nouns correspond to objects and properties, verbs to operations, and adjectives to properties that can be replaced by variables. Numbers also correspond to properties that can vary. The document then provides a practical problem involving grouping animals in a hierarchical tree structure based on number of legs, ability to fly, or class. This tree structure could guide a questioning strategy for a "Twenty Questions" style game to identify an animal with minimal questions.

Uploaded by

mohamed ghaleb
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views2 pages

Unit (14.2) Pattern Recognition

This document discusses pattern recognition in problem solving and computing. It provides guidelines for recognizing simple patterns, including looking for repeatedly used nouns and verbs. An example algorithm is examined to illustrate these patterns. Nouns correspond to objects and properties, verbs to operations, and adjectives to properties that can be replaced by variables. Numbers also correspond to properties that can vary. The document then provides a practical problem involving grouping animals in a hierarchical tree structure based on number of legs, ability to fly, or class. This tree structure could guide a questioning strategy for a "Twenty Questions" style game to identify an animal with minimal questions.

Uploaded by

mohamed ghaleb
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

‫جامعة تبوك‬

‫عمادة التعلم اإللكتروني والتعليم عن بعد‬

Week 14 – Lecture 2 (Practical)


Problem Solving in Computing
(Pattern Recognition)

Recognizing simple patterns


Guidelines: here’s one practical approach to spotting simple patterns:
 Look for nouns that appear repeatedly. These could correspond to objects
that your solution deals with.
 Look for verbs that appear repeatedly. These could be operations that the
solution carries out.
 Look for concrete descriptions. These could probably be substituted by
placeholders that vary in different situations. For example:
o adjectives (‘red’, ‘long’, ‘smooth’) which indicate properties of things and
could be replaced by the property name (colour, size, texture);
o actual numbers, which could be replaced with variables.
Let’s illustrate all this by examining the algorithm above. What patterns can
be seen?
 nouns like circle, radius, position, line, thickness;
 verbs like draw;
 adjectives like red, black, filled;
 numbers in several places.

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.

Our practical today is discussion session for the following problem:


You can group animals by their shared characteristics into a hierarchical tree
structure. Consider these animals: bat, crocodile, fox, human, octopus, ostrich,
penguin, shark, snake, swan, turtle. Group them into three different tree structures
by:
A. number of legs;
B. whether they can fly;
C. their class (mammal, fish, etc).

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

You might also like