Discrete_Structures_Notes_with_Examples_Fixed
Discrete_Structures_Notes_with_Examples_Fixed
Mathematical Reasoning
Mathematical reasoning is the process of logical thinking to derive conclusions. It involves using
Example: To prove that the sum of two even numbers is even, let two even numbers be 2a and 2b
(where a and b are integers). Their sum is 2a + 2b = 2(a + b), which is also even.
Propositional logic deals with statements that are either true or false, combined with logical
Predicate logic extends this by including variables and quantifiers (e.g., 'for all', 'there exists').
Example: In propositional logic, 'P AND Q' means both P and Q are true. In predicate logic, 'For all
x, if P(x) then Q(x)' means for all x, if P(x) is true, then Q(x) is also true.
Rules of Inference
Rules of inference are patterns of reasoning to derive conclusions from premises. Examples include
Example: Modus Ponens states that if 'P implies Q' and 'P' are both true, then 'Q' must be true.
If 'If it rains, the ground will be wet' (P implies Q) and 'It is raining' (P), then 'The ground is wet' (Q).
Proof Techniques
- Proof by Contraposition: Show that if the conclusion is false, the premise must be false.
- Proof by Induction: Prove a base case and an inductive step.
Example (Proof by Induction): To prove the formula for the sum of the first n integers, 1 + 2 + ... + n
= n(n+1)/2, prove it for n=1 and assume it holds for n=k to prove it holds for n=k+1.
Set Theory
Set theory studies collections of objects called sets. Basic operations include union, intersection,
and complement.
Example: If A = {1, 2, 3} and B = {2, 3, 4}, then A union B = {1, 2, 3, 4} and A intersection B = {2, 3}.
A relation is a connection between elements of two sets, and functions are specific relations where
Example: A relation on the set of integers can be 'is divisible by.' A function could be f(x) = x^2,
Recurrence Relations
Example: The Fibonacci sequence is defined by F(n) = F(n-1) + F(n-2), with F(1) = 1 and F(2) = 1.
Functions or mappings assign each element from a domain to exactly one element in a range.
Example: For the function f(x) = x + 3, if the domain is {1, 2, 3}, the function maps to the range {4, 5,
6}.
Number Theory
Number theory studies properties of integers, such as divisibility, primes, and modular arithmetic.
Example: A prime number is an integer greater than 1 with no divisors other than 1 and itself (e.g.,
2, 3, 5, 7).
Counting Principles
Example (Pigeonhole Principle): If 10 pigeons are placed in 9 pigeonholes, at least one pigeonhole
Example: For a set of 3 objects {A, B, C}, there are 6 permutations (ABC, ACB, BAC, BCA, CAB,
CBA) and 3 combinations (AB, AC, BC) if order does not matter.
Graph theory studies structures made of vertices and edges. Topics include planar graphs, coloring,
and paths.
Example: An Euler path in a graph visits every edge exactly once. A Hamiltonian path visits every
Traversals
Traversals visit every node in a structure like a tree or graph. Common traversals include DFS and
BFS.
Example: In a binary tree, DFS can visit nodes in Preorder, Inorder, or Postorder. BFS visits nodes
level by level.