Movie Shuffle

Essential Questions: - What is the probabilty of a person who prefers to watch action movies over other genres
- Can what an individual watches show their preference based on the type of genre movies they’ve watched most?

We will be seeing if it is true whether the amount of movies do determine our preference in the genres that we might be most interested. while using the probability experimental design.

tidyverse is what will help us organize the coding and the data

library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.4     ✔ readr     2.1.5
## ✔ forcats   1.0.0     ✔ stringr   1.5.1
## ✔ ggplot2   3.5.1     ✔ tibble    3.2.1
## ✔ lubridate 1.9.3     ✔ tidyr     1.3.1
## ✔ purrr     1.0.2     
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors

Organize the clean data of the movies and its genres.

df <- read.csv("movies.csv")
 head(df)
##            Genres                  Titles
## 1 genre 1: Comedy               Unfrosted
## 2 genre 1: Comedy                   Shrek
## 3 genre 1: Comedy smurfs:the lost village
## 4 genre 1: Comedy           Happy Gilmore
## 5 genre 1: Comedy             cat and dog
## 6 genre 1: Comedy    think like a man too

#The list of movies being rearranged from the genres in order

df %>% arrange(Genres)
##                        Genres                                    Titles
## 1       genre 10: Documentary                         What Jennifer Did
## 2       genre 10: Documentary                          Hack Your Health
## 3       genre 10: Documentary                    Lover, Stalker, Killer
## 4       genre 10: Documentary                     Einstien and the Bomb
## 5       genre 10: Documentary                 The greatest night in pop
## 6       genre 10: Documentary                  Hell Camp:Teen Nightmare
## 7       genre 10: Documentary Buried: The 1982 Alpine Meadows Avalanche
## 8       genre 10: Documentary                                       Sly
## 9            genre 11: Sci-Fi                                     Glass
## 10           genre 11: Sci-Fi                                     Split
## 11           genre 11: Sci-Fi                            mortal engines
## 12           genre 11: Sci-Fi                                  spaceman
## 13           genre 11: Sci-Fi                             code 8 part 2
## 14           genre 11: Sci-Fi                          Ready Player One
## 15           genre 11: Sci-Fi                         Love and Monsters
## 16           genre 11: Sci-Fi                                      Lucy
## 17           genre 11: Sci-Fi                                Downsizing
## 18         genre 12: Thriller                    The postcards killings
## 19         genre 12: Thriller                                 Deep Fear
## 20         genre 12: Thriller                    Leave the World Behind
## 21         genre 12: thriller                               On the line
## 22         genre 12: thriller                            your lucky day
## 23         genre 12: thriller                                     alone
## 24         genre 12: thriller                               unthinkable
## 25         genre 12: thriller                                      fear
## 26         genre 12: thriller                              May December
## 27         genre 12: thriller                            The impossible
## 28         genre 12: thriller                                 Locked In
## 29            genre 1: Comedy                                 Unfrosted
## 30            genre 1: Comedy                                     Shrek
## 31            genre 1: Comedy                   smurfs:the lost village
## 32            genre 1: Comedy                             Happy Gilmore
## 33            genre 1: Comedy                               cat and dog
## 34            genre 1: Comedy                      think like a man too
## 35            genre 1: Comedy                           Horrible Bosses
## 36            genre 1: Comedy                                      Lift
## 37            genre 1: Comedy                               Dumb Monney
## 38            genre 1: Comedy                                 Queenpins
## 39            genre 1: Comedy        Tyler perry's the single moms club
## 40            genre 1: Comedy                        Dumb and Dumber To
## 41            genre 1: Comedy                                 Neighbors
## 42            genre 1: Comedy                       A Walk in the Woods
## 43             genre 2: Drama                             Miller's Girl
## 44             genre 2: Drama                              Megan Leavey
## 45             genre 2: Drama                         The Little Things
## 46             genre 2: Drama                          Mending the line
## 47             genre 2: Drama                          the miracle club
## 48             genre 2: Drama                                   shirley
## 49             genre 2: Drama                                 Mea culpa
## 50             genre 2: Drama                             Made in Italy
## 51             genre 2: Drama                                   The vow
## 52             genre 2: Drama                                  The hill
## 53             genre 2: Drama                      Fried Green Tomatoes
## 54             genre 2: Drama                            Blood and Bone
## 55             genre 2: Drama                       Society of the snow
## 56             genre 2: Drama                          After Everything
## 57             genre 2: Drama                                   Trapped
## 58             genre 2: Drama                               The Courier
## 59             genre 2: Drama                                     Elvis
## 60             genre 2: Drama                              Gran Turismo
## 61             genre 2: Drama                          See You on Venus
## 62   genre 3: Romantic Comedy                            Anyone But You
## 63   genre 3: Romantic Comedy                                   Blended
## 64   genre 3: Romantic Comedy                                knocked up
## 65   genre 3: Romantic Comedy                                irish wish
## 66   genre 3: Romantic Comedy                                27 dresses
## 67   genre 3: Romantic Comedy                                   Players
## 68   genre 3: Romantic Comedy                                Crossroads
## 69   genre 3: Romantic Comedy                                Queen Bees
## 70   genre 3: Romantic Comedy                       Mother of the bride
## 71   genre 3: Romantic Comedy                                   upgrade
## 72   genre 3: Romantic Comedy                  Holiday In the Vineyards
## 73   genre 3: Romantic Comedy                     Best.Christmas. Ever!
## 74   genre 3: Romantic Comedy                          No Hard Feelings
## 75   genre 3: Romantic Comedy                            13 going on 30
## 76            genre 4: Action                            The Great Wall
## 77            genre 4: Action                             The equalizer
## 78            genre 4: Action                         Rebel Moon part 2
## 79            genre 4: Action                                      Anna
## 80            genre 4: Action                            The Bricklayer
## 81            genre 4: Action                               Baby Driver
## 82            genre 4: Action                                Skyscraper
## 83            genre 4: Action                            The accountant
## 84            genre 4: Action                         The wages of fear
## 85            genre 4: Action                                    damsel
## 86            genre 4: Action                       heart of the hunter
## 87            genre 4: Action                                      noah
## 88            genre 4: Action                    The legend of Hercules
## 89            genre 4: Action                                 The abyss
## 90            genre 4: Action                         American Assassin
## 91            genre 4: Action                            Seraphim Falls
## 92            genre 4: Action                                      Fury
## 93            genre 4: Action                               Pacific Rim
## 94            genre 4: Action                           The equalizer 3
## 95            genre 4: Action               Escape plan: the extractors
## 96            genre 4: Action                                  Aquaman 
## 97            genre 4: Action                    Those who wish me dead
## 98            genre 4: Action                                 john wick
## 99            genre 4: Action                                Madame Web
## 100           genre 4: Action                         Meg 2: The Trench
## 101           genre 4: Action                      John Wick: Chapter 3
## 102           genre 4: Action                      John Wick: Chapter 2
## 103           genre 4: Action                         Reber Moon Part 1
## 104           genre 4: Action                     Sniper: Ultimate Kill
## 105           genre 4: Action                    Sniper: Assassin's End
## 106           genre 4: Action                            Suidcide Squad
## 107           genre 4: Action                                Black adam
## 108           genre 4: Action                             hunter killer
## 109           genre 4: Action                             The sliencing
## 110           genre 4: Action                                   The Meg
## 111           genre 4: Action                             Lone Survivor
## 112           genre 4: Action                                The Killer
## 113           genre 4: Action                                Real Steel
## 114           genre 4: Action                                   Harriet
## 115           genre 4: Action                                 The mummy
## 116            genre 5: Crime                                 The Judge
## 117          genre 6: Fantasy                             Mortal Kombat
## 118          genre 7: History                              King Richard
## 119           genre 8: Horror                                Rust creek
## 120           genre 8: Horror                              Thanksgiving
## 121           genre 8: Horror                   Insidious: The Red door
## 122           genre 8: Horror                                    Legion
## 123  genre 9: Kids and Family                                     turbo
## 124  genre 9: Kids and Family              ruby gillman, teenage kraken
## 125  genre 9: Kids and Family                                   Minions
## 126  genre 9: Kids and Family                                    Trolls
## 127  genre 9: Kids and Family                        Orion and the dark
## 128  genre 9: Kids and Family                             Tom and Jerry
## 129  genre 9: Kids and Family                                The croods
## 130  genre 9: Kids and Family                           The flintstones
## 131  genre 9: Kids and Family             teen titans go! to the movies
## 132  genre 9: Kids and Family                        Thelma the unicorn
## 133  genre 9: Kids and Family                       Shrek Forever After
## 134  genre 9: Kids and Family               Madagascar: Escale 2 Africa
## 135  genre 9: Kids and Family                                       Leo
## 136  genre 9: Kids and Family                             Family Switch
## 137  genre 9: Kids and Family           Chicken Run: Dawn of the nugget
## 138  genre 9: Kids and Family                  The Christmas Chronicles
## 139  genre 9: Kids and Family   The adventures of sharkboy and lavagirl
## 140  genre 9: Kids and Family                   DC league of super pets
## 141  genre 9: Kids and Family       Spider-Man: Across the spider-verse
## 142 genre 9: Kids and Family                      The super Mario Bros.
## 143 genre 9: Kids and Family              Woody woodpecker goes to camp
## 144 genre 9: Kids and Family                       Hotel Transylvania 2
## 145 genre 9: Kids and Family                                  Space Jam
## 146 genre 9: Kids and Family                                 Tysons run
## 147 genre 9: Kids and Family                              the boss baby

#Count the amount of movies that are listed which are all collected from the site of Netflix

df %>% count(Genres)
##                       Genres  n
## 1      genre 10: Documentary  8
## 2           genre 11: Sci-Fi  9
## 3         genre 12: Thriller  3
## 4         genre 12: thriller  8
## 5            genre 1: Comedy 14
## 6             genre 2: Drama 19
## 7   genre 3: Romantic Comedy 14
## 8            genre 4: Action 40
## 9             genre 5: Crime  1
## 10          genre 6: Fantasy  1
## 11          genre 7: History  1
## 12           genre 8: Horror  4
## 13  genre 9: Kids and Family 19
## 14 genre 9: Kids and Family   6
genre_counts <- df %>% count(Genres)

Finds the probability from the amount of movies that are listed

genre_counts<-genre_counts %>% mutate( probility = n/148)
genre_counts
##                       Genres  n   probility
## 1      genre 10: Documentary  8 0.054054054
## 2           genre 11: Sci-Fi  9 0.060810811
## 3         genre 12: Thriller  3 0.020270270
## 4         genre 12: thriller  8 0.054054054
## 5            genre 1: Comedy 14 0.094594595
## 6             genre 2: Drama 19 0.128378378
## 7   genre 3: Romantic Comedy 14 0.094594595
## 8            genre 4: Action 40 0.270270270
## 9             genre 5: Crime  1 0.006756757
## 10          genre 6: Fantasy  1 0.006756757
## 11          genre 7: History  1 0.006756757
## 12           genre 8: Horror  4 0.027027027
## 13  genre 9: Kids and Family 19 0.128378378
## 14 genre 9: Kids and Family   6 0.040540541

#Tried a small sample so we can find the amount that is potentially watched and see if the greater amount of genres that are most watched still higher of a probability

sample_count <-sample_n(df, 10) %>% count(Genres)
sample_count
##                      Genres n
## 1     genre 10: Documentary 1
## 2           genre 4: Action 5
## 3          genre 6: Fantasy 1
## 4  genre 9: Kids and Family 2
## 5 genre 9: Kids and Family  1

That same sample of the 10 movies that are given a experimental probability of how likely that are more watched express their interest ina genre based on the increase of probability.

sample_count<-sample_count %>% mutate(probility = n/10)
sample_count
##                      Genres n probility
## 1     genre 10: Documentary 1       0.1
## 2           genre 4: Action 5       0.5
## 3          genre 6: Fantasy 1       0.1
## 4  genre 9: Kids and Family 2       0.2
## 5 genre 9: Kids and Family  1       0.1

This will be our 2nd sample for in search of another experimental probability if we increased the number by 4 more movies

sample_count2 <-sample_n(df, 14) %>% count(Genres)
sample_count2
##                     Genres n
## 1         genre 11: Sci-Fi 1
## 2       genre 12: thriller 2
## 3          genre 1: Comedy 3
## 4           genre 2: Drama 2
## 5          genre 4: Action 2
## 6          genre 8: Horror 2
## 7 genre 9: Kids and Family 2

#This shows an increase of the probability

#This gives us the probability when we increased it by 4 more Movies

sample_count2<-sample_count2 %>% mutate(probility = n/14)
sample_count2
##                     Genres n  probility
## 1         genre 11: Sci-Fi 1 0.07142857
## 2       genre 12: thriller 2 0.14285714
## 3          genre 1: Comedy 3 0.21428571
## 4           genre 2: Drama 2 0.14285714
## 5          genre 4: Action 2 0.14285714
## 6          genre 8: Horror 2 0.14285714
## 7 genre 9: Kids and Family 2 0.14285714

#This is our 3rd sample but with a much lowered number than our last test run to see what will our probability will change to and if it will increase the chances more or less

sample_count3 <-sample_n(df, 5) %>% count(Genres)
sample_count3
##                     Genres n
## 1           genre 2: Drama 2
## 2          genre 4: Action 2
## 3 genre 9: Kids and Family 1

#Here we are given our probability for our 3rd sample

sample_count3<-sample_count3 %>% mutate(probility = n/5)
sample_count3
##                     Genres n probility
## 1           genre 2: Drama 2       0.4
## 2          genre 4: Action 2       0.4
## 3 genre 9: Kids and Family 1       0.2

#From here is another experiment for a different amount of movies for a 4th sample

sample_count4 <-sample_n(df, 24) %>% count(Genres)
sample_count4
##                      Genres n
## 1     genre 10: Documentary 2
## 2          genre 11: Sci-Fi 4
## 3           genre 1: Comedy 1
## 4            genre 2: Drama 4
## 5  genre 3: Romantic Comedy 1
## 6           genre 4: Action 8
## 7           genre 8: Horror 1
## 8  genre 9: Kids and Family 1
## 9 genre 9: Kids and Family  2
sample_count4<-sample_count4 %>% mutate(probility = n/24)
sample_count4
##                      Genres n  probility
## 1     genre 10: Documentary 2 0.08333333
## 2          genre 11: Sci-Fi 4 0.16666667
## 3           genre 1: Comedy 1 0.04166667
## 4            genre 2: Drama 4 0.16666667
## 5  genre 3: Romantic Comedy 1 0.04166667
## 6           genre 4: Action 8 0.33333333
## 7           genre 8: Horror 1 0.04166667
## 8  genre 9: Kids and Family 1 0.04166667
## 9 genre 9: Kids and Family  2 0.08333333

Analysis and synthesize We realized that each probability is different as the number of movies and genres change, so do the probabilities. Each of the samples were experiments to see how much do the probabilities change or if from the most watched movie from this individuals list explains its preference as many of the movies were mostly categorized as Action for the genre which explains how it mainly equaled to other movies or it became the most that was watched more constantly. The use of this type of simulation is used quite often such as flipping a coin, or throwing a dice, or even weather forecasting which is all based on the probability of what is likely to happen based on passed occurrences that has happened to predict it. This simulation of probabilities is one of many, but one that is very often known and used.