diff --git a/chapter_1/1_3_2_1.png b/chapter_1/1_3_2_1.png new file mode 100644 index 0000000..e7e31ee Binary files /dev/null and b/chapter_1/1_3_2_1.png differ diff --git a/chapter_1/1_3_2_2.png b/chapter_1/1_3_2_2.png new file mode 100644 index 0000000..766b44a Binary files /dev/null and b/chapter_1/1_3_2_2.png differ diff --git a/chapter_1/1_3_2_3.png b/chapter_1/1_3_2_3.png new file mode 100644 index 0000000..17d47ba Binary files /dev/null and b/chapter_1/1_3_2_3.png differ diff --git a/chapter_1/1_3_2_4.png b/chapter_1/1_3_2_4.png new file mode 100644 index 0000000..6f14ce2 Binary files /dev/null and b/chapter_1/1_3_2_4.png differ diff --git a/chapter_1/1_3_2_5.png b/chapter_1/1_3_2_5.png new file mode 100644 index 0000000..6aae4d8 Binary files /dev/null and b/chapter_1/1_3_2_5.png differ diff --git a/chapter_1/1_3_2_6.png b/chapter_1/1_3_2_6.png new file mode 100644 index 0000000..c56eded Binary files /dev/null and b/chapter_1/1_3_2_6.png differ diff --git a/chapter_1/1_3_2_7.png b/chapter_1/1_3_2_7.png new file mode 100644 index 0000000..f2d7ed8 Binary files /dev/null and b/chapter_1/1_3_2_7.png differ diff --git a/chapter_1/1_3_2_8.png b/chapter_1/1_3_2_8.png new file mode 100644 index 0000000..4ccdeb5 Binary files /dev/null and b/chapter_1/1_3_2_8.png differ diff --git a/chapter_1/examples.md b/chapter_1/examples.md index 0ef0a52..f85c3c5 100644 --- a/chapter_1/examples.md +++ b/chapter_1/examples.md @@ -13,7 +13,7 @@ b. Given any real number, its square is nonnegative. a. Are there numbers $a$ and $b$ with the property that $a^2 + b^2 = (a + b)^2$? -_Or_: Are there numbers $a$$ and $b$ such that $a^2 + b^2 = (a + b)^2$? +_Or_: Are there numbers $a$ and $b$ such that $a^2 + b^2 = (a + b)^2$? _Or_: Do there exist any numbers $a$ and $b$ such that $a^2 + b^2 = (a + b)^2$? @@ -422,3 +422,296 @@ data structures and to respect the notations that are used for them. Similarly in mathematics, it is important to distinguish among, say, _{a, b, c}, {{ab}, c}, (a, b, c), (a, (b, c)), abc_ and so forth, because these are all significantly different objects. + +--- + +**Example 1.3.1 A Relation as a Subset** + +Page 39 + +Let $A = \{1, 2\}$ and $B = \{1, 2, 3\}$ and define a relation $R$ from $A$ to +$B$ as follows: Given any $(x, y) \in A \times B$. + +$(x, y) \in R$ means that $\dfrac{x - y}{2}$ is an integer. + +a. State explicitly which ordered pairs are in $A \times B$ and which are in +$R$. + +b. Is 1 _R_ 3? Is 2 _R_ 3? Is 2 _R_ 2? + +c. What are the domain and co-domain of _R_? + +**Solution** + +a. State explicitly which ordered pairs are in $A \times B$ and which are in +$R$. + +$$ A \times B = \{(1, 1), (1, 2), (1, 3), (2, 1), (2, 2), (2, 3)\} $$ + +$$ (x, y) \in R = \{(A \times B) | \left(\frac{x - y}{2}\right) \in \mathbb{Z}\} $$ + +$$ R = \{(1, 1), (1, 3), (2, 2)\} $$ + +b. Is 1 _R_ 3? Is 2 _R_ 3? Is 2 _R_ 2? + +Is 1 _R_ 3?: Yes, because $(1, 3) \in R$. + +Is 2 _R_ 3? No, because $(2, 3) \notin R$. + +Is 2 _R_ 2? Yes, because $(2, 2) \in R$. + +c. What are the domain and co-domain of _R_? + +The domain of _R_ is $\{1, 2\}$ and the co-domain of _R_ is $\{1, 2, 3\}$ + +--- + +**Example 1.3.2 The Circle Relation** + +Page 40 + +Define a relation $C$ from $\mathbb{R}$ to $\mathbb{R}$ as follows: For any +$(x, y) \in \mathbb{R} \times \mathbb{R}$. + +$(x, y) \in C$ means that $x^2 + y^2 = 1$. + +a. Is $(1, 0) \in C$? Is $(0, 0) \in C$? Is +$\left(-\dfrac{1}{2}, \dfrac{\sqrt{3}}{2}\right) \in C$? Is -2 _C_ 0? Is 0 _C_ +(-1)? Is 1 _C_ 1? + +b. What are the domain and co-domain of _C_? + +c. Draw a graph for _C_ by plotting the points of _C_ in the Cartesian plane. + +**Solution** + +a. Is $(1, 0) \in C$? Is $(0, 0) \in C$? Is +$\left(-\dfrac{1}{2}, \dfrac{\sqrt{3}}{2}\right) \in C$? Is -2 _C_ 0? Is 0 _C_ +(-1)? Is 1 _C_ 1? + +Is $(1, 0) \in C$? + +Yes, $(1)^2 + (0)^2 = 1$ + +Is $(0, 0) \in C$? + +No, $(0)^2 + (0)^2 = 0 \neq 1$ + +Is $\left(-\dfrac{1}{2}, \dfrac{\sqrt{3}}{2}\right) \in C$? + +Yes, +$\left(-\frac{1}{2}\right)^2 + \left(\frac{\sqrt{3}}{2}\right)^2 = \frac{1}{4} + \frac{3}{4} = 1$ + +Is -2 _C_ 0? + +No because $(-2)^2 + (0)^2 = 4 \neq 1$ + +Is 0 _C_ (-1)? + +Yes because $(0)^2 + (-1)^2 = 1$. + +Is 1 _C_ 1? + +No, because $(1)^2 + (1)^2 = 2 \neq 1$. + +b. What are the domain and co-domain of _C_? + +The domain of _C_ is $\mathbb{R}$ and the co-domain of _C_ is also $\mathbb{R}$. + +c. Draw a graph for _C_ by plotting the points of _C_ in the Cartesian plane. + +This is just the circle formula, so: + +![image 1_3_2_1](./1_3_2_1.png) + +--- + +**Example 1.3.3 Arrow Diagrams and Relations** + +Page 41 + +Let $A = \{1, 2, 3\}$ and $B = \{1, 2, 3\}$ and define relations $S$ and $T$ +from $A$ to $B$ as follows: + +For every $(x, y) \in A \times B$, + +$(x, y) \in S$ means that $x < y$ ($S$ is a "less than" relation). + +$T = \{(2, 1), (2, 5)\}$. + +Draw arrow diagrams for $S$ and $T$. + +**Solution** + +![image 1_3_2_2](./1_3_2_2.png) + +These example relations illustrate that it is possible to have several arrows +coming out of the same element of $A$ pointing in different directions. Also, it +is quite possible to have an element of $A$ that does not have an arrow coming +out of it. + +--- + +**Example 1.3.4 Functions and Relations on Finite Sets** + +Page 42 + +Let $A = \{2, 4, 6\}$ and $B = \{1, 3, 5\}$. Which of the relations $R$, $S$, +and $T$ defined below are functions from $A$ to $B$? + +a. $R = \{(2, 5), (4, 1), (4, 3), (6, 5)\}$ + +b. For every $(x, y) \in A \times B$, $(x, y) \in S$ means that $y = x + 1$. + +c. $T$ is defined by the arrow diagram + +![image 1_3_2_3](./1_3_2_3.png) + +**Solution** + +a. $R = \{(2, 5), (4, 1), (4, 3), (6, 5)\}$ + +$R$ is not a function because it does not satisfy property (2). The ordered +pairs $(4, 1)$ and $(4, 3)$ have the same first element but different second +elements. You can see this graphically if you draw the arrow diagram for $R$. +There are two arrows coming out of 4: One point to 1 and the other points to 3. + +![image 1_3_2_4](./1_3_2_4.png) + +b. For every $(x, y) \in A \times B$, $(x, y) \in S$ means that $y = x + 1$. + +$S$ is not a function because it does not satisfy property (1). It is not true +that every element of $A$ is the first element of an ordered pair in $S$. For +example $6 \in A$ but there is no $y$ in $B$ such that $y = 6 + 1 = 7$. You can +also see this graphically by drawing the arrow diagram for $S$. + +![image 1_3_2_5](./1_3_2_5.png) + +c. $T$ is defined by the arrow diagram + +$T$ is a function: Each element in $\{2, 4, 6\}$ is related to some element in +$\{1, 3, 5\}$, and no element in $\{2, 4, 6\}$ is related to more than one +element in $\{1, 3, 5\}$. When these properties are stated in terms of the arrow +diagram, they become (1) there is an arrow coming out of each element of the +domain, and (2) no element of the domain has more than one arrow coming out of +it. So you can write $T(2) = 5$, $T(4) = 1$, $T(6) = 1$. + +--- + +**Example 1.3.5 Functions and Relations on Sets of Strings** + +Page 43 + +Let $A = \{a, b\}$ and let $S$ be the set of all strings over $A$. + +a. Define a relation $L$ from $S$ to $\mathbb{Z}^{\text{nonneg}}$ as follows: +For every string $s$ in $S$ and for every nonnegative integer $n$, + +$$ (s, n) \in L \text{ means that the length of } s \text{ is } n $$ + +Observe that $L$ is a function because every string in $S$ has one and only one +length. Find _L(abaaba)_ and _L(bbb)_. + +b. Define a relation $C$ from $S$ to $S$ as follows: For all strings $s$ and $t$ +in $S$, + +$$ (s, t) \in C \text{ means that } t = as $$ + +where $as$ is the string obtained by appending $a$ on the left of the characters +in $s$. ($C$ is called **concatenation** by $a$ on the left.) Observe that $C$ +is a function because every string in $S$ consists entirely of $a$'s and $b$'s +and adding an additional $a$ on the left creates a new string that also consists +of $a$'s and $b$'s and thus is also in $S$. Find _C(abaaba)_ and _C(bbb)_. + +**Solution** + +a. Define a relation $L$ from $S$ to $\mathbb{Z}^{\text{nonneg}}$ as follows: +For every string $s$ in $S$ and for every nonnegative integer $n$, + +$$ (s, n) \in L \text{ means that the length of } s \text{ is } n $$ + +Observe that $L$ is a function because every string in $S$ has one and only one +length. Find _L(abaaba)_ and _L(bbb)_. + +_L(abaaba)_ = 6 + +_L(bbb)_ = 3 + +b. Define a relation $C$ from $S$ to $S$ as follows: For all strings $s$ and $t$ +in $S$, + +$$ (s, t) \in C \text{ means that } t = as $$ + +where $as$ is the string obtained by appending $a$ on the left of the characters +in $s$. ($C$ is called **concatenation** by $a$ on the left.) Observe that $C$ +is a function because every string in $S$ consists entirely of $a$'s and $b$'s +and adding an additional $a$ on the left creates a new string that also consists +of $a$'s and $b$'s and thus is also in $S$. Find _C(abaaba)_ and _C(bbb)_. + +_C(abaaba)_ = aabaaba + +_C(bbb)_ = abbb + +--- + +**Example 1.3.6 Functions Defined by Formulas** + +Page 44 + +The **squaring function** $f$ from $\mathbb{R}$ to $\mathbb{R}$ is defined by +the formula $f(x) = x^2$ for every real number $x$. This means that no matter +what real number input is substituted for $x$, the output of $f$ will be the +square of that number. The idea can be represented by writing +$f(\Box) = \Box^2$. In other words, $f$ sends each real number $x$ to $x^2$, or +symbolically, $f: x \to x^2$. Note that the variable $x$ is a dummy variable; +any other symbol could replace it, as long as the replacement is made everywhere +the $x$ appears. + +The **successor function** $g$ from $\mathbb{Z}$ to $\mathbb{Z}$ is defined by +the formula $g(n) = n + 1$. Thus, no matter what integer is substituted for $n$, +the output of $g$ will be that number plus $1$: $g(\Box) = \Box + 1$. In other +words, $g$ sends each integer $n$ to $n + 1$, or, symbolically, +$g: n \to n + 1$. + +An example of a **constant function** is the function $h$ from $\mathbb{Q}$ to +$\mathbb{Z}$ defined by the formula $h(r) = 2$ for all rational numbers $r$. +This function sends each rational number $r$ to $2$. In other words, no matter +what the input, the output is always $2$: $h(\Box) = 2$ or $h: r \to 2$. + +The functions $f$, $g$, and $h$, are represented by the function machines in +Figure 1.3.2 (see page 44). + +A function is an entity in its own right. It can be thought of as a certain +relationship between sets or as an input/output machine that operates according +to a certain rule. This is the reason why a function is generally denoted by a +single symbol or string of symbols, such as $f$, $G$, or $\log$, or $\sin$. + +A relation is a subset of a Cartesian product and a function is a special kind +of relation. Specifically, if $f$ and $g$ are functions from a set $A$ to a set +$B$, then + +$$ f = \{(x, y) \in A \times B | y = f(x)\} \quad \text{ and } g(x) = \{(x, y) \in A \times B | y = g(x)\} $$ + +It follows that + +$$ f \text{ equals } g, \quad \text{ written } f = g, \quad \text{ if, and only if, } f(x) = g(x) \text{ for all } x \text{ in } A $$ + +--- + +**Example 1.3.7 Equality of Functions** + +Page 44 + +Define functions $f$ and $g$ from $\mathbb{R}$ to $\mathbb{R}$ by the following +formulas: + +$$ f(x) = |x| \quad \text{ for every } x \in \mathbb{R} $$ + +$$ g(x) = \sqrt{x^2} \quad \text{ for every } x \in \mathbb{R} $$ + +Does $f = g$? + +**Solution** + +Yes. Because the absolute value of any real number equals the square root of its +square, $|x| = \sqrt{x^2}$ for all $x \in \mathbb{R}$. Hence $f = g$. diff --git a/chapter_1/exercises.md b/chapter_1/exercises.md index c8dac7c..581adb7 100644 --- a/chapter_1/exercises.md +++ b/chapter_1/exercises.md @@ -753,3 +753,431 @@ c. $R \times S \times T$ **Solution** xxxxy, xxxyx, xxyxx, xyxxx, yxxxx + +--- + +**Exercise Set 1.3** + +Page 45 + +1. Let $A = \{2, 3, 4\}$ and $B = \{6, 8, 10\}$ and define a relation $R$ from + $A$ to $B$ as follows: For every $(x, y) \in A \times B$, + +$$ (x, y) \in R \quad \text{ means that } \frac{y}{x} \text{ is an integer.} $$ + +**Solution** + +a. + +Is 4 _R_ 6? + +No, $\dfrac{6}{4} = \dfrac{3}{2}$, which is not an integer. + +Is 4 _R_ 8? + +Yes, $\dfrac{8}{4} = 2$, which is an integer. + +Is $(3, 8) \in R$? + +No, $\dfrac{8}{3}$ is not an integer. + +Is $(2, 10) \in R$? + +Yes, $\dfrac{10}{2} = 5$ which is an integer. + +b. Write _R_ as a set of ordered pairs. + +$$ R = \{(2, 6), (2, 8), (2, 10), (3, 6), (4, 8)\} $$ + +c. Write the domain and co-domain of _R_. + +The domain of _R_ is $\{2, 3, 4\}$. + +The co-domain of _R_ is $\{6, 8, 10\}$. + +d. Draw an arrow diagram for _R_. + +2. Let $C = D = \{-3, -2, -1, 1, 2, 3\}$ and define a relation $S$ from $C$ to + $D$ as follows: For every $(x, y) \in C \times D$, + +$$ (x, y) \in S \quad \text{ means that } \frac{1}{x} - \frac{1}{y} \text{ is an integer.} $$ + +**Solution** + +a. + +Is 2 _S_ 2? + +Yes, $\dfrac{1}{2} - \dfrac{1}{2} = 0 \in \mathbb{Z}$. + +Is -1 _S_ -1? + +Yes $\dfrac{1}{-1} - \dfrac{1}{-1} = 0 \in \mathbb{Z} $ + +Is $(3, 3) \in S$? + +Yes $\dfrac{1}{3} - \dfrac{1}{3} = 0 \in \mathbb{Z} $ + +Is $(3, -3) \in S$? + +No, $\dfrac{1}{3} - \dfrac{1}{-3} = \dfrac{2}{3} \notin \mathbb{Z} $ + +b. Write _S_ as a set of ordered pairs. + +$$ S = \{(-3, -3), (-2, -2), (-1, -1), (1, 1), (2, 2), (3, 3)\} $$ + +c. Write the domain and co-domain of _S_. + +The domain and co-domain of _S_ is $\{-3, -2, -1, 1, 2, 3\}$. + +d. Draw an arrow diagram for _S_. + +3. Let $E = \{1, 2, 3\}$ and $F = \{-2, -1, 0\}$ and define a relation $T$ from + $E$ to $F$ as follows: For every $(x, y) \in E \times F$, + +$$ (x, y) \in T \quad \text{ means that } \frac{x - y}{3} \text{ is an integer.} $$ + +**Solution** + +a. + +Is 3 _T_ 0? + +Yes, $\dfrac{3 - 0}{3} = 1 \in \mathbb{Z}$. + +Is 1 _T_ (-1)? + +No, $\dfrac{(1) - (-1)}{3} = \dfrac{2}{3} \notin \mathbb{Z}$. + +Is $(2, -1) \in T$? + +Yes, $\dfrac{(2) - (-1)}{3} = 1 \in \mathbb{Z}$. + +Is $(3, -2) \in T$? + +No, $\dfrac{(3) - (-2)}{3} = \dfrac{5}{3} \notin \mathbb{Z}$. + +b. Write $T$ as a set of ordered pairs. + +$$ T = \{(1, -2), (2, -1), (3, 0)\} $$ + +c. Write the domain and co-domain of $T$. + +The domain of $T$ is $\{1, 2, 3\}$, and the co-domain of $T$ is $\{-2, -1, 0\}$. + +d. Draw an arrow diagram for $T$. + +4. Let $G = \{-2, 0, 2\}$ and $H = \{4, 6< 8\}$ and define a relation $V$ from + $G$ to $H$ as follows: For every $(x, y) \in G \times H$, + +$$ (x, y) \in V \quad \text{ means that } \frac{x - y}{4} \text{ is an integer.} $$ + +**Solution** + +a. + +Is 2 _V_ 6? + +Yes, $\dfrac{(2) - (6)}{4} = -1 \in \mathbb{Z}$. + +Is (-2) _V_ (8)? + +No, $\dfrac{(-2) - (8)}{4} = -\dfrac{10}{4} = -\dfrac{5}{2} \notin \mathbb{Z}$. + +Is $(0, 6) \in V$? + +No, $\dfrac{(0) - (6)}{4} = -\dfrac{6}{4} = -\dfrac{3}{2} \notin \mathbb{Z}$. + +Is $(2, 4) \in V$? + +No, $\dfrac{(2) - (4)}{4} = -\dfrac{1}{2} \notin \mathbb{Z}$. + +b. Write $V$ as a set of ordered pairs. + +$$ V = \{(-2, 6), (0, 4), (0, 8), (2, 6)\} $$ + +c. Write the domain and co-domain of _V_. + +The domain of _V_ is $\{-2, 0, 2\}$ and the co-domain of _V_ is $\{4, 6, 8\}$ + +d. Draw an arrow diagram for _V_. + +5. Define a relation $S$ from $\mathbb{R}$ to $\mathbb{R}$ as follows: For every + $(x, y) \in \mathbb{R} \times \mathbb{R}$, + +$$ (x, y) \in S \quad \text{ means that } x \geq y $$ + +**Solution** + +a. + +Is $(2, 1) \in S$? + +Yes, $(2) \geq (1)$. + +Is $(2, 2) \in S$? + +Yes, $(2) \geq (2)$. + +Is 2 _S_ 3? + +No, $(2) \cancel{\geq} (3)$. + +Is (-1) _S_ (-2)? + +Yes, $(-1) \geq (-2)$. + +b. Draw the graph of _S_ in the Cartesian plane. + +6. Define a relation $R$ from $\mathbb{R}$ to $\mathbb{R}$ as follows: For every + $(x, y) \in \mathbb{R} \times \mathbb{R}$, + +$$ (x, y) \in R \quad \text{ means that } y = x^2 $$ + +**Solution** + +a. + +Is $(2, 4) \in R$? + +Yes, $(4) = (2)^2$. + +Is $(4, 2) \in R$? + +No, $(2) \neq (4)^2$. + +Is (-3) _R_ 9? + +Yes, $(9) = (-3)^2$. + +Is 9 _R_ (-3)? + +No, $(-3) \neq (9)^2$. + +b. Draw the graph of _R_ in the Cartesian plane. + +7. Let $A = \{4, 5, 6\}$ and $B = \{5, 6, 7\}$ and define relations $R$, $S$, + and $T$ from $A$ to $B$ as follows: For every $(x, y) \in A \times B$: + +$$ (x, y) \in R \quad \text{ means that } x \geq y $$ + +$$ (x, y) \in S \quad \text{ means that } \frac{x - y}{2} \text{ is an integer.} $$ + +$$ T = \{(4, 7), (6, 5), (6, 7)\} $$ + +**Solution** + +a. Draw arrow diagrams for $R$, $S$, and $T$. + +b. Indicate whether any of the relations $R$, $S$, and $T$ are functions. + +$R$ is not a function because it satisfies neither property (1) nor property (2) +of the definition. It fails property (1) because $(4, y) \not in R$, for any $y$ +in $B$. It fails property (2) because $(6, 5) \in R$ and $(6, 6) \in R$ and +$5 \neq 6$. + +$S$ is not a function because $(5, 5) \in S$ and $(5, 7) \in S$ and $5 \neq 7$. +So $S$ does not satisfy property (2) of the definition of a function. + +$T$ is not a function both because $(5, x) \notin T$ for any $x$ in $B$ and +because $(6, 5) \in T$ and $(6, 7) \in T$ and $5 \neq 7$. So $T$ does not +satisfy either property (1) or property (2) of the definition of a function. + +8. Let $A = \{2, 4\}$ and $B = \{1, 3, 5\}$ and define relations $U$, $V$, and + $W$ from $A$ to $B$ as follows: For every $(x, y) \in A \times B$: + +$$ (x, y) \in U \quad \text{ means that } y - x > 2 $$ + +$$ (x, y) \in V \quad \text{ means that } y - 1 = \frac{x}{2} $$ + +W = \{(2, 5), (4, 1), (2, 3)\} + +**Solution** + +a. Draw arrow diagrams for $U$, $V$, and $W$. + +b. Indicate whether any of the relations $U$, $V$, and $W$ are functions. + +$U$ is not a function by property (1), as $(4, y) \notin B$. + +$V$ is not a function by property (1) as $(2, y) \notin B$. + +$T$ is not a function by property (2) as $(2, 3) \in B$ and $(2, 5) \in B$ and +$3 \neq 5$. + +9. + +**Solution** + +a. Find all functions from $\{0, 1\}$ to $\{1\}$. + +$$ \{(0, 1), (1, 1)\} $$ + +b. Find two relations form $\{0, 1\}$ to $\{1\}$ that are not functions. + +$$ \{(0, 1)\}, \{(1, 1)\} $$ + +10. Find four relations from $\{a, b\}$ to $\{x, y\}$ that are not functions + from $\{a, b\}$ to $\{x, y\}$. + +**Solution** + +$$ \{(a, x)\}, \{(a, y)\}, \{(b, x)\}, \{(b, y)\} $$ + +11. Let $A = \{0, 1, 2\}$ and let $S$ be the set of all strings over $A$. Define + a relation $L$ from $S$ to $\mathbb{Z}^{\text{nonneg}}$ as follows: For + every string $s$ in $S$ and every nonnegative integer $n$, + +$$ (s, n) \in L \quad \text{ means that the length of } s \text{ is } n $$ + +Then $L$ is a function because every string in $S$ has one and only one length. +Find $L(0201)$ and $L(12)$. + +**Solution** + +$$ L(0201) = 4 $$ + +$$ L(12) = 2 $$ + +12. Let $A = \{x, y\}$ and let $S$ be the set of all strings over $A$. Define a + relation $C$ from $S$ to $S$ as follows: For all strings $s$ and $t$ in $S$, + +$$ (s, t) \in C \quad \text{ means that } t = ys $$ + +Then $C$ is a function because every string in $S$ consists entirely of $x$'s +and $y$'s and adding an additional $y$ on the left creates a single new string +that consists of $x$'s and $y$'s and is, therefore, also in $S$. Find $C(x)$ and +$C(yyxyx)$. + +**Solution** + +$$ C(x) = yx $$ + +$$ C(yyxyx) = yyyxyx $$ + +13. Let $A = \{-1, 0, 1\}$ and $B = \{t, u, v, w\}$. Define a function + $F: A \to B$ by the following arrow diagram: + +![image 1_3_2_6](./1_3_2_6.png) + +**Solution** + +a. Write the domain and co-domain of $F$. + +The domain of $F$ is $\{-1, 0, 1\}$, and the co-domain of $F$ is +$\{t, u, v, w\}$. + +b. Find $F(-1)$, $F(0)$, and $F(1)$. + +$$ F(-1) = u $$ + +$$ F(0) = w $$ + +$$ F(1) = u $$ + +14. Let $C = \{1, 2, 3, 4\}$ and $D = \{a, b, c, d\}$. Define a function + $G: C \to D$ by the following diagram: + +![image 1_3_2_7](./1_3_2_7.png) + +**Solution** + +a. Write the domain and co-domain of $G$. + +The domain of $G$ is $\{1, 2, 3, 4\}$, and the co-domain of $G$ is +$\{a, b, c, d\}$. + +b. Find $G(1)$, $G(2)$, $G(3)$, and $G(4)$. + +$$ G(1) = c $$ + +$$ G(2) = c $$ + +$$ G(3) = c $$ + +$$ G(4) = c $$ + +15. Let $X = \{2, 4, 5\}$ and $Y = \{1, 2, 4, 6\}$. Which of the following arrow + diagrams determine functions from $X$ to $Y$? + +![image 1_3_2_8](./1_3_2_8.png) + +**Solution** + +Only (d) is a function. + +(a) is not a function by property (2), as $(2, 1) \in X \to Y$ and +$(2, 6) \in X \to Y$, and $1 \neq 6$. + +(b) is not a function by property (1), as $(5, y) \notin X \to Y$. + +(c) is not a function by property (2), as $(4, 1) \in X \to Y$ and +$(4, 2) \in X \to Y$ and $(1 \neq 2)$. + +(e) is not a function by property (1), as $(2, y) \notin X \to Y$. + +16. Let $f$ be the squaring function defined in Example 1.3.6. Find $f(-1)$, + $f(0)$, and $f\left(\dfrac{1}{2}\right)$. + +**Solution** + +$$ f(-1) = (-1)^2 = 1 $$ + +$$ f(0) = (0)^2 = 0 $$ + +$$ f\left(\frac{1}{2}\right) = \left(\frac{1}{2}\right)^2 = \frac{1}{4} $$ + +17. Let $g$ be the successor function defined in Example 1.3.6. Find $g(-1000)$, + $g(0)$, and $g(999)$. + +**Solution** + +$$ g(-1000) = (-1000) + 1 = -999 $$ + +$$ g(0) = (0) + 1 = 1 $$ + +$$ g(999) = (999) + 1 = 1000 $$ + +18. Let $h$ be the constant function defined in Example 1.3.6. Find + $h\left(-\dfrac{12}{5}\right)$, $h\left(\dfrac{0}{1}\right)$, and + $h\left(\dfrac{9}{17}\right)$. + +**Solution** + +$$ h\left(-\frac{12}{5}\right) = 2 $$ + +$$ h\left(\frac{0}{1}\right) = 2 $$ + +$$ h\left(\frac{9}{17}\right) = 2 $$ + +19. Define functions $f$ and $g$ from $\mathbb{R}$ to $\mathbb{R}$ by the + following formulas: For every $x \in \mathbb{R}$, + +$$ f(x) = 2x \quad \text{ and } \quad g(x) = \frac{2x^3 + 2x}{x^2 + 1} $$ + +Does $f = g$? Explain. + +**Solution** + +Yes, by factoring out $2x$ from the numerator of $g(x)$ we find they are the +same function: + +$$ g(x) = \frac{2x^3 + 2x}{x^2 + 1} = \frac{2x(x^2 + 1)}{(x^2 + 1)} = 2x = f(x) $$ + +This means that for every input $x$ to both $g$ and $f$, $f(x) = g(x)$, and so +$f = g$ by definition of equality of functions. + +20. Define functions $H$ and $K$ from $\mathbb{R}$ to $\mathbb{R}$ by the + following formulas: For every $x \in \mathbb{R}$, + +$$ H(x) = (x - 2)^2 \quad \text{ and } \quad K(x) = (x - 1)(x - 3) + 1 $$ + +Does $H = K$? Explain. + +**Solution** + +$$ H(x) = (x - 2)^2 = (x - 2)(x - 2) = x^2 - 4x + 4 $$ + +$$ K(x) = (x - 1)(x - 3) + 1 = x^2 - 4x + 3 + 1 = x^2 - 4x + 4 $$ + +Therefore $H(x) = K(x)$ by the definition of equality of functions. diff --git a/chapter_1/notes.md b/chapter_1/notes.md index 807fb9b..54029e8 100644 --- a/chapter_1/notes.md +++ b/chapter_1/notes.md @@ -150,3 +150,48 @@ parentheses or commas. The elements of $A$ are called the **characters** of the string. The **null string** over $A$ is defined to be the "string" with no characters. It is often denoted $\lambda$ and is said to have length $0$. If $A = \{0, 1\}$, then a string over $A$ is called a **bit string**. + +--- + +Page 39 + +**Definition** + +Let $A$ and $B$ be sets. A **relation $R$ from $A$ to $B$** is a subset of +$A \times B$. Given an ordered pair $(x, y)$ in $A \times B$, **$x$ is related +to $y$ by $R$, written $xRy$, if, and only if, $(x, y)$ is in $R$. The set $A$ +is the **domain** of $R$ and the set $B$ is called its **co-domain**. + +The notation for a relation $R$ may be written symbolically as follows: + +$xRy$ means that $(x, y) \in R$. + +The notation $x\cancel{R}y$ means that $x$ is not related to $y$ by $R$: + +$x\cancel{R}y$ means that $(x, y) \notin R$. + +--- + +Page 41 + +**Definition** + +A **function $F$ form a set $A$ to a set $B$** is a relation with domain $A$ and +co-domain $B$ that satisfies the following two properties: + +1. For every element $x$ in $A$, there is an element $y$ in $B$ such that + $(x, y) \in F$. + +2. For all elements $x$ in $A$ and $y$ and $z$ in $B$, + +$$ \text{if } \quad (x, y) \in F \text{ and } (x, z) \in F \text{, } \quad \text{ then } \quad y = z $$ + +--- + +Page 42 + +**Function Notation** + +If $A$ and $B$ are sets and $F$ is a function from $A$ to $B$, then given any +element $x$ in $A$, the unique element in $B$ that is related to $x$ by $F$ is +denoted $F(x)$, which is read **"$F$ of $x$."** diff --git a/chapter_1/test_yourself.md b/chapter_1/test_yourself.md index 55efaf4..70fe649 100644 --- a/chapter_1/test_yourself.md +++ b/chapter_1/test_yourself.md @@ -81,3 +81,39 @@ $c \in C$. **Solution** parentheses; commas + +--- + +**Test Yourself** + +Page 45 + +1. Given sets $A$ and $B$, a relation from $A$ to $B$ is _______. + +**Solution** + +a subset of the Cartesian product $A \times B$ + +2. A function $F$ from $A$ to $B$ is a relation from $A$ to $B$ that satisfies + the following two properties: + +a. for every element $x$ of $A$, there is _______. + +b. for all elements $x$ in $A$ and $yr and $z$ in $B$, if _______ then _______. + +**Solution** + +a. for every element $x$ of $A$, there is _______. + +an element $y$ of $B$ such that $(x, y) \in F$ + +b. for all elements $x$ in $A$ and $y$ and $z$ in $B$, if _______ then _______. + +$(x, y) \in F$ and $(x, z) \in F$; $y = z$ + +3. If $F$ is a function from $A$ to $B$ and $x$ is an element of $A$, then + $F(x)$ is _______. + +**Solution** + +a unique element of $B$ that is related to $x$ by $F$. diff --git a/leftoff.txt b/leftoff.txt index e522732..abac1ea 100644 --- a/leftoff.txt +++ b/leftoff.txt @@ -1 +1 @@ -38 +47