creating a distrubution
Posted: Fri Apr 24, 2009 3:20 am
Hi, I would like to create a variable that contains a distribution of values characterised by: 80% of values in the distribution are "4" and 20% of the values are "0". When the user clicks on a button I would like the button label to be replaced with either "4" or "0" in the likihoods specificed by the distribution (i.e., on 80% of button presses "4" will appear, and on 20% of button presses "0" will appear).
The way I have been doing this up until now is to create a fld with 100 numbers, in the correct proportion to the ratio I want, and then randomising the list, and then selecting the first value from the list. This method is time consuming and I was wondering if there was a better, quicker way?
Cheers,
Adrian
The way I have been doing this up until now is to create a fld with 100 numbers, in the correct proportion to the ratio I want, and then randomising the list, and then selecting the first value from the list. This method is time consuming and I was wondering if there was a better, quicker way?
Cheers,
Adrian