[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Axiom-developer] [#227 'random()$Integer' is a strange function]

From: kratt6
Subject: [Axiom-developer] [#227 'random()$Integer' is a strange function]
Date: Tue, 15 Nov 2005 02:39:06 -0600

I disagree:

 - 'random()' has meaning only if I specify a distribution. If no distribution 
   specified, usually the uniform distribution is taken. There is no uniform 
   on the integers, nor on the reals.
   By the way: random without an argument is not a lisp function!

 - I am not proposing to remove 'random()' for finite sets. If it is known how 
to select
   an element from a certain finite set - for example the set of partitions of 
$k$ - then
   it should be implemented. In fact: it is.
   By the way: I don't see how knowing the size of a set helps with creating a 
   element. I believe one needs some way of enumerating the elements?
   Furthermore, I think that lines like 'random()\$Z rem 11' are a bad idea, 
since the
   resulting distribution will be nearly uniform, but not quite... Do you know 
why such
   code was written?

 - I did not say that it is impossible to create a random element of the 
   according to some distribution. Only: it cannot be the uniform 
   To generate random Integers according to a specific distribution we have 

Apart from the usage in 'D01AGNT' - where 'random()\$Integer' is used to 
generate a seed, did you find any other places where 'random()\$Integer' is 

Finally: Which CAS defines a function random for floats? I checked Mathematica 
and MuPAD, the both define functions that return a (uniformly distributed) 
float between zero and one. This is reasonable, since most (all?) other 
distributions can be generated from that one.

forwarded from

reply via email to

[Prev in Thread] Current Thread [Next in Thread]