Session Ready
Exercise

The normal distribution and cumulative probability

In the previous assignment we calculated probabilities according to the normal distribution by looking at an image. However, it is not always as simple as that. Sometimes we deal with cases where we want to know the probability that a normally distributed variable is between a certain interval. Let's work with an example of female hair length.

Hair length is considered to be normally distributed with a mean of 25 centimeters and a standard deviation of 5. Imagine we wanted to know the probability that a woman's hair length is less than 30. We can do this in R using the pnorm() function. This function calculates the cumultative probability. We can use it the following way: pnorm(30, mean = 25, sd = 5). If you wanted to calculate the probability of a woman having a hair length larger or equal to 30 centimers, you can set the lower.tail argument to FALSE. For instance, pnorm(30, mean = 25, sd = 5, lower.tail = FALSE). Let's visualize this. Note that the first example is visualized on the left, while the second example is visualized on the right:

Instructions
100 XP
  • Calculate the probability of a woman having a hair length less than 20 centimeters using a mean of 25 and a standard deviation of 5. Use the pnorm() function and round the value to two decimals.