Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
| Download

📚 The CoCalc Library - books, templates and other resources

Views: 96165
License: OTHER
1
"""This file contains code for use with "Think Bayes",
2
by Allen B. Downey, available from greenteapress.com
3
4
Copyright 2012 Allen B. Downey
5
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
6
"""
7
8
from thinkbayes import Pmf
9
10
pmf = Pmf()
11
pmf.Set('Bowl 1', 0.5)
12
pmf.Set('Bowl 2', 0.5)
13
14
pmf.Mult('Bowl 1', 0.75)
15
pmf.Mult('Bowl 2', 0.5)
16
17
pmf.Normalize()
18
19
print pmf.Prob('Bowl 1')
20
21