All Collections
Editor: how to add and edit learning materials
How can I work with (parameterised) distributions in exercises?
How can I work with (parameterised) distributions in exercises?
You can define a distribution in parameters, but what can you do with this? This article explains this parameter type with a short example
Eric Bouwers avatar
Written by Eric Bouwers
Updated over a week ago

Since December 2021 it is possible to define a parameter which represents a distribution. Three different distributions are currently supported:

These three distributions can be used in other parameter types to calculate the outcome of the cumulative distribution function or the probability density function for a given value. In addition, the value for a given quantile can be calculated.

But how could you use this in your exercises? In this article we explain how this can be done!

The exercise

As an example, we will work with the following question:

Naturally, you can simply define this question with hard-coded values. However, in this case we have randomised the value for which the probability needs to be determined:

The parameters

So how did we set up the parameters for this exercise? Let's take a look at the definitions:

First, we define a parameter c which takes a random value between 0.80 and 0.95. Naturally, this range can be extended to create more possibilities. Then, we create a Normal distribution with standard values for mean and the standard deviation. Note that the mean and / or the standard deviation could also have been randomised.

We use this distribution to calculate the probability of the value being less can c using the cumulative distribution function. Lastly, we round the probability to four digits to ensure that students can look up the correct value.


As mentioned above, we can add more variance to the exercise by, for example, taking a greater range for c or randomising the mean and standard deviation of the normal distribution.

In addition, we can also choose a different distribution such as the Student-T distribution, possibly with a randomised degree of freedoms.


Hopefully this example inspires you to create more exercises with parameterised distributions. If you want to know what else you can randomise using parameters you can find a list of all possibilities in this help article.

Did this answer your question?