Describe Monte Carlo simulation technique and mention its different steps. Also describe how would you generate random numbers from Weibull distribution with parameters (θ, β) .

In this question, I know what the Monte Carlo simulation technique is and the procedure to take random numbers out from a random number table to perform the experiment.
But I have come across many questions which say to generate random number from a certain distribution (here it is Weibull, and sometimes it is exponential); how can I write it in my answer sheet, because I know the command for this in Excel.

  • 1
    $\begingroup$ Taking random (Uniform?) numbers out of a table has not been seen for many years! $\endgroup$
    – Xi'an
    Commented Jun 14, 2021 at 6:19
  • 2
    $\begingroup$ The Weibull distribution has a simple and invertible CDF (as does the exponential distribution), so just take random numbers uniform on $[0,1)$ and apply the inverse of the CDF $\endgroup$
    – Henry
    Commented Jun 14, 2021 at 10:44
  • $\begingroup$ @Xi'an actually I am preparing for a govt exam , and the pattern has been the same for more than 30 years , that's the reason $\endgroup$
    – simran
    Commented Jun 15, 2021 at 5:41

2 Answers 2


Taking as definition of the Weibull distribution that $X\sim \mathfrak W(k,\lambda)$ iff $(X/\lambda)^k\sim\mathfrak E\text{xp}(1)$, the generation of a Weibull realisation can proceed by

  1. generating a Uniform $\mathcal U(0,1)$ realisation $u$ (or selecting one from a table)
  2. turning it into an exponential realisation as $$y=-\log u$$
  3. turning this exponential realisation into a Weibull realisation as$$x=\lambda y^{1/k}$$

This inverse cdf transform is for instance the one used by R function rweibull.


To "generate random number from a certain distribution" you need

  • either a software that does it out-of-the-box, like most of the statistical software,
  • or write an algorithm by yourself. The simplest one is inverse transform sampling for which you only need to know an inverse of the cumulative distribution function and need to be able to generate values from a standard uniform distribution.

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