π¦ What are Sets?
A Set is a well-defined collection of distinct objects, considered as a single entity. Sets are fundamental in all areas of mathematics.
Objects in a set are called elements or members.
Notation: Sets are usually written with curly brackets:
{1, 2, 3}
π€ Types of Sets
- Empty Set (β ): A set with no elements. Example: { } or β
- Finite Set: Set with a countable number of elements.
- Infinite Set: Set with uncountable elements. Example: {1, 2, 3, ...}
- Subset: A set A is a subset of B if every element of A is in B. Notation: A β B
- Proper Subset: A β B if A β B and A β B
- Universal Set: The set that contains all elements under discussion. Usually denoted by U.
- Power Set: The set of all subsets of a set. If A = {1, 2}, then P(A) = {β , {1}, {2}, {1, 2}}
- Disjoint Sets: Two sets that have no elements in common.
βοΈ Set Operations
- Union (A βͺ B): Elements in A, B, or both
- Intersection (A β© B): Elements common to both A and B
- Difference (A - B): Elements in A but not in B
- Complement (Aβ²): Elements not in A (within the universal set)
Example: Let A = {1, 2, 3}, B = {2, 3, 4}
- A βͺ B = {1, 2, 3, 4}
- A β© B = {2, 3}
- A - B = {1}
- B - A = {4}
π Venn Diagrams
Venn diagrams are visual representations of sets and their relationships using overlapping circles.
Basic Shapes:
- Circle A β Represents Set A
- Overlap of A and B β A β© B
- Entire shaded area of both circles β A βͺ B
- Area in A only β A - B
π§ Introduction to Logic
Logic is the framework that determines truth in mathematical reasoning. It involves statements, operators, and rules for combining them.
Statements (Propositions)
A statement is a sentence that is either true or false β not both.
Examples:
- 2 + 2 = 4 β True
- The sky is green β False
π Logical Operators
- Negation (Β¬p): "Not p"
- Conjunction (p β§ q): "p and q" β True only if both are true
- Disjunction (p β¨ q): "p or q" β True if at least one is true
- Implication (p β q): "If p, then q"
- Biconditional (p β q): "p if and only if q"
Example Table (Truth Table):
p | q | p β§ q | p β¨ q | p β q | p β q
-------------------------------------
T | T | T | T | T | T
T | F | F | T | F | F
F | T | F | T | T | F
F | F | F | F | T | T
π Logical Equivalences
Used to simplify logical expressions. Two statements are equivalent if they have the same truth values in all cases.
- De Morganβs Laws:
- Β¬(p β§ q) β‘ Β¬p β¨ Β¬q
- Β¬(p β¨ q) β‘ Β¬p β§ Β¬q
- Double Negation: Β¬(Β¬p) β‘ p
- Contrapositive: p β q β‘ Β¬q β Β¬p
π Applications of Sets and Logic
- Database querying (SQL logic)
- Computer science: algorithms, programming, binary logic
- Mathematical proofs
- Venn diagrams in data science
- Set-based decision-making systems
π§ͺ Practice Problems
- List the power set of A = {1, 2}
- Let U = {1,2,3,4,5}, A = {1,2,3}, B = {3,4}. Find A βͺ B, A β© B, and Aβ².
- Draw a Venn diagram for sets A and B with A β© B β β
- Use truth tables to determine if (p β§ q) β p is always true
- Simplify Β¬(p β¨ q) using De Morgan's law