4
Math 2112 Solutions Assignment 6 7.1.31 Given a set S and a subset A, the characteristic function of A, denoted χ A , is a funtion defined from S to Z with the property that for all u S, χ A (u)= 1 if u A 0 if u 6A. Show that each of the following holds for all subsets A and B of S and all u S. a. χ AB (u)= χ A (u) · χ B (u) b. χ AB (u)= χ A (u)+ χ B (u) - χ A (u) · χ B (u) a. Proof: Suppose u A B. Then χ AB (u) = 1. But then u A and u B so χ a (u) · χ B (u) = 1 and hence LHS = RHS. Suppose a 6A B. Then χ AB (u) = 0. But then either u 6A or u 6B, so either χ A (u) = 0 or χ B (u) = 0. Therefore χ A (u) · χ B (u) = 0, and hence LHS = RHS. b. Proof: Suppose u A and u B. Then χ AB (u) = 1. Also, χ A (u)=1 and χ B (u) = 1, so χ A (u)+ χ B (u) - χ A (u) · χ B (u) = 1. So LHS = RHS. The other three cases follow analagously. 7.1.34 Prove that there are infinitely many integers n for which φ(n) is a perfect square. Proof: From 7.1.33, we know that if p is a prime number and k is an inte- ger with k 1, then φ(p k )= p k - p k-1 . Consider p = 2. Then φ(2 k )=2 k - 2 k-1 =2 k-1 = (2 k-1 2 ) 2 . Thus φ(2 k ) is a perfect square whenever k is odd. Thus there are infinitely many integers n such that φ(n) is a perfect square. 7.3.44 Let f (x)= 2x+1 x for all real numbers x 6=0. If the co-domain is the set of all real numbers not equal to 2, is f (x) a one-to-one corre- spondence? If so, find the inverse. Proof: f(x) is one-to-one: Suppose x 1 ,x 2 R with x 1 ,x 2 6= 0 such that 2x 1 +1 x 1 = 2x 2 +1 x 2 (2x 1 + 1)x 2 = (2x 2 + 1)x 1 2x 1 x 2 + x 2 = 2x 1 x 2 + x 1 x 2 = x 1 . 1

Discrete Math

Embed Size (px)

DESCRIPTION

Discrete

Citation preview

Page 1: Discrete Math

Math 2112 SolutionsAssignment 6

7.1.31 Given a set S and a subset A, the characteristic function of A,denoted χA, is a funtion defined from S to Z with the property thatfor all u ∈ S,

χA(u) ={

1 if u ∈ A0 if u 6∈ A.

Show that each of the following holds for all subsets A and B of S andall u ∈ S.a. χA∩B(u) = χA(u) · χB(u)b. χA∪B(u) = χA(u) + χB(u)− χA(u) · χB(u)

a. Proof: Suppose u ∈ A ∩ B. Then χA∩B(u) = 1. But then u ∈ A andu ∈ B so χa(u) · χB(u) = 1 and hence LHS = RHS.

Suppose a 6∈ A ∩ B. Then χA∩B(u) = 0. But then either u 6∈ A or u 6∈ B,so either χA(u) = 0 or χB(u) = 0. Therefore χA(u) · χB(u) = 0, and henceLHS = RHS.

b. Proof: Suppose u ∈ A and u ∈ B. Then χA∪B(u) = 1. Also, χA(u) = 1and χB(u) = 1, so χA(u) + χB(u)− χA(u) · χB(u) = 1. So LHS = RHS. Theother three cases follow analagously.

7.1.34 Prove that there are infinitely many integers n for which φ(n)is a perfect square.

Proof: From 7.1.33, we know that if p is a prime number and k is an inte-ger with k ≥ 1, then φ(pk) = pk − pk−1. Consider p = 2. Then

φ(2k) = 2k − 2k−1 = 2k−1 = (2k−12 )2.

Thus φ(2k) is a perfect square whenever k is odd. Thus there are infinitelymany integers n such that φ(n) is a perfect square.

7.3.44 Let f(x) = 2x+1x for all real numbers x 6= 0. If the co-domain is

the set of all real numbers not equal to 2, is f(x) a one-to-one corre-spondence? If so, find the inverse.

Proof: f(x) is one-to-one: Suppose x1, x2 ∈ R with x1, x2 6= 0 such that

2x1 + 1x1

=2x2 + 1x2

(2x1 + 1)x2 = (2x2 + 1)x1

2x1x2 + x2 = 2x1x2 + x1

x2 = x1.

1

Page 2: Discrete Math

Therefore f(x) is one-to-one.

f(x) is onto: Let y ∈ R such that y 6= 2. Let

x =−1

2− yx(2− y) = −12x− xy = −1

2x+ 1 = xy2x+ 1x

= y

Therefore ∀y∃x such that f(x) = y. Therefore f(x) is onto.

Let f−1(x) = −12−x . Then

f ◦ f−1(x) = f(−1

2− x)

=2( −1

2−x ) + 1−12−x

=−2+2−x

2−x−12−x

=−x

2− x· 2− x−1

= x

Similarly, f−1 ◦ f(x) = x.

7.3.46 a. Let X = {x1, x2, ..., xn} be a set with n elements. Use Ex-ample 7.3.8 as a model to define a one-to-one correspondence fromP(X), the set of all subsets of X, to the set of all strings of 0’s and1’s that have length n.b. Use the one-to-one correspondence of part (a) to deduce that aset with n elements has 2n subsets.

a. Proof: Define f : P(X) 7→ {0, 1}n as f(A) is equal to the binary vectorwith a 1 in column i iff xi ∈ A and 0 otherwise.f is one-to-one: Suppose f(A) = f(B). Then A and B must have the same ele-ments, so A = B.

f is onto: Let α ∈ {0, 1}n. Create a set A such that xi ∈ A iff the i’th col-umn of α is a 1. Therefore A ∈ P(X) and f(A) = α.

b. Proof: Since there is a one-to-one correspondence between P(X) and{0, 1}n, they must have the same cardinality. The set {0, 1}n has 2n elements,so so must P(X).

2

Page 3: Discrete Math

7.4.31 A penny collection contains twelve 1967 pennies, seven 1968pennies, and eleven 1971 pennies. If you are to pick some pennieswithout looking at the dates, how many must you pick to be sure ofgetting at least five pennies from the same year?

Proof: If we take twelve pennies, we could get four from each year. Thus, bythe pigeonhole principle, if we take thirteen pennies, we must get five from someparticular year.

7.4.33 Let A be a set of six positive integers each of which is less that13. Show that there must be two distinct subsets of A whose elementswhen added up give the same sum.

Proof: The largest possible sum for any subset must be 57 since 57 = 12+11+10 + 9 + 8 + 7. The smallest possible sum is 0 since all the integers are positivebut we may take the empty set. Thus there are 58 possible sums. We create afunction from the subsets to the integers from 0 to 57. A subset gets mappedto the sum of its elements. There are 64 possible subsets of a six element set.Thus, since 64 > 58, by the pigeonhole principle, our function cannot be one-to-one. Therefore there exists a number which has two subsets mapped to it.Therefore, there exists two subsets with the same sum.

7.4.37 Show that in any sequence of n2+1 distinct real numbers, theremust be a sequence of length n+ 1 which is either strictly increasingor strictly decreasing.

Proof: Let a1, a2, ..., an2+1 be a sequence of n2 +1 distinct real numbers. Let fbe a function such that f(aj) = (ij , dj), with ij being the length of the longestincreasing sequence starting at aj and dj being the length of the longest decreas-ing sequence starting at aj . Suppose that f(aj) = f(ak) for j 6= k. Assume thatj < k. Thus ij = ik, and dj = dk. Since aj and ak are distinct real numbers,either aj > ak or aj < ak.

If aj > ak, then dj 6= dk, since we may simple add aj to the start of thesequence which is decreasing of length dk starting at ak and we may obtain adecreasing sequence of length dk + 1 starting at aj .

If aj < ak, then ij 6= ik, since we may simple add aj to the start of the se-quence which is increasing of length ik starting at ak and we may obtain adecreasing sequence of length ik + 1 starting at aj . Thus f is one-to-one.

3

Page 4: Discrete Math

Assume by way of contradiction that there is no increasing or decreasing se-quence of length n + 1 among a1, a2, ...an2+1. Then for all k, 1 ≤ ik ≤ n and1 ≤ dk ≤ n. Therefore, there are n2 distinct pairs of the form (ik, dk). Butf maps each ak to a pair (ik, dk), and we know that f is one-to-one. By thepigeonhole principle, this is a contradiction.

Therefore, there must be an increasing or decreasing subsequence of length n+1.

4