0Pricing
R Academy · Lesson

Probability Distributions

Work with common distributions (normal, binomial, Poisson) and generate random samples.

Probability Distributions is a free R Academy lesson on CoddyKit — lesson 2 of 3. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the R Academy learning path, one of 3 lessons in the course, and your progress syncs across the web and the CoddyKit app.

1

Introduction to Probability Distributions

Probability distributions describe how values are distributed in a dataset. In R, you can work with common distributions using built-in functions.

Probability Distributions — illustration 1

2

Normal Distribution

The normal distribution is a symmetric, bell-shaped distribution commonly used in statistics.

x <- rnorm(100, mean=50, sd=10)
hist(x, main='Normal Distribution', col='blue')

3

Binomial Distribution

The binomial distribution models the number of successes in a fixed number of independent trials.

x <- rbinom(100, size=10, prob=0.5)
barplot(table(x), main='Binomial Distribution', col='red')

4

Poisson Distribution

The Poisson distribution represents the probability of a given number of events occurring in a fixed interval.

x <- rpois(100, lambda=5)
barplot(table(x), main='Poisson Distribution', col='green')

5

Uniform Distribution

The uniform distribution assigns equal probability to all values within a range.

x <- runif(100, min=0, max=10)
hist(x, main='Uniform Distribution', col='purple')

6

Exponential Distribution

The exponential distribution describes the time between events in a Poisson process.

x <- rexp(100, rate=1)
hist(x, main='Exponential Distribution', col='orange')

7

Comparing Distributions

You can generate and compare multiple distributions using plots.

x1 <- rnorm(100, mean=50, sd=10)
x2 <- rnorm(100, mean=60, sd=15)
hist(x1, col=rgb(1,0,0,0.5), main='Comparing Distributions')
hist(x2, col=rgb(0,0,1,0.5), add=TRUE)

8

9

Simulating Probability Distributions

You can generate random samples from different distributions for simulations.

set.seed(123)
data <- rnorm(1000, mean=50, sd=10)
hist(data, main='Simulated Normal Distribution', col='blue')

10

Summary

In this lesson, you learned:

  • How to generate data from different probability distributions.
  • The key characteristics of normal, binomial, Poisson, uniform, and exponential distributions.
  • How to compare distributions using histograms.
Probability Distributions — illustration 10

Frequently asked questions

Is the “Probability Distributions” lesson free?

Yes — the full text of “Probability Distributions” is free to read here on the web, and the R Academy course includes 3 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the R Academy course, upgrade to CoddyKit PRO.

What will I learn in “Probability Distributions”?

Work with common distributions (normal, binomial, Poisson) and generate random samples. You practise R Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start R Academy?

No prior experience is required. R Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 2 of 3, so you can start here or from the beginning and move at your own pace.

How long does the “Probability Distributions” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this R Academy lesson?

Yes. Every R Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Descriptive Statistics
  2. Probability Distributions
  3. Hypothesis Testing
← Back to R Academy