1
$\begingroup$

See this SO thread: Calculating which item is next in a percentage distribution.

To summarize,

you calculate

max ((rand1 * 10), (rand2 * 20), (rand3 * 30), (rand4 * 40))

for four random numbers in a range (say 1-100).

If the max is

rand1 * 10, you choose 'A'
rand2 * 20, you choose 'B'
rand3 * 30, you choose 'C'
rand4 * 40, you choose 'D'

What is the expected distribution of choosing A, B, C and D?

How to derive it mathematically?

(Using some C code, the percentages come out to be 1, 10, 31 and 56 respectively)

  • 0
    What is the distribution of the random numbers?2010-09-05
  • 0
    @Rasmus: uniform distribution (each has equal probability), forgot to mention this.2010-09-06

2 Answers 2

2

The probabilities are given by:

$p_i = \int_0^1 \prod_{j \in {1,2,3,4}, j\ne i} min(\frac{ix}{j},1) dx, i = 1, 2, 3, 4$

each factor in the integrand computes the probability density that the i-th random variable is larger than the j-th one.

The exact result is

[1/96, 31/288 91/288 163/288]

  • 0
    Can you please mention how to derive this? That would be more useful.2010-09-05
  • 0
    Consider four random variables R1, R2, R3, R4 uniformly distrbuted in [0,1]. The probability space is a four dimensional hypercube of length 1. Consider for example the case C, where 3R3 is required to be the maximal. Suppose that R3 = x,the probability that 3R3 exceeds 2R2 is 3x/2 if x<2/3 and 1 if x>=2/3 because probabilities cannot exceed 1. All the factors in the integral are constructed according to this rule. The probabilities are multiplied because 3R3 is required to be greater than x1 and 2R2 and 4R4 and the integration is because x can take any value between zero and one uniformly.2010-09-05
1

Suppose you only had three random numbers between 0 and 1. Point (x,y,z)=(rand1*10,rand2*20,rand3*30) falls uniformly inside parallelepiped with dimensions 10,20,30. Sets x>y&&x>z, y>x&&y>z, z>x&&z>y partition this parallelepiped into 3 parts, as pictured below, and their relative volumes represent the fraction of the time that x, y or z are the maximum value, respectively. Working out expression for the volumes should give you the integral expression David gave above.

  • 0
    wow! nice explanation and diagrams! how did you generate these figures?2010-09-06
  • 0
    Mathematica -- RegionPlot3D[x>=y&&x>=z,{x,0,10},{y,0,20},{z,0,30}]2010-09-06