File weighted.icn

Summary

###########################################################################

       File:     weighted.icn

       Subject:  Procedure to shuffle list with randomness

       Author:   Erik Eid

       Date:     May 23, 1994

###########################################################################

   This file is in the public domain.

###########################################################################

     WeightedShuffle returns the list "sample" with only a portion of the
 elements switched.  Examples:

     L := WeightedShuffle (X, 100)   - returns a fully shuffled list
     L := WeightedShuffle (X, 50)    - every other element is eligible to
                                       be switched
     L := WeightedShuffle (X, 25)    - every fourth element is shuffled
     L := WeightedShuffle (X, 0)     - nothing is changed

     The procedure will fail if the given percentage is not between 0 and
 100, inclusive, or if it is not a numeric value.

###########################################################################
Procedures:
WeightedShuffle

This file is part of the (main) package.

Source code.

Details
Procedures:

WeightedShuffle(sample, percentage)



This page produced by UniDoc on 2021/04/15 @ 23:59:54.