Homework 1, Mon 08-29-11

advertisement
Homework 1, Mon 08-29-11
CS 2050, Intro Discrete Math for Computer Science
Due Wed 09-07-11 (Mon 09-05-11 is Labor Day)
Solutions
Problem 1
Let n and m be integers.
(a) Prove that if at least one of n or m is even then the product n × m is even.
(b)Prove that if both n and m are odd then the product n × m is odd.
Answer
(a) Direct proof, based on the general fact that:
An integer is even, if and only if it is of the form 2k, for some integer k.
For this question, we may assume, without loss of generality, that n is even.
Therefore, by the above general fact, n = 2k, for some integer k.
Therefore, the product n×m = (2k)×m = 2(k×m) = 2k 0 , where k 0 is the integer k 0 = k×m.
Therefore, by the same above general fact, n×m is even.
(b) Direct proof, based on the general fact that:
An integer is odd, if and only if it is of the form 2k+1, for some integer k.
By the above general fact, n = 2k+1, for some integer k.
Also, by the above general fact,n = 2l+1, for some integer l.
Therefore, the product n×m is
n×m =
=
=
=
(2k+1) × (2l+1)
4kl + 2k + 2l + 1
2 × (2kl + k + l) + 1
2k 0 + 1
by simple calculations
factoring out the 2 from the first 3 terms
where k 0 is the integer k 0 = 2kl+k+l
Therefore, by the same above general fact that an integer is odd,
if and only if it is of the form 2k+1, for some integer k, we conclude that n×m = 2k 0 +1 is odd.
1
Problem 2 P
(a) Let Sn = ni=1 i. Prove that, for every n ≥ 2, Sn > n.
(b) Prove that there is unique positive integer that equals the sum of the positive integers not
exceeding it.
Answer
P
, ∀i ≥ 1.
(a) Direct proof, based on the fact that Sn = ni=1 i = n(n+1)
2
In the sequence of ”if and only if” (⇐⇒) inferences below,
we assume that n > 0 is an integer, and proceed to compare n(n+1)
with n.
2
n(n+1)
2
n(n + 1)
n+1
n+1
n
n
>
>
>
>
>
≥
n
2n
2 , where we cancelled n from both sides, since n > 0
1+1
1
2 , since n is an integer .
We therefore conclude that
(n ≥ 2)
and since
Sn =
=⇒
⇐⇒
⇐⇒
⇐⇒
⇐⇒
⇐⇒
n(n + 1)
>n
2
n(n + 1)
, ∀i ≥ 1 (consequently also ∀i ≥ 2)
2
we infer
( n ≥ 2)
=⇒
(Sn > n)
.
Which is equivalent to
∀n ≥ 2 .
Sn > n ,
(b) From part (a) we have
Sn =
n
X
i > n ,
∀n ≥ 2 ,
i=1
meaning that, every positive integer strictly greater than 1 is strictly smaller than the sum of
the positive integers not exceeding it. Therefore, the number 1 is the only possible integer which
might be equal to the sum of the positive integers not exceeding it.
Indeed, we may veryfy that
1
X
S1 =
i = 1 .
i=1
2
Problem 3
P
Let Sn be the sum of all positive integers from 1 to n, ie Sn = 1+2+. . .+n or Sn = ni=1 i.
Let Sn0 be the sum of the squares
all positive integers from 1 to n,
Pof
n
2
2
2
0
0
ie Sn = 1 +2 + . . . +n or Sn = i=1 i2 .
Let
Sn00 = 1×2 + 2×3 + 3×4 + . . . + n(n+1)
n
X
=
i(i+1) .
i=1
Prove that Sn00 = Sn + Sn0 .
Answer
Sn00 =
n
X
i(i+1)
i=1
=
=
n
X
i=1
n
X
(i(i+1))
i2 + i
, by calculations inside the sum
i=1
=
n
X
i=1
!
2
i
+
n
X
!
i
, breaking up the terms of the sum
i=1
= Sn0 + Sn , by definition of Sn0 and Sn .
3
Problem 4
P
i
Prove that, for every positive integer n, 2n
i=1 (1 + (−1) ) = 2n.
Answer
Direct argument, based on two basic facts:
First Fact
( if i is even then (−1)i = 1 ) =⇒
( if i is odd then (−1)i = −1 ) =⇒
1 + (−1)i = 2
1 + (−1)i = 0
Second Fact
There are n even numbers between 1 and 2n.
Combining Facts 1 and 2 above, we may write:
2n
X
1 + (−1)i
= n×2
i=1
= 2n .
4
Problem 5
(a) Prove that the 5 × 5 board with the top left corner removed can be covered using 2 × 1 tiles.
(b) Prove that, for any odd integers n > 1 and m > 1, the n × m board with the top left corner
removed can be covered using 2 × 1 tiles.
Answer TO BE ADDED
5
Problem 6: Extra Credit
Let n > 1 and m > 1 be odd integers. Let S be the set of squares of the n × m board. Give a
complete characterization of the (single) squares that, if removed from the n × m board, then the
remaining (n×m)−1 area can be covered using 2×1 tiles. That is, characterize the set T ⊆ S such
that
x∈T
x∈S \T
=⇒
=⇒
S \ {x} can be covered using 2×1 tiles
S \ {x} cannot be covered using 2×1 tiles
Answer TO BE ADDED
6
Download