Intro. to Risk Analysis, Fall 2001

ASSIGNMENT FOR FRIDAY, OCTOBER 12

COMMENTS:

1.The purpose of this assignment is two-fold: First, to reinforce the ideas of a binomial random variable as a sum of binary random variables and the Central Limit Theorem; second, to give you some practice with simulations before we do some risk analysis simulations.

2. You may do this assignment either by yourself or with one other student. If you choose the latter option, please hand in just one paper for the pair.

3. You may use any software you choose, as long as you either write your own code or otherwise work out the simulation step-by-step yourself. In other words, you may not use software or someone else's macro that will give you the results by typing in a few parameters and clicking.

4.If you write your own code, please hand in your code. If you use menu driven software such as Excel or Software, please hand in a brief description of the procedure you used. There are some pointers on the web about how to use Minitab and Excel for this problem

5. Contrary to what I said in the first day handout, Excel isn't particularly convenient for this assignment; Minitab works more easily. However, if you are familiar with Excel but not Minitab, you may find it easier to work with Excel -- and you might know better ways than I do to use Excel. To the best of my knowledge, however, you can't draw the histogram and the normal curve together in Excel; you will need to add the normal curve by hand. If you do choose this option, I will expect a careful drawing -- not just one that seems to fit, but one that shows whether or not the normal curve fits. (Alternatively, you might start with the normal curve, and then add in the histogram -- carefully -- by hand.)

 

PROBLEM: BINOMIAL SIMULATION

A. Simulate a sample from the binomial random variable with p = 0.5 and n = 10 by creating ten binary random variables with values 0 and 1 (each with probability 0.5) and summing them. Use at least 1000 samples from the ten binary random variables. Draw a histogram of your final result, superimposing a normal curve that, by the Central Limit Theorem, should approximate the histogram. Hand in:

a. The first ten samples from each of the ten binary variables plus the sum.

b. Your graph (histogram plus superimposed normal curve).

c. Your code or an outline of the steps you used.

Things to think about as you do this problem:

1. If you make a histogram (the usual way) with frequencies (i.e., counts), you will need to scale your normal curve by an appropriate factor (what factor?). The alternative is to make a "density histogram," scaled so that the area under it is one.

2. Think about what bins (intervals) are appropriate for your histogram. The default of your software probably will not be a good choice.

3. Think about what the appropriate mean and standard deviation for the approximating normal distribution are.

B. Do a second related simulation or group of simulations that you think is interesting. You may choose from one of the following, or something similar. (It would be a good idea to check it out with me if you choose "something similar."). Hand in the same three items as in part (A).

Choices:

1. Simulate a binomial random variable with p not equal to 1/2 as a sum of binary random variables. (You may need to use a bigger n to get something interesting; or you might try this for a couple of different values of n and compare.)

2. Do a simulation of a normal random variable by adding randomly drawn values from several different random variables. (For example, you might choose ten binary random variable, each with a different value of p; or ten different uniform random variables, etc.)