Bernoulli Sample

Start Timer

0:00:00

Upvote
3
Downvote
Save question
Mark as completed
View comments (17)

Write a function to get a sample from a Bernoulli trial.

Input:

def bernoulli_sample(p):
    pass

Output:

1 with probability p or 0 with probability 1-p.

.
.
.
.
.


Comments

Loading comments