Chapter 0 – Exercises

Exercise 1: Logical Statements and Arguments

a.) Writing Formal Statements

Write down the following verbal statements in formal notation.

Example. All real numbers are also rational numbers.
Answer: \forall x\in\mathbb R:(x\in\mathbb Q)

(i) The set A contains the number 5.

5\in A


(ii) The set B contains the number 5 but not the number 4.

5\in B \land 4 \notin B
or alternatively (less direct/elegant)
5\in B \land \neg(4\in B)


(iii) No natural number is strictly negative (that is, strictly smaller than zero).

\nexists n\in\mathbb N: (n < 0)


(iv) If x is positive and y is negative, then (this implies that) the product x\cdot y is negative.

(x\geq 0\land y\leq 0)\Rightarrow x\cdot y \leq 0


(v) At any multiple of \pi, the \sin-function is equal to zero.

\forall z\in\mathbb Z: (\sin(z\cdot \pi) = 0)
or, less directly,
(\exists z\in Z : (x = z\cdot \pi))\Rightarrow \sin(x) = 0.
The latter expression, next to being less efficient, also has the caveat that the variable x is not defined in the first expression so that without context, a reader may find it difficult to assess what x should refer to precisely.


(vi) For any natural number and any integer, if the integer is positive, then their product is positive.

\forall n\in\mathbb N\forall z\in\mathbb Z: (z\geq 0 \Rightarrow z\cdot n\geq 0)


b.) Negating Verbal Statements

Write down the negation of the following verbal statements in formal notation, i.e. the formal statement that asserts the exact opposite of the verbal statement given (do not simply use \neg in front of the statement!).

(i) -2 is contained in the natural numbers.

-2\notin \mathbb N


(ii) At any multiple of \pi, the \cos-function is equal to zero.

\exists z\in\mathbb Z: (\cos(z\cdot \pi) \neq 0)
In fact, it is even true that the cosine-function is unequal to zero at every multiple of \pi: \forall z\in\mathbb Z: (\cos(z\cdot \pi) \neq 0). However, this is not the exact opposite of what the verbal statement asserts, and thus not what is asked here as an answer!


(iii) The set A contains some objects which are not real numbers.

\forall a \in A: (a \in \mathbb R)
or, equivalently,
\nexists a \in A: (a \notin \mathbb R)


Exercise 2: Necessary and Sufficient Conditions

a.) How do we disprove Statements?

(i) Suppose that P and Q are statements that each assert some fact. What must we necessarily show to disprove “P and Q are true”, i.e. the statement (P\land Q)?

    1. P and Q are both false, i.e. \neg P \land \neg Q
    2. P does not imply Q and Q does not imply P, i.e. \neg (P\Rightarrow Q)\land \neg (Q\Rightarrow P)
    3. At least one of P and Q are false, i.e. \neg P \lor \neg Q
    4. Exactly one of P and Q are false, i.e. (\neg P \land Q) \lor (\neg Q \land P)
    5. P is false, i.e. \neg P
    6. Q is false, i.e. \neg Q

The right answer is 3.: it must necessarily be true that the exact opposite of P\land Q is satisfied, so \neg(P\land Q) = \neg P \lor \neg Q. Other answers also lead to violation of P\land Q, but they are not necessary (see (ii)).


(ii) Consider again the setup of (i). Which points are sufficient do disprove P\land Q?

All but 2.: Indeed, the exact opposite of P\land Q being satisfied is not only necessary but also equivalent to violation of P\land Q; hence, all statements that imply the opposite (as given by statement 3.) are sufficient conditions. Going over them one by one, it is readily seen that all but 2. do so.


b.) Relationships between Statements

(i) Consider five statements P,Q,R,S,T. Suppose that R\Rightarrow P, P\Rightarrow S and T\Rightarrow Q. What can you say about the statements?

    1. R is a necessary condition for P.
    2. If S implies R, i.e. S\Rightarrow R, then S is an equivalent condition for P.
    3. T is a sufficient condition for Q.
    4. P is an equivalent condition for Q.
    5. The information given allows to preclude that P \Rightarrow R.
    6. P is false, i.e. \neg P is true.
    7. If S is violated, then P can not hold, i.e. \neg S \Rightarrow \neg P.
    8. If T is violated, then Q can not hold, i.e. \neg T \Rightarrow \neg Q.

True answers are: 2., 3. and 7. The first holds because if S\Rightarrow R, by R\Rightarrow P, we know that S\Rightarrow P. Further, the setup gives P\Rightarrow S so that combining these two expressions, we obtain P\Leftrightarrow S. To see which of 7. and 8. is true, recall the intuition of flipping the implication arrow when negating statements.


(ii) Consider again the setup of (i). Can you find a sufficient condition for P\land Q? What about P\lor Q and \neg (P\land Q)?

For each individual statement P and Q, we have a sufficient condition that implies them. Combining them gives a sufficient condition for the combined statement P\land Q: (R\land T)\Rightarrow (P\land Q).
To ensure P\lor Q, it suffices that one of the two statements holds, so that both R and T individually are already sufficient for P\lor Q: R\Rightarrow (P\lor Q) and T\Rightarrow (P\lor Q).
To violate P\land Q, it suffices to violate either one of the statements. From (i), we know that \neg S\Rightarrow \neg P, so that \neg S is also sufficient for \neg (P\land Q). More directly, this can be seen from rewriting \neg (P\land Q) as \neg P \lor \neg Q. Hence:
\neg S\Rightarrow\neg (P\land Q).


c.) Quantifiers and Implication

Assess whether the following statements are necessary, sufficient, equivalent, or neither of the previous, for S:= (\forall x\in A: (x - \pi \in \mathbb Z)), where A is a non-empty set.

    1. \exists x\in A: (x - \pi \in \mathbb Z)
    2. \forall x\in A: (x - \pi \in \mathbb N)
    3. \exists ! x\in A: (x - \pi \in \mathbb Z)
    4. \nexists x\in A: (x - \pi \notin \mathbb Z)
    5. \nexists x\in A: (x - \pi \notin \{1,2,3\})
    6. A = \{1, 2, 3\}
    7. A = \{1 + \pi, -1 + \pi\}
    8. \forall x\in\mathbb A: (x-4\geq 2)

1.: necessary
2.: sufficient (because N\subset \mathbb Z; S can hold even if x-\pi \in \mathbb Z\backslash\mathbb N for some x\in A)
3.: nothing (if A has more than one element, 3. and S are mutually exclusive, i.e. \neg 3. \Leftrightarrow S, and 3. together with |A|=1 are equivalent to S; however, there is no information on |A|)
4.: equivalent
5.: sufficient as \{1,2,3\}\subset \mathbb Z, same logic as 2.
6.: nothing (actually: mutually exclusive, i.e. \neg 3. \Leftrightarrow S
7.: sufficient (concrete example of sets A that satisfy S)
8.: nothing (insufficient information)


Exercise 3: Set Theory

a. Sets and Logic

This exercise is intended to train your understanding of how sets are helpful in thinking about statements and arguments. The solutions feature no drawings using the “circle approach” to sets, but you may find it helpful to draw the sets when assessing whether given relationships hold or not.

(i) Re-write the following statements and arguments in set notation:

    1. If all unicorns like candy and Charlie is a unicorn, then Charlie likes candy.
    2. On rainy days, there is no sunshine.
    3. If there is no sunshine on rainy days and there is no sunshine today, then today is a rainy day.
    4. I always win in chess against people that have never played before.
    5. If I always win in chess against people that have never played before, and John has beaten me in chess, then John has played chess before.

Example: For 1., define U as the set of unicorns, c as Charlie and LC as the set of beings/objects that can be assigned the property of “liking candy”. Then, we can write 1. as ((\forall u\in U: u \in LC) \land c\in U)\Rightarrow (c\in LC). Using the subset notation, we can also find a more elegant way of writing this argument: (U\subseteq LC \land c\in U)\Rightarrow (c\in LC).

1.: see example.
2.: Define R as the set of rainy days and S as the days with sunshine. Then, the statement is expressed as either \forall d\in R: d\notin S or R\subseteq S^c (the former can alternatively be written as \forall d\in R: d\in S^c).
3.: With the notation of 2. and t as today, (R\subseteq S^c \land t\in S^c)\Rightarrow t\in R.
Note: alternatively, for 2. and 3., you can of course also define NS as the days with no sunshine; then 2. becomes \forall d\in R: d\in NS or R\subseteq NS; for 3., simply replace S^c with NS.
4.: Define N as the set of people that have never played chess before and W as the set of players against which I always win. Then, N\subseteq W.
5.: With the notation of 4. and j as John, because John has beaten me, j\notin W. Hence, the argument can be written as: (N\subseteq W\land j\notin W)\Rightarrow j\notin N. Assuming that having and not having played chess before are mutually exclusive, we can also write (N\subseteq W\land j\notin W)\Rightarrow j\in N^c.


(ii) Consider the arguments (1., 3., 5.) in (i). Are they valid?

1.: Valid. This can be seen by drawing the circles; formally, we would argue that
a) we assume the premises hold, i.e. (U\subseteq LC \land c\in U)
b) because U\subseteq LC, x\in LC for any x\in U
c) because c\in U and b), c\in LC.
Therefore, the premises imply the conclusion.
3.: Not valid. With circles, it is possible to draw a counterexample of the conclusion that is consistent with the premises. Intuitively, while the premises do not rule out the conclusion, it gives insufficient information to necessarily conclude on the conclusion from the premises: there may also be days without sunshine that are not rainy. Formally, t\in S^c implies t\in R only in combination with S^c\subseteq R, which is not given by the setup and not ensured by R\subseteq S^c.
5.: Valid. Again, you can draw circles; formally:
a) we assume the premises hold, i.e. (N\subseteq W\land j\notin W)
b) because N\subseteq W, x\notin N for any x\notin W
c) because j\notin W and b), j\notin N
Therefore, the premises imply the conclusion.
Alternatively, using complements, you can put for b) and c):
b) because N\subseteq W and N\subseteq W is equivalent to W^c\subseteq N^c, x\in N^c for any x\in W^c
c) because j\in W^c and b), j\in N^c


b. Set Notation

Write down the formal notation for the sets verbally described in the following.

    1. The set S_1 of even natural numbers.
    2. The set S_2 of natural numbers divisible by 7.
    3. The set S_3 of natural numbers that are powers of 2 (i.e. 1,2,4,8,16,32, etc.).
    4. The set S_4 of numbers n that can be written as an alternating sum of natural numbers from one to a number n_{max}\in N, e.g. 3 = 1 - 2 + 3 - 4 + 5 (assume that you always start from +1).
    5. The set S_5 of real numbers (weakly) smaller than 10.
    6. The set S_6 of real numbers x that are no more than 0.25 “away” from an even number, i.e. |x-e|\leq 0.25 for the closest even number e (hint: union over intervals).

Hint: the “direct” explicit representation of the set may not always be the most efficient one.

1.: S_1 = \{n\in\mathbb N: (\exists k\in\mathbb N: n = 2\cdot k)\} = \{2\cdot n\}_{ n\in\mathbb N}
2.: S_2 = \{n\in\mathbb N: (n/7\in\mathbb N)\}
3.: S_3 = \{n\in\mathbb N: (\exists k\in\mathbb N: n = 2^k)\} = \{2^n\}_{ n\in\mathbb N}
4.: S_4 = \{n\in\mathbb N: (\exists k\in\mathbb N: n = \sum_{i=1}^k (-1)^{i-1}\cdot i)\} = \mathbb Z\backslash\{0\}
5.: S_5 = \{x\in\mathbb R: x\leq 10\} = (-\infty, 10]
6.: S_6 = \{x\in\mathbb R: (\min_{e\in S_1} |x-e|\leq 0.25)\} = \bigcup_{n\in\mathbb N} [2n - 0.25, 2n + 0.25]


c. Set Operations

(i) Compute union, intersection and the set differences for A = \{1, 3, 5, 7, 9\} and B = \{-1, 0, 1, 2, 3, 4, 5\}.

Union: A\cup B = \{-1, 0, 1, 2, 3, 4, 5, 7, 9\}
Intersection: A\cap B = \{1, 3, 5\}
Difference 1: A\backslash B = \{7, 9\}
Difference 2: B\backslash A = \{-1, 0, 2, 4\}


For the questions to follow, recall that it may be helpful to illustrate sets using circles.

(ii) If A\subseteq B, how do B\backslash A and B\cap A relate to each other?

B\backslash A and B\cap A are a “disjoint decomposition” of B: they split B into two subsets that contain no common elements. To make this relationship more intuitive, note that when A\subseteq B, then B\cap A = A. Formally, we can describe this as
a) (B\backslash A)\cap (B\cap A) = (B\backslash A)\cap A = \varnothing, and
b) (B\backslash A)\cup (B\cap A) = (B\backslash A)\cup A = B.
You can also combine a) and b) to one big statement using the logical “and”:

    \[((B\backslash A)\cap (B\cap A) = \varnothing) \land ((B\backslash A)\cup (B\cap A) = B)\]


(iii) Consider the relationship A\backslash (B\cup C) = (A\backslash B) \cap (A\backslash C). Is it true for arbitrary sets A, B and C? Can you give a reasoning for why or why not, respectively? What about the analogous statement when we change intersections to unions and vice versa?

The relationship is true. Intuitively, when excluding objects from both B and C from consideration within the set A, what is left is precisely the intersection of what remains when excluding only objects from either of the sets B and C. We can also proceed formally:

    \[\begin{split} A\backslash (B\cup C) & = \{x\in A: (x\notin B\cup C)\}\\ &=\{x\in A: (x\notin B \land x\notin C)\}\\ &=\{x: (x\in A \land x\notin B) \land (x\in A \land x\notin C)\}\\ &= \{x: (x\in A\backslash B) \land (x\in A\backslash C)\}\\ &= (A\backslash B) \cap (A\backslash C) \end{split}\]

When we “flip” union and intersection, we consider the relationship A\backslash (B\cap C) = (A\backslash B) \cup (A\backslash C). Here, it is arguably more difficult to find an intuitive explanation; however, from a graphical illustration, it should already become clear that this holds as well. Formally:

    \[\begin{split} A\backslash (B\cap C) & = \{x\in A: (x\notin B\cap C)\}\\ &=\{x\in A: (x\notin B \lor x\notin C)\}\\ &=\{x: (x\in A \land x\notin B) \lor (x\in A \land x\notin C)\}\\ &= \{x: (x\in A\backslash B) \lor (x\in A\backslash C)\}\\ &= (A\backslash B) \cup (A\backslash C) \end{split}\]


Exercise 4: Functions

a. Derivative Rules

Take the derivatives of the functions mapping from and to real numbers, with the following mapping rules:

(i) f(x) = \cos(x)/x^2

The derivative is obtained from quotient rule:

    \[f'(x) = \frac{-\sin(x)\cdot x^2 - \cos(x) \cdot 2x}{(x^2)^2} = (-1)\cdot\frac{\sin(x)\cdot x + 2\cos(x) }{x^3}\]


(ii) f(x) = \sin(x^2+3)

The derivative is obtained from chain rule: set g(x) = \sin(x) and h(x) = x^2 + 3. Then,

    \[f'(x) = h'(x)\cdot g'(h(x)) = 2x\cdot \cos(x^2 + 3)\]


(iii) f(x) = \exp(4x\cdot \sqrt{x+3}) (assume that we do not use arguments x< -3 so that \sqrt{x+3} is always real)

The derivative is obtained from combining chain rule and product rule: set g(x) = \exp(x) and h(x) = 4x\cdot \sqrt{x+3}. Then, we compute h'(x) in a first step using product rule:

    \[h'(x) = 4\cdot\sqrt{x+3} + 4x\cdot \frac{1}{2}\frac{1}{\sqrt{x+3}} = \frac{2}{\sqrt{x+3}}(2x + 6 + 2x) = \frac{8x+12}{\sqrt{x+3}}\]

Now we are ready to obtain f'(x) from chain rule (note that g'(x) = g(x)):

    \[ f'(x) = h'(x)\cdot g'(h(x)) = \frac{8x+12}{\sqrt{x+3}} \cdot \exp(4x\cdot \sqrt{x+3}) \]


b. Limit Rules

Recall that for continuous functions f, \lim_{x\to a} f(x) = f(a) = f(\lim_{x\to a} x), i.e. we can pull the limit into continuous functions. In the following, you can take for granted that continuity applies to the exponential function, the cosine and sine function, the square root function and, when c is a constant, polynomial functions x^c and the “power” function c^x.

Determine the limits of
(i) \lim_{x\to 5} x^2 + 4\cdot \sqrt{4/5\cdot x}

\lim_{x\to 5} x^2 + 4\cdot \sqrt{4/5\cdot x} = (\lim_{x\to 5} x)^2 + 4\cdot \sqrt{4/5\cdot (\lim_{x\to 5}x)} = 5^2 + 4\cdot \sqrt{4/5\cdot 5} = 33


(ii) \lim_{x\to \pi} \sin(\cos(x/2)) + 4^{x/\pi}

\lim_{x\to \pi} \sin(\cos(x/2)) + 4^{x/\pi} = \sin(\cos(\lim_{x\to \pi} x/2)) + 4^{\lim_{x\to \pi} x/\pi} = \sin(\cos(\pi/2)) + 4^{\pi/\pi} = 0 + 4 = 4


(iii) \lim_{x\to 0} \frac{x}{e^x - 1} (Hint: L’Hôpital’s rule)

Both x and e^x - 1 tend to 0 as x\to 0. Because both expressions are differentiable, L’Hôpital’s rule applies. Taking the derivative in both the numerator and denominator, we obtain

    \[ \lim_{x\to 0} \frac{x}{e^x - 1} = \lim_{x\to 0} \frac{1}{e^x} = \frac{1}{\lim_{x\to 0} e^x} = \frac{1}{1} = 1 \]


This concludes the exercises for Chapter 0. If you desire to practice more, you may consult the recap questions in the companion script.