(New page: I believe that by saying X=drand48() Y=drand48() because the drand48() function produces indep RVs you can say: D=X^2+Y^2 Just like in problem 4 of homework 6.)
 
(Brian Thomas Rhea HW7 -- Apologies for my tardiness in getting this up!)
 
Line 9: Line 9:
  
 
Just like in problem 4 of homework 6.
 
Just like in problem 4 of homework 6.
 +
 +
----
 +
 +
Your suggestion isn't quite like problem 4 of homework 6.  Recall that in the case of the problem cited, X and Y were ''Gaussian'' RV's.
 +
 +
HW6.4 generated an exponential RV from two Gaussian RV's.  So, our strategy should be to go in reverse -- that is, to generate a Gaussian RV from one or more exponential RV's.
 +
 +
We can generate exponential RV's using the template established in HW7.1b:
 +
 +
*Let <math>F(x)=1-e^{-\lambda x} (x \geq 0)</math>
 +
*Then, as per HW7.1b, if we assign an RV <math>D=F^{-1} (\text{drand48()})</math>, we know that D will be ~exp(<math>\lambda</math>).
 +
*The only thing left in this step, then, is to find <math>F^{-1}(x)</math> for any x, so that we know what number we generate for a given input.  Since we know that <math>F(x)=1-e^{-\lambda x}</math>, it is easy to show that <math>F^{-1}(x)=\frac{-\ln(1-x)}{\lambda}</math>
 +
*Thus, <math>D=\frac{-\ln(1-\text{drand48()})}{\lambda}</math>
 +
 +
Does anybody have a suggestion on where to proceed from here?
 +
 +
--[[User:Thomas34|Thomas34]] 20:08, 20 October 2008 (UTC)

Latest revision as of 16:08, 20 October 2008

I believe that by saying

X=drand48() Y=drand48()

because the drand48() function produces indep RVs you can say:

D=X^2+Y^2

Just like in problem 4 of homework 6.


Your suggestion isn't quite like problem 4 of homework 6. Recall that in the case of the problem cited, X and Y were Gaussian RV's.

HW6.4 generated an exponential RV from two Gaussian RV's. So, our strategy should be to go in reverse -- that is, to generate a Gaussian RV from one or more exponential RV's.

We can generate exponential RV's using the template established in HW7.1b:

  • Let $ F(x)=1-e^{-\lambda x} (x \geq 0) $
  • Then, as per HW7.1b, if we assign an RV $ D=F^{-1} (\text{drand48()}) $, we know that D will be ~exp($ \lambda $).
  • The only thing left in this step, then, is to find $ F^{-1}(x) $ for any x, so that we know what number we generate for a given input. Since we know that $ F(x)=1-e^{-\lambda x} $, it is easy to show that $ F^{-1}(x)=\frac{-\ln(1-x)}{\lambda} $
  • Thus, $ D=\frac{-\ln(1-\text{drand48()})}{\lambda} $

Does anybody have a suggestion on where to proceed from here?

--Thomas34 20:08, 20 October 2008 (UTC)

Alumni Liaison

Correspondence Chess Grandmaster and Purdue Alumni

Prof. Dan Fleetwood