Probability in R. Discrete Random Variables

Infermath links mathematical theory with programming application to give high level understanding of quantitative fields
3.9 (40 ratings)
Instead of using a simple lifetime average, Udemy calculates a
course's star rating by considering a number of different factors
such as the number of ratings, the age of ratings, and the
likelihood of fraudulent ratings.
1,935 students enrolled
Start Learning Now
  • Lectures 12
  • Length 2 hours
  • Skill Level Intermediate Level
  • Languages English
  • Includes Lifetime access
    30 day money back guarantee!
    Available on iOS and Android
    Certificate of Completion
Wishlisted Wishlist

How taking a course works


Find online courses made by experts from around the world.


Take your courses with you and learn anywhere, anytime.


Learn and practice real-world skills and achieve your goals.

About This Course

Published 3/2016 English

Course Description

Probability in R is a course that links mathematical theory with programming application. Discrete Random Variables series gives overview of the most important discrete probability distributions together with methods of generating them in R. Fundamental functionality of R language is introduced including logical conditions, loops and descriptive statistics. Viewers are acquainted with basic knowledge of numerical analysis.

Course is designed for students of probability and statistics who would like to enrich their learning experience with statistical programming. While basic knowledge of probability and calculus is useful prerequisite it is not essential. The suggested method of using the course is by repeating the reasoning and replicating the R code. Therefore it is essential for students to download and use R in the course.

The course consists of twelve short lectures totaling two hours of video materials. Four major topics are covered: Bernoulli distribution (2 lectures), binomial distribution (3 lectures), geometric distribution (3 lectures) and Borel-Cantelli lemma (4 lectures). Eight lectures are presented in a form of writing R code. Remaining four lectures focus solely on theory of probability.

How is Infermath different from other education channels? It equips students with tools and skills to use acquired knowledge in practice. It aims to show that learning mathematics is not only useful but also fun and inspiring. It places emphasis on equal chances in education and promotes open source approach.

What are the requirements?

  • high school calculus
  • high school probability theory
  • download and install R

What am I going to get from this course?

  • draw random numbers in R
  • use descriptive statistics in R
  • use boolean variables in R
  • define and use Bernoulli random variable
  • define and derive probability of binomial distribution
  • define and assign values to vectors
  • use histogram in R
  • use combinations in set theory
  • define and assign values to matrices in R
  • draw plots in R
  • use for and while loops in R
  • use logical conditions in R
  • sum geometric series
  • define and derive probability of geometric distribution
  • predict numerical limitations of computers and R
  • define functions in R
  • define infinite series of events
  • specify conditions for series convergence
  • use independence of events
  • use properties of complementary events
  • use squeeze theorem
  • hold the loop execution and print results in R
  • define and prove Borel-Cantelli lemma

What is the target audience?

  • students of probability theory
  • R and statistical programming students
  • bachelor students of quantitative fields
  • high school students
  • open source enthusiasts
  • programming beginners
  • self learners
  • classical music melomaniacs
  • inquisitive souls
  • philosophy and logic apprentices

What you get with this course?

Not for you? No problem.
30 day money back guarantee.

Forever yours.
Lifetime access.

Learn on the go.
Desktop, iOS and Android.

Get rewarded.
Certificate of completion.


Section 1: Bernoulli random variable

Infermath links mathematical theory with programming application to provide high level understanding of quantitative fields.

In this video we generate a Bernoulli random variables using R. We familiarize ourselves with boolean variables and logical conditions in R.
Section 2: Binomial distribution
We define binomial distribution and generate it using R. We familiarize ourselves with histogram in R.
In this episode we derive the probability of each outcome in binomial distribution. We show the probabilities add up to 1 using set theory, polynomials and Pascal's triangle.

In this video we are comparing the probability distribution of binomial random variables to simulation in R. We learn how to generate vectors and matrices, use the for loop and bar plot in R.

Section 3: Geometric distribution
We define geometric distribution and draw random variables from it in R. We familiarize ourselves with while loop and scientific notation.
We derive probability distribution of the geometric random variables and learn about geometric series. We encounter cumulative distribution function.

We want to increase to infinity the maximum value coming from geometric distribution. On our way we encounter NAs and machine epsilon but don't give up.

Section 4: Borel-Cantelli lemma
We create a function in R returning a result of Bernoulli trial and we use it in for loop to generate series of trials. We try to understand what does it mean for a series of events to happen infinitely many times.
We derive the first part of the Borel - Cantelli lemma. On the way we use properties of sequences and series, visit police station and do a quick trip to outer space.
We prove the second part of Borel-Cantelli lemma. We come across exponential function, complementary events, a monkey and William Shakespeare.
In the last episode of discrete random variables we use Borel-Cantelli lemma to generate infinite series of successful Bernoulli trials. As we approach infinity we turn to philosophy and music.

Students Who Viewed This Course Also Viewed

  • Loading
  • Loading
  • Loading

Instructor Biography

Pawel Dudko, Financial Engineer

In 2012 received BSc in Mathematics from University of Warsaw.

In 2013 graduated with Distinction from Imperial College London receiving MSc degree in Risk Management and Financial Engineering.

Since graduation working in Sales and Trading at Commerzbank, London.

Specializing in probability, statistics, stochastic calculus and numerical methods.

Programming, open source and self development enthusiast.

Ready to start learning?
Start Learning Now