0
$\begingroup$

Let x be a variable. Lets say I have a coin and I flip it n times. If it lands on tails, I add one to x. Given a source of uniformly distributed numbers (0 to 1), how map it to a number between 0 and n so that the distribution of the random numbers is the same as the distribution of x? Also, please provide a more general way to do this for a biased coin, with probability of tails being t.

$\endgroup$
  • $\begingroup$ This is the problem of generating binomial random variates. There is a lot of literature out there about this for you to explore. $\endgroup$ – Parcly Taxel Mar 24 '17 at 13:55
0
$\begingroup$

Your variable $x$ is distributed according to the binomial distribution with parameters $n$ and $t$.

Take a look at the generating binomial random variates section to find how to transform a uniformly distributed random number to your variable $x$.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.