Exercise 16.22 [carvpiexercise]
(Adapted from Pearl [@Pearl:1988].) A usedcar buyer can decide to carry out various tests with various costs (e.g., kick the tires, take the car to a qualified mechanic) and then, depending on the outcome of the tests, decide which car to buy. We will assume that the buyer is deciding whether to buy car $c_1$, that there is time to carry out at most one test, and that $t_1$ is the test of $c_1$ and costs $50.
A car can be in good shape (quality ) or bad shape (quality $q^$), and the tests might help indicate what shape the car is in. Car $c_1$ costs $1,500, and its market value is if it is in good shape; if not, in repairs will be needed to make it in good shape. The buyer’s estimate is that $c_1$ has a 70% chance of being in good shape.

Draw the decision network that represents this problem.

Calculate the expected net gain from buying $c_1$, given no test.

Tests can be described by the probability that the car will pass or fail the test given that the car is in good or bad shape. We have the following information:
Use Bayes’ theorem to calculate the probability that the car will pass (or fail) its test and hence the probability that it is in good (or bad) shape given each possible test outcome.

Calculate the optimal decisions given either a pass or a fail, and their expected utilities.

Calculate the value of information of the test, and derive an optimal conditional plan for the buyer.