MAT013 - Example Challenge Solution

Vince Knight

www.vincent-knight.com

###The Problem --- 4 methods of playing a stochastic game: which one is better?

Pulling in the data


shut_the_box_data<-read.csv("Data_for_Analysis.csv")

Compartementalising the data



Greedy<-data.frame(Score=shut_the_box_data$Greedy_Score,Game_Length=shut_the_box_data$Greedy_History)
Greedy$Method<-"greedy"
Random<-data.frame(Score=shut_the_box_data$Random_Score,Game_Length=shut_the_box_data$Random_History)
Random$Method<-"random"
Shortest<-data.frame(Score=shut_the_box_data$Shortest_Score,Game_Length=shut_the_box_data$Shortest_History)
Shortest$Method<-"shortest"
Longest<-data.frame(Score=shut_the_box_data$Longest_Score,Game_Length=shut_the_box_data$Longest_History)
Longest$Method<-"longest"
                        

Getting Summary Statistics




mean(Random$Game_Length, na.rm=TRUE)
mean(Shortest$Game_Length, na.rm=TRUE)
mean(Longest$Game_Length, na.rm=TRUE)
mean(Greedy$Game_Length, na.rm=TRUE)

                        

Results


(Demo of code, pictures, graph...?)