160 likes | 171 Views
This text covers a review of set definitions, power sets, and conditional/biconditional statements in the context of computer science foundations. It includes examples and explanations of concepts such as subsets, proper subsets, intersection, union, and the power set of a set.
E N D
CMPU-145: Foundations of Computer ScienceSpring, 2019 1, sections 1.1 – 1.4 and 4.2 (Continued)
Topics • Today we’ll cover: • A review of Tuesday’s lab • A review of set definitions • Power sets • Conditional/Biconditional statements CMPU 145 – Foundations of Computer Science
Sets: Quick Review • Here’s a few sets: • A = {2, 4, 6, 8, 10} • B = {1, 2, 3} • C = {2, 8} • D = {1, 5, 7} • E = {2, 4, 6, 8, 10} • ___ ⊆ A ? • ___ ⊂ A ? • A ∩ B ? • A ∪ D ? CMPU 145 – Foundations of Computer Science
Set: Quick Review • Here’s a few sets: • A = {2, 4, 6, 8, 10} • B = {1, 2, 3} • C = {2, 8} • D = {1, 5, 7} • E = {2, 4, 6, 8, 10} • ___ ⊆ A ? (subset: C, E qualify) • ___ ⊂ A ? (proper subset: C qualifies) • A ∩ B ? (Intersection: {2}) • A ∪ D ? (Union: {1, 2, 4, 5, 6, 7, 8, 10}) CMPU 145 – Foundations of Computer Science
The Power Set I • DEFINITION. The power set of a set A consists of all subsets of A: • 𝒫(A) = {B | B ⊆ A}. • Example: • A = {1, 2, 3} • 𝒫(A) = {∅, {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, {1, 2, 3}} CMPU 145 – Foundations of Computer Science
The Power Set II • “Power” means “exponent”: • If the number of elements in the set A is n, then 𝒫(A) • contains 2n elements. • A = {1, 2, 3} • |A| = 3 • Notation for number of elements • 𝒫(A) = {∅, {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, {1, 2, 3}} • | 𝒫(A)| = 8 = 23 • Thus, the power set of A is also written as 2A. CMPU 145 – Foundations of Computer Science
Power Set III • 𝒫(A) always includes ∅, the empty set, because: • The empty set is a subset of every set • If A contains 1, 𝒫(A) does not contain 1! It contains: • The singleton set {1}. • 𝒫(A) always includes A because A ⊆ A. CMPU 145 – Foundations of Computer Science
Running On Empty I • What is the power set of the empty set? • i.e. What is 𝒫(∅)? CMPU 145 – Foundations of Computer Science
Running On Empty II • What is the power set of the empty set? • i.e. What is 𝒫(∅)? • |∅| = 0 • Since 20 = 1, |𝒫(∅)| = 1 • 𝒫(∅) = {∅} • Not ∅ ! CMPU 145 – Foundations of Computer Science
Some Common Sets/Notation CMPU 145 – Foundations of Computer Science
Conditional / BiConditional Statements • These are what I started to talk about on Tuesday • We’ll revisit my statement about the Super Bowl • Goal: to be able to mathematically judge the truthiness of a statement • Hopefully with more precision than with conversational English. CMPU 145 – Foundations of Computer Science
Conditional Statements • The conditional if α then β is true in virtually all cases • The lone exception: when α is true and β is false. • Also written as α => β CMPU 145 – Foundations of Computer Science
Conditional Statement: truth table CMPU 145 – Foundations of Computer Science
Biconditional Statement: α • The biconditionalstatement, α if and only if β is true • whenever α and β have the same truth value • α if and only if β is false • whenever they have opposite truth values • Also written as α iff β, α β, or α≡β CMPU 145 – Foundations of Computer Science
Biconditional Statement: truth table CMPU 145 – Foundations of Computer Science
Conditional / BiConditional Statements • If the New England Patriots win the Super Bowl, • Then I will give you a dollar. • If the New England Patriots end up losing the Super Bowl (not likely!) and I give you a dollar, what does that mean? • …besides you being one dollar richer? CMPU 145 – Foundations of Computer Science