Comprehensive Discrete Mathematics Study Notes
Set Theory
- Definition of a Set: Sets are the fundamental discrete structures on which all others are built. Formally, a set is an unordered, well-defined collection of distinct objects, known as elements or members of the set, all of the same type. The "type" is defined by the person establishing the set.
- Examples of Sets:
- A={0,2,4,6,…}
- B={1,3,5,…}
- C={x∣x∈Natural number}
- Notation and Membership:
- Sets are generally denoted by capital letters (A,B,C).
- Objects within a set are called elements or members.
- Lower case letters (x,y,z) are used to denote elements.
- x∈A means that element x is a member of set A.
- x∈/A means that element x is not a member of set A.
- Cardinality of a Set: This refers to the number of elements present in a set, denoted as ∣A∣. For example, if A={0,2,4,6}, then ∣A∣=4.
- Representation of Sets:
- Tabular/Roster Form: The set is defined by actually listing all its members inside curly braces. Examples include A={a,e,i,o,u}, B={1,2,3,4}, and C={…,−4,−2,0,2,4,…}.
- Set Builder Form: The set is defined by specifying the property that all elements must satisfy. Examples include:
- A={x∣x is an odd positive number less than 10}
- B={x∣x∈English alphabet and x is a vowel}
- C={x∣x∈Z and x(mod2)=0}
- Types of Sets:
- Finite Set: A set S is finite if it contains exactly n elements, where n is a non-negative integer. Example: A={1,2,3,4}.
- Infinite Set: A set is infinite if the count of its elements never comes to an end. Example: The set of all natural numbers.
- Null / Empty Set: A unique set containing no elements, denoted by ϕ or ∅ or ∅, with a cardinality of zero (∣ϕ∣=0).
- Singleton Set: A set containing exactly one element.
- Universal Set: A fixed set containing all objects under investigation, of which all other sets are subsets. In Venn diagrams, it is represented by a rectangle and denoted by U.
- Subsets:
- If every element of set A is also an element of set B, then A is a subset of B, written as A⊆B. Formally: ∀x(x∈A→x∈B).
- If A⊆B, then B is called the superset of A.
- To show A is not a subset of B, one must find at least one element x∈A such that x∈/B.
- Important Properties:
- ϕ⊆A: The empty set is a subset of every set.
- A⊆U: Every set is a subset of the Universal set.
- A⊆A: Every set is a subset of itself.
- Proper Subset: If A⊆B and A=B, then A is a proper subset of B, denoted as A⊂B. This implies there is at least one element in B not present in A.
- Equality of Sets: Sets A and B are equal (A=B) if they contain exactly the same elements. This is true if A⊆B and B⊆A, or ∀x(x∈A↔x∈B).
- Power Set: The set of all subsets of a set A is called the power set, denoted P(A) or 2A. If ∣A∣=n, then the cardinality of the power set is ∣P(A)∣=2n. For example, if A={1,2,3}, then P(A)={ϕ,{1},{2},{3},{1,2},{2,3},{1,3},{1,2,3}}.
Operations on Sets
- Complement of a Set: The set of all elements in the universal set U that are not in set A, denoted Ac. Formally: Ac={x∣x∈/A and x∈U}.
- Union of Sets: The set containing all elements that belong to either set A, set B, or both. Denoted A∪B={x∣x∈A or x∈B}.
- Intersection of Sets: The set containing all elements that belong to both set A and set B. Denoted A∩B={x∣x∈A and x∈B}.
- Disjoint Sets: Two sets are disjoint if they have no common elements, meaning A∩B=ϕ.
- Set Difference: The set of all elements that belong to set A but do not belong to set B. Denoted A−B={x∣x∈A and x∈/B}.
- Symmetric Difference: The set of elements that are in A or in B but not in both. Denoted A⊕B. Equivalents include:
- A⊕B=(A∪B)−(A∩B)
- A⊕B={x∣(x∈A and x∈/B) or (x∈B and x∈/A)}
- A⊕B=(A−B)∪(B−A)
Mathematical Laws of Sets
- Idempotent Laws:
- A∪A=A
- A∩A=A
- Associative Laws:
- (A∪B)∪C=A∪(B∪C)
- (A∩B)∩C=A∩(B∩C)
- Commutative Laws:
- A∪B=B∪A
- A∩B=B∩A
- Distributive Laws:
- A∪(B∩C)=(A∪B)∩(A∪C)
- A∩(B∪C)=(A∩B)∪(A∩C)
- De Morgan's Laws:
- (A∪B)c=Ac∩Bc
- (A∩B)c=Ac∪Bc
- Identity Laws:
- A∪ϕ=A
- A∩ϕ=ϕ
- A∪U=U
- A∩U=A
- Complement Laws:
- A∪Ac=U
- A∩Ac=ϕ
- Uc=ϕ
- ϕc=U
- Involution Law:
- (Ac)c=A
Relations
- Cartesian Product: The set of all ordered pairs (a,b) where a∈A and b∈B. Denoted A×B={(a,b)∣a∈A and b∈B}.
- It is the maximum possible relation between two sets.
- It is generally not commutative: A×B=B×A.
- If ∣A∣=m and ∣B∣=n, then ∣A×B∣=m×n.
- Definition of a Relation: A relation from set A to set B is any subset of the Cartesian product A×B.
- Since a relation is a subset of A×B, the total number of possible relations is 2m×n.
- Representation: Relations can be represented using a matrix where rows correspond to elements of A and columns to elements of B. A value of 1 indicates a pair is in the relation, and 0 indicates it is not.
- Complement of a Relation (R′): Let R be a relation from A to B. The complement consists of all pairs in A×B not present in R.
- R′={(a,b)∣(a,b)∈A×B,(a,b)∈/R}
- R∪R′=A×B
- R∩R′=ϕ
- Inverse of a Relation (R−1): A relation from B to A formed by reversing the pairs in R.
- R−1={(b,a)∣(a,b)∈R}. The size remains the same: ∣R∣=∣R−1∣.
- Diagonal Relation ($\Delta_A$): A relation containing all pairs (x,x) for every x∈A. Denoted ΔA={(x,x)∣∀x∈A}.
Types of Relations on a Set
- Reflexive Relation: A relation R on set A is reflexive if ∀x∈A,(x,x)∈R.
- Irreflexive Relation: A relation R on set A is irreflexive if ∀x∈A,(x,x)∈/R.
- Symmetric Relation: If ∀a,b∈A,(a,b)∈R→(b,a)∈R.
- Anti-Symmetric Relation: If ∀a,b∈A,(a,b)∈R and (b,a)∈R→a=b. Symmetry is not allowed except for diagonal pairs (a=b).
- Asymmetric Relation: If ∀a,b∈A,(a,b)∈R→(b,a)∈/R. No symmetry is allowed, including diagonal pairs.
- Transitive Relation: If ∀a,b,c∈A,(a,b)∈R and (b,c)∈R→(a,c)∈R.
- Equivalence Relation: A relation that is simultaneously reflexive, symmetric, and transitive.
- If R1 and R2 are equivalence relations, their intersection R1∩R2 is an equivalence relation, but their union R1∪R2 is not necessarily one.
- Partial Order Relation: A relation that is reflexive, anti-symmetric, and transitive.
- Poset (Partially Ordered Set): A set A paired with a partial order relation R, denoted [A,R]. Examples include [A,divides], [A,≤], and [P(S),⊆].
Hasse Diagrams and Lattices
- Hasse Diagram: A graphical representation of a partial order relation in its transitive reduction form.
- Steps to create:
- Draw a vertex for each element.
- Draw an edge from a to b if (a,b)∈R.
- Remove all reflexive edges (loops) and transitive edges.
- Remove direction and arrange by increasing height.
- Lattice: A Poset or Hasse diagram where every pair of elements has a unique supremum (least upper bound or Join) and infimum (greatest lower bound or Meet).
- A Lattice is both a Join Semi-Lattice and a Meet Semi-Lattice.
- Lattice Laws: Idempotent, Associative, Commutative, Distributive, De Morgan's, Identity, Complement, and Involution laws all apply to lattice operations ∨ (Join) and ∧ (Meet).
- Properties of Lattices:
- Unbounded Lattice: Contains an infinite number of elements.
- Bounded Lattice: Contains a finite number of elements, with a defined upper bound (U) and lower bound (ϕ).
- Complement of an Element: Element ac is a complement of a if a∨ac=Upper bound and a∧ac=Lower bound.
- Distributive Lattice: For every element, there exists at most one complement (zero or one).
- Complemented Lattice: For every element, there exists at least one complement (one or more).
- Boolean Algebra: A lattice that is both complemented and distributive, where every element has exactly one complement.
Functions
- Definition: A function is a relation between sets A and B that associates every element of set A to exactly one element of set B. Written as f:A→B.
- Range of a Function: The set of all images of elements of A, such that Range={y∣y∈B and (x,y)∈f}. Note that Range⊆B.
- Total Number of Functions: If ∣A∣=m and ∣B∣=n, there are nm possible functions.
- Function Composition: Operation taking f:X→Y and g:Y→Z to produce h(x)=g(f(x)). Denoted g∘f. Composition is associative: f∘(g∘h)=(f∘g)∘h.
- Types of Functions:
- One-to-One (Injective): Function where distinct elements of the domain map to distinct elements of the codomain. Possible if ∣A∣≤∣B∣. Number of injective functions is P(n,m). If ∣A∣=∣B∣=n, there are n! functions.
- Onto (Surjective): Function where every element in codomain B is the image of at least one element in domain A (Range=B). Possible if ∣B∣≤∣A∣.
- Formula for Number of Onto Functions: nm−(1n)(n−1)m+(2n)(n−2)m−(3n)(n−3)m+⋯+(−1)n−1(n−1n)1m
- Bijective: A function that is both injective and surjective. Possible only if ∣A∣=∣B∣=n. Total bijective functions: n!.
- Inverse of a Function (f−1): A function that reverses the original mapping. If f(x)=y, then f−1(y)=x. Only bijective functions have inverses.
Theory of Logics
- Proposition: A declarative sentence that is either true (T) or false (F), but not both.
- Determining Propositions:
- "Delhi is the capital of USA": Proposition (F).
- "How are you doing?": Not a proposition.
- 5≤11: Proposition (T).
- X+y=z: Not a proposition unless variables are defined.
- Arguments: A set of premises (P1,P2,…,Pn) yielding a conclusion (Q). An argument is valid if whenever all premises are true, the conclusion must be true.
- Logical Operators:
- Negation ($\neg p$): "It is not the case that p". Inverts truth value.
- Conjunction (p∧q): True only if both p and q are true.
- Disjunction (p∨q): False only if both p and q are false.
- Implication (p→q): True except when p is true and q is false. p→q≡¬p∨q.
- Biconditional (p↔q): True only if p and q have the same truth value. p↔q≡(p→q)∧(q→p).
- Derived Conditional Statements:
- Implication: p→q
- Converse: q→p
- Inverse: ¬p→¬q
- Contrapositive: ¬q→¬p (Logically equivalent to Implication).
- Logical States:
- Tautology: Always true regardless of variable truth values.
- Contradiction: Always false regardless of variable truth values.
- Contingency: Neither a tautology nor a contradiction.
- Satisfiable: Has at least one true value in its truth table.
- Functionally Complete Set: A set of connectives that can express any propositional function. Examples: {∧,¬} and {∨,¬}.
- Canonical Normal Forms:
- Canonical SOP (PDNF): Sum of Product where each AND term contains all literals.
- Canonical POS (PCNF): Product of Sum where each OR term contains all literals.
First Order Predicate Logic (FOPL)
- Subject and Predicate: Logic used to extract more information than propositional logic. In "1 is a natural number", "1" is the subject and "natural number" is the predicate (NatNo(1)).
- Quantifiers:
- Universal ($\forall x P(x)$): Assert that P(x) is true for all values of x in the universe of discourse.
- Existential ($\exists x P(x)$): Assert that P(x) is true for at least one value of x in the universe of discourse.
- Quantification Logic Examples:
- "Every Indian likes cricket": ∀x[Indian(x)→Cricket(x)]
- "Some Indians like samosa": ∃x[Indian(x)∧Samosa(x)]
- Negation of Quantifiers:
- ¬[∀xP(x)]≡∃x[¬P(x)]
- ¬[∃xP(x)]≡∀x[¬P(x)]
- Rules of Inference:
- Universal Specification: ∀xP(x)∴P(c)
- Universal Generalization: P(c) for all c∴∀xP(x)
- Existential Specification: ∃xP(x)∴P(c)
- Existential Generalization: P(c)∴∃xP(x)
- Universal Modus Ponens: ∀x(P(x)→Q(x)),P(c)∴Q(c)
Algebraic Structures
- Binary Operation Properties:
- Closure: For set A and operation ∗, ∀a,b∈A,a∗b∈A.
- Associativity: ∀a,b,c∈A,(a∗b)∗c=a∗(b∗c).
- Identity: There exists e∈A such that ∀a∈A,a∗e=e∗a=a.
- Inverse: For each a∈A, there exists a−1∈A such that a∗a−1=a−1∗a=e.
- Commutativity: ∀a,b∈A,a∗b=b∗a.
- Hierarchical Structures:
- Algebraic Structure: Satisfies Closure.
- Semi-Group: Satisfies Closure and Associativity.
- Monoid: Satisfies Closure, Associativity, and Identity.
- Group: Satisfies Closure, Associativity, Identity, and Inverse.
- Abelian Group: A Group that also satisfies Commutativity.
- Properties of Groups:
- If the group order is even, there is at least one element that is its own inverse.
- (a∗b)−1=b−1∗a−1.
- Cancellation law: a∗b=a∗c→b=c.
- Finite Groups and Modulo Operators:
- Addition Modulo (+m): a+mb=(a+b)(modm).
- Multiplication Modulo (∗m): a∗mb=(a×b)(modm).
- Examples: ⟨{0,1,2,…,p−1},+p⟩ is always a group. ⟨{1,2,…,p−1},∗p⟩ is a group if p is prime.
- Subgroup: A subset of a group that is itself a group under the same operation.
- Lagrange's Theorem: The order of a subgroup must exactly divide the order of the group (O(G)(modO(H))=0).
- Cyclic Group: A group containing at least one generator 'a' such that every element can be expressed as an integral power of 'a'.
- Number of generators for a cyclic group of order n is given by ϕ(n)=n×p1p2…pk(p1−1)(p2−1)…(pk−1), where pk are distinct prime factors of n.
- Cosets:
- Left Coset: aH={ah∣h∈H}.
- Right Coset: Ha={ha∣h∈H}.
- Advanced Structures:
- Ring: An algebraic system ⟨R,+,⋅⟩ where ⟨R,+⟩ is an abelian group, ⟨R,⋅⟩ is a semigroup, and ⋅ distributes over +.
- Integral Domain: A commutative ring with unity and no zero divisors (a⋅b=0→a=0 or b=0).
- Field: A commutative ring where every non-zero element has a multiplicative inverse (⟨R∖{0},⋅⟩ is an abelian group).
Graph Theory
- Basic Definitions:
- Graph G(V, E): Consists of vertices (V) and edges (E).
- Self-Loop: Edge (vi,vi) connecting a vertex to itself.
- Parallel Edges: Multiple edges between the same two vertices.
- Adjacent Vertices: Vertices connected by the same edge.
- Complete Graph (Kn): A simple graph with an edge between every pair of vertices. Total edges: 2n(n−1).
- Degree and Theorems:
- Degree: Number of edges incident to a vertex.
- Hand-shaking Theorem: ∑deg(vi)=2∣E∣.
- The number of vertices with odd degree in a graph must be even.
- Memory Representations:
- Adjacency Matrix: Symmetric V×V matrix for undirected graphs.
- Incidence Matrix: V×E matrix where rows are vertices and columns are edges.
- Adjacency List: An array of lists representing adjacent vertices for each node.
- Popular Graphs:
- Bipartite Graph: Vertices can be partitioned into two disjoint sets V1,V2 such that all edges connect a vertex in V1 to one in V2.
- Complete Bipartite Graph (Km,n): Every vertex in V1 is connected to every vertex in V2.
- Planar Graph: A graph that can be drawn on a plane without edges crossing.
- Euler's Formula: r=e−v+2 (for connected planar graphs, where r is regions, e edges, v vertices).
- Disconnected Euler Formula: v−e+r−k=1 (where k is number of components).
- Kuratowski's Non-Planar Graphs: K5 and K3,3 are the simplest non-planar graphs.
- Graph Coloring: Vertex coloring assigns colors such that no adjacent vertices share a color. The minimum colors required is the Chromatic Number (χ(G)).
- Traversals:
- Path: Open walk with no repeated vertices.
- Connectivity: Minimum edges required for connectivity is n−1. Guaranteed for all graphs if edges exceed 2(n−1)(n−2).
- Euler Graph: Connected graph with a closed walk containing all edges. Exists iff all vertices have even degree.
- Hamiltonian Graph: Contains a circuit visiting every vertex exactly once.
Combinatorics
- Permutation (P(n,r)): Arrangement of items where order matters. P(n,r)=(n−r)!n!.
- Combination (C(n,r)): Selection of items where order does not matter. C(n,r)=r!(n−r)!n!.
- Pigeonhole Principle: If n items are put into m containers and n>m, then at least one container must contain more than one item (⌈mn⌉ elements).
- Principle of Inclusion-Exclusion (PIE): Used to find the size of the union of sets.
- ∣A∪B∪C∣=∣A∣+∣B∣+∣C∣−∣A∩B∣−∣B∩C∣−∣A∩C∣+∣A∩B∩C∣
Questions & Discussion
- Proposition Validity Example:
- "If the labor market is perfect then wages are equal. Wages are not equal. Therefore the labor market is not perfect." - This is a valid argument (Modus Tollens).
- Logic Problem:
- "If it does not rain or if it is not foggy, then the sailing race will be held."
- "If the sailing race is held, then the trophy will be awarded."
- "The trophy was not awarded."
- Conclusion: It must have rained. (Reasoning via contrapositive through the chain).
- Pigeonhole Application: In a class of 30 students, at least ⌈30/12⌉=3 students must share the same birthday month.
- PIE Problem: Finding integers between 1 and 500 divisible by 3 or 5 or 7:
- ∣A∣=⌊500/3⌋=166
- ∣B∣=⌊500/5⌋=100
- ∣C∣=⌊500/7⌋=71
- ∣A∩B∣=⌊500/15⌋=33
- ∣B∩C∣=⌊500/35⌋=14
- ∣A∩C∣=⌊500/21⌋=23
- ∣A∩B∩C∣=⌊500/105⌋=4
- Result: 166+100+71−33−14−23+4=271.