Probability Puzzles in R

Learn strategies for answering probability questions in R by solving a variety of probability puzzles.
Start Course for Free
4 Hours13 Videos45 Exercises2,071 Learners
3750 XP

Create Your Free Account

By continuing you accept the Terms of Use and Privacy Policy. You also accept that you are aware that your data will be stored outside of the EU and that you are above the age of 16.

Loved by learners at thousands of companies

Course Description

Do you want to take your probability skills to the next level? This course will help get you there, using problem-based learning with probability puzzles as the framework. As you are guided through their solutions, you will gain coding tools and general strategies for solving probability problems that you might encounter in many other situations. Organized by theme, the course begins with classic problems like the Birthday Problem and Monty Hall, and ends with puzzles that involve poker like Texas Hold'em and the World Series of Poker!

  1. 1

    Introduction and Classic Puzzles

    This chapter will introduce some basic principles that will be used throughout the course, such as writing loops and functions. Then, we dive into a couple of classic problems: the Birthday Problem, and Monty Hall.
    Play Chapter Now
  2. 2

    Games with Dice

    In this chapter, we explore games in which dice are rolled, including Yahtzee, Settlers of Catan, and Craps. You will learn tools such as using built-in R functions to calculate combinatorics, and using functions such as replicate and the %in% operator.
    Play Chapter Now
  3. 3

    Inspired from the Web

    The puzzles in this chapter were inspired by ideas encountered on the internet. In order to solve them, you will learn to combine tools such as nested for loops, and the functions round, identical, and sapply.
    Play Chapter Now
  4. 4


    This chapter explores questions in poker, including the most often televised version of Texas Hold'em. We will learn to code for win probabilities with any given number of outs, and also explore a more theoretical model of poker known as the von Neumann model. We will learn to use functions such as Reduce, runif, and ifelse.
    Play Chapter Now
In the following tracks
Probability and Distributions
Chester IsmayAmy Peterson
Peter Chi Headshot

Peter Chi

Assistant Professor of Statistics, Villanova University
Peter Chi is an Assistant Professor in the Department of Mathematics and Statistics at Villanova University. His primary research focus is centered on statistical methodologies in phylogenetics and evolutionary biology. He completed his Ph.D. in the Department of Biostatistics at the University of Washington, and has previously held faculty positions at Ursinus College, and Cal Poly San Luis Obispo. Find out more at his webpage, and follow him on Twitter @PeterBChi.
See More

What do other learners have to say?

I've used other sites—Coursera, Udacity, things like that—but DataCamp's been the one that I've stuck with.

Devon Edwards Joseph
Lloyds Banking Group

DataCamp is the top resource I recommend for learning data science.

Louis Maiden
Harvard Business School

DataCamp is by far my favorite website to learn from.

Ronald Bowers
Decision Science Analytics, USAA