🚧 Almost done with chapter 1

This commit is contained in:
tomit4 2026-05-23 22:11:51 -07:00
parent 4c8c47c688
commit a1eee3269b
13 changed files with 804 additions and 2 deletions

View file

@ -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$.