This preview shows page 1. Sign up to view the full content.
98
Chapter 16.
Solutions: Monte Carlo Principles
CHALLENGE 16.4.
function y = strange_random()
% We subtract 2 from the average sample value for randmy, to make the mean 0.
% Then we divide by the standard deviation, to make the resulting variance 1.
y = sqrt(1000)*(sum(randmy(1000))/1000  2)/sqrt(5);
This is the end of the preview. Sign up
to
access the rest of the document.
Unformatted text preview: CHALLENGE 16.5. In this program, z is a sample from a uniform distribution on [0,1] and y is a sample from the desired distribution. z = rand(1); if (z < .6) then y = 0; else y = 1; end...
View
Full
Document
This note was uploaded on 01/21/2012 for the course MAP 3302 taught by Professor Dr.robin during the Fall '11 term at University of Florida.
 Fall '11
 Dr.Robin

Click to edit the document details