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 a_{1,j1}+a_{2,j2}+a_{3,j3}+a_{4,j4}+a_{5,j5}=const, where j_{k}≠j_{m}, ∀k,m∈{1..5}

This implies that, e.g. a_{1,j1}+a_{2,j2}=a_{1,j2}+a_{2,j1} or by simplifying it a_{1,i}+a_{2,j}=a_{1,j}+a_{2,i}. We make this expression even more generic (easy to prove)

**a _{p,i}+a_{q,j}=a_{p,j}+a_{q,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 |

*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 |

*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.