> < ^ Date: Thu, 21 Mar 2002 23:47:03 -0500 (EST)
> < ^ From: Sven Reichard <reichard@math.udel.edu >
^ Subject: gap forum Low weight random matricies


I don't know how big your matrices are and how you organized your loops,
but I would try the following (written without checking in GAP, so be

# assuming that n1, n2 and w (integers) are given

f := GF(2);
matrix := NullMat(n1, n2, f); # not sure if this is syntax for null matrix 
                              # over f, check manual
for k in [1..w] do
  i := Random([1..n1]);
  j := Random([1..n2]);
  matrix[i][j] := One(f);

This should run reasonably fast; the expected weight of the matrix is
slightly smaller than the given parameter w, however the error is small
for small weights (quadratic in w/(n1*n2)?).

Hope this helps.

Sven Reichard
Dept. of Math. Sci.
University of Delaware

Miles-Receive-Header: reply

> < [top]