13,095,218 members (86,148 online)
Technical Blog
alternative version

#### Stats

4.3K views
3 bookmarked
Posted 8 Aug 2012

# The Code - Part 3

, 8 Aug 2012
 Rate this:
Solution to a puzzle

Here is another interesting puzzle from the book (as I stated previously, you need the passwords from the pre-selections).

Basil, a friend of mine, gave me this interesting array of numbers. He told me that if I grab any five numbers from it such that none of the numbers shares a row or column with another, then my five chosen numbers will always add up to the same sum. I think he made an error, however, because it does not always seem to verify properly. Exactly where is the glitch and what quantity should go in its place to improve the matrix's reliability?

 82 105 87 243 141 77 100 82 142 136 142 165 147 303 201 274 297 279 435 333 63 86 68 224 122

Let's start with some analysis. The claim is that a1,j1+a2,j2+a3,j3+a4,j4+a5,j5=const, where jk≠jm, ∀k,m∈{1..5}

This implies that, e.g. a1,j1+a2,j2=a1,j2+a2,j1 or by simplifying it a1,i+a2,j=a1,j+a2,i. We make this expression even more generic (easy to prove)
ap,i+aq,j=ap,j+aq,i

Indeed, this is what is happening:

##### Example 1
 82 105 87 243 141 77 100 82 142 136 142 165 147 303 201 274 297 279 435 333 63 86 68 224 122

Or 274+86=63+297

##### Example 2
 82 105 87 243 141 77 100 82 142 136 142 165 147 303 201 274 297 279 435 333 63 86 68 224 122

Or 86+303=165+224

A quick check for all of the 2x2 sub-matrices (stepwise, can be done by a computer program) shows the problem:

 82 105 87 243 141 77 100 82 142 136 142 165 147 303 201 274 297 279 435 333 63 86 68 224 122

The answer is, `142` should be replaced by `238`.

## Share

 Software Developer (Senior) Snappli Ltd. United Kingdom
My name is Ruslan Ciurca. Currently I am a Software Developer at snappli.com.