#### CS 662: AI Programming

Homework #7: Utility

30 points.
Assigned: November 22

Due: December 1.

To turn in: Typed or clearly handwritten answers to the questions throughout
the homework. (Note: if you have messy handwriting, please type your
answers. If we can't read what you've written, we can't grade it.)

- (10 points) Tickets to play the lottery cost $1. With
probability 1/50, you'll win $10, and with probability 1/2,000,000,
you'll win $1,000,000. How many tickets should you buy, if any? Be precise
and compute expected utility.

- You have built an agent that will help you buy a used car. You
take it with you to the car lot and it will help you decide whether
to carry out tests on the car.

You will have time to perform at most one test. If you perform a test,
it will cost $50.

A car can be in either good shape (denoted G) or bad shape (denoted B).

The car costs $1500. Its resale value is $2000 if it's in good shape,
and $1300 if it's in bad shape. You estimate that there is a 70%
probability that it's in good shape.
- (5 points) What is the expected utility of buying the car without
performing a test?
- We can describe a test by the probability that cars in good/bad shape will pass. You know that:

P(pass | G) = 0.8

P(pass | B) = 0.35
- (5 points) Use Bayes' Theorem to calculate the probability that the car
will pass or fail its test, and thus the probability that it is in
good (or bad) shape given each possible test outcome. In other
words, compute P(G | pass), P(G | fail), P(B | pass), P(B |
fail).
- (10 points) Calculate the value of the information in the
test. Should you get the car tested?