Question: Write a program in python that takes one floating point argument p and prints out at random either True with probability equal to p, or
Write a program in python that takes one floating point argument p and prints out at random either True with probability equal to p, or False with probability equal to 1 p. Note that a fair coin would correspond to the input p = 0.5. Use random.random() in your solution. Please explain. Thanks!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
