June 6, 20242 yr Greetings: Working with the probability weighting control in random functions displays that they may be some value in revisiting the code to see if there may be a way to improve it. What I am seeing: (setf instr2 (flatten (rnd-unique n-bars pats2 :prob 0.89))) Here "pats2" is a field of 32 values from 1 to 32. "n-bars" is 11 in this case. A return of this function: (26 27 16 19 31 17 20 29 24 6 5) With the weighting of 0.89, I do not expect to see 6 or 5 in the result. In fact, with a higher number, such as 0.9, low numbers are returned often, but the result "should" be from only the higher numbers? If one sets the weighting to 1.0, there is another kind of anomaly in the output: OM 361 > rnd-unique :seed 138124 flatten (32 31 30 29 28 27 26 25 24 23 22) OM 362 > rnd-unique :seed 856981 flatten (32 31 30 29 28 27 26 25 24 23 22) Likewise setting the value to 0.0 results in the opposite result. My intuition suggests that this may have to do with two factors: 1) the nature of the rnd-unique function itself - only selecting UNIQUE elements (no repeated values) and 2) the relatively small domain of the possible (32 in this case) combined with the number of results (11 in this case). However, I am not sure. I hope that these comments are helpful.
June 7, 20242 yr Hi Robert, Janusz is in travel but will probably have a look at this when back to OM Lab 🙂
Create an account or sign in to comment