Re: Matrices Over Z/NZ
- To: mathgroup at smc.vnet.net
- Subject: [mg39056] Re: Matrices Over Z/NZ
- From: wesh <wharke at sprynet.com>
- Date: Sun, 26 Jan 2003 05:23:07 -0500 (EST)
- References: <b0teom$9ho$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
In article <b0teom$9ho$1 at smc.vnet.net>, flip_alpha at safebunch.com says... > Hello, > > If I want to create a matrix A mod 2, which is a matrix of 0's and 1's, how > do I do that? > > > Flip > For a matrix of order n first create a list of 0s and 1s with IntegerDigits[k,2,n^2]. This operation represent the integer k as an n^2 bit number and then separates the bits into a length n^2 list. Next divide the list into n sublists, voila, an nxn matrix. By letting k range from 0 to 2^(n^2) - 1 you can generate all binary matrices of that order. Wesh