MT131 - Discrete Mathematics Lecture Flashcards
THE FOUNDATIONS: LOGIC
Mathematical Logic Definition: This is a tool for working with compound statements. It is the study of correct reasoning.
Applications of Logic:
In Mathematics: Used to prove theorems.
In Computer Science: Used to prove that programs perform exactly what they are supposed to do.
PROPOSITIONAL LOGIC
Definition of a Proposition: A proposition (denoted by letters like , , ) is a declarative statement that is either True () or False (), but not both or anything in between.
Examples of Propositions:
"Washington, D.C., is the capital of USA"
"California is adjacent to New York"
""
Non-Propositions:
Questions: "What time is it?"
Meaningless statements: "La la la la la."
Commands: "Read this carefully!"
Expressions with non-truth values: ""
Expressions with unknown variables: ""
LOGICAL OPERATORS AND CONNECTIVES
Operands and Operators: An operator combines one or more operands into a larger expression.
Unary Operators: Take one operand (e.g., ).
Binary Operators: Take two operands (e.g., ).
Boolean Operators: Operate on propositions or truth values.
Popular Boolean Operators
Negation (NOT): Symbol . Arity: Unary. Definition: Let be a proposition; the negation is (not ). If , then .
Truth Table for NOT:
If , then
If , then
Conjunction (AND): Symbol . Arity: Binary. Definition: The proposition "" is true only when both and are true.
Truth Table for AND:
Disjunction (OR): Symbol . Arity: Binary. Also called "Inclusive OR." Definition: True if at least one of the propositions is true.
Truth Table for OR:
Exclusive OR (XOR): Symbol . Arity: Binary. Definition: True if exactly one of or is true, but not both.
Truth Table for XOR:
Implication (Condition): Symbol . Nickelname: IMPLIES. Definition: states that if is true, then must be true. If is false, the statement is true regardless of . is the hypothesis/antecedent; is the conclusion/consequent.
Truth Table for Implication:
(The only False case)
Biconditional: Symbol . Nickname: IFF (If and only if). Definition: True only when and have the same truth value.
Precedence of Logical Operators
Parentheses:
Negation:
Conjunction/Disjunction/XOR: , ,
Implication/Biconditional: ,
Evaluation direction: Left to Right.
LOGICAL EQUIVALENCES AND LAWS
Tautology: A compound proposition that is always True (e.g., ).
Contradiction: A compound proposition that is always False (e.g., ).
Contingency: A compound proposition that is neither a tautology nor a contradiction.
Logical Equivalence ( or ): Compound propositions that always have the same truth values.
Key Logic Laws
Identity Laws: ;
Domination Laws: ;
Idempotent Laws: ;
Double Negation:
Commutative Laws: ;
Associative Laws: ;
Distributive Laws: ;
De Morgan's Laws: ;
Implication Representation:
PREDICATES AND QUANTIFIERS
Predicates: A part of a sentence that characterizes a variable (the subject). Example: In "", is the variable and "is greater than 3" is the predicate .
Universal Quantifier (): "For all." asserts that is true for every in the domain.
Existential Quantifier (): "There exists." asserts that is true for at least one in the domain.
Negating Quantifiers:
SET THEORY
Set: An unordered collection of objects. Objects are called elements or members.
Notation: (element is in the set); (element is not in the set).
Empty Set (): A unique set containing no elements. .
Important Number Sets
(Natural numbers)
(Integers)
(Positive integers)
Set Operations
Subset (): Every element of is also an element of .
Proper Subset (): and .
Union (): Elements in , or , or both. .
Intersection (): Elements in both and . .
Difference (): Elements in but not in . .
Symmetric Difference (): Elements in or but not both. .
Complement (): Elements in the universal set that are not in .
Cardinality (): The number of distinct elements in a set.
Power Set (): The set of all subsets of . If , then .
Cartesian Product (): The set of ordered pairs where and .
FUNCTIONS
Definition: A function assigns each element of domain to exactly one element of codomain .
Injective (One-to-One): is injective if implies for all in the domain.
Surjective (Onto): is surjective if every element in the codomain has at least one preimage in the domain.
Bijective: A function that is both injective and surjective (one-to-one correspondence).
Inverse Function (): Only exists if the function is a bijection. Reverses the mapping.
Floor Function (): Largest integer less than or equal to .
Ceiling Function (): Smallest integer greater than or equal to .
Factorial (): . Note: .
NUMBER THEORY AND CRYPTOGRAPHY
Division and Modular Arithmetic
Divisibility: means divides ( for some integer ).
Division Algorithm: For integer and positive integer , there exist unique integers (quotient) and (remainder) such that and .
Modular Congruence: if divides , implying .
Primes and Greatest Common Divisors
Prime: A positive integer whose only factors are and .
Fundamental Theorem of Arithmetic: Every positive integer has a unique prime factorization.
Greatest Common Divisor (,): The largest integer that divides both and .
Least Common Multiple (,): The smallest positive integer that is a multiple of both and .
Relation:
Cryptology
Caesar Cipher: Encryption function . Decryption: .
Hashing Functions: Used to map data to memory locations. Example: .
Number Representations
Binary expansion: Base 2.
Octal expansion: Base 8.
Hexadecimal expansion: Base 16 (Digits: where to ).
Conversion to Decimal: Multiply each digit by the base raised to its positional power.
COUNTING AND DISCRETE PROBABILITY
Counting Rules
Product Rule: If a task consists of sequential tasks with and ways, there are total ways.
Sum Rule: If tasks are disjoint, there are ways.
Subtraction Rule (Inclusion-Exclusion): Total ways = .
Division Rule: There are ways to do a task if for every way , exactly of the ways correspond to .
Permutations and Combinations
Permutations (): Ordered arrangements. .
Combinations (): Unordered selections. .
Discrete Probability
Laplace's Definition: For a finite sample space of equally likely outcomes, the probability of event is .
Complementary Event: .
Union of Events: .
Bernoulli Trials: Probability of exactly successes in independent trials with probability of success and failure is given by:
RELATIONS
Binary Relation: A subset of .
Relation Properties on Set :
Reflexive:
Irreflexive:
Symmetric:
Antisymmetric:
Transitive:
Equivalence Relation: A relation that is reflexive, symmetric, and transitive.
Partial Ordering (Poset): A relation that is reflexive, antisymmetric, and transitive.
Hasse Diagrams: Used to represent partial orderings after removing self-loops and transitive edges.
GRAPHS AND TREES
Graph Terminology
Simple Graph: Undirected, no loops, no multiple edges.
Multigraph: May have multiple edges between the same vertices.
Pseudograph: May include loops and multiple edges.
Degree of a Vertex (): Number of incident edges.
Handshaking Theorem: (Sum of degrees is twice the number of edges).
Connected Graph: Path exists between every pair of vertices.
Trees
Tree Definition: A connected undirected simple graph with no simple circuits.
Properties:
A tree with vertices has exactly edges.
A unique simple path exists between any two vertices.
Rooted Tree: One node is the root; edges are directed away from it.
Leaf: Node with no children.
Internal Node: Node with at least one child.
-ary Tree: Every internal vertex has no more than children. In a full -ary tree, every internal vertex has exactly children.
Balanced Tree: Heights of all leaves differ by at most 1.