Docsity

cs paper upload for fun, Exercises of Computer Communication Systems

Toggle sidebar
bg1
2.1 Sets 131
2.1.7 Using Set Notation with Quantifiers
Sometimes we restrict the domain of a quantified statement explicitly by making use of a par-
ticular notation. For example, ∀x∈S(P(x)) denotes the universal quantification of P(x)overall
elements in the set S. In other words, ∀x∈S(P(x)) is shorthand for ∀x(x∈S→P(x)). Simi-
larly, ∃x∈S(P(x)) denotes the existential quantification of P(x) over all elements in S. That is,
∃x∈S(P(x)) is shorthand for ∃x(x∈S∧P(x)).
EXAMPLE 22 What do the statements ∀x∈R(x2≥0) and ∃x∈Z(x2=1) mean?
Solution: The statement ∀x∈R(x2≥0) states that for every real number x,x2≥0. This state-
ment can be expressed as “The square of every real number is nonnegative.” This is a true
statement.
The statement ∃x∈Z(x2=1) states that there exists an integer xsuch that x2=1. This
statement can be expressed as “There is an integer whose square is 1.” This is also a true state-
ment because x=1 is such an integer (as is −1). ◂
2.1.8 Truth Sets and Quantifiers
We will now tie together concepts from set theory and from predicate logic. Given a predicate
P, and a domain D, we define the truth set of Pto be the set of elements xin Dfor which P(x)
is true. The truth set of P(x) is denoted by {x∈D∣P(x)}.
EXAMPLE 23 What are the truth sets of the predicates P(x), Q(x), and R(x), where the domain is the set of
integers and P(x)is“|x|=1,” Q(x)is“x2=2,” and R(x)is“|x|=x.”
Solution: The truth set of P,{x∈Z∣|x|=1}, is the set of integers for which |x|=1. Because
|x|=1 when x=1orx=−1, and for no other integers x, we see that the truth set of Pis the
set {−1,1}.
The truth set of Q,{x∈Z∣x2=2}, is the set of integers for which x2=2. This is the
empty set because there are no integers xfor which x2=2.
The truth set of R,{x∈Z∣|x|=x}, is the set of integers for which |x|=x. Because |x|=x
if and only if x≥0, it follows that the truth set of Ris N, the set of nonnegative integers. ◂
Note that ∀xP(x) is true over the domain Uif and only if the truth set of Pis the set U.
Likewise, ∃xP(x) is true over the domain Uif and only if the truth set of Pis nonempty.
Exercises
1. List the members of these sets.
a) {x∣xis a real number such that x2=1}
b) {x∣xis a positive integer less than 12}
c) {x∣xis the square of an integer and x<100}
d) {x∣xis an integer such that x2=2}
2. Use set builder notation to give a description of each of
these sets.
a) {0,3,6,9,12}
b) {−3,−2,−1,0,1,2,3}
c) {m, n, o, p}
3. Which of the intervals (0,5), (0,5], [0,5), [0,5], (1,4],
[2,3], (2,3) contains
a) 0? b) 1?
c) 2? d) 3?
e) 4? f) 5?
4. For each of these intervals, list all its elements or explain
why it is empty.
a) [a, a]b) [a, a)
c) (a, a]d) (a, a)
e) (a, b), where a>bf) [a, b], where a>b
pf3
pf4
pf5

Partial preview of the text

Download cs paper upload for fun and more Exercises Computer Communication Systems in PDF only on Docsity!

2.1 Sets 131

2.1.7 Using Set Notation with Quantifiers

Sometimes we restrict the domain of a quantified statement explicitly by making use of a par-

ticular notation. For example, ∀x ∈ S(P(x)) denotes the universal quantification of P(x) over all

elements in the set S. In other words, ∀x ∈ S(P(x)) is shorthand for ∀x(x ∈ S → P(x)). Simi-

larly, ∃x ∈ S(P(x)) denotes the existential quantification of P(x) over all elements in S. That is,

∃x ∈ S(P(x)) is shorthand for ∃x(x ∈ S ∧ P(x)).

EXAMPLE 22 What do the statements ∀x ∈ R (x^2 ≥ 0) and ∃x ∈ Z (x^2 = 1) mean?

Solution: The statement ∀x ∈ R (x^2 ≥ 0) states that for every real number x, x^2 ≥ 0. This state-

ment can be expressed as “The square of every real number is nonnegative.” This is a true

statement.

The statement ∃x ∈ Z (x^2 = 1) states that there exists an integer x such that x^2 = 1. This

statement can be expressed as “There is an integer whose square is 1.” This is also a true state-

ment because x = 1 is such an integer (as is −1). ◂

2.1.8 Truth Sets and Quantifiers

We will now tie together concepts from set theory and from predicate logic. Given a predicate

P, and a domain D, we define the truth set of P to be the set of elements x in D for which P(x)

is true. The truth set of P(x) is denoted by {x ∈ D ∣ P(x)}.

EXAMPLE 23 What are the truth sets of the predicates P(x), Q(x), and R(x), where the domain is the set of

integers and P(x) is “|x| = 1,” Q(x) is “x^2 = 2,” and R(x) is “|x| = x.”

Solution: The truth set of P, {x ∈ Z ∣ |x| = 1 }, is the set of integers for which |x| = 1. Because

|x| = 1 when x = 1 or x = −1, and for no other integers x, we see that the truth set of P is the

set {− 1 , 1 }.

The truth set of Q, {x ∈ Z ∣ x^2 = 2 }, is the set of integers for which x^2 = 2. This is the

empty set because there are no integers x for which x^2 = 2.

The truth set of R, {x ∈ Z ∣ |x| = x}, is the set of integers for which |x| = x. Because |x| = x

if and only if x ≥ 0, it follows that the truth set of R is N , the set of nonnegative integers. ◂

Note that ∀xP(x) is true over the domain U if and only if the truth set of P is the set U.

Likewise, ∃xP(x) is true over the domain U if and only if the truth set of P is nonempty.

Exercises

1. List the members of these sets. a) {x ∣ x is a real number such that x^2 = 1 } b) {x ∣ x is a positive integer less than 12} c) {x ∣ x is the square of an integer and x < 100 } d) {x ∣ x is an integer such that x^2 = 2 } 2. Use set builder notation to give a description of each of these sets. a) { 0 , 3 , 6 , 9 , 12 } b) {− 3 , − 2 , − 1 , 0 , 1 , 2 , 3 } c) {m, n, o, p} 3. Which of the intervals (0, 5), (0, 5], [0, 5), [0, 5], (1, 4], [2, 3], (2, 3) contains a) 0? b) 1?

c) 2? d) 3?

e) 4? f ) 5?

4. For each of these intervals, list all its elements or explain why it is empty. a) [a, a] b) [a, a)

c) (a, a] d) (a, a)

e) (a, b), where a > b f ) [a, b], where a > b

132 2 / Basic Structures: Sets, Functions, Sequences, Sums, and Matrices

5. For each of these pairs of sets, determine whether the first is a subset of the second, the second is a subset of the first, or neither is a subset of the other. a) the set of airline flights from New York to New Delhi, the set of nonstop airline flights from New York to New Delhi b) the set of people who speak English, the set of people who speak Chinese c) the set of flying squirrels, the set of living creatures that can fly 6. For each of these pairs of sets, determine whether the first is a subset of the second, the second is a subset of the first, or neither is a subset of the other. a) the set of people who speak English, the set of people who speak English with an Australian accent b) the set of fruits, the set of citrus fruits c) the set of students studying discrete mathematics, the set of students studying data structures 7. Determine whether each of these pairs of sets are equal. a) { 1 , 3 , 3 , 3 , 5 , 5 , 5 , 5 , 5 } , { 5 , 3 , 1 } b) {{ 1 }} , { 1 , { 1 }} c) ∅ , {∅} 8. Suppose that A = { 2 , 4 , 6 }, B = { 2 , 6 }, C = { 4 , 6 }, and D = { 4 , 6 , 8 }. Determine which of these sets are subsets of which other of these sets. 9. 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 }}} 10. For each of the sets in Exercise 9, determine whether { 2 } is an element of that set. 11. Determine whether each of these statements is true or false. a) 0 ∈ ∅ b) ∅ ∈ { 0 } c) { 0 } ⊂ ∅ d) ∅ ⊂ { 0 } e) { 0 } ∈ { 0 } f ) { 0 } ⊂ { 0 } g) {∅} ⊆ {∅} 12. Determine whether these statements are true or false. a) ∅ ∈ {∅} b) ∅ ∈ {∅ , {∅}} c) {∅} ∈ {∅} d) {∅} ∈ {{∅}} e) {∅} ⊂ {∅ , {∅}} f ) {{∅}} ⊂ {∅ , {∅}} g) {{∅}} ⊂ {{∅} , {∅}} 13. Determine whether each of these statements is true or false. a) x ∈ { x } b) { x } ⊆ { x } c) { x } ∈ { x } d) { x } ∈ {{ x }} e) ∅ ⊆ { x } f ) ∅ ∈ { x } 14. Use a Venn diagram to illustrate the subset of odd inte- gers in the set of all positive integers not exceeding 10. 15. Use a Venn diagram to illustrate the set of all months of the year whose names do not contain the letter R in the set of all months of the year. 16. Use a Venn diagram to illustrate the relationship A ⊆ B and B ⊆ C. 17. Use a Venn diagram to illustrate the relationships A ⊂ B and B ⊂ C. 18. Use a Venn diagram to illustrate the relationships A ⊂ B and A ⊂ C. 19. Suppose that A, B , and C are sets such that A ⊆ B and B ⊆ C. Show that A ⊆ C. 20. Find two sets A and B such that A ∈ B and A ⊆ B. 21. What is the cardinality of each of these sets? a) { a } b) {{ a }} c) { a, { a }} d) { a, { a } , { a, { a }}} 22. What is the cardinality of each of these sets? a) ∅ b) {∅} c) {∅ , {∅}} d) {∅ , {∅} , {∅ , {∅}}} 23. Find the power set of each of these sets, where a and b are distinct elements. a) { a } b) { a, b } c) {∅ , {∅}} 24. Can you conclude that A = B if A and B are two sets with the same power set? 25. How many elements does each of these sets have where a and b are distinct elements? a) ({ a, b, { a, b }}) b) ({∅ , a, { a } , {{ a }}}) c) ((∅)) 26. 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 }} 27. Prove that ( A ) ⊆ ( B ) if and only if A ⊆ B. 28. Show that if A ⊆ C and B ⊆ D , then A × B ⊆ C × D 29. Let A = { a, b, c, d } and B = { y, z }. Find a) A × B. b) B × A. 30. What is the Cartesian product A × B , where A is the set of courses offered by the mathematics department at a university and B is the set of mathematics professors at this university? Give an example of how this Cartesian product can be used. 31. What is the Cartesian product A × B × C , where A is the set of all airlines and B and C are both the set of all cities in the United States? Give an example of how this Carte- sian product can be used. 32. Suppose that A × B = ∅, where A and B are sets. What can you conclude? 33. Let A be a set. Show that ∅ × A = A × ∅ = ∅. 34. Let A = { a, b, c }, B = { x, y }, and C = { 0 , 1 }. Find a) A × B × C. b) C × B × A. c) C × A × B. d) B × B × B. 35. Find A^2 if a) A = { 0 , 1 , 3 }. b) A = { 1 , 2 , a, b }. 36. Find A^3 if a) A = { a }. b) A = { 0 , a }. 37. How many different elements does A × B have if A has m elements and B has n elements? 38. How many different elements does A × B × C have if A has m elements, B has n elements, and C has p elements?

144 2 / Basic Structures: Sets, Functions, Sequences, Sums, and Matrices

P − Q = {max(4 − 3 , 0) ⋅ a, max(1 − 4 , 0) ⋅ b, max(3 − 0 , 0) ⋅ c, max(0 − 2 , 0) ⋅ d}

= { 1 ⋅ a, 0 ⋅ b, 3 ⋅ c, 0 ⋅ d} = { 1 ⋅ a, 3 ⋅ c}, and

P + Q = {(4 + 3) ⋅ a, (1 + 4) ⋅ b, (3 + 0) ⋅ c, (0 + 2) ⋅ d}

= { 7 ⋅ a, 5 ⋅ b, 3 ⋅ c, 2 ⋅ d}. ◂

Exercises

1. Let A be the set of students who live within one mile of school and let B be the set of students who walk to classes. Describe the students in each of these sets. a) A ∩ B b) A ∪ B c) A − B d) B − A 2. Suppose that A is the set of sophomores at your school and B is the set of students in discrete mathematics at your school. Express each of these sets in terms of A and B. a) the set of sophomores taking discrete mathematics in your school b) the set of sophomores at your school who are not tak- ing discrete mathematics c) the set of students at your school who either are sophomores or are taking discrete mathematics d) the set of students at your school who either are not sophomores or are not taking discrete mathematics 3. Let A = { 1 , 2 , 3 , 4 , 5 } and B = { 0 , 3 , 6 }. Find a) A ∪ B. b) A ∩ B. c) A − B. d) B − A. 4. Let A = {a, b, c, d, e} and B = {a, b, c, d, e, f, g, h}. Find a) A ∪ B. b) A ∩ B. c) A − B. d) B − A.

In Exercises 5–10 assume that A is a subset of some underly- ing universal set U.

5. Prove the complementation law in Table 1 by showing that A = A. 6. Prove the identity laws in Table 1 by showing that a) A ∪ ∅ = A. b) A ∩ U = A. 7. Prove the domination laws in Table 1 by showing that a) A ∪ U = U. b) A ∩ ∅ = ∅. 8. Prove the idempotent laws in Table 1 by showing that a) A ∪ A = A. b) A ∩ A = A. 9. Prove the complement laws in Table 1 by showing that a) A ∪ A = U_._ b) A ∩ A = ∅. 10. Show that a) A − ∅ = A. b) ∅ − A = ∅. 11. Let A and B be sets. Prove the commutative laws from Table 1 by showing that a) A ∪ B = B ∪ A. b) A ∩ B = B ∩ A. 12. Prove the first absorption law from Table 1 by showing that if A and B are sets, then A ∪ (A ∩ B) = A. 13. Prove the second absorption law from Table 1 by show- ing that if A and B are sets, then A ∩ (A ∪ B) = A. 14. Find the sets A and B if A − B = { 1 , 5 , 7 , 8 }, B − A = { 2 , 10 }, and A ∩ B = { 3 , 6 , 9 }. 15. Prove the second De Morgan law in Table 1 by showing that if A and B are sets, then A ∪ B = A ∩ B a) by showing each side is a subset of the other side. b) using a membership table. 16. Let A and B be sets. Show that a) (A ∩ B) ⊆ A. b) A ⊆ (A ∪ B). c) A − B ⊆ A. d) A ∩ (B − A) = ∅. e) A ∪ (B − A) = A ∪ B. 17. Show that if A and B are sets in a universe U then A ⊆ B if and only if A ∪ B = U. 18. Given sets A and B in a universe U, draw the Venn dia- grams of each of these sets. a) A → B = {x ∈ U | x ∈ A → x ∈ B} b) A ↔ B = {x ∈ U | x ∈ A ↔ x ∈ B} 19. Show that if A, B, and C are sets, then A ∩ B ∩ C = A ∪ B ∪ C a) by showing each side is a subset of the other side. b) using a membership table. 20. Let A, B, and C be sets. Show that a) (A ∪ B) ⊆ (A ∪ B ∪ C). b) (A ∩ B ∩ C) ⊆ (A ∩ B). c) (A − B) − C ⊆ A − C. d) (A − C) ∩ (C − B) = ∅. e) (B − A) ∪ (C − A) = (B ∪ C) − A. 21. Show that if A and B are sets, then a) A − B = A ∩ B. b) (A ∩ B) ∪ (A ∩ B) = A. 22. Show that if A and B are sets with A ⊆ B, then a) A ∪ B = B. b) A ∩ B = A. 23. Prove the first associative law from Table 1 by show- ing that if A, B, and C are sets, then A ∪ (B ∪ C) = (A ∪ B) ∪ C. 24. Prove the second associative law from Table 1 by show- ing that if A, B, and C are sets, then A ∩ (B ∩ C) = (A ∩ B) ∩ C. 25. Prove the first distributive law from Table 1 by showing that if A, B, and C are sets, then A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C).

2.2 Set Operations 145

26. Let A, B, and C be sets. Show that (A − B) − C = (A − C) − (B − C). 27. Let A = { 0 , 2 , 4 , 6 , 8 , 10 }, B = { 0 , 1 , 2 , 3 , 4 , 5 , 6 }, and C = { 4 , 5 , 6 , 7 , 8 , 9 , 10 }. Find a) A ∩ B ∩ C. b) A ∪ B ∪ C. c) (A ∪ B) ∩ C. d) (A ∩ B) ∪ C. 28. 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) 29. Draw the Venn diagrams for each of these combinations of the sets A, B, and C. a) A ∩ (B − C) b) (A ∩ B) ∪ (A ∩ C) c) (A ∩ B) ∪ (A ∩ C) 30. Draw the Venn diagrams for each of these combinations of the sets A, B, C, and D. a) (A ∩ B) ∪ (C ∩ D) b) A ∪ B ∪ C ∪ D c) A − (B ∩ C ∩ D) 31. What can you say about the sets A and B if we know that a) A ∪ B = A? b) A ∩ B = A? c) A − B = A? d) A ∩ B = B ∩ A? e) A − B = B − A? 32. Can you conclude that A = B if A, B, and C are sets such that a) A ∪ C = B ∪ C? b) A ∩ C = B ∩ C? c) A ∪ C = B ∪ C and A ∩ C = B ∩ C? 33. Let A and B be subsets of a universal set U. Show that A ⊆ B if and only if B ⊆ A_._ 34. Let A, B, and C be sets. Use the the identity A − B = A ∩ B, which holds for any sets A and B, and the identities from Table 1 to show that (A − B) ∩ (B − C) ∩ (A − C) = ∅. 35. Let A, B, and C be sets. Use the identities in Table 1 to show that (A ∪ B) ∩ (B ∪ C) ∩ (A ∪ C) = A ∩ B ∩ C. 36. Prove or disprove that for all sets A, B, and C, we have a) A × (B ∪ C) = (A × B) ∪ (A × C). b) A × (B ∩ C) = (A × B) ∩ (A × C). 37. Prove or disprove that for all sets A, B, and C, we have a) A × (B − C) = (A × B) − (A × C). b) A × (B ∪ C) = A × (B ∪ C).

The symmetric difference of A and B, denoted by A ⊕ B, is the set containing those elements in either A or B, but not in both A and B.

38. Find the symmetric difference of { 1 , 3 , 5 } and { 1 , 2 , 3 }. 39. Find the symmetric difference of the set of computer sci- ence majors at a school and the set of mathematics majors at this school. 40. Draw a Venn diagram for the symmetric difference of the sets A and B. 41. Show that A ⊕ B = (A ∪ B) − (A ∩ B). 42. Show that A ⊕ B = (A − B) ∪ (B − A). 43. Show that if A is a subset of a universal set U, then a) A ⊕ A = ∅. b) A ⊕ ∅ = A. c) A ⊕ U = A. d) A ⊕ A = U. 44. Show that if A and B are sets, then a) A ⊕ B = B ⊕ A. b) (A ⊕ B) ⊕ B = A. 45. What can you say about the sets A and B if A ⊕ B = A? ∗ (^) 46. Determine whether the symmetric difference is associa- tive; that is, if A, B, and C are sets, does it follow that A ⊕ (B ⊕ C) = (A ⊕ B) ⊕ C? ∗ (^) 47. Suppose that A, B, and C are sets such that A ⊕ C = B ⊕ C. Must it be the case that A = B? 48. If A, B, C, and D are sets, does it follow that (A ⊕ B) ⊕ (C ⊕ D) = (A ⊕ C) ⊕ (B ⊕ D)? 49. If A, B, C, and D are sets, does it follow that (A ⊕ B) ⊕ (C ⊕ D) = (A ⊕ D) ⊕ (B ⊕ C)? 50. Show that if A and B are finite sets, then A ∪ B is a finite set. 51. Show that if A is an infinite set, then whenever B is a set, A ∪ B is also an infinite set. ∗ (^) 52. Show that if A, B, and C are sets, then

|A ∪ B ∪ C| = |A| + |B| + |C| − |A ∩ B| − |A ∩ C| − |B ∩ C| + |A ∩ B ∩ C|.

(This is a special case of the inclusion–exclusion princi- ple, which will be studied in Chapter 8.)

53. Let A (^) i = { 1 , 2 , 3 , … , i} for i = 1 , 2 , 3 ,. … Find

a)

⋃^ n

i= 1

A (^) i. b)

⋂^ n

i= 1

A (^) i.

54. Let A (^) i = {… , − 2 , − 1 , 0 , 1 , … , i}. Find

a)

⋃^ n

i= 1

A (^) i. b)

⋂^ n

i= 1

A (^) i.

55. Let A (^) i be the set of all nonempty bit strings (that is, bit strings of length at least one) of length not exceeding i. Find

a)

⋃^ n

i= 1

A (^) i. b)

⋂^ n

i= 1

A (^) i.

56. Find

i= 1 A^ i^ and^

i= 1 A^ i^ if for every positive integer^ i, a) A (^) i = {i, i + 1 , i + 2 , …}. b) A (^) i = { 0 , i}. c) A (^) i = (0, i), that is, the set of real numbers x with 0 < x < i_._ d) A (^) i = (i, ∞), that is, the set of real numbers x with x > i_._

57. Find

i= 1 A^ i^ and^

i= 1 A^ i^ if for every positive integer^ i, a) A (^) i = {−i, −i + 1 , … , − 1 , 0 , 1 , … , i − 1 , i}. b) A (^) i = {−i, i}. c) A (^) i = [−i, i], that is, the set of real numbers x with −i ≤ x ≤ i_._ d) A (^) i = [i, ∞), that is, the set of real numbers x with x ≥ i_._

58. Suppose that the universal set is U = { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 }. Express each of these sets with bit strings where the ith bit in the string is 1 if i is in the set and 0 otherwise. a) { 3 , 4 , 5 } b) { 1 , 3 , 6 , 10 } c) { 2 , 3 , 4 , 7 , 8 , 9 }