What I am trying to do: In American roulette, the payout for winning on green is $17. This means that if you bet $1 and it lands on green, you get $17 as a prize.
The output I desire: Create a sampling model to predict winnings from betting on green.
# Use the `set.seed` function to make sure your answer matches the expected result after random sampling.
set.seed(1)
# The variables 'green', 'black', and 'red' contain the number of pockets for each color
green <- 2
black <- 18
red <- 18
# Assign a variable `p_green` as the probability of the ball landing in a green pocket
p_green <- green / (green+black+red)
# Assign a variable `p_not_green` as the probability of the ball not landing in a green pocket
p_not_green <- 1 - p_green
#Create a model to predict the random variable `X`, your winnings from betting on green.
X <- sample(17,1,prob = p_green)
#> Error in sample.int(x, size, replace, prob): incorrect number of probabilities
# Print the value of `X` to the console
X
#> Error in eval(expr, envir, enclos): object 'X' not found