Queue it up!

Lab 2D

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

Where we left off

Back to songs

With or Without?

Sample with? Or without?

Simulations at work

Simulations and probability

Counting similar outcomes

mutate(draws, nrap = rowSums(draws=="rap"))
draws == "rap"
rowSums(draws == "rap")
mutate(draws, nrap = rowSums(draws=="rap"))

Counting other outcomes

Step 1: Creating a subset

draws_sub <- filter(draws, ___ == "rap",  ___ == "rap")
nrow(___) / ___

Estimating probabilities

On your own

If we draw 5 songs from a playlist of 30 rap, 23 country and 47 rock songs, how does the estimated probability of all 5 songs being rap songs change if we draw the songs with or without replacement?