Calculate Theoretical Probabilities ###Next I need to find the
theoretical probabilities of getting each genre by creating a new column
in my genre counts table.
genre_counts <- genre_counts %>% mutate(prob = n/sum(n))
genre_counts
## # A tibble: 6 × 3
## genre n prob
## <fct> <int> <dbl>
## 1 Genre 1 - hiphop/rap 26 0.181
## 2 Genre 2 - pop/kpop/Latin 22 0.153
## 3 Genre 3 - house/ska 5 0.0347
## 4 Genre 4 - rnb/soul 43 0.299
## 5 Genre 5 - alt/indie/folk 34 0.236
## 6 Genre 6 - country/rock 14 0.0972
I don’t like all those long decimal numbers, so I’m going to round
them to 2 decimal places.
genre_counts$prob <- round(genre_counts$prob, 2)
genre_counts
## # A tibble: 6 × 3
## genre n prob
## <fct> <int> <dbl>
## 1 Genre 1 - hiphop/rap 26 0.18
## 2 Genre 2 - pop/kpop/Latin 22 0.15
## 3 Genre 3 - house/ska 5 0.03
## 4 Genre 4 - rnb/soul 43 0.3
## 5 Genre 5 - alt/indie/folk 34 0.24
## 6 Genre 6 - country/rock 14 0.1
This new table tells me that there is an 18% chance of getting a
hiphop/rap song, a 15% chance of getting a pop/kpop/Latin song, a 3%
chance of getting a house/ska song, a 30% chance of getting an rnb/soul
song, a 24% chance of getting an alt/indie/folk song, and a 10% chance
of getting a country/rock song.