Message Boards Message Boards

0
|
5053 Views
|
12 Replies
|
3 Total Likes
View groups...
Share
Share this post:

Find mean of the minimum of N uniformly distributed random variables

Posted 4 years ago

I want to find the mean of the minimum of N uniformly distributed random variables. I used to the following code to find it for two random variables X1 and X2

a = 0; b = 1; Num = 1000000;
X1 = RandomReal[UniformDistribution[{a, b}], Num];
X2 = RandomReal[UniformDistribution[{a, b}], Num];
W = Table[Min [X1[[i]], X2[[i]]], {i, 1, Num}];
Print["The mean for the minimum set is ", Mean[W]]
POSTED BY: Bilal Owaidat
12 Replies
Posted 4 years ago

That is exactly what my answer is.

POSTED BY: Jim Baldwin
Posted 4 years ago

Thank you, what about the maximum?

POSTED BY: Bilal Owaidat
Posted 4 years ago

The documentation will tell you to change the 1 to n in the code I gave to get the maximum. (For a Uniform distribution there's no need to perform simulations with a specific sample size. There is an exact answer for a general sample size.)

POSTED BY: Jim Baldwin
Posted 4 years ago
Mean[OrderDistribution[{UniformDistribution[{a, b}], n}, 1]] // FullSimplify
(* (b + a n)/(1 + n) *)
POSTED BY: Jim Baldwin
Posted 4 years ago

I need to find the Mean of the minimum of N uniformly distributed random variables, does your answer include that?

POSTED BY: Bilal Owaidat
Posted 4 years ago

Hi Bilal,

Here is one way to do it

n = 2;
Table[RandomReal[UniformDistribution[{a, b}], Num], n] // MapThread[Min, #] & // Mean
POSTED BY: Rohit Namjoshi
Posted 4 years ago

enter image description here

I get the following error when I used your code, any idea?

POSTED BY: Bilal Owaidat
Posted 4 years ago

It should work fine. Please post code, not an image so we can run exactly what you ran. The image shows boxes for // what is that?

POSTED BY: Rohit Namjoshi
Posted 4 years ago
a = 0; b = 1; Num = 1000000; n = 2;
Table[RandomReal[UniformDistribution[{a, b}], Num], n] // 
  MapThread[Min, #] & // Mean

This is the code I used

POSTED BY: Bilal Owaidat
Posted 4 years ago

I cut and pasted that code and it ran without any errors.

POSTED BY: Rohit Namjoshi
Posted 4 years ago

That's strange, I tried it again and the same error occurred. I am running it on a old version of Mathematica (9.0) , maybe that is the problem.

POSTED BY: Bilal Owaidat
Posted 4 years ago

I'll try it on another Mathematica version. Which version do you have?

POSTED BY: Bilal Owaidat
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract