list of random numbers that goes towards the mean faster

melisen

New Member
Joined
Apr 9, 2013
Messages
13
I need to generate a list of about 50 zeros and ones where each position on the list have a certain probability (say 70/30) to be picked over zeros and the result is to be used in a monte carlo simulation. Easy enough: if(rand()<0.7,1,0).

The problem is I need the list to “go towards the mean” rather quickly. At least closer to the mean than the list of 50 numbers get me on average. One way is to let the generation of the next number on be influenced by the distribution of zeros and ones so its probability is mildly screwed to bring the overall distribution in line. And I can do it quite easily. But is there a more “accepted” method?

I know any method suggested will be quite unfit for any scientific work and it would certainly not qualify as a list of random numbers but thats perfectly acceptable for the purpose.
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
You could list the desired number of each value, add a column of =RAND(), and sort by that to randomize the list order. Or,

Row\Col
A​
B​
C​
1​
Value
Count
2​
1​
7​
A2:B3: Input
3​
0​
3​
4​
Total
10​
B4: =B2+B3
5​
Draw
Result
6​
1​
1​
B6: =IF(RAND() <= ($B$2 - COUNTIF(B$5:B5, $A$2)) / (B$4 - ROWS(B$5:B5) + 1), $A$2, $A$3)
7​
2​
1​
8​
3​
0​
9​
4​
1​
10​
5​
1​
11​
6​
1​
12​
7​
1​
13​
8​
1​
14​
9​
0​
15​
10​
0​
16​
Total
7​
B16: =COUNTIF(B6:B15, A2)
 
Last edited:
Upvote 0
Sometimes you have explained yourself the problem a thousand times more complex than it really is. Thank you for letting me realize that the solution is simulated sampling without replacement. Pure statistics 101:)

Because that is basically what both your suggestion are: A random sample the size of the population sampled. When that is realized it is easy to control both the distribution in the population AND controlling the population size relative to the sample size: The closer the two numbers are the more you nudge the total distribution of the random numbers into a narrower band around the desired average probability.
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,120
Members
451,399
Latest member
alchavar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top