Get startedGet started for free

Simulation basics

1. Simulation basics

Now let's learn about simulations.

2. Simulations

Simulation is a framework that allows us to model real-world systems and processes. It's a very popular tool that has been applied in multiple domains. Simulations are typically characterized by repeated random sampling, which means that we use the power of random variables to generate multiple outcomes.

3. Simulations

Think of simulations as tossing a coin again and again to record the outcomes. Simulations typically give us an approximate solution. After recording the result of the coin tosses, you may find that after 100 tosses, you actually observe only 48 heads as opposed to 50. This is still a good enough approximation.

4. Simulations

Finally, as we'll see later in the course, using very simple modeling techniques, we can use simulations to solve pretty complex problems. Simulations perform particularly well in some areas where traditional methods don't give us a clean solution.

5. Simulation steps

Simulations typically involves the following steps. 1) Define the set of outcomes associated with a random variable. 2) Assign a probability to each of these outcomes - the probability distribution. 3) Define the relationship between multiple random variables. These three steps essentially describe our statistical model.

6. Simulation steps

4) Draw samples from the probability distributions. 5) Analyze the sample outcomes. This might seem daunting at first, but we'll work through an example in the exercises to make it more clear.

7. Simulating the dice game

In the following exercises, you will be running your first simulation - a simple dice game. The dice game involves throwing two dice and winning if they show the same number. Thus, seeing 1 & 4 is a loss while 3 & 3 is a win. Let's see what we need for this simulation. For step 1 and 2 we first define the outcomes of the die and assign a probability to each outcome. Since both die A and B are fair dice, we can use identical probability distributions. Also since the probability of seeing each outcome is the same, this is a uniform distribution.

8. Simulating the dice game

In step 3, we define the relationship between each of the dice. If they show the same number, we win, otherwise we lose. Steps 1, 2, and 3 give us the statistical model underlying the simulation. For any complex simulation, this is essentially the foundation - describing the model.

9. Simulating the dice game

Finally in step 4, we generate multiple outcomes through repeated random sampling. Keep in mind that there is an additional step 5 where we'll need to analyze the outcomes but for now, let's focus on the first 4 steps and make sure we are comfortable with them.

10. Let's practice!

You are now ready to run your first simulation, let's work through it in the exercises.

Create Your Free Account

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.