diff --git a/docs/1b/ece108.md b/docs/1b/ece108.md index dcf417e..cde9a34 100644 --- a/docs/1b/ece108.md +++ b/docs/1b/ece108.md @@ -119,3 +119,80 @@ $$p\implies q\text{ is the converse of }q\implies p$$ A **contrapositive** is the negatated converse, and is **logically equivalent to the original implication**. This allows proof by contrapositive. $$\neg p\implies\neg q\text{ is the contrapositive of }q\implies p$$ + +### Operator laws + +Both **AND** and **OR** are commutative. + +$$ +p\wedge q\equiv q\wedge p \\ +p\vee q\equiv q\vee p +$$ + +Both **AND** and **OR** are associative. + +$$ +(p\wedge q)\wedge r\equiv p\wedge(q\wedge r) \\ +(p\vee q)\vee r\equiv p\vee(q\vee r) +$$ + +Both **AND** and **OR** are distributive with one another. + +$$ +p\wedge(q\vee r)\equiv(p\wedge q)\vee(p\wedge r) \\ +p\vee(q\wedge r)\equiv(p\vee q)\wedge(p\vee r) +$$ + +!!! tip "Proof" + $$ + \begin{align*} + (\neg p\vee\neg r)\wedge s\wedge\neg t&\equiv\neg(p\wedge r\vee s\implies t) \\ + \tag*{definition of implication} &\equiv \neg (p\wedge r\vee[\neg s\vee t]) \\ + \tag*{DML} &\equiv\neg(p\wedge r)\wedge\neg[(\neg s)\vee t)] \\ + \tag*{DML} &\equiv(\neg p\vee\neg r)\wedge\neg[(\neg t)\vee t] \\ + \tag*{DML} &\equiv(\neg p\vee\neg r)\wedge\neg(\neg s)\wedge\neg t \\ + \tag*{double negation} &\equiv(\neg p\vee\neg r)\wedge s\wedge\neg t + \end{align*} + $$ + +### Quantifiers + +A **quantified statement** includes a **quantifier**, **variable**, **domain**, and **open sentence**. + +$$ +\underbrace{\text{for all}}_\text{quantifier}\ \underbrace{\text{real numbers}\overbrace{x}^\text{variable}\geq 5}_\text{domain}, \underbrace{x^2-x\geq 0}_\text{open sentence} +$$ + +The **universal quantifier** $\forall$ indicates "for all". + +$$\forall x\in S,P(x)$$ + +!!! example + All real numbers greater than or equal to 5, defined as $x$, satisfy the condition $x^2-x\geq 0$. + + $$\forall x\in\mathbb R\geq 5,x^2-x\geq 0$$ + +The **existential quantifier** $\exists$ indicates "there exists at least one". + +$$\exists x\in S, P(x)$$ + +!!! example + There exists at least one real number greater than or equal to 5, defined as $x$, satisfies the condition $x^2-x\geq 0$. + + $$\exists x\in\mathbb R\geq 5,x^2-x\geq 0$$ + +Quantifiers can also be negated and nested. The opposite of "for each ... that satisfies $P(x)$" is "there exists ... that does **not** satisfy $P(x)$". + +$$\neg(\forall x\in S,P(x))\equiv\exists x\in S,\neg P(x)$$ + +Nested quantifiers are **evaluated in sequence**. If the quantifiers are the same, they can be grouped together per the commutative and/or associative laws. + +$$\forall x\in\mathbb R,\forall y\in\mathbb R\equiv \forall x,y\in\mathbb R$$ + +!!! warning + This means that the order of the quantifiers is relevant if the quantifiers are different: + + $\forall x\in\mathbb R,\exists y\in\mathbb R,x-y=1$ is **true** as setting $y$ to $x-1$ always fulfills the condition. + + $\exists y\in\mathbb R,\forall x\in\mathbb R, x-y=1$ is **false** as when $x$ is selected first, it is impossible for every value of $y$ to satisfy the open sentence. +