In this article I want to give out a basic reusable infrastructure for quickly starting off with simulations and reporting the results.
I will give a step-by-step setup of simulations testbed using 4 different technologies:
- Excel Spreadsheets
- Excel VBA macro
I believe that the best way to learn something is to bring in an application (or example) in as soon as possible. So the layout of this article will be that I will describe a fictitious 'situation' and then I will go ahead and provide a step-by-step guide as how to model the 'situation' in computer tech (e.g. matlab, python,...).
The complete source code is available in Appendix A
Problem Definition (Example)
Say there are 1000 students and each students is given a die (small cube with the numbers 1 to 6 marked in dots on the sides used in gambling). Each student will roll the die once and the teacher will note that value (the number of dots on the side facing up) of the roll. Now, we are interested in the average (or the expected value) of this process.
Note: This is a very simple example which might not make a lot of sense in real life, but this will show us how simulations are useful. You can later extend this example into more complicated ones like ones given in Monte Carlo Simulation & Analytical Hierarchy Process.
To the problem given above we can take 3 approaches to get to the solution:
- Using the principals of probability and mathematics to get the expected value (average in our example) for the result.
- Gather 1000 students; give each one of them a die; get a teacher; ask each student to roll the die and have the teacher note the result in a notebook; then take the average of the 1000 results. Good luck!
- Using simulations: Write a computer program that simulates 1000 students, the properties of a die roll & the teacher who keeps record of the dice rolls. Have the computer create the report result.
I will talk about solutions 1 and 2 briefly next, then I will work on solution 3 and give you different infrastructures for simulations.