Skip to content
Justice Tech School

Probability Distributions

Functions starting with d, p, q and r give density, cumulative probability, quantile and random numbers: dnorm, pnorm, qnorm, rnorm. Use set.seed for repeatable random numbers.

Example
set.seed(1)
x <- rnorm(5)
print(length(x)); print(pnorm(0)); print(qnorm(0.975))

Exercise

Repeatable randomness.

.seed(42)

Quiz Test

What does set.seed do?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.