Professional Documents
Culture Documents
CS201 Assignment-1 Solutions
CS201 Assignment-1 Solutions
CS201 Assignment-1 Solutions
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 α → β.
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).