Which song plays next?

Lab 2C

Directions: Follow along with the slides and answer the questions in red font in your journal.

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

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 the one’s who went to the movies last Friday?