ct1 Sol PDF

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

CS30053 Foundations of Computing, Spring 2004

Class test 1 : Solutions

1. (a) False. For p = F and q = T, the subexpression p q p q evaluates to T and so (p q) p


evaluates to T, whereas q is F.
(b) True. We have (p q) q (p q) q (p q) (q q) (p q) F p q
(p q).
(c) True. Given x R take m := bxc 1 and n := dxe + 1.
(d) False. For x R, x 6 0, we do not have a non-negative integer m < x.
(e) False. Take x = 2. Then dbx/2c /3e = db2/2c /3e = d1/3e = 1, whereas bdx/2e /3c = bd2/2e /3c =
b1/3c = 0.
(f) True. Since f (n) = n2 + 2n + 3 = (n + 1)2 + 2, f (m) = f (n) implies (m + 1)2 = (n + 1)2 . But
m + 1 and n + 1 are both positive and so m + 1 = n + 1, i.e., m = n.
(g) False. As in Part (f) g(m) = g(n) implies (m+1)2 = (n+1)2 , but now we may have m+1 = (n+1),
i.e., m = n 2 6= n (unless n = 1). As a specific example, we have g(0) = g(2) = 3.
2. Let A = {a1 , a2 , . . . , an }.
(a) Consider an i {1, 2, . . . , n}. There are two possibilities for (ai , ai )it is either in the relation or not.
Also for each i, j with 1 6 i < j 6 n there are three possibilities that respect anti-symmetry: 1) neither
(ai , aj ) nor (aj , ai ) belongs to the relation, 2) only (ai , aj ) (but not (aj , ai )) belongs to the relation, and
3) only (aj , ai ) (but not (ai , aj )) belongs to the relation.
(b) Let R be a relation on A, that is both symmetric and anti-symmetric. Let i, j {1, 2, . . . , n}. Then
ai R aj implies aj R ai by symmetry and so by anti-symmetry i = j. Thus R contains only pairs of the form
(ai , ai ) and for each such i there are two choiceseither include (ai , ai ) in R or not.
3. (a) Let f (m) = f (n). If m < n, we have f (m) < f (n), whereas if m > n, we have f (m) > f (n). So we
must have m = n.
(b) Consider f : N N defined by f (n) :=

if n = 0,
0 if n = 1,

n if n > 2.

(c) If f (n+1)f (n) = 0 for some n, then f is not injective. So assume that f (n+1)f (n) {1, 1} for
all n. I now claim that f (n + 1) f (n) = 1 for all n, which proves that f is strictly monotonic increasing.
For proving the claim assume that there exists an n, call it N , for which f (N + 1) f (N ) = 1. Let
k := f (N ), so that f (N + 1) = k 1. Now f (N + 2) = f (N + 1) 1. Since f is given to be injective,
this forces f (N + 2) = (k 1) 1 = k 2. Similarly, we have f (N + 3) = k 3, f (N + 4) = k 4 and
so on. In particular, f (N + k 1) = 1 and f (N + k) = 0. Since f (N + k + 1) must be non-negative and
differ from f (N + k) by (at most) 1, we must then have f (N + k + 1) = 1 = f (N + k 1), a contradiction
to the injectivity of f .

Dr. Abhijit Das, Dept. of Computer Science & Engineering, IIT Kharagpur, India

You might also like