On Sunday, April 24, 2016 at 12:04:27 AM UTC+1, Kiran Kedlaya wrote:
>
> On Saturday, April 23, 2016 at 3:36:28 PM UTC-7, Dima Pasechnik wrote:
>>
>>
>>
>> On Saturday, April 23, 2016 at 10:16:33 PM UTC+1, Kiran Kedlaya wrote:
>>>
>>> I just tried the following experiment on several different machines; 
>>> several different recent versions of Sage; algorithm = ple, m4ri; and n = 
>>> 20000, 25000, 30000. In all cases, the result is identical:
>>>
>>> sage: M = MatrixSpace(GF(2), n)
>>> sage: for i in range(10):
>>> ...:     print M.random_element().rank()
>>> 19937
>>> 19937
>>> 19937
>>> 19937
>>> 19937
>>> 19937
>>> 19937
>>> 19937
>>> 19937
>>> 19937
>>>
>>> Using the Internet, I also retroactively tested this in Sage 4.0.1. 
>>> (Search in the page for "19937".)
>>>
>>> https://wiki.sagemath.org/sagebeatsmagma
>>>
>>> By contrast, I just tried a whole bunch of sparse examples coming from 
>>> Cremona modular symbols that gave more plausible answers, e.g.:
>>> sage: S = CremonaModularSymbols(300001, sign=-1)
>>> sage: T = 
>>> hecke_matrix(2).sage_matrix_over_ZZ().change_ring(GF(2)).dense_matrix()
>>> sage: T.dimensions()
>>> (27549, 27549)
>>> sage: T.rank()
>>> 27461
>>>
>>> I'm not sure if this rank is correct, but at least it's not 19937.
>>>
>>
>> well, this is hardly a surprise:
>>
>> sage: random_matrix?
>> ...
>>    Warning: Matrices generated are not uniformly distributed. For
>>      unimodular matrices over finite field this function does not even
>>      generate all of them: for example "Matrix.random(GF(3), 2)" never
>>      generates "[[2,0],[0,2]]". This function is made for teaching
>>      purposes.
>>
>> Really?
>
> sage: l = [Matrix.random(GF(3),2) for i in range(10000)]
> sage: len([i for i in l if i == 2])
> 114
>
> The issue I raised appears to be distinct (see my response to Volker), but 
> maybe there should also be a ticket to correct this docstring.
>

indeed, you have the codepath pointed out by Volker, not the one I kept in 
mind. Sorry for noise.
Hope http://trac.sagemath.org/ticket/20493#comment:2 is useful. 

An entertaining bug!

Dima

-- 
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 sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to