home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!spool.mu.edu!caen!uflorida!math.ufl.edu!shadrach.math.ufl.edu!squash
- From: squash@math.ufl.edu (Jonathan King)
- Newsgroups: sci.math
- Subject: Re: Constant-sum table algorithm
- Message-ID: <SQUASH.93Jan8163108@poincare.math.ufl.edu>
- Date: 8 Jan 93 21:31:08 GMT
- References: <79483@hydra.gatech.EDU>
- Sender: news@math.ufl.edu
- Organization: University of Florida Department of Mathematics
- Lines: 48
- In-Reply-To: np4@prism.gatech.EDU's message of 8 Jan 93 12:49:33 GMT
-
- In article <79483@hydra.gatech.EDU> np4@prism.gatech.EDU (Nick Pomponio) writes:
-
- I would like to generate an NxN table of positive integers such that
- any N entries chosen from the table, with the restriction that no
- two in are in the same row or column, add up to the same value, S.
- The only way I know to construct such a table is to choose 2N integers
- which sum to S, arrange N along the top of the table (one above each
- column), and N along the side (one beside each row), then fill in each
- entry as the sum of it's corresponding row and column heading numbers.
-
- Question: Is there an algorithm for choosing the 2N integers such that
- every resulting number in the NxN table is unique (no repetitions)?
- For my particular case, N^2 << S.
-
- Yes. Call such a set of N entries a "diagonal".
- (NB. Any board whose diagonal-sums are constant can be built by the
- algorithm Mr. Pomponio describes.)
-
- Consider the board
-
- 1 2 ... N
-
- N+1 N+2 2N
-
- 2N+1 2N+2 ... 3N
-
- ...
-
- (N-1)N+1 (N-1)N+2 ... N^2 .
-
-
- Every diagonal of this board sums to
-
- S' := N(N+1)/2 + N*(N-1)N/2
- = N(N^2 + 1) / 2.
-
- Moreover, no distinct-entry board consisting of positive integers could have a
- smaller diagonal-sum.
-
- Now add a non-negative constant B to every entry in the bottommost row.
- Certainly the entries in this new table are distinct, and the diagonal-sum for
- this new table is
-
- S := S' + B .
-
- So using positive integers as entries, one can obtain a distinct-entry
- [diagonal-sum = S] board iff S is an integer which is
- greater-equal N(N^2 + 1) / 2. -Jonathan
-