It doesn't for this special algorithm, like already explained here
But if you want the inverse - however "inversion" is defined - you need to build a new hash with accordingly "inverted" weights, like demonstrated here.
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
In reply to Re^6: Randomly choosing from a set of alternatives with varying popularity
by LanX
in thread Randomly choosing from a set of alternatives with varying popularity
by ibm1620
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |