Write a mathematical proof that shows that a square at position (i, j) is diagonal to a square at (x, y) if and only if i+j == x+y or i-j == x-y. You can use the following definition of a diagonal square. Two squares (i, j) and (x, y) are diagonal if one of the following cases is true:
i-m = x and j-m = y
i-m = x and j+m = y
i+m = x and j-m = y
i+m = x and j + m = y
Hint: Go through each of the four definitions and show that each of them resolves to either i+j == x+y or i-j == x-y.
Consider case 1:-
Given i-m = x and j-m = y. So subtracting these two equations, we get (i-m) - (j-m) = x-y i.e. i-j = x-y ---------- (1)
Consider case 2:-
Given i-m = x and j+m = y. So adding these two equations, we get (i-m) + (j+m) = x+y i.e. i+j = x+y ---------- (2)
Consider case 3:-
Given i+m = x and j-m = y. So adding these two equations, we get (i+m) + (j-m) = x+y i.e. i+j = x+y ---------- (3)
Consider case 4:-
Given i+m = x and j+m = y. So subtracting these two equations, we get (i+m) - (j+m) = x-y i.e. i-j = x-y ---------- (4)
We can observe that (1) , (4) are same equations i.e. i-j = x-y, similarly (2) , (3) are also same equations i.e.i+j = x+y
** Since it is given that one of the cases must be true, we can conclude that a square at position (i, j) is diagonal to a square at (x, y) if and only if i+j == x+y or i-j == x-y.
Hence proved.
Get Answers For Free
Most questions answered within 1 hours.