Flip Two Coins

def f(p1, p2):
	return p1 * p2

print f(0.5, 0.8)

c1 p(H|c1)=p1
c2 p(H|c2)=p2

p(c1)=p0=0.3
p(c2)=1-p0=0.7
p1 = 0.5
p2 = 0.9
0.15+0.7*0.9
p(H)=0.78

def f(p0, p1, p2):
	return p0 * p1 + (1-p0) * p2

print f(0.3, 0.5, 0.9)