By Kardi Teknomo, PhD .

Monte Carlo Simulation Tutorial: Bias Coin

< Previous | Next | Contents >

Now suppose you want to make Monte Carlo Simulation of unfair coin. You determine specific probability Monte Carlo Simulation Tutorial: Bias Coin to get one of the faces of the coin. If the probability to get zero is Monte Carlo Simulation Tutorial: Bias Coin and the probability to get one is Monte Carlo Simulation Tutorial: Bias Coin , we can generate a biased coin using the following formula

Formula Monte Carlo Simulation Tutorial: Bias Coin

Random number Monte Carlo Simulation Tutorial: Bias Coin that unformly distributed is generated according to previous page . To put this formula in action, I have made a worksheet in MS Excel. You may download it here . The explanation of how to use the worksheet is given below .

How does the formula work?

Monte Carlo Simulation Tutorial: Bias Coin

Monte Carlo Simulation Tutorial: Bias Coin maps the value of Monte Carlo Simulation Tutorial: Bias Coin from Monte Carlo Simulation Tutorial: Bias Coin into range of Monte Carlo Simulation Tutorial: Bias Coin . The Monte Carlo Simulation Tutorial: Bias Coin function will round down all values below 1 into 0 and round down all values between 1 and Monte Carlo Simulation Tutorial: Bias Coin into 1.

If the value of Monte Carlo Simulation Tutorial: Bias Coin is either -1 or 1, then the formula change into Monte Carlo Simulation Tutorial: Bias Coin .

In general, if we would like to get the value of Monte Carlo Simulation Tutorial: Bias Coin is either Monte Carlo Simulation Tutorial: Bias Coin or Monte Carlo Simulation Tutorial: Bias Coin , where Monte Carlo Simulation Tutorial: Bias Coin with some biased probability Monte Carlo Simulation Tutorial: Bias Coin to get Monte Carlo Simulation Tutorial: Bias Coin , then

Monte Carlo Simulation Tutorial: Bias Coin

The expected mean is Monte Carlo Simulation Tutorial: Bias Coin and the expected variance is Monte Carlo Simulation Tutorial: Bias Coin or Monte Carlo Simulation Tutorial: Bias Coin

How to use the worksheet?

Worksheet companion of this biased coins tutorial can be downloaded here

The sample worksheet uses the two methods above to compute unfair coins. Of course, in many cases you may need to use this more general formula to make 2 integers (not only zero and one, but any numbers Monte Carlo Simulation Tutorial: Bias Coin and Monte Carlo Simulation Tutorial: Bias Coin )

Every time you press F9, it generates one sampling experiment of Monte Carlo Simulation. If you delete the word "STOP", every time you press F9, you are not only making one sample of numerical simulation; you will add the statistics of the sampling to all samples results. In this way, actually obtain full simple program of Monte Carlo Simulation.

To use the worksheet fully, delete the word "STOP" and press F9 repeatedly. If you don't delete the STOP, the simulation will still work but the result of all experiments are simply copies of the current experiment. Write any letter or number on that Blue cell to reset the counter.

The formula for mean and variance are recursive. You may see more explanation about this recursive formula in my tutorial on Recursive Statistics . If you are still confuse on how to use iteration in MS Excel, please read my tutorial on MS Excel Iteration .

< Previous | Next | Contents >

Give your comments, questions or suggestions for this tutorial

This tutorial is copyrighted .

Preferable reference for this tutorial is

Teknomo, Kardi. Monte Carlo Simulation Tutorial. https:\\people.revoledu.com\kardi\ tutorial\Simulation