Am Dienstag, 7. Oktober 2014 13:25:33 UTC+2 schrieb Jeremy Ruston:
>
>
> The action of the 'choose' filter would be to modulo the operand by the 
> number of entries in the current list, and then use the result as an index 
> to choose a value from the current list.
>
 
I propose to have $:/info/random be a number from x with 0 <= x < 1. Then 
do not do a modulo, but multiply $:/info/random with the length of the 
list. The integer part of the result is the index.

If you have modulo, you get unfair distributions. Suppose your numbers 
range from 0 to 99 (so modulo 100). And your list length is 66. The result 
will be that the first 33 elments will be picked with a double the 
probability than the last 33.

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.

Reply via email to