discrete_mathematics_with_a.../chapter_8/exercises.md
2026-08-14 20:02:31 -07:00

6.4 KiB

Page 516

Exercise Set 8.1

  1. As in Example 8.1.2, the congruence modulo $2$ relation E is defined from \mathbb{Z} to \mathbb{Z} as follows: For every ordered pair (m, n) \in \mathbb{Z} \times \mathbb{Z},
 m E n \Leftrightarrow m - n \text{ is even} 

a. Is 0 E 0? Is 5 E 2? Is (6, 6) \in E? Is (-1, 7) \in E?

b. Prove that for any even integer n, n E 0.

  1. Prove that for all integers m and n, m - n is even if, and only if, both m and n are even or both m and n are odd.

  2. The congruence modulo $3$ relation, T, is defined from \mathbb{Z} to \mathbb{Z} as follows: For all integers m and n,

 m T n \Leftrightarrow 3 | (m - n) 

a. Is 10 T 1? Is 1 T 10? Is (2, 2) \in T? Is (8, 1) \in T?

b. List five integers n such that n T 0.

c. List five integers n such that n T 1.

d. List five integers n such that n T 2.

e. Make and prove a conjecture about which integers are related by T to 0, which integers are related to T to 1, and which integers are related to T to 2.

  1. Define a relation P on \mathbb{Z} as follows: For every ordered pair (m, n) \in \mathbb{Z} \times \mathbb{Z},
 m P n \Leftrightarrow m \text{ and } n \text{ have a common prime factor} 

a. Is 15 P 25?

b. Is 22 P 27?

c. Is 0 P 5?

d. Is 8 P 8?

  1. Let X = \{a, b, c\}. Recall that \mathscr{P}(X) as follows: For all sets A and B in \mathscr{P}(X),
 A \mathbf{J} B \Leftrightarrow A \cap B \neq \emptyset 

a. Is \{a\} \mathbf{J} \{c\}?

b. Is \{a, b\} \mathbf{J} \{b, c\}?

c. Is \{a, b} \mathbf{J} \{a, b, c\}?

  1. Define a relation R on \mathbb{Z} as follows: For all integers m and n,
 m R n \Leftrightarrow 5 | (m^2 - n^2) 

a. Is 1 R (-9)?

b. Is 2 R 13?

c. Is 2 R (-8)?

d. Is (-8) R 2?

  1. Let A be the set of all strings of a's and b's of length 4. Define a relation R on A as follows: For every s, t \in A,
 s R t \Leftrightarrow s \text{ has the same first two characters as } t 

a. Is abaa R abba?

b. Is aabb R bbaa?

c. Is aaaa R aaab?

d. Is baaa R abaa?

  1. Let A be the set of all strings of 0's, 1's, and 2's of length 4. Define a relation R on A as follows: For every s, t \in A,
 s R t \Leftrightarrow \text{ the same of the characters in } s \text{ equals the sum of the characters in } t 

a. Is 0121 R 2200?

b. Is 1011 R 2101?

c. Is 2212 R 2121?

d. Is 1220 R 2111?

  1. Let A = \{3, 4, 5\} and B = \{4, 5, 6\} and let R be the "less than" relation. That is, for every ordered pair (x, y) \in A \times B,
 x R y \Leftrightarrow x < y 

State explicitly which ordered pairs are in R and R^{-1}.

  1. Let A = \{3, 4, 5\} and B = \{4, 5, 6\} and let S be the "divides" relation. That is, for every ordered pair (x, y) \in A \times B,
 x S y \Leftrightarrow x | y 

State explicitly which ordered pairs are in S and S^{-1}.

a. Suppose a function F: X \to Y is one-to-one but not onto. Is F^{-1} (the inverse relation for F) a function? Explain your answer.

b. Suppose a function F: X \to Y is onto but not one-to-one. Is F^{-1} (the inverse relation for F) a function? Explain your answer.

Draw the directed graphs of the relations defined in 13-18.

  1. Define a relation R on A = \{0, 1, 2, 3\} by R = \{(0, 0), (1, 2), (2, 2)\}.

  2. Define a relation S on B = \{a, b, c, d\} by S = \{(a, b), (a, c), (b, c), (d, d)\}.

  3. Let A = \{2, 3, 4, 5, 6, 7, 8\} and define a relation R on A as follows: For every x, y \in A,

 x R y \Leftrightarrow x | y 
  1. Let A = \{5, 6, 7, 8, 9, 10\} and define a relation S on A as follows: For every x, y \in A,
 x S y \Leftrightarrow 2 | (x - y) 
  1. Let A = \{2, 3, 4, 5, 6, 7, 8\} and define a relation T on A as follows: For every x, y \in A,
 x T y \Leftrightarrow 3 | (x - y) 
  1. Let A = \{0, 1, 3, 4, 5, 6\} and define a relation V on A as follows: For every x, y \in A,
 x V y \Leftrightarrow 5 | (x^2 - y^2) 

Exercises 19-20 refer to unions and intersections of relations. Since relations are subsets of Cartesian products, their unions and intersections can be calculated as for any subsets. Given two relations R and S from A to B,

 R \cup S = \{(x, y) \in A \times B | (x, y) \in R \text{ or } (x, y) \in S\} 
 R \cap S = \{(x, y) \in A \times B | (x, y) \in R \text{ and } (x, y) \in S\} 
  1. Let A = \{2, 4\} and B = \{6, 8, 10\} and define relations R and S from A to B as follows: For every (x, y) \in A \times B,
 x R y \Leftrightarrow x | y \text{ and } x S y \Leftrightarrow y - 4 = x 

State explicitly which ordered pairs are in A \times B, R, S, R \cup S, and R \cap S.

  1. Let A = \{-1, 1, 2, 4\} and B = \{1, 2\} and define relations R and S from A to B as follows: For every (x, y) \in A \times B,
 x R y \Leftrightarrow |x| = |y| \text{ and } x S y \Leftrightarrow x - y \text{ is even} 

State explicitly which ordered pairs are in A \times B, R, S, R \cup S, and R \cap S.

  1. Define relations R and S on \mathbb{R} as follows:
 R = \{(x, y) \in \mathbb{R} \times \mathbb{R} | x < y\} \text{ and } S = \{(x, y) \in \mathbb{R} \times \mathbb{R} | x = y\}

That is, R is the "less than" relation and S is the "equals" relation on \mathbb{R}. Graph R, S, R \cup S, and R \cap S in the Cartesian plane.

  1. Define relations R and S on \mathbb{R} as follows:
 R = \{(x, y) \in \mathbb{R} \times \mathbb{R} | x^2 + y^2 = 4\} \text{ and } S = \{(x, y) \in \mathbb{R} \times \mathbb{R} | x = y\} 

Graph R, S, R \cup S, and R \cap S in the Cartesian plane.

  1. Define relations R and S on \mathbb{R} as follows:
 R = \{(x, y) \in \mathbb{R} \times \mathbb{R} | y = |x|\} \text{ and } S = \{(x, y) \in \mathbb{R} \times \mathbb{R} | y = 1\} 

Graph R, S, R \cup S, and R \cap S in the Cartesian plane.

  1. In Example 8.1.7 consider the query SELECT Patient_ID#, Name FROM S WHERE Primary_Diagnosis = X. The response query is the projection onto the first two coordinates of the intersection of the database with the set A_1 \times A_2 \times A_3 \times \{X\}.

a. Find the result of the query SELECT Patient_ID#, Name FROM S WHERE Primary_Diagnosis = pneumonia.

b. Find the result of the query SELECT Patient_ID#, Name FROM S WHERE Primary_Diagnosis = appendicitis.