BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Suppose a one unit line is divided randomly in two pieces. How can I use simulation to find E(the short piece divided by the long piece)?

Thank You!
3 REPLIES 3
Paige
Quartz | Level 8
You can't find E(the short piece divided by the long piece) via simulation, if I am understanding you properly, that E is Expected value.

You can find the mean of the randomly generated numbers.
SteveDenham
Jade | Level 19
I love "A-ha" moments. I prepared the following, and thought it a neat approach, but then the "A-ha" occurred shortly before posting. I offer the following in quotes, and give the "A-ha" afterwards.

"I'm curious as to why you can't find this. If X is a random value from the univariate distribution on [0,1] and Y is 1-X, then I would think that the formula (via a Taylor's series expansion) could be applied:

E(X/Y) = E(X)/E(Y) * [1 + (V(Y)/(E(Y)^2) - (cov(X,Y)/E(X)*E(Y))]

where E(a) is the expected value of a, V(a) is the variance of a, and cov(a,b) is the covariance between a and b. By using the sample values for each run of the simulation, approximate values of E(X/Y) could be calculated, and then averaged across all runs. It seems like a perfect bootstrap opportunity. I must be missing something here."

Well, I missed a key something. The OP wants the short divided by the long. Consequently, X and Y as I tried to define them do not meet this definition. Sometimes X>Y, sometimes Y>X, so they do NOT define the short and the long pieces. I suppose that if you think about this hard enough, you see that the ratio would follow some kind of Cauchy distribution, implying that the expectation doesn't exist. One could simulate as much as you want, but the thing you end up calculating? I don't know what to call it.

Cool.

Steve Denham
Paige
Quartz | Level 8
Steve

I agree with your comments.

My point is that E(X), E(Y), etc. etc. are quantities that cannot be computed via simulation. E(X), E(Y) and the other moments are integrals, and SAS doesn't do integrals. You cannot evaluate integrals via simulation. You can however obtain an ESTIMATE of E(X), or E(Y), or E(the short piece divided by the long piece) via simulation.

sas-innovate-white.png

🚨 Early Bird Rate Extended!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.

 

Lock in the best rate now before the price increases on April 1.

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 1580 views
  • 0 likes
  • 3 in conversation