discrete_mathematics_with_a.../chapter_7/exercises.md
2026-07-25 19:42:03 -07:00

15 KiB

Page 458

Exercise Set 7.1

  1. Let X = \{1, 3, 5\} and Y = \{s, t, u, v\}. Define f: X \to Y by the following arrow diagram.

(See page 458 for image)

a. Write the domain of f and the co-domain of f.

b. Find f(1), f(3), and f(5).

c. What is the range of f?

d. Is 3 an inverse image of s? Is 1 an inverse image of u?

e. What is the inverse image of s? of u? of v?

f. Represent f as a set of ordered pairs.

  1. Let X = \{1, 3, 5\} and Y = \{a, b, c, d\}. Define g: X \to Y by the following arrow diagram.

(See page 459 for image)

a. Write the domain of g and the co-domain of g.

b. Find g(1), g(3), and g(5).

c. What is the range of g?

d. Is 3 an inverse image of a? Is 1 an inverse image of b?

e. What is the inverse image of b? of c?

f. Represent g as a set of ordered pairs.

  1. Indicate whether the statements in parts (a)-(d) are true or false for all functions. Justify your answers.

a. If two elements in the domain of a function are equal, then their images in the co-domain are equal.

b. If two elements in the co-domain of a function are equal, then their preimages in the domain are also equal.

c. A function can have the same output for more than one input.

d. A function can have the same input for more than one output.

a. Find all functions from X = \{a, b\} to Y = \{u, v\}.

b. Find all functions from X = \{a, b, c\} to Y = \{u\}.

c. Find all functions from X = \{a, b, c\} to Y = \{u, v\}.

  1. Let I_{\mathbb{z}} bee the identity function defined on the set of all integers, and suppose that e, b_i^{jk}, K(t), and u_{kj} all represent integers. Find the following:

a. I_{\mathbb{Z}}(e)

b. I_{\mathbb{Z}}\left(b_i^{jk}\right)

c. I_{\mathbb{Z}}(K(t))

d. I_{\mathbb{Z}}(u_{kj})

  1. Find functions defined on the set of nonnegative integers that can be used to define the sequences whose first six terms are given below.

a. 1, -\dfrac{1}{3}, \dfrac{1}{5}, -\dfrac{1}{7}, \dfrac{1}{9}, -\dfrac{1}{11}

b. 0, -2, 4, -6, 8, -10

  1. Let A = \{1, 2, 3, 4, 5\}, and define a function F: \mathscr{P}(A) \to \mathbb{Z} as follows: For each set X in \mathscr{P}(A),

F(x) = \begin{cases} 0& \text{if } X \text{ has an even number of elements} \ 1 & \text{if } X \text{ has an odd number of elements} \end{cases}

Find the following:

a. F(\{1, 3, 4\})

b. F(\emptyset)

c. F(\{2, 3\})

d. F(\{2, 3, 4, 5\})

  1. Let J_5 = \{0, 1, 2, 3, 4\}, and define a function F: J_5 \to J_5 as follows: For each x \in J_5, F(x) = (x^3 + 2x + 4) \mod 5.

Find the following:

a. F(0)

b. F(1)

c. F(2)

d. F(3)

e. F(4)

  1. Define a function S: \mathbb{Z}^+ \to \mathbb{Z}^+ as follows: For each positive integer n,
 S(n) = \text{ the sum of the positive divisors of } n 

Find the following:

a. S(1)

b. S(15)

c. S(17)

d. S(5)

e. S(18)

f. S(21)

  1. Let D be the set of all finite subsets of positive integers.

Define a function T: \mathbb{Z}^+ \to D as follows: For each positive integer n, T(n) = the set of positive divisors of n.

Find the following:

a. T(1)

b. T(15)

c. T(17)

d. T(5)

e. T(18)

f. T(21)

  1. Define F: \mathbb{Z} \times \mathbb{Z} \to \mathbb{Z} \times \mathbb{Z} as follows: For every ordered pair (a, b) of integers, F(a, b) = (2a + 1, 3b - 2).

Find the following:

a. F(4, 4)

b. F(2, 1)

c. F(3, 2)

d. F(1, 5)

  1. Let J_5 = \{0, 1, 2, 3, 4\}, and define G: J_5 \times J_5 \to J_5 \times J_5 as follows: For each (a, b) \in J_5 \times J_5,
 G(a, b) = ((2a + 1) \mod 5, (3b - 2) \mod 5) 

Find the following:

a. G(4, 4)

b. G(2, 1)

c. G(3, 2)

d. G(1, 5)

  1. Let J_5 = \{0, 1, 2, 3, 4\}, and define functions f: J_5 \to J_5 and g: J_5 \to J_5 as follows: For each x \in J_5,
 f(x) = (x + 4)^2 \mod 5 \quad \text{ and } \quad g(x) = (x^2 + 3x + 1) \mod 5 

Is f = g? Explain.

  1. Define functions H and K from \mathbb{R} to \mathbb{R} by the following formulas:

For every x \in \mathbb{R},

 H(x) = \lfloor x \rfloor + 1 \quad \text{ and } \quad K(x) = \lceil x \rceil 

Does H = K? Explain.

  1. Let F and G be functions from the set of all real numbers to itself. Define the product functions F \cdot G: \mathbb{R} \to \mathbb{R} and G \cdot F: \mathbb{R} \to \mathbb{R} as follows: For every x \in \mathbb{R},
 (F \cdot G)(x) = F(x) \cdot G(x) 
 (G \cdot F)(x) = G(x) \cdot F(x) 

Does F \cdot G = G \cdot F? Explain.

  1. Let F and G be function sfrom the set of all real numbers to itself. Define new functions F - G: \mathbb{R} \to \mathbb{R} and G - F: \mathbb{R} \to \mathbb{R} as follows: For every x \in \mathbb{R},
 (F - G)(x) = F(x) - G(x) 
 (G - F)(x) = G(x) - F(x) 

Does F - G = G - F? Explain.

  1. Use the definition of logarithm to fill in the blanks below.

a. \log_28 = 3 because _____.

b. \log_5\left(\dfrac{1}{25}\right) = -2 because _____.

c. \log_44 = 1 because _____.

d. \log_3(3^n) = n because _____.

e. \log_41 = 0 because _____.

  1. Find exact values for each of the following quantities without using a calculator.

a. \log_{3}81

b. \log_{2}1024

c. \log_{3}\left(\dfrac{1}{27}\right)

d. \log_{2}1

e. \log_{10}\left(\dfrac{1}{10}\right)

f. \log_{3}3

g. \log_{2}(2^k)

  1. Use the definition of logarithm to prove that for any positive real number b with b \neq 1, \log_{b}b = 1.

  2. Use the definition of logarithm to prove that for any positive real number b with b \neq 1, \log_{b}1 = 0.

  3. If b is any positive real number with b \neq 1 and x is any real number, b^{-x} is defined as follows:

b^{-x} = \dfrac{1}{b^x}. Use this definition and the definition of logarithm to prove that \log_{b}\left(\dfrac{1}{u}\right) = -\log_{b}u for all positive real numbers u and b, with b \neq 1.

  1. Use the unique factorization for the integers theorem (Section 4.4) and the definition of logarithm to prove that \log_{3}(7) is irrational.

  2. If b and y are positive real numbers such that \log_{b}y = 3, what is \log_{\frac{1}{b}}y? Explain.

  3. If b and y are positive real numbers such that \log_{b}y = 2, what is \log_{b^2}(y)? Explain.

  4. Let A = \{2, 3, 5\} and B = \{x, y\}. Let p_1 and p_2 be the projections of A \times B onto the first and second coordinates. That is, for each pair (a, b) \in A \times B, p_1(a, b) = a and p_2(a, b) = b.

a. Find p_1(2, y) and p_1(5, x). What is the range of p_1?

b. Find p_2(2, y) and p_2(5, x). What is the range of p_2?

  1. Observe that \mod and \text{div} can be defined as functions from \mathbb{Z}^{\text{nonneg}} \times \mathbb{Z}^+$ to \mathbb{Z}. For each ordered pair (n, d) consisting of a nonnegative integer n and a positive integer d, let

\mod(n, d) = n \mod d (the nonnegative remainder obtained when n is divided by d).

\text{div}(n, d) = n \text{ div } d (the integer quotient obtained when n is divided by d).

Find each of the following:

a. \mod(67, 10) and \text{div}(67, 10)

b. \mod(59, 8) and \text{div}(59, 8)

c. \mod(30, 5) and \text{div}(30, 5)

  1. Let S be the set of all strings of $a$'s and $b$'s.

a. Define f: S \to Z as follows: For each string s in S

f(s) = \begin{cases} & \text{ the number of b's to the left-most a in s} \ 0 & \text{if s contains no a's} \end{cases}

Find f(aba), f(bbab), and f(b). What is the range of f?

b. Define g: S \to S as follows: For each string s in S,

 g(s) = \text{ the string obtained by writing the characters of s in reverse order} 

Find g(aba), g(bbab), and g(b). What is the range of g?

  1. Consider the coding and decoding functions E and D defined in Example 7.1.9.

a. Find E(0110) and D(111111000111).

b. Find E(1010) and D(000000111111).

  1. Consider the Hamming distance function defined in Example 7.1.10.

a. Find H(10101, 00011.

b. Find H(00110, 10111).

  1. Draw arrow diagrams for the Boolean functions defined by the following input/output tables.

a.

Input Intput Output
P Q R
------- -
1 1 0
1 0 1
0 1 0
0 0 1

b.

Input Intput Input Output
P Q R S
- - - -
1 1 1 1
1 1 0 0
1 0 1 1
1 0 0 1
0 1 1 0
0 1 0 0
0 0 1 0
0 0 0 1
  1. Fill in the following table to show the values of all possible two-place Boolean functions.
Input Input f_1 f_2 f_3 f_4 f_5 f_6 f_7 f_8 f_9 f_{10} f_{11} f_{12} f_{13} f_{14} f_{15} f_{16}
1 1
1 0
0 1
0 0
  1. Consider the three-place Boolean function f defined by the following rule: For each triple (x_1, x_2, x_3) of $0$'s and $1$'s,
 f(x_1, x_2, x_3) = (4x_1 + 3x_2 + 2x_3) \mod 2 

a. Find f(1, 1, 1) and f(0, 0, 1).

b. Describe f using an input/output table.

  1. Student A tries to define a function g: \mathbb{Q} \to \mathbb{Z} by the rule

g\left(\dfrac{m}{n}\right) = m - n, for all integers m and n with n \neq 0.

Student B claims that g is not well defined. Justify student B's claim.

  1. Student C tries to define a function h: \mathbb{Q} \to \mathbb{Q} by the rule

h\left(\dfrac{m}{n}\right) = \dfrac{m^2}{n}, for all integers m and n with n \neq 0.

Student D claims that h is not well defined. Justify student D's claim.

  1. Let U = \{1, 2, 3, 4\}. Student A tries to define a function R: U \to Z as follows: For each x \in U,

R(x) is the integer y so that (xy) \mod 5 = 1.

Student B claims that R is not well defined. Who is correct: student A or student B? Justify your answer.

  1. Let V = \{1, 2, 3\}. Student C tries to define a function S: V \to V as follows: For each x \in V,

S(x) is the integer y in V so that (xy) \mod 4 = 1.

Student D claims that S is not well defined. Who is right: student C or student D? Justify your answer.

  1. On certain computers the integer data type goes from -2,147,483,648 through 2,147,483,647. Let S be the set of all integers from -2,147,483,648 through 2,147,483,647. Try to define a function f: S \to S by the rule f(n) = n^2 for each n in S. Is f well defined? Explain.

  2. Let X = \{a, b, c\} and Y = \{r, s, t, u, v, w\}. Define f: X \to Y as follows: f(a) = v, f(b) = v, and f(c) = t.

a. Draw an arrow diagram for f.

b. Let A = \{a, b\}, C = \{t\}, D = \{u, v\}, and E = \{r, s\}. Find f(A), f(X), f^{-1}(C), f^{-1}(D), f^{-1}(E), and f^{-1}(Y).

  1. Let X = \{1, 2, 3, 4\} and Y = \{a, b, c, d, e\}. Define g: X \to Y as follows: g(1) = a, g(2) = a, g(3) = a, and g(4) = d.

a. Draw an arrow diagram for g.

b. Let A = \{2, 3\}, C = \{a\}, and D = \{b, c\}. Find g(A), g(X), g^{-1}(C), g^{-1}(D), and g^{-1}(Y).

  1. Let X and Y be sets, let A and B be any subsets of X, and let F be a function from X to Y. Fill in the blanks in the following proof that F(A) \cup F(B) \subseteq F(A \cup B).

Proof:

Let y be any element in F(A) \cup F(B). [We must show that y is in F(A \cup B).] By definition of union, __ (i) __.

Case 1 y \in F(A):

In this case, by definition of F(A), y = F(x) for __ (ii) __ x \in A. Since A \subseteq A \cup B, it follows from the definition of union that x \in __ (iii) __. Hence, y = F(x) for some x \in A \cup B, and thus, by definition of F(A \cup B), y \in __ (iv) __.

Case 2, y \in F(B):

In this case, by definition of F(B), __ (v) __ for some x \in B. Since B \subseteq A \cup B it follows from the definition of union that __ (vi) __. Thus y \in F(A \cup B).

Therefore, regardless of whether y \in F(A) or y \in F(B), we have that y \in F(A \cup B) [as was to be shown].

In 41-49 let X and Y be sets, let A and B be any subsets of X, and let C and D be any subsets of Y. Determine which of the properties are true for every function F from X to Y and which are false for at least one function F from X to Y. Justify your answers.

  1. If A \subseteq B then F(A) \subseteq F(B)

  2. F(A \cap B) \subseteq F(A) \cap F(B)

  3. F(A) \cap F(B) \subseteq F(A \cap B)

  4. For all subsets A and B of X, F(A - B) = F(A) - F(B).

  5. For all subsets C and D of Y, if C \subseteq D, then F^{-1}(C) \subseteq F^{-1}(D).

  6. For all subsets C and D of Y,

 F^{-1}(C \cup D) = F^{-1}(C) \cup F^{-1}(D) 
  1. For all subsets C and D of Y,
 F^{-1}(C \cap D) = F^{-1}(C) \cap F^{-1}(D) 
  1. For all subsets C and D of Y,
 F^{-1}(C - D) = F^{-1}(C) - F^{-1}(D) 
  1. F(F^{-1}(C)) \subseteq C

  2. Given a set S and a subset A, the characteristic function of $A$, denoted \chi_A, is the function defined from S to \mathbb{Z} with the property that for each u \in S,

\chi_{A}(u) = \begin{cases} 1 & \text{if } u \in A \ 0 & \text{if } u \notin A \end{cases}

Show that each of the following holds for all subsets A and B of S and every u \in S.

a. \chi_{A \cap B}(u) = \chi_{A}(u) \cdot \chi_{B}(u)

b. \chi_{A \cup B}(u) = \chi_{A}(u) + \chi_{B}(u) - \chi_{A}(u) \cdot \chi_{B}(u)

Each of exercises 51-53 refers to the Euler phi function, denoted \phi, which is defined as follows: For each integer n \geq 1, \phi(n) is the number of positive integers less than or equal to n that have no common factors with n except \pm 1. For example \phi(10) = 4 because there are four positive integers less than or equal to 10 that have no common factors with 10 except \pm 1 - namely, 1, 3, 7, and 9.

  1. Find each of the following:

a. \phi(15)

b. \phi(2)

c. \phi(5)

d. \phi(12)

e. \phi(11)

f. \phi(1)

  1. Prove that if p is a prime number and n is an integer with n \geq 1, then \phi(p^n) = p^n - p^{n - 1}.

  2. Prove that there are infinitely many integers n for which \phi(n) is a perfect square.