Question: R code ::: repeat the game snakes and ladders for a single player and work out how many turns it takes on average to reach

R code ::: repeat the game snakes and ladders for a single player and work out how many turns it takes on average to reach the 100th square. Repeat this simulation 500times and plot the distribution of the number of turns taken to reach the 100th square. Explain what you observe in the distribution briefly
incorporate and FIX the code below
set.seed(42)
max_turns <-10
position <-4
max_position <-100
n_sides_die <-10
for (turn in 1:max_turns){ die_roll <- sample.int(n_sides_die, 1) position <- position + die_roll if (position >= max_position){ break }}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!