Exercise 11        Name __________________        Score __/14

Document last modified: 

1) Show that P(a|b Ù a) = 1

P(x|y) = P(x Ù y)/P(y) and x Ù x Û x

P(a|b Ù a) = P(a Ù (b Ù a))/P(b Ù a) = P(b Ù a)/P(b Ù a) =1

2) Calculate the following from the full joint distribution; note the bold (random variable distribution probabilities) versus non-bold P (probability of a value) and upper (random variable) versus lower case (value true or false) variable names:

  1. P(toothache) the probability that Toothache is true.

        0.108+0.012+0.016+0.064=0.2
     
  2. P(Cavity) the vector of probability values for the random variable Cavity; it has two values, list in order <true,false>.

        P(cavity) = 0.108+0.012+0.072+0.008=0.2
        P(Cavity) = <0.2, 0.8>
     
  3. P(Toothache|cavity) the vector of probability values for the random variable Toothache given that Cavity is true.

        <(0.108+0.012)/0.2, (0.072+0.008)/0.2)> = <0.6, 0.4>
     
  4. What is the normalization constant for Question c?

        1/0.2 = 5
     
  5. P(cavity,tootache,catch)

        0.108
     
  6. P(Cavity, toothache, catch)

        <0.108, 0.016>
     
  7. P(Cavity, toothache)

        <0.108+0.012, 0.072+0.008> = <0.12, 0.08>
     
  8. P(Cavity|toothache Ú catch) the vector of probability values for the random variable Cavity given that either Toothache or Catch is true.

        First compute normalization constant denominator P(toothache Ú catch) = 0.108+0.012+0.016+0.064+0.072+0.144=0.416
       
        P(Cavity|toothache Ú catch) =
            <(0.108+0.012+0.072)/0.416, (0.016+0.064+0.144)/0.416)> =
            <0.4615,0.5384>
     
  9. From the full joint distribution table, determine the conditional probability tables for the following belief diagram:

    Toothache
       /      \
    Cavity Catch
     

    Recall definition of conditional probability and product rule on page 470:

        P(BÙA) = P(B|A)*P(A) = P(A|B)*P(B) = P(AÙB)

       Full joint distribution
    P(Toothache, Catch, Cavity) =
      by definition of conditional probability
    P
    (Cavity|Toothache, Catch)*P(Toothache,Catch) =
      by definition of conditional probability

    P(Cavity|Toothache, Catch)*P(Catch|Toothache)*P(Toothache) =
      by conditional independence of Cavity and Catch

    P(Cavity|Toothache)*P(Catch|Toothache)*P(Toothache)

    P(Cavity|Toothache) = <.108+.012,.016+.064> = <.12,.08>
    P
    (Catch|Toothache)  = <.108+.016,.012+.064> = <.124,.076>          
    P(Toothache) = <.108+.012+.064+.016,.072+.008+.144+.576>
                        =<.2,.8> 

    P(tootache)
    0.2
       
         
    Tootache P(cavity)
    true
    false
    0.12
    0.08
     
    Tootache P(catch)
    true
    false
    0.124
    0.076
         

 

3) Three prisoners, A, B and C, are awaiting execution of one of their number and the pardoning of the others. What is A's chances of execution given equal likelihood of a prisoner being executed?

    1/3

The guard knows who is to be executed. Prisoner A asks the guard to tell B or C that they will be pardoned. The guard agrees and replies that B was given the pardon message. What are A's chances of being executed now given B is freed; state in terms of conditional probability, let Fx="x will be freed" and Ex="x will be executed".

    P(FB|EA)=1 given EA since only one will be executed
    P(EA) = 1/3
    P(FB) = 2/3 the probability that FB

    P(EA|FB) = P(FB|EA)*P(EA)/P(FB) =
                              (1*1/3)/(2/3) = 1/2

    Yikes! A's likelihood of execution has seemingly increased.

 

4) Expressed as conditional probability tables,

P(C)
0.2
   
     
C P(S)
true
false
0.8
0.2
 
C P(P)
true
false
0.6
0.5
     
S P P(E)
true
true
false
false
true
false
true
false
0.6
0.9
0.1
0.2
 
P P(F)
true
false
0.9
0.7


 

  1. Probability that will study given that go to college?

        P(S|C) = 0.8
     
  2. P(E|FÙCÙØSÙØP)?

        Because E is dependent only on S and P.

        P(E|FÙCÙØSÙØP) = P(E|ØSÙØP) = 0.2
     
  3. Determine whether studied or not.
     

    P(CÙSÙFÙEÙP) = P(C)*P(S|C)*P(P|C)*P(E|SÙP)*P(F|P)

                         = .2*.8*.6*.6*.9 = .05184

    P(CÙØSÙFÙEÙP) = P(C)*P(ØS|C)*P(P|C)*P(E|ØSÙP)*P(F|P)

                             = .2*.2*.6*.1*.9 = 0.0021

5) Classify (x=1, y=2, z=3)

Training Example

x y z Classification
2 3 2 A
4 1 4 B
1 3 2 A
2 4 3 A
4 2 4 B
2 1 3 C
1 2 4 A
2 3 3 B
2 2 4 A
3 3 3 C
3 2 1 A
1 2 1 B
2 1 4 A
4 3 4 C
2 2 4 A

 

Summary classification table

A's - 8
B's - 4
C's - 3
      15 total
A
value x y z
1 2 1 1
2 5 4 2
3 1 2 1
4 0 1 4
B
value x y z
1 1 1 1
2 1 2 0
3 0 1 1
4 2 0 2
C
value x y z
1 0 1 0
2 1 0 0
3 1 2 2
4 1 0 1

 

Classify: (x=1, y=2, z=3)

Use P(ci)*PP(dj|ci) to compute posterior probability of ci

P(A)*P(x=1|A)*P(y=2|A)*P(z=3|A) =
8/15*2/8        *4/8        *1/8         =0.00833

P(B)*P(x=1|B)*P(y=2|B)*P(z=3|B) =
4/15*1/4        *1/4        *1/4         = 0.00416

P(C)*P(x=1|C)*P(y=2|C)*P(z=3|C) =
3/15*1/3        *2/3        *2/3         =0.0296 maximum

Classify as C since maximum posterior probability