ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 13 Jan 2023 18:24:47 +0100Random matrix with density.https://ask.sagemath.org/question/65899/random-matrix-with-density/ I have a little question of comprehension
random_matrix(ZZ, 5, 4, x=0,y=11, density = 0.33)
generate a result like
[0 6 0 0]
[0 5 0 0]
[5 0 0 0]
[0 0 0 4]
but this gives 5 non zero enters which correspond, as I undeerstand it, to a density of 5/25 which is very far from .33 ?
As always I suppose I have not clearly understood the meaning of `density`.
Should somebody explain this ?
CyrilleFri, 13 Jan 2023 18:24:47 +0100https://ask.sagemath.org/question/65899/