Updating from evidence

Foundations of Probability in R

David Robinson

Chief Data Scientist, DataCamp

20 flips of a coin

Foundations of Probability in R

Two piles of 50,000 coins

fair <- rbinom(50000, 20, .5)
sum(fair == 14)
# 1888
biased <- rbinom(50000, 20, .75)
sum(biased == 14)
# 8372
1888 + 8372
# [1] 10260

$$\Pr(\text{Biased}|\text{14 Heads})=$$ $$\frac{\text{\# biased w/14 Heads}}{\text{\# total w/14 Heads}}$$

$$=\frac{8372}{1888+8372}=82\%$$

Foundations of Probability in R

Let's practice!

Foundations of Probability in R

Preparing Video For Download...