Will do. I have a few other things on hand right now though but I'll 
definitely get to it eventually. In the meantime, anyone else feel free to 
review this.

On Thursday, May 9, 2013 8:17:30 PM UTC-7, Kenneth Lin wrote:
>
> Hey everyone,
>
> So I'm not sure if I discovered two bugs in random_matrix or if I'm 
> reading the documentation wrong. Firstly, in the documentation, it says:
>
>    Random integer matrices.  With no arguments, the majority of the
>>    entries are -1 and 1, never zero, and rarely "large."
>>       sage: random_matrix(ZZ, 5, 5)
>>       [ -8   2   0   0   1]
>>       [ -1   2   1 -95  -1]
>>       [ -2 -12   0   0   1]
>>       [ -1   1  -1  -2  -1]
>>       [  4  -4  -6   5   0]
>
>
> Now, it appears that there are 0's in the matrix produced. This also 
> happens when I run the exact function above. Is this a bug in the 
> documentation or the function?
>
> Secondly, the documentation says this about random matrices in rational 
> fields:
>
>    Random rational matrices.  Now "num_bound" and "den_bound" control
>>    the generation of random elements, by specifying limits on the
>>    absolute value of numerators and denominators (respectively).
>>    Entries will be positive and negative (map the absolute value
>>    function through the entries to get all positive values), and zeros
>>    are avoided unless the density is set.  If either the numerator or
>>    denominator bound (or both) is not used, then the values default to
>>    the distribution for ZZ described above that is most frequently
>>    positive or negative one.
>
>
>
> However, when I run <code>random_matrix(QQ, 10, 10)</code>, it appears all 
> the numbers are either 0, 1, 2, -1, -2, 1/2, and -1/2. This doesn't seem to 
> be the "most frequently positive or negative one" distribution, but instead 
> the "uniform" one for integers. I could imagine it being such that two 
> numbers every time with the uniform distribution as the numerator and 
> denominator and the two are divided. Could anyone else verify this behavior?
>
> Thanks
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-devel?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to