CS533 --- Program 5 --- Solution

  1. Here is a table of the possible scenarios and the resulting costs.
    Component:      Scenarios:
                    1   2   3   4   5   6   7   8   9  10
    0 SparkPlugs    0   0   0   0   0   0   0   1   0   0
    1 Distributor   0   0   0   0   0   0   1   0   0   0
    2 FuelPump      0   0   0   0   0   1   0   0   0   0
    3 Leak2         0   0   0   0   0   0   0   0   0   1
    4 Starter       0   0   0   0   0   0   0   0   1   0
    5 BatteryAge    1   0   0   0   0   0   0   0   0   0
    6 BatteryState  1   0   0   0   0   0   0   0   0   0
    7 Alternator    0   1   0   0   0   0   0   0   0   0
    8 FanBelt       0   0   1   0   0   0   0   0   0   0
    9 Leak          0   0   0   1   0   0   0   0   0   0
    10 Charge       0   1   1   1   0   0   0   0   0   0
    11 BatteryPower 1   1   1   1   0   0   0   0   0   0
    12 EngineCranks 1   1   1   1   0   0   0   0   1   1
    13 Starts       1   1   1   1   1   1   1   1   1   1
    14 Radio        1   1   1   1   0   0   0   0   0   0
    15 GasInTank    0   0   0   0   1   0   0   0   0   0
    16 GasGauge     1   1   1   1   1   0   0   0   0   0
    17 Lights       1   1   1   1   0   0   0   0   0   0
    Cost:          37 149  47 239  12 117  67 107  67 142
    
    As an example of running one of these scenarios, here is a trace of the first scenario:
    % diagnose car.net car.dx
    Expected value of repairing GasInTank = 14.4641
    Repair GasInTank
    Is the device working (ok = 0, broken = 1)? 1
    Expected value of repairing BatteryAge = 33.2927
    Observe BatteryAge.  What is result (new = 0, old = 1)? 1
    Repair BatteryAge
    Device should be working now!
    Cost of solution was 37
    

    What this means is that first the program asks me to fill the tank with gas. Then it asks me if this fixed the problem. I answer "1" because it did not fix the problem. Then it asks me to inspect the age of the battery, and I answer "1", because the battery is old (BatteryAge = 1).

  2. The cost of filling the tank with gas must be 73 in order to force the program to check the BatteryAge first.


    Tom Dietterich, tgd@cs.orst.edu