From 0ee1dbde493a9212f34aa4b5583c838fd5c06c85 Mon Sep 17 00:00:00 2001 From: Louie S Date: Tue, 31 Mar 2020 12:06:04 -0700 Subject: first commit --- 1.1.md | 184 +++++++++++++++++++++++++++++++++++++++++++++++++ negation.png | Bin 0 -> 740 bytes plus_inside_circle.png | Bin 0 -> 2822 bytes 3 files changed, 184 insertions(+) create mode 100644 1.1.md create mode 100644 negation.png create mode 100644 plus_inside_circle.png diff --git a/1.1.md b/1.1.md new file mode 100644 index 0000000..a04674d --- /dev/null +++ b/1.1.md @@ -0,0 +1,184 @@ +# Propositional Logic p1 + +- Def: A **proposiion** is a declarative sentence that is either true or false (but not both) + - A sentence that declares a fact + +- Determine which of the following sentences are propositions: + 1. Lebron James plays basketball + - it is declaring something + - it is true + - **it is a proposition** :) + 2. All students live in dorms + - it is declaring something + - it is false + - **it is a proposition** :) + 3. Where is Carmen? + - it is NOT declaring something + - **it is NOT a proposition** :( + 4. Sit down! + - it is NOT declaring something + - **it is NOT a proposition** :( + 5. `4 + 5 = 9` + - it is declaring something + - it is true + - **it is a proposition** :) + 6. `x + 5 = 9` + - it is declaring something + - **it is NEITHER true or false** + - **it is NOT a proposition** :( + 7. `x + 5y = 5y + x; x,y are real` + - it is declaring something + - it is true + - **it is a proposition** :) + +- If a proposition is true: write `T` +- If a proposition is false: write `F` + - alternatively, sometimes an upside down 'T' instead + +--- + +# Operators + +- List of operators: + - ┓ ([a top right corner](negation.png)) + - ^ (carrot) + - ∨ (descending wedge symbol) + - ⊕ ([plus inside a circle](plus_inside_circle.png)) + - -> (right arrow) + - <-> (arrow pointed both ways) +- These are all **operators** on propositions + - Propositions involving operators are **compound propositions** + - (e.g. p^q) + - read as *p and q* + +## Negation (┓) + +- Let `p` be a proposition `┓p` (meaning *not p*) + - This is a **negation** + - This is a **proposition** + +- Let `r` = "Lebron James plays basketball" + - `┓r` = "Lebron James does **not play** basketball" + +## Introducing Truth Tables + +example: + +|p|┓p| +|-|--| +|T|F | +|F|T | + +when `p` is true, `┓p` is false, and vice versa + +## Conjunction (^) + +- Let `p` and `q` be propositions +- "p and q" is a proposition called the **conjunction** of `p` and `q`, denoted by `p^q` + - read as "p and q" + +### Truth Table + +|p|q|p^q| +|-|-|---| +|T|T|T | +|T|F|F | +|F|T|F | +|F|F|F | + +`p^q` is only true when both `p` and `q` are true + +## Disjunction (∨) + +- Let `p` and `q` be propositions +- "p or q" is a proposition called the **disjunction** of `p` and `q`, denoted `p∨q` + - read as "p or q" + +### Truth Table + +|p|q|p∨q| +|-|-|---| +|T|T|T | +|T|F|T | +|F|T|T | +|F|F|F | + +- The disjunction is an **inclusive or** + - Either `p`, or `q`, or both need to be true for `p∨q` to be true + +## Exclusive Or (⊕) + +- Let `p` and `q` be propositions +- "p exclusive or q" is a proposition called **exclusive or** of `p` and `q` and is denoted `p⊕q` + - read as "p exclusive or q" + +### Truth Table + +|p|q|p⊕q| +|-|-|---| +|T|T|F | +|T|F|T | +|F|T|T | +|F|F|F | + +- One of `p` or `q` need to be true for `p⊕q` to be true, but not both + +## "Or" in English + +- I can wake up early **or** I can sleep in. + - In English, this is an exclusive or (I can't wake up and sleep at the same time!) + +- People with kids **or** pets get less sleep. + - In English, this is an inclusive or (both kids and pets can get less sleep) + +## Memory Tip +- `^` looks like an intersection symbol (which means **and**) +- `∨` looks like an union symbol (which means **inclusive or**) + +## Implication (->) + +- Sometimes called conditional operator +- Let `p` and `q` be propositions +- "If p then q" is a proposition called the **implication** of `p` and `q` and is denoted `p->q` + - read as "if p then q" or sometimes "p implies q" + +### Truth Table + +|p|q|p->q| +|-|-|----| +|T|T|T | +|T|F|F | +|F|T|T | +|F|F|T | + +- Example: "If it is Wednesday, we wear pink" + - `p` is "it is Wednesday" (sometimes called the hypothesis) + - `q` is "we wear pink" (sometimes called the conclusion) + - Only violated (`p->q` is false) if it is Wednesday (`p` is true) and we don't wear pink (`q` is false) + +- Implication can be read in many different ways (example `p->q`): + - p implies q + - p only if q + - q when p + - p if sufficient for q + - q is necessary for p + +## Biconditional (<->) + +- Let `p` and `q` be propositions +- "p if and only if q" is a proposition called the **biconditional** of `p` and `q`, denoted `p<->q` + - read "p if and only if q" or "p iff q" + +### Truth Table + +|p|q|p<->q| +|-|-|----| +|T|T|T | +|T|F|F | +|F|T|F | +|F|F|T | + +- Violated when one is `T` but other if `F` +- Satisfied when either `p` and `q` are both true or both false + +- `p<->q` is "equivalent" to `(p->q)^(q->p)` diff --git a/negation.png b/negation.png new file mode 100644 index 0000000..4f7acf0 Binary files /dev/null and b/negation.png differ diff --git a/plus_inside_circle.png b/plus_inside_circle.png new file mode 100644 index 0000000..21573f0 Binary files /dev/null and b/plus_inside_circle.png differ -- cgit