CS201 Assignment-1 Solutions

You might also like

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

CS201 Assignment-1 Solutions

Q1. Let A = {a1 , a2 , a3 , . . .} be a countable set.


Let H ⊆ A be an infinite subset of A.
We may write H = {ai1 , ai2 , ai3 , . . .}, where i1 < i2 < i3 < . . ..
So H is also countable.
Q2.
(a) Assume (towards contradiction) that P(N) is countable.
Let P(N) = {A1 , A2 , A3 , . . .}.
Define D = { i ∈ N | i 6∈ Ai }. Clearly D ⊆ N.
So there must be a j s.t. D = Aj .
Now, j ∈ D ⇔ j 6∈ Aj (by definition of D) ⇔ j 6∈ D (because D = Aj )
This is a contradiction.
So our assumption that P(N) is countable must be false.
(b) Let Pf in (N) stand for the set of finite subsets of N.
We show that Pf in (N) is countable.
Define P(N)i = {A ⊆ N | sum of elements of A is i} .
Each P(N)i is finite, in fact P(N)i ⊆ P({1, . . . , i}),
and P(N)i , P(N)j are disjoint for i 6= j.
Note that Pf in (N) = {∅} ∪i∈N P(N)i .
We could therefore list elements of Pf in (N) by listing ∅, followed by ele-
ments of P(N)1 , followed by elements of P(N)2 etc.
Q3.
(a) We assume that A 6= ∅. Let a0 ∈ A.
⇒ Given f (
: A → B is injecive. We define g : B → A as
a if there is an a ∈ A s.t. f (a) = b
g(b) =
a0 Otherwise
Note that g is well defined because f is injective.
Now for a ∈ A, g ◦ f (a) = g(f (a)) = a.
(Second equality holds by definition of g).

1
⇐ Let g : B → A be given s.t. g ◦ f = idA .
For any a1 , a2 ∈ A,
f (a1 ) = f (a2 )
⇒ g(f (a1 )) = g(f (a2 ))
⇒ a1 = a2 (∵ g ◦ f = idA )
This shows that f is injective.

(b)
⇒ Given that f : A → B is surjecive.
We define g : B → A as
g(b) = a, for some fixed a ∈ A s.t. f (a) = b
Note that g is defined on all b ∈ B because for all b ∈ B there is a ∈ A
s.t. f (a) = b as f is surjective.
Now for b ∈ B, f ◦ g(b) = f (a) = b.
(the equality f (a) = b follows from the definition of g(b) )
⇐ Let g : B → A be given s.t. f ◦ g = idB .
For b ∈ B, we have g(b) ∈ A s.t.
f (g(b)) = f ◦ g(b) = b
Therefore f is surjective.
Q4.
• Let α be the statement:
‘For all n ∈ N [(for all m s.t. m < n , P (m) ) → P (n)]’
• Let β be the statement: For all n ∈ N, P (n).
We prove the principle of strong induction by showing α → β.

• Define Q(n) as: ‘For all m s.t. m < n, P (m) holds’.


Assuming α, we shall prove ‘for all n, Q(n)’ by standard induction
principle.
– Q(1) holds vacuously because there is no m ∈ N, m < 1.
– Note that α can be stated as: For all n ∈ N[Q(n) → P (n)].
Or equivalently, For all n ∈ N[Q(n) → Q(n) ∧ P (n)].
Or equivalently, For all n ∈ N[Q(n) → Q(n + 1)].
(∵ by definition of Q, Q(n + 1) ⇔ P (n) ∧ Q(n))
By usual induction principle of natural numbers, we conclude that
‘for all n ∈ N, Q(n)’.

We now prove that,

2
• (for all n ∈ N, Q(n)) ⇒ (for all n ∈ N, P (n)).
To this end,
– let n ∈ N.
Since ‘for all n ∈ N, Q(n)’, in particular, we have Q(n + 1).
As Q(n + 1) ⇒ P (n),
we also have P (n).
This shows that ‘for all n ∈ N, P (n)’.
In other words β holds as was to be shown. 
Q5. (I now use standard notation of logic. Symbol ∀ stands for ‘for all’. Formula
∀n ∈ N[A(n)] means that: for all n ∈ N, A(n) holds).
(a) Let P (0) and ∀n ∈ N[P (n) → P (n + 1)] be true.
Assume (towards contradiction) that ∀n ∈ N[P (n)] is false.
Define S = {n ∈ N|P (n) is false}.
Set S is non-empty by our assumption (∀n ∈ N[P (n)] is false) above.
Let n0 ∈ N be the least number in S by the least number principle.
As P (0) is true, we must have n0 > 0. Let n0 = m0 + 1.
Since n0 is the least number in S, P (m0 ) is true.
By second premise, ∀n ∈ N [P (n) → P (n + 1)], we get that P (m0 + 1) is
true.
In other words, P (n0 ) is true. This contradicts that n0 ∈ S.
So our assumption that, ∀n ∈ N[P (n)] is false is incorrect.
Hence ∀n ∈ N[P (n)] is true.
(b) Define P (n) be ∀X ⊆ N[n ∈ X → (X has a least number)]
Let n ∈ N. We show that [(∀m ∈ N(m < n → P (m))) → P (n)].
Let X ⊆ N and n ∈ X. If there is a some m < n in X then by induction
hypothesis P (m) it follows that X has a least number. Otherwise, n is
the least number in X.
By strong induction principle of natural numbers,
it follows that ∀n ∈ N.P (n).
The least number principle is now shown as follows.
If X ⊆ N is non-empty then n0 ∈ X for some n0 ∈ N.
As P (n0 ) holds, we get that X has a least number.
Q6. Define Q(n) to be [n ≥ n0 → P (n)]. We show ∀n ∈ N[Q(n)], by induction
principle of natural numbers.
Base case: We need to show Q(0). That is, [0 ≥ n0 → P (0)]. If n0 = 0
then P (0) is given by condition (1) in the question, so Q(0) is true.

3
If n0 > 0 then [0 ≥ n0 → P (0)] is vacuously true.
Induction Step: Let n ∈ N. Assume Q(n). We need to show Q(n + 1).
If n + 1 < n0 then Q(n + 1) is vacuously true.
If n + 1 = n0 then Q(n + 1) is true by condition (1) in the question.
If n + 1 > n0 then n ≥ n0 . By Q(n), we get P (n). By condition (2) in the
question, we get P (n + 1). This shows that Q(n + 1) is true.
Q7. Define P (n) as: Let there be a host couple and n guest couples in a party.
Some handshakes took place in the party. No one shook hand with his/her
spouse. If all the guest couples and hostess shook hand with different
number of people then the hostess shook hands with n people.
We prove P (n) by induction on n.
Base case: n = 0. Hostess can’t shake hands with her spouse and there
are no guests so she did not shake hands with anyone. That is, she shook
hands with 0 people.
Induction Step: Suppose there are n + 1 guest couples. There are 2n + 4
people at the party, so anyone can shake hands with at most 2n + 2 people
(excluding himself/herself and the spouse). It is given that 2n + 3 people
(all guests and hostess) shook hands with different number of people. So
the number of handshakes for these 2n + 3 people must be 0, 1, . . . , 2n + 2.
Consider person x who has shaken hands with 2n + 2 people (that is with
everyone excluding x and spouse of x). There is also a person who shook
hands with none (corresponding to number of handshakes equal to 0).
This person can only be the spouse of x as everyone else (except x) has
shaken hands with x. Let spouse of x be x0 . Number of handshakes by
remaining 2n + 1 people are 1, . . . , 2n + 1.
Now consider the party without couple x, x0 . Each of the 2n remaining
guests and hostess have now shaken hands with one person less (namely
x). So the number of handshakes are 0, 1, . . . , 2n amongst themselves. By
induction hypothesis, hostess shook hands with n of the remaining guests.
So she has shaken hands with n + 1 of the original guests. This shows
P (n + 1).

You might also like