Skip to content

Instantly share code, notes, and snippets.

@rpglover64
Created November 18, 2011 20:56
Show Gist options
  • Save rpglover64/1377735 to your computer and use it in GitHub Desktop.
Save rpglover64/1377735 to your computer and use it in GitHub Desktop.
Text file with tabs and spaces important
1. a.
i.
P(day 1 is hot) = 0.491
Prior of CHH:
Prior of starting C = .5
Prior of day 2 as H = P(C₁)*P₂(H₂|C₁)
P(C₁H₂) = .5 * .1
= .05
Prior of day 3 as H = P(C₁H₂)*P(H₃|H₂)
P(C₁H₂H₃) = .05 * .8
= .04
Prior of HHH:
Prior of starting H = .5
Prior of day 2 as H = P(H₁)*P₂(H₂|H₁)
P(H₁H₂) = .5 * .8
= .4
Prior of day 3 as H = P(H₁H₂)*P(H₃|H₂)
P(H₁H₂H₃) = .4 * .8
= .32
P(133|CHH) = P(1|C) * P(3|H) * P(3|H)
= .7 * .7 * .7
= .343
P(133|HHH) = P(1|H) * P(3|H) * P(3|H)
= .1 * .7 * .7
= .049
(with P(133) = 1)
P(CHH) = P(133|CHH) * P(CHH)
= .343 * .04
= .01372
P(HHH) = P(133|HHH) * P(HHH)
= .049 * .32
= .01568
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment