# Homework1 ```Comp Sci 212
Northwestern
Spring 2022
Homework 1
Due Date: April 13, 2022
Instructor: Shravas Rao
Student: FIRSTNAME LASTNAME
Answer the following questions. You may collaborate with other members in your group. However,
1. (6 points) (a) Let N and k be positive numbers at least 1. Prove that
√
N
≥ N 1/3 .
k+
k
Hint: Use a proof by cases. Further hints will be posted on campuswire.
Solution:
(b) Let x and y be integers. Prove that x − y is odd if and only if x + y is odd.
Solution:
(c) Prove that if x is irrational, then 3x is irrational.
Hint: Consider the contrapositive.
Solution:
2. (4 points) In Comp Sci 212, it is allowed to work in groups of at most three. This quarter, it
turns out that no possible choice of group consists of mutual friends (that is, where all three
pairs are friends). In particular, every possible group of three students has at least one pair
that have never met.
Prove that if student x is friends with student y, then x and y do not have any friends in
common that are also taking Comp Sci 212.
Solution:
3. (5 points) Let f0 , f1 , f2 . . . be functions defined recursively as follows.
(
0
if n = 0
fn (x) =
fn−1 (x) + x − n otherwise.
Determine with proof the roots of fn for all non-negative integers n, that is, the values x such
that fn (x) = 0. Hint: Use induction
Solution:
Comp Sci 212
Northwestern
Spring 2022
Due Date: April 13, 2022
Instructor: Shravas Rao
Student: FIRSTNAME LASTNAME
Homework 1
4. (5 points) Farmer John owns a field of size m &times; n that is surrounded by a fence and contains
m &middot; n cows. However, the cows have started fighting with each other, and so Farmer John needs
to add more fencing so that each cow can be in its own 1 &times; 1 square. Every time Farmer John
adds a fence, it can be any length, but it must be either horizontal or vertical, and can not
pass through any existing fencing. Prove that it is possible for Farmer John to achieve his goal
by adding only mn − 1 new fences. For example, if the field is of size 3 &times; 4, Farmer John can
add his first 4 fences as follows. The dotted lines represent where fences still need to be added.
4
1
2
3
Hint: Use strong induction.
Solution:
5. (5 points) Optional: Consider the base-10 number system with the extra addition of a digit
A representing 10. Thus, 1A1 = 1 &middot; 100 + 10 &middot; 10 + 1 = 201 and A5 = 10 &middot; 10 + 5 = 105. Any
number that does not contain the digit A is equal to the same number in the usual base-10
number system. (Note that this system is different from base-11).
Some numbers, like 201, can be represented in two ways in this modified base-10 system, while
others can only be represented in one way. For example, 201 can also be written as 1A1,
while 211 can not be written in any other way. Describe with proof, which numbers can be
represented in at least two different ways in this modified base-10 system.