Bắt đầu ngayBắt đầu miễn phí

Generating random numbers from other distributions

You can generate random numbers from a variety of statistical distributions in addition to the uniform distribution. Unfortunately, it takes a sneaky trick!

First, you generate a uniform random number between 0 and 1 using RAND(). Then you apply the inverse cumulative distribution function for the distribution you are interested in. Don't worry, it sounds trickier than it is.

As an example, to generate random numbers from a normal distribution with mean 3 and standard deviation 2, you would use =NORMINV(RAND(), 3, 2).

There are many other inverse cumulative distribution functions available: you can repeat that same code swapping FINV() for the F distribution, BETAINV() for the beta distribution, and so on.

Bài tập này là một phần của khóa học

Google Sheets nâng cao

Xem khóa học

Hướng dẫn bài tập

  • In column H, generate normally distributed random geocentric distances with the mean taken from column C and a standard deviation of 1000.
  • In column I, generate beta distributed random asteroid sizes.
    • Call BETAINV(), passing RAND() as the first argument.
    • Set the second and third "shape" arguments to 2.
    • Set the fourth and fifth "bound" arguments to the asteroid lower and upper size estimates.

Bài tập tương tác thực hành

Biến lý thuyết thành hành động với một trong các bài tập tương tác của chúng tôi

Bắt đầu bài tập