Homework 2 2/15/2017 SOLUTIONS In

Homework 2
2/15/2017
SOLUTIONS
In-class Exercise 6.
1. Decide for each of the following expressions: Is it a function? If so,
(i) what is its domain, codomain, and image?
(ii) is it injective?
(iii) is it surjective?
(iv) is it invertible?
(a) f : R → R defined by x 7→ x3
(b) f : R → R defined by x 7→
√
x
(c) f : Z × Z → Q defined by (a, b) 7→ a/b
(d) f : R × Z → Z defined by (r, z) 7→ dre ∗ z
f is a function.
(i) Domain: R. Codomain: R. Range: R.
(ii) Yes injective.
(iii) Yes surjective.
(iv) Yes invertible.
f is not a function, since, for example, 1 7→ 1 and −1.
f is not a function since it’s not defined on Z × {0}.
f is a function.
(i) Domain: R × Z. Codomain: Z. Range: Z.
(ii) f is not injective. For example, (2, 1) and (1.5, 1)
both map to 2.
(iii) f is surjective, since for every integer z, (1, z) 7→
z. (iv) f is not invertible since its not injective.
1
2
f
(e)
k
c
j
b
i
a
A
f is a function.
(i) Domain: {i, j, k}. Codomain: {a, b, c}. Range:
{a, b, c}.
(ii) f is injective.
(iii) f is surjective. (iv) f is invertible.
B
f
(f)
k
c
j
b
i
a
A
f is not a function since j has no image and i has two
elements in its image.
B
2. For those examples which were not functions in the previous problems, can you restrict the
domain and/or codomain to make them functions? i.e. pick a reasonable subset of the given
domain/codomain such that the expression is a function on that domain.
(b) Some examples: Restrict the domain to R≥0 , or to R≤0 , or to {1}, or. . . .
(c) Some examples: Restrict the domain to R × Z>0 , or to R × (Z>0 ∪ Z<0 , or to {−3} × {2},
or. . . .
(f) Restrict the domain to {k} (only possibility).
3. Choose a domain and codomain for the following expressions to make them into functions satisfying
(i) f is an injective but not surjective function;
(ii) f is a surjective but not injective function;
(iii) f is an invertible function;
(iv) f is not a function;
where f is given by:
(a) f (x) = |x|
(i)
(ii)
(iii)
(iv)
injective but not surjective: Domain R>0 , Codomain R.
surjective but not injective: Domain R, Codomain R≥0 .
invertible function: Domain R>0 , Codomain R>0 .
not a function: Domain R>0 , Codomain {0}.
(b) f (x) = 1/x
(i) injective but not surjective: Domain R>0 , Codomain R.
(ii) surjective but not injective: Not possible within C.
(iii) invertible function: Domain R>0 , Codomain R>0 .
3
(iv) not a function: Domain R, Codomain anything.
(c) f (x) = 6
injective but not surjective: Domain {1}, Codomain R.
surjective but not injective: Domain {1, 2}, Codomain {6}.
invertible function: Domain {1}, Codomain {6}.
not a function: Domain {1, 2}, Codomain {0}.
√
(d) f (x, y) = xy
(i)
(ii)
(iii)
(iv)
(i)
(ii)
(iii)
(iv)
injective but not surjective: Domain Z>0 × {1}, Codomain R.
surjective but not injective: Domain Z>0 × {0}, Codomain {0}.
invertible function: Domain {0} × {0}, Codomain {0}.
not a function: Domain {1} × {1}, Codomain {±1}.
(e) f is determined by the set {(1, 5), (2, −3), (1, 10), (3, −3)}.
(i)
(ii)
(iii)
(iv)
injective but not surjective: Domain {1}, Codomain {5, 6}.
surjective but not injective: Domain {2, 3}, Codomain {−3}.
invertible function: Domain {1}, Codomain {5}.
not a function: Domain {5}, Codomain anything.
4. Let f be a function from the set A to the set B. Let S and T be subsets of A. Show that
(a) f (S ∪ T ) = f (S) ∪ f (T ):
Proof. First we show that f (S ∪ T ) ⊆ f (S) ∪ f (T ):
If x ∈ f (S ∪ T ), then x = f (a) for a ∈ S ∪ T . So either x = f (a) for a ∈ S, or x = f (a) for
a ∈ T . Thus x ∈ f (S) ∪ f (T ), implying that f (S ∪ T ) ⊆ f (S) ∪ f (T ).
Next, we show that f (S ∪ T ) ⊇ f (S) ∪ f (T ):
If x ∈ f (S) ∪ f (T ), then x ∈ f (S) ⊇ f (S ∪ T ) or x ∈ f (T ) ⊇ f (S ∪ T ). So x ∈ f (S ∪ T ).
Thus f (S ∪ T ) ⊇ f (S) ∪ f (T ).
So f (S ∪ T ) = f (S) ∪ f (T ).
(b) f (S ∩ T ) ⊆ f (S) ∩ f (T ).
Proof. If x ∈ f (S ∩ T ) then x = f (a) for a ∈ S and a ∈ T . So x ∈ f (S) and x ∈ f (T ),
implying x ∈ f (S) ∩ f (T ). Thus f (S ∩ T ) ⊆ f (S) ∩ f (T ).
Can you think of an example where the inclusion in part (b) could be proper (not equal)?
Example: Let f : {a, b} → {x} be the function f (a) = f (b) = x. With S = {a} and T = {b},
f (S ∩ T ) = f (∅) = ∅
and
f (S) ∩ f (T ) = {x} ∩ {x} = {x} ⊃ ∅.
In-class Exercise 7. Let
f :A→B
and
g:B→C
be functions. Draw some pictures (like our previous example) and make some conjectures about
the following questions.
4
1. Is g ◦ f always a function?
Yes.
2. What are the conditions on f , g, A, B, and/or C for g ◦ f to be surjective?
It must be the case that g is surjective. Then for each c ∈ C, f (A)∩g −1 (c) must be nonempty.
3. What are the conditions on f , g, A, B, and/or C for g ◦ f to be injective?
It must be the case that f is injective, and that g restricted to f (A) must also be injective.
4. What are the conditions on f , g, A, B, and/or C for g ◦ f to be bijective?
In this case, f must be injective, and g restricted to f (A) must be bijective.
5. What are the conditions on f , g, A, B, and/or C for f ◦ g to be a function?
In order for f to be defined on g(B), we must have g(B) ⊆ A
6. If g and g ◦ f are injective, is it necessarily true that f is injective?
Yes, as we guessed before, for g ◦ f to be injective at all, f must be injective.
7. If g and g ◦ f are surjective, is it necessarily true that f is surjective?
No.
In-class Exercise 8. Show that if both
f :A→B
and
g:B→C
are surjective functions, then g ◦ f is also surjective.
Proof. Pick any c ∈ C. Since g is a surjective function, there is some b ∈ B such that g(b) = c.
And since f is a surjective function, there is some a ∈ A such that f (a) = b. So g(f (a)) = g(b) = c,
so that c ∈ (g ◦ f )(A). Since this was true for any c ∈ C, we have C ⊆ (g ◦ f )(A). Therefore g ◦ f
is surjective.
In-class Exercise 9.
1. Decide if the following sequences are arithmetic, geometric, or neither. If it’s arithmetic or
geometric, find a formula expressing the nth term of the sequence.
(a) 5, 1, −3, −7, −11, . . .
Check: −4 = 1 − 5 = −3 − 1 = −7 − (−3) = −11 − (−7) = · · · , so the sequence is arithmetic,
given by an = −4n + 5 (starting at a0 ).
(b) 1, 4, 9, 16, 25, . . .
Check: the differences and ratios are not constant (4 − 1 6= 9 − 4 and 4/1 6= 9/4), so this
sequence is neither arithmetic nor geometric.
(c) 3, 9, 27, 81, 243, . . .
Check: 3 = 9/3 = 27/9 = 81/27 = 243/81 = · · · , so this sequence is geometric, given by
an = 3 ∗ 3n (starting at a0 ).
(d) The sequence satisfying a0 = 2 and an = 21 an−1 .
This sequence starts out like 2, 1, 1/2, 1/4, 1/8, . . . . Check: an /an−1 = 12 an−1 /an−1 = 12 . So
this sequence is geometric with an = 2(1/2)n (starting at a0 ).
5
(e) The sequence satisfying a0 = −1 and an = an−1 + 5.
This sequence starts out like −1, 4, 9, 14, . . . . Check: an − an−1 = an−1 + 5 − an−1 = 5, so
this sequence is arithmetic with an = −1 + 5n (starting at a0 ).
(f) The sequence satisfying a0 = 1, a1 = −1 and an = an−2 ∗ an−1 .
This sequence starts out like 1, −1, 1, −1, 1, −1, 1, −1, . . . . Check: an /an−1 = 1/−1 or −1/1,
and is either way the constant −1. So this sequence is geometric, given by an = (−1)n
(starting from a0 ).
2. For each of the following, try to find a closed formula.
(a) The sequence satisfying a0 = 2 and an = 21 an−1 .
an = 21 an−1 for n = 0, 1, 2, . . . . (see part (1)(d))
(b) The sequence satisfying a0 = −1 and an = an−1 + 5.
an = an−1 + 5 for n = 0, 1, 2, . . . . (see part (1)(e))
(c) The sequence satisfying a0 = 2 and an = −an−1 .
This sequence starts out like 2, −2, 2, −2, 2, . . . , so that it is a geometric sequence with
an = 2(−1)n for n = 0, 1, 2, . . . .
In-class Exercise 10.
(1) Calculate the following:
8
X
(a)
(1 + (−1)j ) = 2 + 0 + 2 + 0 + 2 + 0 + 2 + 0 + 2 = 10
(b)
j=0
2
X
3
X
(2i + 3j)
j=−1 i=2
2 X
3
X
(2i + 3j) =
j=−1 i=2
2
X
((2 ∗ 2 + 3j) + (2 ∗ 3 + 3j))
j=−1
=
2
X
(10 + 6j)
j=−1
= (10 + 6(−1)) + (10 + 6(0)) + (10 + 6(1)) + (10 + 6(2))
= 40 + 6(−1 + 0 + 1 + 2) = 52
(c)
X
2 =2+2+2= 6
j∈{−1,4,15}
(d)
X
j
j∈{z∈Z | |z|≤2}
Since {z ∈ Z | |z| ≤ 2} = {−2, −1, 0, 1, 2}, we have
X
j = −2 + −1 + 0 + 1 + 2 = 0
j∈{z∈Z | |z|≤2}
6
(e)
5
X
(an − an−1 ) where an = n!
n=2
5
X
(an − an−1 ) = (a2 − a1 ) + (a3 − a2 ) + (a4 − a3 ) + (a5 − a4 ) = a5 − a1 = 5! − 1! = 5! − 1
n=2
(f)
2000
X
i = 2000 ∗ 2001/2 = 2, 001, 000
i=1
(2) Use partial sums to explain why, for any sequence a0 , a1 , . . . , an , that
n
X
ai − ai−1 = an − a0 .
i=1
Pn
[Let Sn = i=1 ai − ai−1 . Write out S1 , S2 , S3 , and so on until you see the pattern. Then
use the fact that Sn = Sn−1 + (an − an−1 ).]
P
Let Sn = ni=1 ai − ai−1 , so that
S1 = a1 − a0
S2 = a1 − a0 + a2 − a1 = a2 − a0
S3 = a1 − a0 + a2 − a1 + a3 − a2 = a3 − a0
..
.
Note that Sn = Sn−1 + (an − an−1 ). So starting with S1 = a1 , adding the next term to
Sn−1 to get Sn always cancels the highest index term of Sn−1 (an−1 ) and adds an . What’s
left if an − a0 .
§2.3 #2 Determine whether f is a function from Z to R if
(a) f (n) = √
±n
Ans: no, since 1 7→ ±1
Ans: Yes, if we always take the positive root, no if not.
(b) f (n) = n2 + 1
2
(c) f (n) = 1/(n − 4)
Ans: No, since f (2) is not defined.
§2.3 #6 Find the domain and range of these functions.
(a) the function that assigns to each pair of positive integers the first integer of the pair.
Ans: Domain Z>0 × Z>0 , Range Z>0 .
(b) the function that assigns to each positive integer its largest decimal digit.
Ans: Domain Z>0 , Range {0}.
(d) the function that assigns to each positive integer the largest integer not exceeding
the square root of the integer.
Ans: Domain Z>0 × Z>0 , Range Z>0 .
§2.3 #16 Consider these functions from the set of students in a discrete math class. Under what
conditions is the function one-to-one if it assigns to a student his of her
(a) mobile phone number
Ans: If no two students share a phone
7
(b) student identification number
Ans: If the registrar hasn’t messed up
(c) final grade in the class
Ans: If no two students get the same final grade (small class!)
(d) home town Ans: If no two students come from the same town
§2.3 #32 Let f (x) = 2x where the domain is the set of real numbers.
(a) f (Z) = { even integers }
(b) f (N) = { positive even integers }
(c) f (R) = R
§2.3 #42 Let f be the function from R to R defined by f (x) = x2 .
(a) f −1 ({1}) = {±1}
(b) f −1 ({x | 0 < x < 1}) = {x | 0 < x < 1} ∪ {x | 0 > x > −1}
(c) f −1 ({x | x > 4}) = {x | x > 2} ∪ {x | x < −2}
§2.4 #4 What are the terms a0 , a1 , a2 , and a3 of the sequence {an }, where an equals
(a) (−2)n : a0 = 1, a1 = −2, a2 = 4, and a3 = −8.
(b) 3: a0 = 3, a1 = 3, a2 = 3, and a3 = 3.
(c) 7 + 4n : a0 = 8, a1 = 11, a2 = 23, and a3 = 71.
(d) 2n + (?2)n : a0 = 2, a1 = 0, a2 = 8, and a3 = 0.
§2.4 #8 Find at least three different sequences beginning with the terms 3, 5, 7 whose terms are
generated by a simple formula or rule.
Some examples, each beginning with a0 :
an = 2n + 3
lnm
, a0 = 3
2
an = an−1 + 2fn , a0 = 3, where fn is the Fibbonacci sequence starting with f0 = 0, f1 = 1
The day value of dates that MWFs fall on, beginning with August 3rd, 2015.
an = an−1 + 2
§2.4 #10 (b,c) Find the first six terms of the sequence defined by each of these recurrence relations
and initial conditions.
(b) an = an−1 − an−2 , a0 = 2, a1 = −1
2, −1, −3, −2, 1, 3, . . .
(c) an = 3a2n−1 , a0 = 1
1,
3,
33 ,
37 ,
315 ,
331 . . .
§2.4 #12 (b,c)Show that the sequence {an } is a solution of the recurrence relation an = −3an−1 +
4an−2 if
(b) an = 1:
Check:
an = 1 = −3(1) + 4(1) = −3an−1 + 4an−2
X.
8
(c) an = (−4)n :
Check:
−3an−1 + 4an−2 = −3 ∗ (−4)n−1 + 4 ∗ (−4)n−2 = −3 ∗ (−4)n−1 − (−4)n−1 = (−4)n = an
X.
§2.4 #14 (c,d,e) For each of these sequences find a recurrence relation satisfied by this sequence.
(The answers are not unique because there are infinitely many different recurrence relations
satisfied by any sequence.)
(c) an = 2n + 3
For example, a0 = 3 and an = an−1 + 2.
(d) an = 5n
For example, a0 = 1 and an = 5an−1 .
(e) an = n2
For example, a0 = 0 and an = an−1 +2n−1 (since (n−1)2 = n2 −2n+1).
§2.4 #43 (a,b,c) What are the values of the following products?
10
Y
(a)
i = 0 ∗ 1 ∗ 2 ∗ · · · ∗ 10 = 0
i=0
(b)
8
Y
i = 5 ∗ 6 ∗ 7 ∗ 8 = 1680
i=5
100
Y
(c)
(−1)i
i=1
100
Y
(−1)i = (−1)(−1)2 (−1)3 · · · (−1)100
i=1
= (−1)1+2+3+···+100 = (−1)100∗101/2 = (−1)5050 = 1
§2.4 #44 Express n! using product notation.
n! =
n
Y
i=1
i.