A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/sagemath/sage/issues/8955 below:

random_matrix(GF(2),2,1) always returns all 1 matrix · Issue #8955 · sagemath/sage · GitHub

Reported by Roberto Nóbrega on [sage-devel]:

Hello, all!

After running

random_matrix(GF(2), 2, 1)

I always get the same matrix, [[1][1]].

Also, the following code

freq = {}
for _ in range(1000):
    M = random_matrix(GF(2), 2, 2)
    M.set_immutable()
    if M not in freq:
        freq[M] = 1
    else:
        freq[M] += 1
show(freq)

gives a very different result from the uniform distribution that I was
expecting. For example, the all-ones 2x2 matrix is the more probable,
and matrices with a full-zero-row does not appear, although matrices
with a full-zero-column does. In general, I noticed that the more
"1's" the matrix has, the more probable it is.

Am I missing something?

Regards,
Roberto.

Component: linear algebra

Author: Martin Albrecht

Reviewer: Yann Laigle-Chapuy

Merged: sage-4.6.alpha2

Issue created by migration from https://trac.sagemath.org/ticket/8955


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4