{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE)
#Beginning of project: Calculating Theoretical Probability #What is the likelihood of a song of each genre being played?
#Installing tidyverse {r} install.packages("tidyverse")
#Load the tidyverse libary {r} library(tidyverse)
#Turn csv
file into a DF
{r} df <- read_csv("Playlist 24-25 - Playlist.csv")
#Write a function that count the value of genre
{r} df %>% count(Genre)
{r} gf<-df %>% count(Genre)
#new column showing the theorectical possibility of each genre
{r} gf %>% mutate(possibility = n / 141 * 100)
#To find the theroectical possibility of each genre, I first found the favorable variables (amount of songs in each genre). Next I calculated the total songs in the playlist, then using ānā, the interger as the amount of songs in each genre, dividing by all the possible outcomes, then multiplying by 100 to get the %.