Robot bayes rule

P(R)=P(G)=0.5
P(seeR|atR)=0.8 P(seeR|¬R)=0.2
P(seeG|atG)=0.8 P(seeG|¬G)=0.2

P(atR|seeR)=0.8
P(atG|seeR)=0.2

def f(p):
	return 1-p
print f(0.3)
def f(p):
	return p*p
print f(0.5)