Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
50
Добавлен:
20.03.2016
Размер:
811.61 Кб
Скачать

Prove that F and G are 1-1. Also, prove that F G and G F are both 1-1 and onto.

7. F is 1-1 since each of 1, 2, 3, 4, 5 has a distinct value as its image under

F .

By examining the tables for F G and G F , you will see the conclusion.

F G : 1

! 5

G F : 1

! 1

2

! 2

2

! 2

3

! 3

3

! 4

4

!

1

4

!

5

5

!

4

5

!

3

9. If a class has 89 students, how many (at least) must have a birthday on the same day of the week?

9.

89 1

7

+ 1 = 13

11. From the standard deck of 52 cards, how many cards must be chosen so that three cards from the same suit will always be included in the selection?

11.

m 1

4

+ 1 = 3

Review Questions

1.We de ne three functions, with de nitions involving unspeci ed constants a and b. In each case, whether the function de ned as onto depends on the values of a and b. For what values of the constants a and b are the following functions onto?

(a)F1 : Q ! Q where F1(x) = ax + b with a; b 2 Q

(b)F2 : Z ! Z where F2(x) = ax + b with a; b 2 Z

(c)F3 : N ! N where F3(x) = ax + b with a; b 2 N

1. All three functions can be proven to be 1{1 using the same proof. Let x1 and x2 be two elements in the domain of one of the functions. Suppose

F (x1) = F (x2): This means ax1 + b = ax2 + b or x1 = x2 which proves the function is 1{1 provided a 6= 0:

The question of which of these functions is onto depends on the domain.

1. (a) Q The function F (x) = ax + b where a; b 2 Q is onto if for any y0 2 Q there is an x0 such that y0 = ax0 + b: Solving this equation for x0 is always possible provided a 6= 0:

1. (b) Z: The function F (x) = ax + b where a; b 2 Z is onto if for any y0 2 Z there is an x0 such that y0 = ax0 + b: Solving this equation for x0 gives x0 = (y0 b)=a: This equation can be solved in Z for all y0 2 Z provided a = 1 or a = 1:

1. (c) N: The function F (x) = ax + b where a; b 2 N is onto if for any y0 2 N there is an x0 such that y0 = ax0 + b: Solving this equation for x0 gives x0 = (y0 b)=a: For this equation to be solved in N for all y0 2 Z not only does a have to be 1, but also b must be zero. If b is a nonzero natural number then no natural number between 0 and b would be the image of any x 2 N.

3.Show that the set f3, 6, 9, 12, . . . g is countable.

3. The function F : N ! f3; 6; 9; 12; : : :g, where F (n) = 3(n + 1) is a bijection.

5.(a) The lattice points in the plane R2 are the points (x; y) where x and y are both integers. Prove that there are only countably many lattice points in R2:

(b) The lattice points in three-dimensional space R3 are the points (x; y; z) where x; y, and z are all integers. Prove that there are only countably many lattice points in R3:

5. (a) Use the diagram that proves that the rationals are countable but interpret the point as ordered pairs rather than quotients.

5.(b) Consider the product N X where X consists of the ordered pairs as they were enumerated in part (a). Now look at this product as a two dimensional plane and traverse the points of the form (i; (x; y)) using the grid used to show the rationals are countable. This will enumerate all the 3-dimensional lattice points and prove this is a countable set.

7.Let S be a set of six positive integers who's maximum is at most 14. Show that the sums of the elements in all the nonempty subsets of S cannot all be distinct.

7.For any nonempty subset A of S, the sum of the elements in A, denoted as SA; satis es

1 SA 9 + 10 + 11 + 12 + 13 + 14 = 69

There are 26 1 = 63 nonempty subsets of S. There are too many pigeonholes. So{

Consider the nonempty subsets A where j A j 5: Then

1 SA 10 + 11 + 12 + 13 + 14 = 60

Since there are 62 nonempty subsets of S with A 5, the elements of at least two of these subsets must be the same.

9.(Uses First Order Logic:) This exercise concerns a result needed for the de nition of subsequence. We took it as obvious there, but it does need proof. Let X N.

Part of the job here is to use as simple set theory as possible to de ne the

functions. You may assume that (i) sets ;, X, N, and N X exist; (ii) for every i; j 2 N, (i; j) exists; (iii) for any x, fxg exists; (iv) for any sets x; y, x[y and x y exist; and (v) the collection of elements of any set satisfying some formula of First Order Logic (with quanti ers ranging over numbers and sets) exists. You are to use just this much set theory to show that the function de ned by recursion exists. The problem is that induction may naturally be used to prove that arbitrarily large, nite sets of ordered pairs exist, but it does not allow one to conclude that a particular in nite set of ordered pairs exists.

Prove the following:

(a)Suppose X is nite. Let n = j X j. There is at most one increasing function from f0; 1; : : : ; n 1g onto X. (Hint: Suppose there are two, say, F and G. Prove by induction on i < n that F (i) = G(i):)

(b)If X is in nite, there is at most one increasing function from N onto

X.

9. (a) Solution Required

9. (b) Solution Required

Using Discrete Mathematics in Computer Science

1.Let F be the function that maps strings of characters and blank spaces onto strings of characters by removing all blank spaces and all vowels. For example, F (\dog cat") = \dgct." Let G be the function that maps strings of characters onto integers such that the value of a string is simply the number of characters in the string. What is F (\george washington")? What is G(\george washington")? What is G F (\george washington")? The function F is a simple example of a compression technique.

1. F (\george washington") =

grgwshngtn." G(\george washington") = 17. G F (\george washington") = 10.

3.A computer is used at least one hour a day and at most 102 hours in 12 days. Prove that in at least one pair of the six pairs of non-overlapping consecutive days, the computer was used for 17 hours.

3. Suppose that each pair of days{1,2-3,4-5,6-7,8-9,10-11,12 uses the computer for at most 16 hours. Then the total use would be at most 16 6 = 96 which contradicts the fact that the computer is used for 102 hours during those 12 days. Therefore, at least on pair of days must use the computer at least 17 hours.

5.Prove there is no surjection from N to the set of functions with domain and codomain N:

5. Use Cantor's second diagonal argument.

7. The circumference of each of two concentric disks is divided into 200 sections. For the outer disk, 100 of the sections are painted red and 100 of the sections are painted blue. For the inner disk the sections are painted red and blue in an arbitrary manner. Show that it is possible to align the two disks so that 100 or more of the sections on the inner disk have their color matched with the corresponding section on the outer disk.

7. Hold the outer disk xed and rotate the inner disk through the 200 possible alignments. For each alignment, count the number of matches. This count is 20,000 because each of the 200 sections on the inner disk will match its color to the color on the corresponding section of the outer disk exactly 100 times. Thus, there are

20; 000 1

200

+ 1

matches in some alignment.

9.De ne a hashing function on a Social Security number as follows. Let the

digits of the Social Security number be x1x2x3x4x5x6x7x8x9 and form the three digit number y1y2y3 as follows:

y1 = (x1 +x4 +x7) (mod 5) (use the remainder when x1 +x4 +x7 is divided by 5)

y2 = (x2 + x5 + x8) (mod 10) y3 = (x3 + x6 + x9) (mod 10)

Calculate the hash value for the following social security numbers:

(a)234-54-7654

(b)534-37-9021

(c)435-54-6782

(d)537-98-9092

(e)239-67-4397

Do not deal with collisions, if any occur.

9. (a) 325

9. (b) 324

9. (c) 153

9. (d) 408

9. (e) 190

Соседние файлы в папке Student Solutions Manual