CS 381 Solutions to Homework 1




1. Prove that $ \frac{2}{\frac{1}{x} + \frac{1}{y}} \leq \sqrt{xy} $, where x and y are positive real numbers.


Since x and y are positive, $ \frac{2}{\frac{1}{x} + \frac{1}{y}} \leq \sqrt{xy} $, can be written as
$\frac{2}{\sqrt{xy}} \leq \frac{1}{x} + \frac{1}{y}$
Hence $\frac{1}{x} + \frac{1}{y} - \frac{2}{\sqrt{xy}} \geq 0 $ ------- (1)
The left hand side can be written as
$\frac{1}{x} - \frac{2}{\sqrt{xy}} + \frac{1}{y}$
= $(\frac{1}{\sqrt{x}})^{2} - \frac{2}{\sqrt{xy}} + (\frac{1}{\sqrt{y}})^{2}$
= $(\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{y}})^{2}$
Since the last quantity is nonnegative, the left hand side of (1) is nonnegative.
Hence by tracing the argument backward from (1) one can conclude that the given inequality holds.


2. In a party with 200 people, among any set of four there is at least one person who knows each of the other three. There are three people who are not mutually acquainted with each other(that is none of the three knows any of the other two). Prove that the other 197 people know everyone at the party. (Assume that if A knows B, then B also knows A.)


Suppose that the conclusion is not true, that is it is not the case that the other 197 people know everyone at the party. This means that there is at least one person, call that person A, among the 197 who does not know at least one person, call that person B. By the second condition there are three people who don't know each other. So call two of them C and D. Then we have a group of four people. According to the first condition at least one of A, B, C, and D know the other three. But that is not possible because everyone does not know at least one person. This is a contradiction.
Hence the conclusion must be true.



3. We can consider the following four cases: (1) $x \geq 0$ and $y \geq 0$, (2) $x \geq 0$ and y < 0 (3) x < 0 and $y \geq 0$, and (4) x < 0 and y < 0.



(1) $x \geq 0$ and $y \geq 0$: In this case $\mid x \mid = x$, $\mid y \mid = y$, and $ \mid x + y \mid = x + y$.
Hence $ \mid x + y \mid = x + y = \mid x \mid + \mid y \mid$.
Hence $ \mid x + y \mid \leq \mid x \mid + \mid y \mid$.
(2) $x \geq 0$ and y < 0: In this case $\mid x \mid = x$, $\mid y \mid = -y$, and $\mid x \mid + \mid y \mid = x - y$.
If $x + y \leq 0$, then $ \mid x + y \mid = -x - y$. Then $\mid x \mid + \mid y \mid - \mid x + y \mid = (x - y) - (-x -y)
= 2x \geq 0$. Hence $ \mid x + y \mid \leq \mid x \mid + \mid y \mid$.
If x + y > 0, then $ \mid x + y \mid = x + y$. Hence $\mid x \mid + \mid y \mid - \mid x + y \mid = (x - y) - (x + y)
=-2y > 0$. Hence $ \mid x + y \mid \leq \mid x \mid + \mid y \mid$.
(3) x < 0 and $y \geq 0$: This is the same as (2) if x and y are switched.
(4) x < 0 and y < 0: In this case $\mid x \mid = -x$, $\mid y \mid = -y$, and $ \mid x + y \mid = -x - y$.
Hence $\mid x \mid + \mid y \mid - \mid x + y \mid = -x -y -(-x -y) = -2y >0$.
Hence $ \mid x + y \mid \leq \mid x \mid + \mid y \mid$.



4. Let us denote the larger pail by L and the smaller one by S.
(1) Fill L and pour the contents of L into S (7 in L).
(2) Empty S and pour L into S (7 in S).
(3) Fill L and pour L into S (14 in L).
(4) Empty S and pour L into S (5 in L).
(5) Empty S and pour L into S (5 in S).
(6) Fill L and pour L into S (12 in L).
(7) Empty S and pour L into S (3 in L).
(8) Empty S and pour L into S (3 in S).
(9) Fill L and pour L into S (10 in L).
(10) Empty S and pour L into S (1 in L).


5. Suppose that the sum of odd squares is a square.
Then m2 + n2 = k2, where m2 and n2 are odd. Hence m and n are also odd, and k2 hence k are even. Thus m = 2m1 + 1, n = 2n1 + 1, and k = 2k1.
Hence m2 + n2 = 4m12 + 4n12 + 4m1 + 4n1 + 2 = 4k12.
Dividing the both sides by 2, 2(m12 + n12 + m1 + n1) + 1 = 2k12.
But LHS is odd while RHS is even, which is a contradiction.
Hence the sum of odd squares can not be a square.


6. If any one ai is removed, then the sum of the rest is even. Hence if any one of ais is even, then the total sum is even, and if any one of ais is odd, then the total sum is odd. Hence if the total sum is odd, then every ai is odd, and if the total sum is even, then every ai is even. Hence ais are either all odd or all even.