Which song plays next?

Lab 2C

Directions: Follow along with the slides, completing the questions in blue on your computer, and answering the questions in red in your journal.

Space, Click, Right Arrow or swipe left to move to the next slide.

A new direction

Estimate what … ?

Calculating probabilities

Estimating probabilities

Getting ready

rap <- rep("rap", times = 39)

Put the songs in the playlist

songs <- __(rap, ____)

Pick a song, any song

sample(songs, size = 1, replace = TRUE)

Now do() it some more

do(___) * sample(___, ___ = ___, ___ = ___)
tally(~___, data = draws)

Proportions vs. Probability

When using simulations to estimate probabilities, using a large number of repeats is better because the estimates have less variability and so we can be confident we’re closer to the actual value.

Non-random Randomness

set.seed(123)
sample(songs, size = 1, replace = TRUE)
## [1] "rap"

Playing with seeds

On your own

If we select a student at random, what is the probability that this student is one of those who went to the movies last Friday?