Chapter 25 - Page 432 Page 1 0.5643 0.8507 0.5078 0.8786...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Page 432 Page 1 0.5643 0.8507 0.5078 0.8786 <-- Rand() 0.9219 0.5273 0.0130 0.5403 0.4725 0.8868 0.8345 0.2471 0.7277 0.1037 0.3517 0.6124 0.8005 0.1846 0.4828 0.9542 0.0128 0.0258 0.3206 0.7737 0.9748 0.0544 0.6244 0.1660 0.4128 0.5969 0.1999 0.9591 0.9670 0.1379 0.0212 0.7008 Each cell contains thefunction Rand(). Each time you updatethe spreadsheet or press F9 the block ofcells will produce a new set of randomnumbers. A B C D E 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 UN-18A Most Elementary Random List To run VBA "randomlist": press [Ctrl]+q Runs 10 Sub randomlist() Output 'Produces a simple list of random numbers 0.4100732207 <-- This cell is named "output," Range("output").Range(Cells(1, 1), Cells(250, 1)).Clear 0.4127668142 and this name is used in the N = Range("runs").Value 0.7127304673 VBA routine in clearing 0.3262062073 previous results. For Index = 1 To N 0.6331788898 Range("output").Cells(Index, 1) = Rnd 0.2075611353 Next Index 0.1860135198 End Sub 0.5833590031 0.080714643 0.4579714537 The VBA code (can be found by pressing [Alt]+F11) A B C D E F G H I J K L M 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 UN-18B USING EXCEL'S FREQUENCY FUNCTION Random numbers Bin Frequency 0.9262 0.1 2 0.4493 0.2 0.0866 0.3 1 0.9392 0.4 0.2838 0.5 3 <-- =FREQUENCY(A5:A14,C5:C14) 0.4383 0.6 0.4220 0.7 2 0.6043 0.8 0.0627 0.9 0.6219 1 2 Each cell in the range A5:A14 contains the formula Rand(). Pressing F9 will produce a new set of random numbers and frequencies. A B C D E F G H 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 UN-18C Uniformly Distributed Random Numbers To run VBA program "uniformrandom", use [Ctrl]+a . Runs 1,000,000 Starttime 23:27:09 Bin Output Stoptime 23:27:11 1 99,862 Elapsed 0:00:02 2 99,706 3 99,762 4 100,291 5 99,952 6 100,708 7 100,057 8 99,757 9 99,706 10 100,199 Using VBA's Rnd function 1 2 3 4 5 6 7 8 9 10 9,000 19,000 29,000 39,000 49,000 59,000 69,000 79,000 89,000 99,000 109,000 VBA's Random Number Generator Bin Number of draws A B C D E F G H I 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 P a g e 4 36 - 4 37 P age 5- 0 .30 23- 1.27 6 8 B in F requenc y 0 .24 25 7- 3 1.276 4 74- 2.9 1.19 8 35- 2.8 1.73 13- 2.7 1- 2.18 35 9- 2.6- 0 .234 18- 2.5 3 1.0 9 5 0 23- 2.4 1 T o re p la c e the ra nd o m num b e rs ,- 1.0 8 6 7- 2.3 1 T o ls |D a t a A n a lys is |R a n d o m N u m b e r G e n e r a t io- 0 .6 9 0 2- 2.2- 1.6 9 0 4 3- 2.1 10- 1.8 4 6 9 1- 2 3- 0 .9 7 6 3- 1.9 3- 0 .7 35 1- 1.8 1- 2.1 79 3- 1.7 15- 0 .5 6 79 2- 1.6 13- 0 .4 0 4 0 5- 1.5 8 0 .134 8 5 3- 1.4 15- 0 .36 5 4 9- 1.3 15- 0 .326 9- 1.2 23- 0 .370 24- 1.1 18 1.34 26 4 2- 1 21- 0 .0 8 5 28- 0 .9 29- 0 .18 6 16- 0 .8 32- 0 .5 1321- 0 .7 32 1.9 72 12- 0 .6 35 0 .8 6 5 6 73- 0 .5 32 2.375 6 5- 0 .4 34- 0 .6 5 4 9 1- 0 .3 30 1.6 14 5 6- 0 .2 3- 1.6 124- 0 .1 4 1 0 .5 38 9 4 8 37 0 .9 0 219 1 0 .1 36 1.9 18 9 16 0 .2 37- 0 .0 8 4 5 2 0 .3 38- 0 .5 238 0 .4 25 0 .6 75 138 0 .5 34- 0 .38 132 0 .6 35 0 .75 76 1 0 .7 31- 1.4 4 19 0 .8 28- 0 .8 4 724 0 .9 35- 1.5 215 7- 1....
View Full Document

This note was uploaded on 02/02/2012 for the course BUSINESS 201 taught by Professor Acknan during the Spring '11 term at MIT.

Page1 / 7

Chapter 25 - Page 432 Page 1 0.5643 0.8507 0.5078 0.8786...

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

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