1 / 16

Foundations of Computer Science: Sets, Power Sets, and Conditional/Biconditional Statements

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.

mcclurg
Download Presentation

Foundations of Computer Science: Sets, Power Sets, and Conditional/Biconditional Statements

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CMPU-145: Foundations of Computer ScienceSpring, 2019 1, sections 1.1 – 1.4 and 4.2 (Continued)

  2. 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

  3. 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

  4. 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

  5. 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

  6. 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

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

  8. Running On Empty I • What is the power set of the empty set? • i.e. What is 𝒫(∅)? CMPU 145 – Foundations of Computer Science

  9. 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

  10. Some Common Sets/Notation CMPU 145 – Foundations of Computer Science

  11. 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

  12. 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

  13. Conditional Statement: truth table CMPU 145 – Foundations of Computer Science

  14. 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

  15. Biconditional Statement: truth table CMPU 145 – Foundations of Computer Science

  16. 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

More Related