# CSCI 333 Homework 1 Solution

## Problem 1

For each of the following relations, prove if the relation is reflexive, symmetric, antisymmetric, and transitive. All of these relations are taken over the set of positive integers.

1. For integers a and b, a R b if and only if a < b+333.

It is reflexive because a < a+333.
It is not symmetic because 100 R 500 but ~(500 R 100).
It is not antisymmetric because 100 R 300 and 300 R 100.
It is not transitive because 500 R 300 and 300 R 100 but ~500 R 100.

2. For integers a and b, a R b if and only if a+333 < b.

It is not reflexive because ~(400 R 400).
It is not symmetic because 300 R 700 but ~(700 R 300).
It is antisymmetric because if a+333 < b then b+333 cannot be less than a.
It is transitive because if a+333 < b and b+333 < c then a+333 < b < b+333 < c.

3. For integers a and b, a R b if and only if a equals 333.

It is not reflexive because ~(400 R 400).
It is not symmetric because 333 R 251 and ~(251 R 333).
It is antisymmetric because if aRb and bRa, then both a and b are equal to 333.
It is transitive because if aRb and bRc, then a must equal 333 and consequently aRc.

4. For integers a and b, a R b if and only if a+b equals 333.

It is not reflexive because ~(100 R 100).
It is symmetric because if a+b equals 333 then b+a equals 333.
It is not antisymmetric because 100 R 233 and 233 R 100.
It is not transitive because 100 R 233 and 233 R 100 but ~(100 R 100).

## Problem 2

Use induction to prove that the function defined by the following recurrence relation:

• T(0) = 1
• T(n) = T(n-1) + 2, for n ≥ 1

has the closed form solution

• T(n) = 2 n + 1

In the base case, we see that T(0) = 1 = 2*0+1.

In the induction case, we assume T(n) = 2 n + 1. By the recurrence relation T(n+1) = T(n) + 2. By induction this means that T(n+1) = (2 n + 1) + 2 which can be rearranged to obtain T(n+1) = 2 (n + 1) + 1.