RandomWeightedRank ( total )
Rate this function: Average rating: 3.0 (2 votes) Discuss this Custom Function
Jeremy Bante, Gaia Herbs, Inc.
https://github.com/jbante/
Returns a random integer between 1 and total such that the probability of each number is proportional to itself.
Sample Input:
List (
RandomWeightedRank ( 10 );
RandomWeightedRank ( 10 );
RandomWeightedRank ( 10 );
RandomWeightedRank ( 10 );
RandomWeightedRank ( 10 );
RandomWeightedRank ( 10 );
RandomWeightedRank ( 10 );
RandomWeightedRank ( 10 );
RandomWeightedRank ( 10 );
RandomWeightedRank ( 10 )
) |
|
Sample Output:
|
Description:
Returns a random integer between 1 and total such that the probability of each number is proportional to itself. For example, 2 is twice as likely as 1, and 3 is 3 times as likely as 1. This may be useful for ordinally weighted lotteries, where applicants have a number of lottery tickets determined by some ranking. For example, you might want to randomly award a scholarship, but you might also want individuals with greater financial need to be more likely to receive the scholarship.
Note: these functions are not guaranteed
or supported by BrianDunning.com. Please contact the individual
developer with any questions or problems.
This is my Custom Function and I want to
edit it
Discuss:There are no comments yet. Be the first to post a comment about this Custom Function! Please try to keep it brief & to the point. Anyone can post:
|
Newest Custom Functions:
| 1. |
Backwards( _Field ) |
| |
(Thu, May 23, 10:49am) |
| 2. |
FilteredPortalList ( fieldObjectName ; portalRow ) |
| |
(Tue, May 21, 5:33pm) |
| 3. |
ListToggle ( InList ; InValue ) |
| |
(Thu, May 16, 6:59pm) |
| 4. |
VatFormat ( vat ) |
| |
(Tue, May 14, 2:45am) |
| 5. |
CheckVatBE ( vat ) |
| |
(Tue, May 14, 2:32am) |
| 6. |
CheckIBAN (IBAN ) |
| |
(Tue, May 14, 2:24am) |
| 7. |
OrcidCheckDigit ( Orcid_id ; Result ; Iterations ) |
| |
(Wed, May 08, 1:44am) |
| 8. |
DateRangeBySpan ( Begin ; End ; Term) |
| |
(Mon, May 06, 6:53am) |
 |
|