Professional Documents
Culture Documents
COMP587 - Final Exam
COMP587 - Final Exam
DEPARTMENT OF MATHEMATICS
COMP587 ARTIFICIAL INTELLIGENCE
FINAL EXAM (SPRING 2020-2021) (DURATION IS 120 MINUTES)
(Question 1)(5 points). You have two empty buckets: the first bucket capable of holding
7 liters of water, and second bucket capable of holding 9 liters of water.You can fill or
empty these buckets. The task is to have 3 liters of water in the second bucket, and no
water in the first bucket.
(Question 2)(5 points). Use the semantic network to represent the following knowledge:
The whale, dolphin, dog, cat, chicken and ostrich are animals. The whale and dolphin are
mammals and live in water. The dog and cat are mammals and live on land. Mammals
have large brains. The chicken and ostrich are birds and they have feathers and lay eggs.
The chicken can fly, but the ostrich can’t fly. Mammals and birds are warm-blooded with
vertebrates. Mammals and birds have a constant temperature of body.
(Question 4).
a)(3 points). Suppose that 0.5% of people have a certain disease. The test for this disease
is not perfect, and while testing it is observed that 85% of people who really have a
disease are tested positive, and 6% of people who do not really have a disease are also
tested positive. Calculate the probability that a person who tests positive actually has a
disease.
b)(3 points). A student taking a multiple-choice test knows the answer 60% of the time;
otherwise, he/she guesses. If he/she knows the answer, he/she gives the correct response
with probability 1; if he/she guesses he/she gives the correct answer with probability 0.2.
Use Bayes rule to calculate the probability that a student really knows the answer to those
questions he/she answered correctly.
c)(3 points). Assume that 0.1% of the population suffers from that disease. It is also
known that if a person has the disease, the test has 99% of chance of turning out positive.
If the person doesn’t have the disease, the test has a 96% chance of turning negative.
Given that a test turned out positive, what are the chances of the person really having the
disease?
d)(3 points). Suppose a car driver can use any of three highways A, B, or C to arrive at a
destination point. The probabilities that a car driver arrives on time using the highways A,
B, and C are 60%, 55%, and 65%, respectively. If a car driver arrives on time and it is
assumed that a car driver is equally likely to choose any of these highways, calculate the
probability that a car driver chooses the highway B.
(Question 5).
a)(3 points). Below is a set of rules:
R1: IF B AND C
THEN A (CF= -0.6)
R2: IF D (CF= -0.8) OR E (CF= -0.5) AND F (CF= -0.9)
THEN B (CF= 0.5)
R3: IF G (CF= -0.2) OR H (CF= 0.3)
THEN C (CF= 0.7)
Combine these rules to find the CF for the conclusion that it will rain.
(Question 6)(6 points). Suppose that a medical doctor needs your help constructing a
constraint net to find prescriptions for his/her flu patients. The following table shows the
symptoms exhibited by flu patients and the list of medications that can be prescribed for
each symptom.
Symptom Medications
Headache H1, H2, H3
Runny nose R1, R2, R3, R4
Fever F1, F2, F3, F4
Sore throat S1, S2, S3, S4
• {H3, R2}
• {R2, F4}
• {F2, S3}
• {F3, R4}
• {H1, S4}
• {S2, F3}
• {S4, R2}
Find appropriate prescriptions (if possible) for the patient if H2, R3, F2, S2, and S4 are
allergic for him/her.