Solution Manual To Third Edition AI
Solution Manual To Third Edition AI
References 527
Author Index 544
Subject Index 557
Chapter 22
Hints to Exercises:
1. Now that a fuzzy cooler is in place, design a simple fuzzy washing machine that can
decide the speed of its motor based on the dirt level, type and the weight of the cloth.
The Instructor should motivate the student to think on similar lines as the cooler
described.
2. Visit the library of your institution, this time, for a different purpose. Inspect what kind
of books are placed in each rack. Write a fuzzy logic program that can suggest the rack
into which a new arrival (book) can go.
One simple method is suggested below. The first task is to process the title of a book and
extract significant key words from it. Membership of these keywords to a an area/field
(Computer Science, Chemistry, Electronics,…) could now be computed based on their
occurrence in respective corpora related to these areas.
Fuzzy rules like: If book is Close Computer Science and Average to Electronics then it
belongs to Computer Science could be used.
Defuzzification can be performed by the maximum truth value.
3. Based on the fuzzy cooler, model the exposure time of a typical camera. Assume the
camera has sensors to detect ambient light, controls for flash and picture type (landscape,
close, etc.) settings. Also assume that exposure times are based on values reported by
these sensors.
Here too, the Instructor should motivate the student to think on similar lines as the cooler
described. Parameters and profiles of course are different and need to be discussed
accordingly.
Chapter 23
Hints to Exercises:
Time table generation is known to be a complex problem. Though a GA may not be able
to arrive at the most optimal table, it can definitely be used to generate near optimal
solutions that could be manually tweaked, thus saving a lot of nerve racking work!
The Instructor could highlight to the students, the nature in which the time table in his/her
academic institution is prepared. The different ways in which the chromosome can be
structured may be discussed.
One simple way is to form an m x n matrix that resembles the contents of a typical time
table. A few constraints, for instance, are cited below:
Professor X wishes to take a class on AI on either Mondays, Tuesdays and Fridays and
would prefer to lecture at 10:00AM except on Fridays when he wishes to do so at
4:00PM.
A table of such constraints could be formed for faculty members. (Maybe senior
Professors could be given preference!)
Likewise room availability constraints could cite the number and their size (maximum
capacity).
Lunch and tea breaks too have to be accounted for as also the number of courses and
lectures and labs. per week.
Crossover could be either random or controlled. For instance a crossover may cause
allocation of one Professor to two lectures at the same time. This could be detected
immediately and the crossover effect nullified.
Mutation could be realized by randomly moving a lecture to another free area. Some
thought should be given to the mutation rate and the manner of mutation.
A fitness function to evaluate each time table generated could take into consideration
parameters like:
2. In the animal world, the ant, grasshopper, the centipede and the millipede move using
different gaits and stances. These probably evolved after several generations. Can we
make a multi-legged robot learn to find the best and most stable gait? Use a Genetic
Algorithm to simulate and aid this robot to learn how to achieve optimal locomotion.
In the real world this problem requires a fitness function that could be calculated by
actually trying out each solution. A 6-legged insect-like robot for instance could look
something like this –
The more the number of legs, the more is the number of possible gaits. This number also
increases with the degrees of freedom of the legs. The above insect-like robot has six
legs. Each can move forward when activated or remain in the position shown. The
possible number of activation signals can go up to 26 = 64. By applying different
sequences of activation signals several gaits can be generated. The idea is to find the best
gait using GAs.
Some of the possible gaits for a hexapod insect are shown below.
Evaluation could be performed by a fitness function that could take into consideration the
actual distance traversed by the robot after several repeated cycles of a particular gait. In
short if we consider the leg activation sequence as 10010 (1 means activated; 0 means
stationary) then this sequence forms a gait. While such a sequence (solution) could be
generated using GAs, the robot’s legs could be activated say around a 100 times with this
sequence repeatedly and the distance traversed by it could form the fitness of this gait.
3. How would you go about embedding the above genetic algorithm into a real multi-
legged robot (imagine a millipede or a centipede-like robot) so that it will evolve and
learn to find the best gait in the real world?
The crucial part as mentioned earlier is the evaluation of the distance traveled (fitness of
the gait). In the real world there is no better way than the hard way – make the robot walk
physically using every gait several times. The solutions obtained from the simulation
phase could be used as the initial starting population. Measuring the distance of course
requires some ingenuity!
Chapter 24
1. A smart house needs an efficient burglar detection and alarm system. Can you
model these using AIS concepts?
You could imagine numerous strategically located burglar detectors each comprising
of cameras and proximity sensors that can trigger alarms. Cameras could sense
movement.
The student could be asked to provide his/her own viewpoints about the model being
tailored to suit AIS concepts within.
2. Many events can be looked upon as a defence mechanism. For instance the simple fact
that you can balance on two legs is a mechanism to defend (or prevent) your centre of
gravity from moving away from a stable point. Self preservation can be viewed, likewise,
as the capability to defend your body. At every stage your actions (be it moving, talking,
thinking, …) are all measures taken to make you feel stable (comfortable). With this in
mind try modelling the following into an AIS based system:
The Instructor is urged to motivate the students to think of each of the above problems as one that has
an Antigen and a Pathogen. Rest of the metaphors could then be discussed.
(ii) Spam has become a perennial problem. While many attempts have
been made to circumvent it, the fact that spammers change their modes
of spamming is highly frustrating.. An initial repertoire of words
(naïve B/T-cells) could be extracted from an existing 100% spam
database (similar to the bone marrow model). These could be used as
starting material to counter spam. These words could undergo somatic
mutation/hypermutation to catch the ever changing camouflaged
words within the incoming email and trigger a detection. For instance
the word – Viagra may have been spelt as Vi$agra. Mutation can help
generate such non-words from real words. Students could be
encouraged to use WordNet (http://wordnet.princeton.edu/) to find
words related to spam words (such as synonyms) so as to make the
word population diverse.