 Nathalie Fields

2022-07-17

Direct Proof Discrete Math.
Show that if n is an odd integer, then ${n}^{2}$ is odd.
Proof : Assume that n is an odd integer. This implies that there is some integer k such that $n=2k+1$. Then ${n}^{2}=\left(2k+1{\right)}^{2}=4{k}^{2}+4k+1=2\left(2{k}^{2}+2k\right)+1$. Thus, ${n}^{2}$ is odd.
Why does the solution assume n to be $2k+1$?
How do you know ${n}^{2}$ is odd based on $2\left(2{k}^{2}+2k\right)+1$?
I don't see how $2k+1$ for n and 2(2k2+2k)+1 for ${n}^{2}$ means an odd integer. Some clarification would be helpful. iljovskint

Expert

Step 1
An integer m is odd if and only if it can be written as the sum of an even integer and 1, if and only if there exists an integer q such that $m=2q+1.$.
Step 2
In the proof, assumption that n is odd implies the existence of an integer k such that $n=2k+1$ (that is the only if part of the lemma). As for ${n}^{2}=2\left(2{k}^{2}+2k\right)+1$, letting $q=2{k}^{2}+2k$ we have ${n}^{2}=2q+1,$, from which it follows that n2 is odd (that is the if part of the lemma). Expert

Step 1
By definition:
integer n is even iff there exists an integer k such that $n=2k$
integer n is odd iff there exists an integer k such that $n=2k+1$
Step 2
So in the first step we use the definition to go from n is odd to $n=2k+1$, and in the other step we again use the definition to go from ${n}^{2}=2\left(2{k}^{2}+2k\right)+1$ to ${n}^{2}$ is odd.

Do you have a similar question?