Sunday, August 14, 2011

The Code, Part 3

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?

8210587243141
7710082142136
142165147303201
274297279435333
638668224122

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

8210587243141
7710082142136
142165147303201
274297279435333
638668224122
Or 274+86=63+297

Example 2
8210587243141
7710082142136
142165147303201
274297279435333
638668224122
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:

8210587243141
7710082142136
142165147303201
274297279435333
638668224122

The answer is, 142 should be replaced by 238.