A Practical Guide to Quantitative Finance Interviews
Contents

2.9 Proof by Contradiction

In a proof by contradiction or indirect proof, you show that if a proposition were false, then some logical contradiction or absurdity would follow. Thus, the proposition must be true.

Irrational number

Can you prove that 2\sqrt2 is an irrational number? A rational number is a number that can be expressed as a ratio of two integers; otherwise it is irrational.

Solution: This is a classical example of proof by contradiction. If 2\sqrt2 is not an irrational number, it can be expressed as a ratio of two integers mm and nn. If mm and nn have any common factor, we can remove it by dividing both mm and nn by the common factor. So in the end, we will have a pair of mm and nn that have no common factors. (It is called irreducible fraction.) Since m/n=2m/n=\sqrt2, we have m2=2n2m^2=2n^2. So m2m^2 must be an even number and mm must be an even number as well. Let’s express mm as 2x2x, where xx is an integer, since mm is even. Then m2=4x2m^2=4x^2 and we also have n2=2x2n^2=2x^2, which means nn must be even as well. But that both mm and nn are even contradicts the earlier statement that mm and nn have no common factors. So 2\sqrt2 must be an irrational number.

Rainbow hats

Seven prisoners are given the chance to be set free tomorrow. An executioner will put a hat on each prisoner’s head. Each hat can be one of the seven colors of the rainbow and the hat colors are assigned completely at the executioner’s discretion. Every prisoner can 32 see the hat colors of the other six prisoners, but not his own. They cannot communicate with others in any form, or else they are immediately executed. Then each prisoner writes down his guess of his own hat color. If at least one prisoner correctly guesses the color of his hat, they all will be set free immediately; otherwise they will be executed.

They are given the night to come up with a strategy. Is there a strategy that they can guarantee that they will be set free? 19

Solution: This problem is often perceived to be more difficult than the prisoner problem in the modular arithmetic section. In the previous prisoner problem, the prisoners can hear others’ guesses. So one prisoner’s declaration gives all the necessary information other prisoners need. In this problem, prisoners won’t know what others’ guesses are. To solve the problem, it does require an aha moment. The key to the aha moment is given by the hint. Once you realize that if we code the colors to 0-6, (∑i=17xi)%7\displaystyle\left(\sum_{i=1}^7x_i\right)\%7 must be among 0, 1, 2, 3, 4, 5 or 6 as well. Then each prisoner ii—let’s label them as 0-6 as well—should give a guess gig_i so that the sum of gig_i and the rest of 6 prisoners’ hat color codes will give a remainder of ii when divided by 7, where gig_i is a unique number between 0 and 6. For example, prisoner 0’s guess should make (g0+∑k≠0xk)%7=0\displaystyle\left(g_0+\sum_{k\ne0}x_k\right)\%7=0. This way, we can guarantee at least one of gi=xig_i=x_i for i=0,1,2,3,4,5,6i=0,1,2,3,4,5,6.

We can easily prove this conclusion by contradiction. If gi≠xig_i\ne x_i, then (∑i=17xi)%7≠i\displaystyle\left(\sum_{i=1}^7x_i\right)\%7\ne i (since (gi+∑k≠ixk)%7≠i\displaystyle\left(g_i+\sum_{k\ne i}x_k\right)\%7\ne i and gig_i and xix_i are both between 0 and 6). But if gi≠xig_i\ne x_i for all i=0,1,2,3,4,5,i=0,1,2,3,4,5, and 6, then (∑i=17xi)%7≠0,1,2,3,4,5,6\displaystyle\left(\sum_{i=1}^7x_i\right)\%7\ne0,1,2,3,4,5,6, which is clearly impossible. So at least one of gig_i must equal to xix_i. As a result, using this strategy, they are guaranteed to be set free.