
Originally Posted by
ixander
i would like to generate random number from column D with effect on the probability from column A
Attachment 445043
See the "Correct Distrib" worksheet in the attached Excel file.
The formula that I use in A11:A10010 is (see the comment for A11):
=CHOOSE(MATCH(RAND(),$C$2:$C$7,1),RANDBETWEEN($D$3,$E$3),RANDBETWEEN($D$4,$E$4),
RANDBETWEEN($D$5,$E$5),RANDBETWEEN($D$6,$E$6),RANDBETWEEN($D$7,$E$7),RANDBETWEEN($D$8,$E$8))
C2:C7 are the cumulative probabilities, starting with 0%. The values in D3:E3 through D8:E8 are the lower and upper values of each range of numbers.
The distribution of the values in A11:A10010 is consistent with the required probabilities in A3:A8, to wit:
|
C |
D |
E |
10
|
Bin
|
Freq
|
Bin Prob
|
11
|
5
|
496 |
4.96% |
12
|
15 |
960 |
9.60% |
13
|
35 |
2032 |
20.32% |
14
|
65 |
2999 |
29.99% |
15
|
85 |
1988 |
19.88% |
16
|
100 |
1525 |
15.25% |
17
|
SUM |
10000 |
|

Originally Posted by
MarvinP
=CHOOSE(RANDBETWEEN(1,6),RANDBETWEEN(1,5),RANDBETWEEN(6,15),RANDBETWEEN(16,35),
RANDBETWEEN(36,65),RANDBETWEEN(66,85),RANDBETWEEN(86,100))
That has the wrong distribution. The probability for each range of numbers is uniformly 1/6, about 16.67%. See the "MarvinP" worksheet in the attached Excel file.
The distribution of the values in A2:A10001 is (see the comment in A2):
|
C
|
D
|
E
|
2
|
Bin
|
Freq |
Bin Prob
|
3
|
5 |
1694 |
16.94% |
4
|
15 |
1560
|
15.60% |
5
|
35 |
1738 |
17.38% |
6
|
65 |
1652 |
16.52% |
7
|
85 |
1692 |
16.92% |
8
|
100 |
1664 |
16.64% |
9
|
SUM |
10000 |
|
10
|
1/6 |
16.67% |
|
Bookmarks