{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

ws05 - distribution 1 Generate one random number using the...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Math 464, Worksheet 5 Today the goal is to speed up the random trial process. Recall that last time, you needed to generate 100 random numbers to find out how many new animals were born to 100 animals. Here’s how you can do it with just one random number: 1. Compute the binomial distribution P ( k ) = 100! n !(100 - n )! (0 . 03) k (0 . 97) 100 - k for each number k = 0 , 1 , 2 , . . . 100. You can do this in Excel. 2. Integrate it. That is, for each number k , add up P (0)+ P (1)+ · · · + P ( k ). This is often called the binomial Cumulative Distribution Function. 3. Generate one random number between 0 and 1. Locate it between two outputs of the CDF. The upper input is the number of new animals. 4. Repeat for the next day. Replace the ”100” in the binomial distribution with a the current number of animals. Even this trick requires you to generate a column of numbers — the CDF — and then examine it before you get the next day’s number. There is a better way. You can get Excel to spit out random numbers that don’t land uniformly between 0 and 1. You can get them to come out in a normal
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: distribution. 1. Generate one random number using the Formula x = sin(2 π RAND()) r-2 ln(RAND()) 2. Random numbers generated this way will distribute normally, with mean 0 and standard deviation 1. We want mean to be the expected number oF animals and the standard deviation to match that oF a binomial distribution. IF there are N animals: (a) Compute the mean: μ = 0 . 03 N . (b) Compute the std deviation: σ = r N (0 . 03)(0 . 97). (c) Rescale your random number: σx + μ . 3. This is the number oF new animals. Sorry, it won’t be an integer. But it’s a very good approximation and easy to repeat. Repeat it For, say, 100 days. 4. Graph the population Function. 1 5. If you did this with Excel, you can change all the random numbers by just recopying any one cell. Do this and watch the graph change. Bonus weekend exercise: Use this technique on the model with Δ N = 1 5000 (250 N-N 2 ) 2...
View Full Document

{[ snackBarMessage ]}