Re: Filling a 2x2 array with random numbers such that...
- From: manishwiz@xxxxxxxxx
- Date: 26 Sep 2006 13:46:31 -0700
omg! Was too sleepy and typed 2x2. I can't believe it!
Actually I meant a 2 dimensional matrix. Is it still trivial?
I apologize for the mistake.
Regards,
M
"Mistakes committed on Usenet will come back haunt forever"
websnarf@xxxxxxxxx wrote:
manishwiz@xxxxxxxxx wrote:
I need to RANDOMLY fill a 2x2 matrix such that the sum of each of rows
is same and the sum of each of the columns is same and these two sums
need not be same. the two sums shall be given.
i.e., a+b=c+d and a+c=b+d. From what I can tell, this solves to a=d
and b=c. So it seems fairly straightforward, to pick two random
numbers for the two entries in the first row, then reverse and copy
them to the second row.
--
Paul Hsieh
http://www.pobox.com/~qed/
http://bstring.sf.net/
.
- Follow-Ups:
- Re: Filling a 2x2 array with random numbers such that...
- From: Thad Smith
- Re: Filling a 2x2 array with random numbers such that...
- From: Willem
- Re: Filling a 2x2 array with random numbers such that...
- References:
- Filling a 2x2 array with random numbers such that...
- From: manishwiz
- Re: Filling a 2x2 array with random numbers such that...
- From: websnarf
- Filling a 2x2 array with random numbers such that...
- Prev by Date: Re: Filling a 2x2 array with random numbers such that...
- Next by Date: Re: Filling a 2x2 array with random numbers such that...
- Previous by thread: Re: Filling a 2x2 array with random numbers such that...
- Next by thread: Re: Filling a 2x2 array with random numbers such that...
- Index(es):
Relevant Pages
|