# Tagged Questions

Rejection sampling is a basic technique used to generate observations from a distribution. [Wikipedia]

412 views

### Simulate a Bernoulli variable with probability ${a\over b}$ using a biased coin

Can someone tell me how to simulate $\mathrm{Bernoulli}\left({a\over b}\right)$, where $a,b\in \mathbb{N}$, using a coin toss (as many times as you require) with $P(H)=p$ ? I was thinking of using ...
50 views

### Monte Carlo Methods

_I've tried using sqrt p(1-p)/n to get the standard error and then calculate the t test but for all parts I get a very large number of t so this means ...
17 views

### Sampling from Irwin-Hall distribution using triangular distribution

So I need to sample from the Irwin-Hall distribution using rejection sampling with the triangular distribution. I built 2 functions: The first is d_irwin which receives an $x\in supp(g)$ and the n we ...
37 views

### Sampling from Irwin-Hall (Uniform Sum) distribution using rejection sampling

Irwin-Hall Distribution is a probability distribution for a random variable defined as the sum of a number of independent random variables,each having a uniform distribution True or False: The ...
36 views

### Why is rejection sampling with acceptance probability 2/3 for Beta(2,2) not slower than rbeta(N,2,2)?

I was trying to illustrate that rejection sampling is inefficient when an alternative approach is available that does not throw away samples. (This post obviously is a candidate for migration to SO, ...
28 views

### Rejection Sampling Not Giving Correct Distribution

I hope someone can check through all my steps to see where I made a mistake: I wish to create a sample with the density $\ f(x)=\frac{1-x}{(π-2)(x + 1)√x}$ using the [1,0] uniform distribution U, and ...
50 views

### How to generate conditioned random variables from a density function?

I want to generate random variables from a distribution function using inverse sampling with the additional condition that the sampling should be conditioned, i.e., random generated variables should ...
148 views

### Generating Double-Triangular-distributed random variates

Wikipedia shows how to generate Triangular-distributed random variates using a variate $U$ drawn from the uniform distribution. A "Double Triangular" distribution is a special case of a mixture of ...
324 views