Riddler: Simulating a Circular Random Walk

Simulation

Notable topics: Simulation

Recorded on: 2020-11-22

Timestamps by: Alex Cookson

## Screencast

## Timestamps

Using `sample()`

and `cumsum()`

to simulate a random walk

Using `%%`

(modulo operator) to "close" the circle (set the number of people in the circle)

Using `crossing`

function to set up "tidy" simulation (gives you all possible combinations of values you provide it)

Using `distinct`

function and its `.keep_all`

argument to get only the first unique set of the variables you give it

Visualizing the number of steps it takes for the sauce to reach people at differents seats

Visualizing the distribution of number of steps it takes to reach each seat

Investigating the parabolic shape of average number of steps to reach a given seat

Using `lm`

and `I`

functions to calculate formula of the parabola describing average number of steps

Starting to vary the size of the table

Summary of screencast