fm3_problems29 - Exercise 1 Most Elementary Random List run...

Info icon This preview shows pages 1–15. Sign up to view the full content.

View Full Document Right Arrow Icon
Exercise 1 Page 1 Most Elementary Random List run VBA "randomlist": press [ctrl]+q Runs 200 Bins 0 0 Output 0.05 7 <-- =FREQU 0.198011577129364 0.1 7 0.495484948158264 0.15 10 0.374976456165314 0.2 12 0.858267068862915 0.25 8 0.730599820613861 0.3 8 0.084487795829773 0.35 6 0.297665178775787 0.4 9 0.271109104156494 0.45 11 0.199349105358124 0.5 11 0.806413769721985 0.55 11 0.997365772724152 0.6 14 0.825571775436401 0.65 10 0.825267732143402 0.7 9 0.310737967491150 0.75 11 0.588152945041657 0.8 15 0.991930961608887 0.85 9 0.760028064250946 0.9 9 0.454943299293518 0.95 9 0.560077965259552 1 14 0.112532854080200 0.539091527462006 0.945145487785339 0.857293665409088 0.167418956756592 0.784833610057831 0.226718068122864 0.206179440021515 0.789951086044312 0.159668862819672 0.624917387962341 0.693466246128082 0.532436370849609 0.569175899028778 0.735507607460022 0.594361603260040 0.381752252578735 0.615222394466400 0.065385699272156 0.450674593448639 0.524971485137939 0.299090087413788 0.923206448554993 0.398940861225128 0.364987134933472 0.974599778652191 1 1 1 1
Image of page 1

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

View Full Document Right Arrow Icon
Exercise 1 Page 2 0.560007452964783 0.748547613620758 0.786137580871582 0.551236331462860 0.559834122657776 0.809858620166779 0.669831514358521 0.947273671627045 0.480364680290222 0.972339212894440 0.660172939300537 0.792899787425995 0.743535161018372 0.032681286334992 0.179586172103882 0.383341729640961 0.776164412498474 0.772928297519684 0.694440841674805 0.881990611553192 0.400579094886780 0.788600265979767 0.230676889419556 0.773526608943939 0.475238680839539 0.566818773746491 0.139429569244385 0.567043960094452 0.785360455513001 0.814431965351105 0.112654447555542 0.749175965785980 0.183544516563416 0.036139547824860 0.448752403259277 0.987219989299774 0.980398774147034 0.362617790699005 0.568194627761841 0.582262456417084 0.585163950920105 0.628644526004791 0.779147624969482 0.172303855419159 0.396338582038879 0.701224148273468 0.293098211288452 0.685383737087250 0.942304015159607 0.057712614536285 0.490478515625000 0.542705714702606 0.271949410438538
Image of page 2
Exercise 1 Page 3 0.613942444324493 0.436290979385376 0.111762464046478 0.595296740531921 0.802347719669342 0.645733356475830 0.409460723400116 0.174125790596008 0.900089085102081 0.099823713302612 0.055246293544769 0.462599158287048 0.607178747653961 0.511025428771973 0.474229037761688 0.497887253761292 0.874605476856232 0.838872194290161 0.350307881832123 0.540793299674988 0.982459604740143 0.055593013763428 0.329295814037323 0.966378331184387 0.868058025836945 0.161737203598022 0.972044885158539 0.404586195945740 0.704069197177887 0.451799392700195 0.957571208477020 0.130868554115295 0.726638138294220 0.029844522476196 0.536179959774017 0.706809878349304 0.313511431217194 0.575132846832275 0.232590377330780 0.870752453804016 0.312162220478058 0.357744932174683 0.799060761928558 0.678421378135681 0.617915213108063 0.504206657409668 0.418513476848602 0.893549561500549 0.002071678638458 0.513114213943481 0.157659947872162 0.628502726554871 0.190034449100494
Image of page 3

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

View Full Document Right Arrow Icon
Exercise 1 Page 4 0.020759105682373 0.670125663280487 0.234904408454895 0.189432919025421 0.816753149032593 0.149575173854828 0.444260954856873 0.868248045444489 0.109653472900391 0.532837092876434 0.758586525917053 0.782937347888947 0.042587518692017 0.953029096126556 0.091028094291687 0.256559908390045 0.458878040313721 0.442682921886444 0.656490445137024 0.706901371479034 0.917668104171753 0.886869370937347 0.112261176109314 0.224598944187164 0.959546089172363 0.226323306560516 0.948635697364807 0.401266396045685 0.622170686721802 0.910568654537201 0.129542231559753 0.407619059085846 0.205895900726318 0.601043403148651 0.983166813850403 0.321598827838898 0.289396047592163 0.124224603176117 0.342578291893005 0.706499159336090 0.995290756225586 0.674753367900848 0.936353325843811 0.439090073108673 0.505769968032837 0.268559873104095 0.029201388359070 0.787743151187897 0.828218936920166
Image of page 4
Exercise 1 Page 5 UENCY(B8:B639,F6:F26) 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1 0 2 4 6 8 10 12 14 16
Image of page 5

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

View Full Document Right Arrow Icon
Exercise 1 Page 6
Image of page 6
Exercise 1 Page 7
Image of page 7

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

View Full Document Right Arrow Icon
Exercise 1 Page 8
Image of page 8
Exercise 2 Page 9 To run the macro, use [Ctrl] + r. The output depends on the seed, so to get different output, you must put in a different seed. Seed -3 Exer2Output VBA code Exer2Runs 16 0.01 Sub Exercise2() 0.36 0.14 N = Range("Exer2Runs").Value 0.19 ReDim Exer2Random(0 To N) A 0.38 Range(Range("Exer2Output").C 0.29 0.09 For Index = 1 To N 0.1 If Index = 1 Then 0.4 X1 = Range("Seed") + App 0.81 X2 = Exp(5 + Log(X1)) 0.74 Exer2Random(1) = X2 - In 0.38 Else 0.29 X1 = Exer2Random(Index 0.36 X2 = Exp(5 + Log(X1)) 0.84 Exer2Random(Index) = X2 0.15 End If Next Index For Index = 1 To N Range("Exer2Output").Cells( Next Index End Sub Make sure that Seed > - π.
Image of page 9

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

View Full Document Right Arrow Icon
Exercise 2 Page 10 e As Variant Cells(1, 1), Range("Exer2Output").Cells(15000, 1)).ClearContents plication.Pi() nt(X2) x - 1) + Application.Pi() 2 - Int(X2) (Index, 1) = Exer2Random(Index)
Image of page 10
Exercise 3 Page 11 To run the macro, use Ctrl + t Exer3Runs 26 Exer3Output 0 0 Notice that the "random" numbers take a 0 while to get going! If you're using this metho 0 you generally start choosing "random" numbe 0 starting from the 100th number ... . 0 0.01 0.06 Sub Exercise3() 0.4 0.82 N = Range("Exer3Runs").Value 0.77 ReDim Exer3X(0 To N) As Double 0.41 Exer3X(0) = 1 0.89 ReDim Exer3Random(0 To N) As Double 0.23 Range(Range("Exer3Output").Cells(1, 1), R 0.62 0.31 For Index = 1 To N 0.14 Exer3X(Index) = (7 * Exer3X(Index - 1)) 0.98 Exer3Random(Index) = Exer3X(Index) / 0.85 Next Index 0.98 0.83 For Index = 1 To N 0.83 Range("Exer3Output").Cells(Index, 1) = 0.81 Next Index 0.66 0.65 End Sub 0.54
Image of page 11

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

View Full Document Right Arrow Icon
Exercise 3 Page 12 Brute-force spreadsheet implementati of this method od, X U ers 2 14 0.000000 98 0.000001 686 0.000007 4802 0.000048 33614 0.000336 235298 0.002353 1647086 0.016471 11529602 0.115296 80707214 0.807072 Range("Exer3Output").Cells(15000, 1)).ClearContents 64950498 0.649505 54653486 0.546535 82574402 0.825744 Mod (10 ^ 8) 78020814 0.780208 10 ^ 8 46145698 0.461457 23019886 0.230199 61139202 0.611392 27974414 0.279744 Exer3Random(Index) 95820898 0.958209 70746286 0.707463 95224002 0.952240 66568014 0.665680
Image of page 12
Exercise 3 Page 13 ion
Image of page 13

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

View Full Document Right Arrow Icon
Exercise 4 Page 14 Run the macro by pressing [Ctrl] + w your daily number pick 130 <-- Put in a number between 000 and 999 number of times you Exer4Output won 0 <-- =DCOUNTA(F7:F257,1,I7:I8) 839 138 There are other ways to do this, 368 but this is the neatest. 240 122 Cost 250 417 Winnings 0 402 Net profit -250 774 862 419 974 571 177 608 255 435 715 852 203 802 234 687 770 127 431 836 356 525 19 969 508 665 59 723 878 907 530 968 421 695 164 319 853 195 524 905 An Excel function that produces an integer between 000 and 999 is =Int(Rand()*1000) .
Image of page 14
Image of page 15
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern