Interview Query

Bernoulli Sample

2
Have you seen this question before?

Given a random Bernoulli trial generator, write a function to return a value sampled from a normal distribution.

Example:

Input:

def bernoulli_sample(p):
  """
  generate 100 outputs of bernoulli sample , given prob of 1 as p and 0 as 1-p

Output:

55

Next question: Credit Card Fraud Model
.....
Python 3.9.6
Loading editor
Use Shift + Enter to run code