Download For each of the following sets, determine whether {2}

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Eisenstein's criterion wikipedia , lookup

Factorization wikipedia , lookup

Structure (mathematical logic) wikipedia , lookup

Birkhoff's representation theorem wikipedia , lookup

Corecursion wikipedia , lookup

Exponentiation wikipedia , lookup

Factorial wikipedia , lookup

Transcript
Discrete Mathematics: Solutions to Homework 2
1. (12%) For each of the following sets, determine whether {2} is an element of that
set.
(a) {x ∈ R| x is an integer greater than 1}
(b) {x ∈ R| x is the square of an integer}
(c) {2,{2}}
(d) {{2},{{2}}}
(e) {{2},{2,{2}}}
(f ) {{{2}}}
Sol:
(a) Since the set contains only integers and {2} is a set, not an integer, {2} is not
an element.
(b) Since the set contains only integers and {2} is a set, not an integer, {2} is not
an element.
(c) The set has two elements. One of them is patently {2}.
(d) The set has two elements. One of them is patently {2}.
(e) The set has two elements. One of them is patently {2}.
(f ) The set has only one element, {{{2}}}; Since this is not the same as {2} (the
former is a set containing a set, whereas the latter is a set containing a nubmer),
{2} is not an element of {{{2}}}.
2. (8%) What is the cardinality of each of these sets?
(a) ϕ
(b) {ϕ}
(c) {ϕ, {ϕ}}
(d) {ϕ, {ϕ}, {ϕ, {ϕ}}}
Sol:
(a) The empty set has no elements, so its cardinality is 0.
(b) This set has one element (the empty set), so its cardinality is 1.
(c) This set has two elements, so its cardinality is 2.
(d) This set has three elements, so its cardinality is 3.
3. (12%) Determine whether each of these sets is the power set of a set, where a and
b are distinct elements.
(a) ϕ
(b) {ϕ, {a}}
(c) {ϕ, {a}, {ϕ, a}}
(d) {ϕ, {a}, {b}, {a, b}}
Sol:
(a) The power set of every set includes at least the empty set, so the power set
cannot be empty. Thus ϕ is not the power set of any set.
(b) This is the power set of {a}.
(c) This set has three elements. Since 3 is not a power of 2, this set cannot be the
power set of any set.
(d) This is the power set of {a, b}.
4. (5%) Find the sets A and B if A − B = {1, 5, 7, 8}, B − A = {2, 10}, and
A ∩ B = {3, 6, 9}.
Sol: Since A = (A − B) ∪ (A ∩ B), we conclude that A = {1, 5, 7, 8} ∪ {3, 6, 9} =
{1, 3, 5, 6, 7, 8, 9}. Similarly B = (B−A)∪(A∩B) = {2, 10}∪{3, 6, 9} = {2, 3, 6, 9, 10}.
5. (6%) Let A, B, and C be sets. Show that (A − B) − C = (A − C) − (B − C).
Sol: First suppose x is in the left-hand side. Then x must be in A but in neither B
nor C. Thus x ∈ A − C, but x ∈
/ B − C, so x is in the right-hand side. Next suppose
that x is in the right-hand side. Thus x must be in A − C and not in B − C. The
first of these implies that x ∈ A and x ∈
/ C. But now it must also be the case that
x∈
/ B, since otherwise we would have x ∈ B − C. Thus we have shown that x is in
A but in neither B nor C, which implies that x is in the left-hand side.
6. (9%) Draw the Venn diagrams for each of these combinations of the sets A, B, and
C.
(a) A ∩ (B ∪ C)
(b) A ∩ B ∩ C
(c) (A − B) ∪ (A − C) ∪ (B − C)
Sol:
(a)
(b)
(c)
7. (3%) Determine whether f is a function from Z to R if
(a) f (n) = ±n
(b) f (n) =
√
n2 + 1
(c) f (n) = 1/(n2 − 4)
(Please describe the reason.)
Sol:
(a) This is not a function because the rule is not well-defined. We do not know
whether f (3) = 3 or f (3) = −3. For a function, it cannot be both at the same
time.
(b) This is a function. For all integers n,
√
n2 + 1 is a well-defined real number.
(c) This is not a function with domain Z, since for n = 2 (and also for n = −2) the
value of f (n) is not defined by the given rule. In other words, f (2) and f (−2)
are not specified since division by 0 makes no sense.
8. (4%) Determine whether each of these functions from Z to Z is one-to-one. Please
describe the reason.
(a) f (n) = n − 1
(b) f (n) = n2 + 1
(c) f (n) = n3
(d) f (n) = ⌈n/2⌉
Sol:
(a) This is one-to-one, since if n1 − 1 = n2 − 1, then n1 = n2 .
(b) This is not one-to-one, since, for example, f (3) = f (−3) = 10.
(c) This is one-to-one, since if n31 = n32 , then n1 = n2 (take the cube root of each
side).
(d) This is not one-to-one, since, for example, f (3) = f (4) = 2.
9. (10%) Determine whether f : Z × Z → Z is onto if
(a) f (m, n) = 2m − n
(b) f (m, n) = m2 − n2
(c) f (m, n) = m + n + 1
(d) f (m, n) = |m| − |n|
(e) f (m, n) = m2 − 4
(Please describe the reason.)
Sol:
(a) This is clearly onto, since f (0, −n) = n for every integer n.
(b) This is not onto, since, for example, 2 is not in the range. To see this, if
m2 − n2 = (m − n)(m + 2) = 2, then m and n must have the same parity (both
even or both odd). In either case, both m − n and m + n are then even, so this
expression is divisible by 4 and hence cannot equal 2.
(c) This is onto, since f (0, n − 1) = n for every integer n.
(d) This is onto. To achieve negative values we set m = 0, and to achieve nonnegative values we set n = 0.
(e) This is not onto, for the same reason as in part (b).
10. (8%) Determine whether each of these functions is a bijection from R to R.
(a) f (x) = −3x + 4
(b) f (x) = −3x2 + 7
(c) f (x) = (x + 1)/(x + 2)
(d) f (x) = x5 + 1
Sol:
(a) This is a bijection since the inverse function is f −1 (x) = (4 − x)/3.
(b) This is not one-to-one since f (17) = f (−17), for instance. It is also not onto,
since the range is the interval (−∞, 7]. For example, 42548 is not in the range.
(c) This function is a bijection, but not from R to R. To see that the domain and
range are not R, note that x = −2 is not in the domain, and f (x) = 1 is not
in the range. On the other hand, f is a bijection from R−{−2} to R−{1},
since its inverse is f −1 (x) = (1 − 2x)/(x − 1)
(d) It is clear that this continuous function is increasing throughout its entire domain (R) and it takes on both arbitrarily large values and arbitrarily small
√
(large negative) ones. So it is a bijection. Its inverse is clearly f −1 (x) = 5 x − 1.
11. (4%) Find f ◦ g and g ◦ f , where f (x) = x2 + 1 and g(x) = x + 2, are functions from
R to R.
Sol: We have (f ◦ g)(x) = f (g(x)) = f (x + 2) = (x + 2)2 + 1 = x2 + 4x + 5, whereas
(g ◦ f )(x) = g(f (x)) = g(x2 + 1) = x2 + 1 + 2 = x2 + 3. Note that they are not eual.
12. (8%) For each of these lists of integers, provide a simple formula or rule that generates the terms of an integer sequence that begins with the given list. Assuming
that your formula or rule is correct, determine the next three terms of the sequence.
(a) 3, 6, 11, 18, 27, 38, 51, 66, 83, 102, ...
(b) 1, 10, 11, 100, 101, 110, 111, 1000, 1001, 1010, 1011, ...
(c) 0, 2, 8, 26, 80, 242, 728, 2186, 6560, 19682, ...
(d) 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, ...
Sol:
(a) The n-th term is n2 + 2. The next three terms are 123, 146, 171.
(b) The n-th term is the binary expansion of n. The next three terms are 1100,
1101, 1110.
(c) The n-th term is 3n − 1, the next three terms are 59048, 177146, 531440.
(d) The sequence consists of one 1, followed by two 0s, then three 1s, four 0s, five
1s, and so on, alternating between 0s and 1s and having one more item in each
group than in the previous group. Thus six 0’s will follow next, so the next
three terms aer 0,0,0.
13. (4%) Compute each of these double sums.
(a)
3 ∑
2
∑
(i − j)
i=1 j=1
(b)
3 ∑
2
∑
(3i + 2j)
i=0 j=0
(c)
3 ∑
2
∑
j
i=1 j=0
(d)
2 ∑
3
∑
i2 j 3
i=0 j=0
Sol:
(a) 3
(b) 78
(c) 9
(d) 180
14. (7%) Show that the polynomial function Z+ ×Z+ →Z+ with f (m, n) = (m + n −
2)(m + n − 1)/2 + m is one-to-one and onto.
Sol:
f (1, 1) = 1
f (2, 1) = 3
f (3, 1) = 6
f (4, 1) = 10
f (5, 1) = 15
f (6, 1) = 21
f (1, 2) = 2
f (2, 2) = 5
f (3, 2) = 9
f (4, 2) = 14
f (5, 2) = 20
f (6, 2) = 27
f (1, 3) = 4
f (2, 3) = 8
f (3, 3) = 13 f (4, 3) = 19
f (5, 3) = 26
f (1, 4) = 7
f (2, 4) = 12 f (3, 4) = 18 f (4, 4) = 25
f (1, 5) = 11 f (2, 5) = 17 f (3, 5) = 24
f (1, 6) = 16 f (2, 6) = 23
f (1, 7) = 22
We see by looking at the diagonals of this table that the function takes on successive values as m + n increases. When m + n = 2, f (m, n) = 1. When m + n = 3,
f (m, n) takes on the values 2 and 3. When m + n = 4, f (m, n) takes on the values
4, 5, and 6. And so on. It is clear from the formula that the range of values the
function takes on for a fixed value of m + n, say m + n = x, is
(x−2)(x−1)
2
(x−2)(x−1)
2
+ 1 through
+ (x − 1), since m can assume the values 1,2,3,..., (x − 1) under these
conditions, and the first term in the formula is a fixed positive integer when m + n
is fixed. To show that this function is one-to-one and onto, we merely need to show
that the range of values for x + 1 picks up precisely where the range of values for x
left off, i.e., that f (x − 1, 1) + 1 = f (1, x). We compute:
f (x − 1, 1) + 1 =
(x − 2)(x − 1)
x2 − x + 2
(x − 1)x
+ (x − 1) + 1 =
=
+ 1 = f (1, x)
2
2
2
Extra Exercises:
1. Determine whether these statements are true or false.
(a) ϕ ∈ {ϕ}
(b) ϕ ∈ {ϕ, {ϕ}}
(c) {ϕ} ∈ {ϕ}
(d) {ϕ} ∈ {{ϕ}}
(e) {ϕ} ⊂ {ϕ, {ϕ}}
(f ) {{ϕ}} ⊂ {ϕ, {ϕ}}
(g) {{ϕ}} ⊂ {{ϕ}, {ϕ}}
Sol:
(a) true.
(b) true.
(c) false- see part (a).
(d) true.
(e) true- the one element in the set on the left is an element of the set on the right,
and the sets are not equal.
(f ) true- similar to part (e).
(g) false- the two sets are equal.
2. Let A = {a, b, c}, B = {x, y}, C = {0, 1}. Find
(a) A × B × C
(b) C × B × A
(c) C × A × B
(d) B × B × B
Sol:
(a) {(a, x, 0), (a, x, 1), (a, y, 0), (a, y, 1), (b, x, 0), (b, x, 1), (b, y, 0), (b, y, 1), (c, x, 0), (c, x, 1),
(c, y, 0), (c, y, 1)}
(b) {(0, x, a), (0, x, b), (0, x, c), (0, y, a), (0, y, b), (0, y, c), (1, x, a), (1, x, b), (1, x, c), (1, y, a),
(1, y, b), (1, y, c)}
(c) {(0, a, x), (0, a, y), (0, b, x), (0, b, y), (0, c, x), (0, c, y), (1, a, x), (1, a, y), (1, b, x), (1, b, y),
(1, c, x), (1, c, y)}
(d) {(x, x, x), (x, x, y), (x, y, x), (x, y, y), (y, x, x), (y, x, y), (y, y, x), (y, y, y)}
3. Prove the first De Morgan law by showing that if A and B are sets, A ∪ B = A ∩ B.
Sol: A ∪ B = {x|x ∈
/ A ∪ B}
= {x|¬(x ∈ (A ∪ B))}
= {x|¬(x ∈ A ∨ x ∈ B)}
= {x|¬(x ∈ A) ∧ ¬(x ∈ B)}
= {x|x ∈
/ A∧x∈
/ B}
= {x|x ∈ A ∧ x ∈ B}
= {x|x ∈ A ∩ B} = A ∩ B
4. Show that the set Z+ ×Z+ is countable.
Sol: Problem 14 gave us a one-to-one correspondence between Z+ × Z+ and Z+ .
Since Z+ is countable, so is Z+ × Z+ .