MAT1123 Units 1-3 Notes
Table of contents
- Unit 1 — Set Theory and Relations
- Set operations (Operações com conjuntos)
- Algebra of sets and Duality (Álgebra de conjuntos e dualidade)
- Finite / infinite sets, power sets, multisets
- Cartesian product (Produto cartesiano)
- Relations and their types (Relações)
- Partial order, Hasse diagram, lattice (course-plan L9)
- Applications: databases and SQL
- Unit 2 — Propositional Calculus
- Basic operations / connectives (Conectivos lógicos)
- Truth values of compound statements
- Tautology, contradiction, equivalence
- Normal forms (Formas normais)
- Quantifiers (Quantificadores)
- Applications: Boolean logic and digital circuits
- Unit 3 — Techniques of Counting
- Permutations (Permutações — order matters)
- The Pigeonhole Principle (Princípio da Casa dos Pombos)
- Combinations (Combinações — order does NOT matter)
- Decision table — which formula?
- Quick exam checklist (Units 1–3)
1. Unit 1 — Set Theory and Relations
1.1 What is a set?
A set is a well-defined collection of distinct objects, known as elements. The order of elements within a set does not matter, and repetitions are disregarded 1.
- Set: A collection of distinct objects.
- Elements: The individual objects within a set 1.
📝 A set can be represented as a bag of items where the arrangement and duplication of items are irrelevant 1.
2. Set operations (Operações com conjuntos)
2.1 Set notation and definitions
Sets are collections of distinct elements where order and repetition do not matter. They can be represented in roster form (listing elements) or set-builder form (describing elements) 2.
- Roster form: Elements are listed within curly braces. Example: A={1,2,3}.
- Set-builder form: Describes the properties of the elements. Example: B={x:x is an even number, x<10}={2,4,6,8}.
- Element membership: x∈A means 'x belongs to A'; x∈/A means 'x does not belong to A'.
- Empty set: ∅ represents a set with no elements.
- Universal set: U encompasses all elements under consideration.
- Number sets: Common sets include N (naturals), Z (integers), Q (rationals), and R (reals).
- Cardinality: ∣A∣ denotes the number of elements in set A. For example, ∣{a,b,c}∣=3 2.
2.2 Subsets
A set A is a subset of set B (A⊆B) if every element in A is also in B. If A is a subset of B and A is not equal to B, it is a proper subset (A⊂B) 2.
- Subset definition: A⊆B means all elements of A are in B.
- Proper subset: A⊂B means A⊆B and A=B.
- Set equality: A=B if and only if A⊆B and B⊆A. This is the method to prove two sets are equal.
- Properties of empty set and self-subset: The empty set ∅ is a subset of every set. Every set is a subset of itself.
- Proving subsets: To prove A⊆B, take any element x∈A and show that x∈B 2.
2.3 Set operations
Several operations can be performed on sets to create new sets. These operations are often visualized using Venn diagrams, where circles represent sets within a rectangular universal set U 3.
| Operation | Symbol | Meaning |
|---|---|---|
| Union | A ∪ B | Elements in A or B (or both) |
| Intersection | A ∩ B | Elements in A and B |
| Difference | A − B | Elements in A but not in B |
| Complement | A′ | Elements in U that are not in A |
| Symmetric difference | A Δ B | Elements in exactly one of A or B (A − B) ∪ (B − A) |
- Disjoint sets: Two sets are disjoint if their intersection is the empty set (A∩B=∅) 3.
2.4 Counting formula (Inclusion-Exclusion Principle)
The inclusion-exclusion principle is used to count the number of elements in the union of sets, accounting for overlaps 3.
- For two sets: The formula is ∣A∪B∣=∣A∣+∣B∣−∣A∩B∣. The intersection is subtracted because its elements were counted twice (once in ∣A∣ and once in ∣B∣).
- For three sets: The formula extends to ∣A∪B∪C∣=∣A∣+∣B∣+∣C∣−∣A∩B∣−∣A∩C∣−∣B∩C∣+∣A∩B∩C∣ 3.
📝 Given A={1,2,3,4} and B={3,4,5}:
- A∪B={1,2,3,4,5}
- A∩B={3,4}
- A−B={1,2}
- B−A={5}
- AΔB={1,2,5} Using the counting formula: ∣A∪B∣=∣A∣+∣B∣−∣A∩B∣=4+3−2=5 3.
3. Algebra of sets and Duality (Álgebra de conjuntos e dualidade)
3.1 Laws of Set Algebra
The algebra of sets follows several fundamental laws that govern operations like union (∪) and intersection (∩). These laws are analogous to those in arithmetic and propositional logic, providing a framework for simplifying set expressions 4.
| Law | Union Rule | Intersection Rule |
|---|---|---|
| Idempotent | A ∪ A = A | A ∩ A = A |
| Commutative | A ∪ B = B ∪ A | A ∩ B = B ∩ A |
| Associative | (A ∪ B) ∪ C = A ∪ (B ∪ C) | (A ∩ B) ∩ C = A ∩ (B ∩ C) |
| Distributive | A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C) | A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C) |
| Identity | A ∪ ∅ = A | A ∩ U = A |
| Domination | A ∪ U = U | A ∩ ∅ = ∅ |
| Complement | A ∪ A′ = U | A ∩ A′ = ∅ |
| Double complement | — | (A′)′ = A |
| Absorption | A ∪ (A ∩ B) = A | A ∩ (A ∪ B) = A |
3.2 De Morgan's Laws
De Morgan's laws describe how the complement operation interacts with union and intersection. They state that the complement of a union is the intersection of the complements, and the complement of an intersection is the union of the complements.
Essentially, the complement operation flips the union and intersection operators 4.
- De Morgan's Laws:
- (A∪B)′=A′∩B′
- (A∩B)′=A′∪B′
- In plain terms, "NOT (A or B)" is equivalent to "NOT A and NOT B" 4.
📝 If set A represents students who like tea and set B represents students who like coffee, then (A∪B)′ represents students who like neither tea nor coffee. According to De Morgan's law, this is equal to A′∩B′, which means students who do not like tea AND do not like coffee 4.
4. Finite / infinite sets, power sets, multisets
4.1 Finite and infinite sets
A finite set is one whose elements can be counted, and the counting process finishes. An infinite set is one where counting the elements never ends.
Sets of natural numbers (N), integers (Z), and real numbers (R) are infinite.
A countably infinite set is an infinite set whose elements can be listed in a sequence, such as the first, second, third, and so on. Examples include N, Z, and the set of rational numbers (Q).
The set of real numbers (R) is uncountable, meaning its elements cannot be listed in such a sequence 5.
4.2 Power sets
The power set of a set A, denoted as P(A), is the set containing all possible subsets of A. This includes the empty set (∅) and the set A itself 5.
If a set A has n elements, its power set P(A) will have 2n subsets. This is because for each element in A, there are two possibilities: it is either included in a subset or it is not 5.
📝 If A={a,b}, then P(A)={∅,{a},{b},{a,b}}. The number of elements in A is 2, so the number of subsets in P(A) is 22=4 5.
4.3 Multisets
A multiset is a generalization of a set that allows for the repetition of elements. The number of times an element appears in a multiset is called its multiplicity 5.
📝 The multiset {a,a,b} contains the element a with a multiplicity of 2 and the element b with a multiplicity of 1 5.
5. Cartesian product (Produto cartesiano)
5.1 Set operations 6
The following table outlines basic set operations and their rules, using multisets A = {a,a,b} and B = {a,b,b,c} as examples.
| Operation | Rule | Example with A={a,a,b}, B={a,b,b,c} |
|---|---|---|
| Union | Take the maximum multiplicity | {a,a,b,b,c} |
| Intersection | Take the minimum multiplicity | {a,b} |
| Sum | Add multiplicities | {a,a,a,b,b,b,c} |
| Difference | Subtract multiplicities (never below 0) | A - B = {a} |
5.2 Cartesian product definition
The Cartesian product of two sets, A and B, forms all possible ordered pairs where the first element comes from set A and the second element comes from set B. This is analogous to pairing every item of clothing with every pair of pants.
- Definition: The Cartesian product A×B is the set of all ordered pairs (a,b) such that a is an element of A and b is an element of B.
- Order matters: The order of elements in a pair is significant, meaning (1,2) is distinct from (2,1).
- Cardinality: The number of elements in the Cartesian product is the product of the number of elements in each set: ∣A×B∣=∣A∣⋅∣B∣.
- Non-commutativity: In general, A×B is not equal to B×A, unless A and B are identical or one of them is an empty set.
- Empty set property: The Cartesian product of any set with an empty set is an empty set: A×∅=∅.
📝 If A={1,2} and B={x,y}, then A×B={(1,x),(1,y),(2,x),(2,y)}. The size of this product is ∣A×B∣=2⋅2=4 6.
6. Relations and their types (Relações)
6.1 Relations
A relation R from set A to set B is defined as any subset of the Cartesian product A×B. This means R consists of ordered pairs (a,b), where a∈A and b∈B.
The notation aRb is used to indicate that the ordered pair (a,b) is an element of the relation R. The domain of a relation consists of all the first elements of the ordered pairs in R, while the range (or image) consists of all the second elements. A relation on a set A is a subset of A×A.
The total number of possible relations from a set A to a set B is 2(∣A∣⋅∣B∣). The inverse of a relation R, denoted R−1, is the set of all ordered pairs (b,a) such that (a,b)∈R.
The composition of two relations, S∘R, is the set of all ordered pairs (a,c) for which there exists an element b such that (a,b)∈R and (b,c)∈S 7.
6.2 Types of relations on a set A 7 8
Relations on a set A can be classified based on several properties:
| Type | Rule | Plain words |
|---|---|---|
| Reflexive | (a,a) ∈ R for every a | Everyone points to themselves |
| Irreflexive | (a,a) ∉ R for every a | Nobody points to themselves |
| Symmetric | (a,b) ∈ R ⇒ (b,a) ∈ R | Every arrow has a return arrow |
| Antisymmetric | (a,b) ∈ R and (b,a) ∈ R ⇒ a = b | Two-way arrows only between a thing and itself |
| Asymmetric | (a,b) ∈ R ⇒ (b,a) ∉ R | No return arrows at all |
| Transitive | (a,b), (b,c) ∈ R ⇒ (a,c) ∈ R | Shortcut arrow for every 2-step path |
6.3 Examples of relation properties 8
The following table illustrates the properties of common relations:
| Relation | Reflexive | Symmetric | Antisym. | Transitive |
|---|---|---|---|---|
| = on integers | ✔ | ✔ | ✔ | ✔ |
| ≤ on integers | ✔ | ✘ | ✔ | ✔ |
| < on integers | ✘ | ✘ | ✔ | ✔ |
| "is a friend of" | ✘ | ✔ | ✘ | usually ✘ |
| "divides" on positive integers | ✔ | ✘ | ✔ | ✔ |
| "is parent of" | ✘ | ✘ | ✔ | ✘ |
Important Note: Symmetric and antisymmetric properties are not opposites. A relation can be both symmetric and antisymmetric (like the equality relation "=") or neither 9.
6.4 Representations of relations
Relations can be represented in several ways:
- Set of pairs: Listing all the ordered pairs that belong to the relation. For example, R={(1,1),(1,2),(2,1)}.
- Matrix: A matrix where rows and columns correspond to the elements of the set. An entry is 1 if aRb and 0 otherwise.
- Digraph (directed graph): Elements are represented as dots, and an arrow from a to b signifies that aRb. A loop on a dot represents a reflexive relation (a,a) 9.
6.5 Reading relation matrices
Key properties can be quickly identified from a relation's matrix:
- Reflexive: The main diagonal (from top-left to bottom-right) consists entirely of 1s.
- Irreflexive: The main diagonal consists entirely of 0s.
- Symmetric: The matrix is equal to its transpose (mirror image across the main diagonal).
- Antisymmetric: For any two off-diagonal positions (i,j) and (j,i) where i=j, if one entry is 1, the other must be 0 9.
📝 To determine if a relation R is transitive, you must check if for every pair of pairs (a,b)∈R and (b,c)∈R, the pair (a,c) is also in R. For instance, if R={(1,2),(2,3),(1,3)}, it is transitive because the pairs (1,2) and (2,3) are in R, and (1,3) is also in R. If R={(1,2),(2,3)}, it would not be transitive because (1,3) is missing 8.
7. Partial order, Hasse diagram, lattice (course-plan L9)
7.1 Equivalence relations
An equivalence relation on a set is a relation that is reflexive, symmetric, and transitive (RST). These three properties ensure that the relation behaves like equality in many respects 10.
- Reflexive: For every element a in the set, a is related to itself (aRa).
- Symmetric: If element a is related to element b, then element b is also related to element a (aRb⟹bRa).
- Transitive: If element a is related to element b, and element b is related to element c, then element a is also related to element c (aRb and bRc⟹aRc) 10.
The equivalence class of an element a, denoted as [a], is the set of all elements x in the set such that x is related to a ([a]={x:xRa}). These equivalence classes form a partition of the set, which is a division of the set into non-empty, non-overlapping subsets that together cover the entire set 10.
📝 Consider the set of integers Z and the relation aRb if a−b is divisible by 3 (congruence modulo 3).
- This relation is reflexive because a−a=0, which is divisible by 3.
- It is symmetric because if a−b is divisible by 3, then b−a=−(a−b) is also divisible by 3.
- It is transitive because if a−b and b−c are divisible by 3, then their sum (a−b)+(b−c)=a−c is also divisible by 3. The equivalence classes are:
- [0]={…,−6,−3,0,3,6,…}
- [1]={…,−5,−2,1,4,7,…}
- [2]={…,−4,−1,2,5,8,…} These three classes partition the set of integers Z 10.
7.2 Partial order
A partial order on a set is a relation that is reflexive, antisymmetric, and transitive. A set equipped with a partial order is called a partially ordered set (poset) 10.
- Antisymmetric: If a is related to b and b is related to a, then a must be equal to b (aRb and bRa⟹a=b) 10.
An example of a partial order is the "less than or equal to" relation (≤) on the set of integers 10.
| Property | Definition |
|---|---|
| Reflexive | a≤a |
| Antisymmetric | If a≤b and b≤a, then a=b |
| Transitive | If a≤b and b≤c, then a≤c |
8. Applications: databases and SQL
8.1 Databases and relations
A database table is structured as a relation, which is essentially a subset of the Cartesian product of its column domains. Each row within this table represents a tuple 11.
8.2 SQL set operations
SQL provides commands that directly correspond to set operations on rowsets:
- UNION: Corresponds to the set union (∪) operation.
- INTERSECT: Corresponds to the set intersection (∩) operation.
- EXCEPT: Corresponds to the set difference (−) operation 11.
9. Unit 2 — Propositional Calculus
9.1 Propositions
A proposition is a declarative sentence that is definitively either true or false, but not both. Propositions are the fundamental building blocks of propositional calculus 12.
- Atomic propositions are simple statements that cannot be broken down further.
- Compound propositions are formed by combining atomic propositions using logical connectives 12.
Propositions are typically represented by letters such as p, q, and r. Their truthfulness is indicated by truth values: T for true and F for false 12.
📝
- "The Earth revolves around the Sun" is a proposition (True).
- "What is your name?" is not a proposition (it's a question).
- "2 + 2 = 5" is a proposition (False).
- "Please pass the salt" is not a proposition (it's a command).
- "x + 3 = 7" is not a proposition because its truth value depends on the value of x 12.
10. Basic operations / connectives (Conectivos lógicos)
10.1 Logical connectives
Logical connectives are symbols used to combine simple propositions into more complex statements. The truth value of a compound proposition depends on the truth values of its components and the specific connective used.
Understanding these connectives is fundamental to propositional logic 13.
| Name | Symbol | Read as | True when… |
|---|---|---|---|
| NOT (negation) | ¬p | not p | p is false |
| AND (conjunction) | p ∧ q | p and q | both true |
| OR (disjunction) | p ∨ q | p or q | at least one true (inclusive) |
| XOR | p ⊕ q | p or q, not both | exactly one true |
| Implication (conditional) | p → q | if p then q | not (p true and q false) |
| Biconditional (biconditional) | p ↔ q | p iff q | p and q have the same value |
10.2 Truth table for logical connectives
A truth table systematically lists all possible combinations of truth values for the propositions involved and the resulting truth value of the compound proposition. This allows for a clear and unambiguous determination of the logical behavior of each connective 13.
- p: q, ¬p, p∧q, p∨q, p⊕q, p→q, p↔q
- T: T, F, T, T, F, T, T
- T: F, F, F, T, T, F, F
- F: T, T, F, T, T, T, F
- F: F, T, F, F, F, T, T 13.
11. Truth values of compound statements
11.1 Compound statement truth tables
A compound statement is formed by combining simpler statements using logical connectives. The truth value of a compound statement depends on the truth values of its component statements and the specific connective used.
When dealing with n distinct propositional variables, a truth table will have 2n rows to cover all possible combinations of truth values. The order of operations for logical connectives is: negation (¬) first, then conjunction (∧), disjunction (∨), implication (→), and finally biconditional (↔).
Brackets can be used to clarify the order when necessary 14.
- p: q, ¬p, p∧q, p∨q, p⊕q, p→q, p↔q
- F: F, T, F, F, F, T, T
- F: T, T, F, T, T, T, F
- T: F, F, F, T, T, T, F
- T: T, F, T, T, F, T, T 14.
11.2 Understanding implication (p → q)
The implication p→q is often the most confusing logical connective. It can be understood as a promise: "If p is true, then q will be true."
The only case where this promise is broken (i.e., the implication is false) is when p is true and q is false. In all other scenarios, the promise is considered kept (true) 14.
- True antecedent, true consequent (p is T, q is T): The promise is kept. The implication is true.
- True antecedent, false consequent (p is T, q is F): The promise is broken. The implication is false. This is the sole condition for p→q to be false.
- False antecedent, true consequent (p is F, q is T): The promise was not broken because the condition (p) was not met. The implication is true.
- False antecedent, false consequent (p is F, q is F): The promise was not broken because the condition (p) was not met. The implication is true 14.
📝 Consider the statement, "If you pass the exam, I will buy you ice cream."
- If you pass (T) and I buy ice cream (T), the promise is kept (T).
- If you pass (T) and I do not buy ice cream (F), the promise is broken (F).
- If you fail (F) and I buy ice cream (T), the promise is not broken (T).
- If you fail (F) and I do not buy ice cream (F), the promise is not broken (T) 14.
11.3 Related statements to implication 14
Several statements are related to the implication p→q, each having its own truth conditions 14.
- Converse (q→p): This statement reverses the antecedent and consequent of the original implication. It is not necessarily equivalent to the original implication.
- Inverse (¬p→¬q): This statement negates both the antecedent and the consequent of the original implication. It is equivalent to the converse.
- Contrapositive (¬q→¬p): This statement negates both the antecedent and the consequent and then reverses them. The contrapositive is always logically equivalent to the original implication p→q 14.
| Statement | Form | Equivalence to p → q |
|---|---|---|
| Original | p → q | — |
| Converse | q → p | Not necessarily equivalent |
| Inverse | ¬p → ¬q | Equivalent to Converse, not Original |
| Contrapositive | ¬q → ¬p | Always equivalent |
12. Tautology, contradiction, equivalence
12.1 Truth tables
Truth tables are used to determine the truth value of a compound proposition for all possible truth values of its atomic propositions. The table is constructed by listing all possible combinations of truth values for the atomic propositions and then evaluating the compound proposition for each combination.
The final column of the truth table shows the truth value of the entire compound proposition for each case 15.
For example, to evaluate (p∨q)∧¬p:
- First, list the truth values for p and q.
- Then, determine the truth value of p∨q.
- Next, determine the truth value of ¬p.
- Finally, combine the results of p∨q and ¬p using the conjunction (∧) operator.
The resulting truth column for (p∨q)∧¬p is F,F,T,F. This is equivalent to ¬p∧q 15.
12.2 Types of propositions
Propositions can be classified based on their truth values across all possible assignments of truth values to their atomic components 15.
| Type | Definition |
|---|---|
| Tautology | A proposition that is always true, regardless of the truth values of its atomic propositions. Example: p∨¬p. |
| Contradiction | A proposition that is always false, regardless of the truth values of its atomic propositions. Example: p∧¬p. |
| Contingency | A proposition that is sometimes true and sometimes false, depending on the truth values of its atomic propositions. |
12.3 Logical equivalence
Two propositions P and Q are logically equivalent, denoted as P≡Q, if they have the same truth column in a truth table. Equivalently, their biconditional P↔Q is a tautology 15.
12.4 Logical laws
Several laws govern logical operations, analogous to set theory laws. These laws can be used to simplify logical expressions and prove equivalences algebraically 16.
| Law | Rule |
|---|---|
| Double negation | ¬¬p≡p |
| Idempotent | p∧p≡p; p∨p≡p |
| Commutative / Associative | Same as in sets |
| Distributive | p∧(q∨r)≡(p∧q)∨(p∧r); p∨(q∧r)≡(p∨q)∧(p∨r) |
| Identity | p∧T≡p; p∨F≡p |
| Domination | p∨T≡T; p∧F≡F |
| Negation | p∨¬p≡T; p∧¬p≡F |
| De Morgan | ¬(p∧q)≡¬p∨¬q; ¬(p∨q)≡¬p∧¬q |
| Absorption | p∨(p∧q)≡p; p∧(p∨q)≡p |
12.5 Laws for implication and biconditional
Additional laws are specific to implication (→) and biconditional (↔) operators, which are often used in logical reasoning 16.
| Law | Rule |
|---|---|
| Implication | p→q≡¬p∨q |
| Contrapositive | p→q≡¬q→¬p |
| Biconditional | p↔q≡(p→q)∧(q→p) |
| Negation of implication | ¬(p→q)≡p∧¬q |
12.6 Proving equivalence
Equivalences can be proven using two primary methods: truth tables or algebraic manipulation using the named logical laws. A common first step in algebraic proofs is to eliminate implications and biconditionals by using the implication law 16.
📝 To prove p→q≡¬q→¬p, we can use the implication law:
p→q≡¬p∨q.
Now, consider the right side:
¬q→¬p≡¬(¬q)∨¬p.
Applying double negation to ¬(¬q) gives q.
So, ¬q→¬p≡q∨¬p.
Since ¬p∨q is the same as q∨¬p due to the commutative law, the two expressions are logically equivalent 16.
13. Normal forms (Formas normais)
13.1 Vocabulary
- Literal: A variable or its negation (e.g., p or ¬p).
- Minterm: An AND of literals where each variable appears exactly once. For example, p∧¬q.
- Maxterm: An OR of literals where each variable appears exactly once. For example, ¬p∨q.
- DNF (Disjunctive Normal Form): A logical formula expressed as an OR of AND terms (a sum of products).
- CNF (Conjunctive Normal Form): A logical formula expressed as an AND of OR terms (a product of sums).
- Principal DNF/CNF: A DNF or CNF where every term includes all variables 17.
13.2 Method 1: Deriving normal forms from a truth table
This method constructs the principal DNF (PDNF) and principal CNF (PCNF) directly from a truth table.
- PDNF: For each row where the truth table output is True (T), create a minterm. If a variable is True in that row, use the variable itself; if False, use its negation. Join all these minterms with the OR operator (∨).
- PCNF: For each row where the truth table output is False (F), create a maxterm. If a variable is False in that row, use the variable itself; if True, use its negation. Join all these maxterms with the AND operator (∧) 17.
For the implication p→q:
- The truth table has T outputs for rows (T,T), (F,T), and (F,F).
- This yields the PDNF: (p∧q)∨(¬p∧q)∨(¬p∧¬q).
- The truth table has an F output for row (T,F).
- This yields the PCNF: ¬p∨q 17.
📝 For the implication p→q, the truth table has an F output for row (T,F), yielding the PCNF: ¬p∨q 17.
13.3 Method 2: Algebraic manipulation
This method transforms a logical formula into a normal form using algebraic rules.
- Eliminate implication (→) and biconditional (↔):
- A→B is equivalent to ¬A∨B.
- A↔B is equivalent to (A→B)∧(B→A), which further simplifies to (¬A∨B)∧(¬B∨A) 17.
The process continues with other algebraic rules to achieve DNF or CNF.
14. Quantifiers (Quantificadores)
14.1 Predicates and quantifiers 18
A predicate is a statement with a variable, such as P(x)="x > 3". This statement becomes a proposition when the variable x is assigned a specific value or when a quantifier is added.
The domain (or universe) specifies the set of possible values for x.
Quantifiers are symbols used to indicate the scope of a variable in a predicate.
| Symbol | Name | Meaning |
|---|---|---|
| ∀xP(x) | Universal (universal) | P(x) is true for every x in the domain |
| ∃xP(x) | Existential (existencial) | P(x) is true for at least one x |
A universal statement (∀xP(x)) is false if even one counterexample exists. An existential statement (∃xP(x)) is true if at least one example can be found 18.
14.2 Negation rules for quantifiers 18
The negation of a universal statement is an existential statement, and vice versa.
| Original Statement | Negation |
|---|---|
| ∀xP(x) | ∃x¬P(x) |
| ∃xP(x) | ∀x¬P(x) |
15. Applications: Boolean logic and digital circuits
15.1 Boolean logic and digital circuits
Boolean logic uses truth values (True/False) to represent logical statements. In digital circuits, these truth values are mapped to electrical signals: True is represented by 1 (high voltage) and False by 0 (low voltage) 19.
Key logical operations correspond to digital gates:
- AND gate: Implements the logical conjunction (∧), outputting 1 only if all inputs are 1.
- OR gate: Implements the logical disjunction (∨), outputting 1 if at least one input is 1.
- NOT gate: Implements logical negation (¬), inverting the input (0 becomes 1, 1 becomes 0) 19.
| Logical Operator | Digital Gate | Symbol |
|---|---|---|
| Conjunction (AND) | AND gate | p \land q |
| Disjunction (OR) | OR gate | p \lor q |
| Negation (NOT) | NOT gate | \neg p |
15.2 Universal gates
NAND (Not-AND) and NOR (Not-OR) gates are considered universal gates because any digital circuit can be constructed using only NAND gates or only NOR gates. This universality simplifies circuit design and manufacturing 19.
15.3 Circuit simplification
Simplifying a digital circuit is equivalent to simplifying its corresponding Boolean logic formula. This is achieved using the laws of Boolean algebra, which allows for the reduction in the number of gates required, leading to more efficient and cost-effective circuits 19.
For example, the expression (p∧q)∨(p∧¬q) can be simplified:
- Apply the distributive law: p∧(q∨¬q)
- Apply the negation law (q∨¬q is always True, T): p∧T
- Apply the identity law (p∧T is p): p This simplification means a complex circuit can be reduced to a single wire 19.
📝 The expression (p∧q)∨(p∧¬q) simplifies to p, meaning a complex circuit can be reduced to a single wire 19.
15.4 Half adder
A half adder is a digital circuit that performs the addition of two single bits. It produces two outputs: a Sum bit and a Carry bit 19.
- Sum: The sum bit is 1 if exactly one of the input bits is 1. This corresponds to the XOR operation (p⊕q).
- Carry: The carry bit is 1 if both input bits are 1. This corresponds to the AND operation (p∧q) 19.
| Input p | Input q | Sum (p ⊕ q) | Carry (p ∧ q) |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 |
16. Unit 3 — Techniques of Counting
16.1 Basic principles
This section introduces fundamental counting techniques: the sum rule and the product rule, which are essential for solving combinatorial problems. These rules help determine the total number of ways an event can occur based on different scenarios 20.
- Sum rule: Used when a task can be performed in one of two mutually exclusive ways. If task 1 can be done in m ways and task 2 can be done in n ways, and these tasks cannot be performed simultaneously, the total number of ways to perform either task is m+n.
- Product rule: Applied when a task involves a sequence of steps. If step 1 can be done in m ways and, for each of those ways, step 2 can be done in n ways, then the total number of ways to perform the entire task is m×n. This rule is often referred to as the "AND" rule or "then" rule 20.
The principle of inclusion-exclusion is used when there are overlapping possibilities. For two sets A and B, the total number of elements in their union is given by the formula: ∣A∪B∣=∣A∣+∣B∣−∣A∩B∣ 20.
- Factorial: The factorial of a non-negative integer n, denoted by n!, is the product of all positive integers less than or equal to n. It is defined as n!=n×(n−1)×⋯×2×1. By definition, 0!=1. For example, 5!=5×4×3×2×1=120 20.
A common strategy for solving counting problems, especially those with restrictions, is to use "slots" or boxes to represent the positions or choices. The number of options for each slot is determined, and then these numbers are multiplied.
It is often beneficial to handle any restricted slots first, such as a slot that must satisfy a specific condition (e.g., a digit in a number must be odd) 20.
📝 If you have 3 different shirts and 2 different pairs of pants, the total number of distinct outfits you can create is 3×2=6 20.
17. Permutations (Permutações — order matters)
17.1 Permutations without repetition
Permutations deal with arrangements where the order of items is significant. For instance, arranging people in a line, where the position of each person matters, is a permutation.
The fundamental principle is that ABC is distinct from CBA 21.
When arranging r items chosen from a set of n distinct items without repetition, the formula is P(n,r)=(n−r)!n!. If all n items are arranged, the formula simplifies to n! 21.
📝 If there are 5 runners in a race and we want to determine the number of ways to award gold, silver, and bronze medals, we use permutations. This is calculated as P(5,3)=(5−3)!5!=2!5!=5×4×3=60 possible outcomes 21.
📝 The number of distinct ways to arrange the letters in the word MATH is 4!=24 21.
17.2 Permutations with repetition 21
Permutations with repetition involve scenarios where items can be reused or where some items in the set are identical.
There are two main cases for permutations with repetition:
| Case | Description | Formula | Example |
|---|---|---|---|
| Items can be reused | Choosing r items from n options, with replacement | nr | A 4-digit PIN can be formed in 104=10,000 ways |
| Arranging objects with identical items | Arranging n objects where n1 are identical of type 1, n2 of type 2,..., nk of type k | n1!⋅n2!⋅…⋅nk!n! | Arranging the letters in BANANA: 3!⋅2!⋅1!6!=12720=60 ways |
A common exam strategy is to first determine if items can be reused. If reuse is allowed, the formula nr applies.
If identical objects exist within the set being arranged, the formula involves dividing by the factorials of the counts of these identical objects 21.
(Bonus: The number of ways to arrange n people in a circle is (n−1)!.) 21.
18. The Pigeonhole Principle (Princípio da Casa dos Pombos)
18.1 The Pigeonhole Principle
The Pigeonhole Principle is a mathematical concept used to prove that certain conditions must exist when a set of objects is distributed into a smaller set of categories. It's based on the intuitive idea that if you have more items than containers, at least one container must hold more than one item 22.
The principle has two main forms 22:
- Basic form: If n+1 objects are placed into n boxes, then at least one box must contain at least 2 objects.
- Generalized form: If N objects are placed into k boxes, then at least one box must contain at least ⌈N/k⌉ objects. The ceiling function, denoted by ⌈x⌉, rounds x up to the nearest integer 22.
The core strategy for applying the Pigeonhole Principle involves identifying which elements represent the "objects" (pigeons) and which represent the "categories" or "boxes" (holes). Proofs typically state the categories and then assert that since the number of objects exceeds the number of categories, the principle guarantees the desired outcome 22.
📝 If there are 13 people, at least two must share the same birth month, because there are only 12 months 22.
18.2 Guarantee Questions
The Pigeonhole Principle is particularly useful for "guarantee" questions, which ask for the minimum number of objects needed to ensure a specific outcome. This often involves thinking about the worst-case scenario 22.
To guarantee that at least m+1 objects are in one box when distributing objects into k boxes, you need to have a total of k⋅m+1 objects. This ensures that even if you distribute the objects as evenly as possible, the (k⋅m+1)-th object will force one box to have m+1 items 22.
📝 To guarantee having at least 3 socks of the same color, given there are 4 possible colors, you need to take 4⋅2+1=9 socks. This is because in the worst case, you could pick 2 socks of each of the 4 colors (total 8 socks), and the 9th sock must then complete a set of 3 22.
19. Combinations (Combinações — order does NOT matter)
19.1 Definition and formula
Combinations refer to the number of ways to choose a subset of items from a larger set where the order of selection does not matter. This is analogous to picking a team, where the same group of individuals constitutes the same team regardless of the order in which they were selected 23.
The formula for combinations is given by C(n,r)=r!(n−r)!n!, where n is the total number of items to choose from, and r is the number of items to choose. This is also denoted as nCr or "n choose r" 23.
Combinations are related to permutations by the formula P(n,r)=r!⋅C(n,r), indicating that permutations involve choosing items first and then arranging them 23.
19.2 Properties of combinations 23
| Property | Meaning |
|---|---|
| C(n,0)=C(n,n)=1 | There is one way to choose nothing or to choose everything from a set. |
| C(n,1)=n | There are n ways to choose one item from a set of n items. |
| C(n,r)=C(n,n−r) | Choosing r items to include is the same as choosing n−r items to exclude. |
| Pascal's Identity: C(n,r)=C(n−1,r−1)+C(n−1,r) | This identity relates combinations to the previous row in Pascal's triangle, often interpreted as choosing a specific item or not. |
| ∑r=0nC(n,r)=2n | The sum of all combinations for a given n equals the total number of subsets, linking to the power set. |
19.3 Examples
To choose 3 students from a group of 5, the number of combinations is calculated as C(5,3)=3!(5−3)!5!=3×2×15×4×3=10 23.
For a scenario involving handshakes among 6 people, where each handshake involves 2 people, the number of combinations is C(6,2)=2!(6−2)!6!=2×16×5=15 23.
📝 Choosing 3 students from 5. The calculation C(5,3)=3!(5−3)!5!=10 shows there are 10 distinct groups of 3 students that can be formed from a set of 5 23.
20. Decision table — which formula?
20.1 Choosing the right formula 24
This section provides a decision table to help determine the correct formula for counting problems based on whether order matters and if repetition is allowed 24.
| Does order matter? | Repetition allowed? | Formula |
|---|---|---|
| Yes (permutation) | No | P(n,r) = n!/(n−r)! |
| Yes (permutation) | Yes | nʳ |
| No (combination) | No | C(n,r) |
| No (combination) | Yes | C(n+r−1, r) |
20.2 Combinations with repetition example
Combinations with repetition are used when choosing items from different types, and repeats are permitted. For instance, selecting 3 ice-cream scoops from 5 available flavors, where flavors can be chosen multiple times, is calculated using this method 24.
📝 Choosing 3 ice-cream scoops from 5 flavors, with repetition allowed, uses the formula C(n+r−1,r). With n=5 flavors and r=3 scoops, this becomes C(5+3−1,3)=C(7,3). Calculating the combinations: C(7,3)=3!(7−3)!7!=3!4!7!=3×2×17×6×5=35. There are 35 different ways to choose the scoops 24.
20.3 Combining rules for selections
When combining different selection criteria, such as forming a committee, the "AND" rule implies multiplication of the individual combination counts. For example, if a committee requires selecting 2 men from 5 and 3 women from 4, the total number of ways to form the committee is the product of the ways to select men and the ways to select women 24.
📝 To form a committee with 2 men from 5 and 3 women from 4, we multiply the number of ways to choose the men by the number of ways to choose the women. The number of ways to choose 2 men from 5 is C(5,2)=2!3!5!=10. The number of ways to choose 3 women from 4 is C(4,3)=3!1!4!=4. Therefore, the total number of ways to form the committee is 10×4=40 24.
21. Quick exam checklist (Units 1–3)
21.1 Proving sets and relations
- Set equality: To prove two sets, A and B, are equal, demonstrate that A is a subset of B and B is a subset of A. Alternatively, use algebraic manipulation, citing the names of the logical laws applied.
- Relation properties: To disprove a property of a relation (reflexive, symmetric, transitive), provide a single counterexample. To prove a property holds, construct a general argument that applies to all elements.
- Equivalence relations: An equivalence relation is reflexive, symmetric, and transitive. It partitions a set into disjoint equivalence classes.
- Partial orders: A partial order is reflexive, antisymmetric, and transitive. Hasse diagrams are used to visualize partial orders by removing loops and shortcuts 25.
21.2 Logical structures and truth tables
- Truth tables: For propositional logic, truth tables have 2n rows, where n is the number of propositional variables. The only case where an implication p→q is false is when p is true and q is false.
- Logical equivalences: First, eliminate implications using the equivalence p→q≡¬p∨q. De Morgan's laws can be used to distribute negations over conjunctions and disjunctions.
- Normal forms:
- PDNF (Principal Disjunctive Normal Form): Derived from the rows where the formula is true.
- PCNF (Principal Conjunctive Normal Form): Derived from the rows where the formula is false.
- Quantifiers:
- Universal quantifier (∀) is typically used with implication (→).
- Existential quantifier (∃) is typically used with conjunction (∧).
- Negating a quantified statement flips the quantifier (e.g., ¬∀xP(x)≡∃x¬P(x)) 25.
📝 The only case where an implication p→q is false is when p is true and q is false 25.
21.3 Counting techniques
- Basic counting principles:
- AND (multiplication): Use when events occur in sequence or when choices are made for multiple independent categories.
- OR (addition): Use when events are mutually exclusive and you are choosing one option from several possibilities.
- Permutations and Combinations:
- Permutation: Used when the order of selection matters.
- Combination: Used when the order of selection does not matter.
- Pigeonhole Principle: If N items are put into k containers, with N>k, then at least one container must contain more than one item. The generalized form states that at least one container must contain at least ⌈N/k⌉ items. Identify the "pigeons" (items) and "holes" (containers) in the problem 25.
| Concept | Key Strategy |
|---|---|
| Proving set equality | Two inclusions or algebraic manipulation with law names |
| Disproving relation properties | One counterexample |
| Proving relation properties | General argument |
| Equivalence relation | Reflexive, Symmetric, Transitive; forms partition |
| Partial order | Reflexive, Antisymmetric, Transitive; draw Hasse diagram |
| Truth table implication T → F | This is the only false case |
| Logical equivalence p → q | Equivalent to ¬p ∨ q |
| De Morgan's laws | Flip ∧/∨ when negating |
| PDNF | From True rows |
| PCNF | From False rows |
| Quantifier ∀ with | Implication (→) |
| Quantifier ∃ with | Conjunction (∧) |
| Negating quantifiers | Flip quantifier and negate predicate |
| Counting AND | Multiply |
| Counting OR | Add |
| Counting order matters | Permutation |
| Counting order doesn't matter | Combination |
| Pigeonhole Principle | Identify pigeons and holes; use ⌈N/k⌉ |
© 2026 Maeve. All rights reserved. This content is protected by copyright.