# Untitled

a guest
May 8th, 2021
118
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. scenario1 <- function(){
2.   ## simulate great vs good player a la Hip's probabilities
3.   if (runif(1,0,1) <= .6 ){
4.     great_vs_good = 'great'
5.   } else{
6.     great_vs_good = 'good'
7.   }
8.   ## simulate great vs bad player a la Hip's probabilities
9.   if (runif(1,0,1) <= .9){
11.   } else{
13.   }
14.   ## simulate great vs good player a la Hip's probabilities
15.   if (runif(1,0,1) <= .6){
17.   } else{
19.   }
20.   ## concatenate results
22.
23.   ## check for round robin re-do
24.   if (length(unique(check_winner)) == 3){
25.     winner = 'none'
26.   } else{
27.     winner = names(table(check_winner))[which.max(table(check_winner))]
28.   }
29.   return(winner)
30. }
31.
32. scenario2 <- function(){
33.   ## great vs good scenario 2
34.   if (runif(1,0,1) <= .62 ){
35.     great_vs_good = 'great'
36.   } else{
37.     great_vs_good = 'good'
38.   }
39.   ## great vs bad scenario 2
40.   if (runif(1,0,1) <= .95){
42.   } else{
44.   }
45.   ## good vs bad scenario 2
46.   if (runif(1,0,1) <= .8){