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

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 fnd 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 ±unction. 3. Generate one random number between 0 and 1. Locate it between two outputs oF the CD±. 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 CD± — 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 DocumentRight 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

This note was uploaded on 10/12/2011 for the course MATH 464 taught by Professor Dougbullock during the Fall '08 term at Boise State.

Page1 / 2

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

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online