RE: Math: Proof Help
Ok, now I'm not sure the norm for calculating for all integers (usually induction questions ask for all positive XOR negative integers). But this is how I would do it:
Prove true for n = 0
LHS:
= floor(0/2) + floor[(0+1)/2]
= floor(0) + floor(0.5)
= 0
RHS:
= n
= 0
LHS = RHS, therefore true for n = 0
Now, assume true for n = k
i.e.
floor(k/2) + floor[(k+1)/2] = k
NOTE: This rearranges to floor(k/2) = k - floor[(k+1)/2] used later in our proof.
Prove true for n = k + 1
i.e. Prove floor[(k+1)/2] + floor[(k+2)/2] = k + 1
LHS:
= floor[(k+1)/2] + floor[(k+2)/2]
= floor[(k+1)/2] + floor(k/2 + 2/2)
= floor[(k+1)/2] + floor(k/2 + 1)
= floor[(k+1)/2] + floor(k/2) + 1
= floor[(k+1)/2] + k - floor[(k+1)/2] + 1 <------- we assumed that it's true for n = k so sub in the assumption here (the bolded part above)
= k + 1
= RHS
Therefore if it is true for n = k, then it is also true for n = k + 1
Therefore since it is true for n = 0, it must also be true for n = 0 + 1 = 1, and since it is true for n = 1 it must also be true for n = 2, and so on for all positive integers n >= 0.
Now we've proven it for positive integers (and 0), we want to prove it for negative integers too (so as to include all possible integers n as requested in the question)
Therefore:
Prove true for n = k - 1
i.e. Prove floor[(k-1)/2] + floor(k/2) = k - 1
LHS:
= floor[(k-1)/2] + floor(k/2)
= floor[(k-1)/2] + k - floor[(k+1)/2] <---- we just substituted in our assumption again for floor(k/2)
= k + floor[(k-1)/2] - floor[(k+1)/2]
= k + floor(k/2 - 1/2) - floor(k/2 + 1/2)
DETOUR:
Now, we know that k is an integer, if it is an odd integer then k/2 would be: x + 1/2 where x is an integer (eg. 5/2 = 2 + 1/2)
floor(x + 1/2 - 1/2) = floor(x ) = x
floor(x + 1/2 + 1/2) = floor(x+1) = x + 1
Therefore floor(x + 1/2 - 1/2) - floor(x + 1/2 + 1/2) = -1
If k were an even integer, then k/2 would be: x where x is an integer (eg. 4/2 = 2)
floor(x - 1/2) = x - 1
floor(x + 1/2) = x
Therefore floor(x - 1/2) - floor(x + 1/2) = -1
So for any integer k, floor(k/2 - 1/2) - floor(k/2 + 1/2) = -1
Now back to our proof:
= k + floor(k/2 - 1/2) - floor(k/2 + 1/2)
= k - 1
= RHS
There if it is true for n = k, then it is also true for n = k - 1
Therefore since it is true for n = 0, it must also be true for n = 0 - 1 = -1, and since it is true for n = -1 it must also be true for n = -2, and so on for all negative integers n < 0
Now we've proven it for negative integers as well as the positive integers (and 0) earlier.
Therefore, it is true for all integers n (positive, negative, 0)
This post was edited on 05-19-2008 at 09:46 AM by Volv.
|