1/6
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
Monte Carlo simulation
still in the probability side
method of generating random data using the rules of probability

what is randomness
anything that isn’t perfectly predictable is subject to randomness, even things that are somewhat regular
random variable
any variable defined by:
a domain: possible values it can take on
function: way of mapping possible values onto numerical outcomes
probability distribution: rules governing how likely each numerical outcome is
random number generation in R
typically start with r
simulate single Bernoulli trial: rbinom(n = 1, size = 1, prob = .5)
n is the number of “draws”/samples taken
size number of trials per draw
prob probability of success on each trial
ifelse()
takes a vector and checks if a test condition is met (yes or no)
ifelse(test = event == 1, yes = "heads", no = "tails")
Monte Carlo procedure
proposed by Stanislow Ulam, John von Neumann and Nicholas Metropolis in the 40s
define domain
define probability distribution
draw random numbers
perform computation on random numbers
repeat many times
analyze distribution of computation outputs from each iteration
for loop
repeats a procedure for a finite number of times, each iteration is indexed
indexed outputs can thus be saved and analyzed after loop is complete