Index of /tcl/ftparchive/sorted/math/random

      Name                   Last modified     Size  Description

[DIR] Parent Directory 09-Aug-99 11:16 - [   ] README 03-Dec-95 20:05 1k [CMP] random.tar.gz 18-Dec-95 19:52 2k

This directory contains a dynamically loadable tcl extension which
supports random number generation.  This extension defines a tcl
command called "random" which returns a random value.  The
distribution from which the value is taken is specified by the command
arguments. 

   by default, with no arguments the number is taken uniformly from [0..1)

   "random -reset" will cause the generator to be reseeded using
   current pid and current time.

   "random -integer ..." will cause the number returned to be rounded
   down to the largest integer less than or equal to the number which
   would otherwise be returned.

   "random -normal m s" will cause the number returned to be taken
   from a gaussian with mean m and standard deviation s.

   "random -exponential m" will cause the number returned to be taken
   from an exponential distribution with mean m.

   "random -uniform low high" will cause the number returned to be
   taken from uniform distribution on [a,b).

   "random -chi2 n" will cause the number returned to be
   taken from chi2 distribution with n degrees of freedom.

   "random -select n list" will cause n elements to be selected at
   random from the list with replacement.

   "random -choose n list" will cause n elements to be selected at
   random from the list without replacement.

   "random -permutation n" will return a permutation of 0..n-1

   "random -permute $list" will return a permutation of $list