Tip:
Highlight text to annotate it
X
Here is my next quiz for you. Supposed we have a coin with probability p.
For example, p might be 0.5.
You flip the coin twice and I want to compute the probability that this coin
comes up head and heads in these 2 flips--obviously that's 0.5 times 0.5.
But I want to do in a way that I can use any arbitrary value for p
using the same style of code as before.
So all your going to modify is the 1-p into something that if I give a probability p
returns to me the probability of seeing heads twice in this coin--that is the probability of heads.