CMSC250 Midterm 1 Notes, Study notes of Discrete Mathematics

midterm notes about logic and probability

Typology: Study notes

2018/2019

Uploaded on 04/30/2019

camera989
camera989 🇺🇸

5

(1)

4 documents

1 / 9

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CMSC250 Midterm #1
Propositional Logic
Propositional symbols: building blocks of propositional logic – boxes that hold value of 1 or 0
Three basic operations
Conjuction (AND, ^) = binary operator
p q p q
FFF
T F F
F T F
TTT
Disjunction (OR) = binary operator
p q p q
F F F
F T T
T F T
T T T
Negation (NOT, ~, ¬) = unary operator
p~p
F T
T F
Binary connectives
if then
p q pq
F F T
F T T
T F F
T T T
if and only if
p q pq
F F T
F T F
pf3
pf4
pf5
pf8
pf9

Partial preview of the text

Download CMSC250 Midterm 1 Notes and more Study notes Discrete Mathematics in PDF only on Docsity!

CMSC250 Midterm # Propositional Logic

  • Propositional symbols: building blocks of propositional logic – boxes that hold value of 1 or 0
  • Three basic operations
    • Conjuction (AND, ^) = binary operator p q^ p^ ∧^ q F F F T F F F T F T T T
  • Disjunction (OR) = binary operator p q p ∨ q F F F F T T T F T T T T
  • Negation (NOT, ~, ¬) = unary operator p ~p F T T F
  • Binary connectives
  • → if then p q pq F F T F T T T F F T T T
  • ↔ if and only if p q p↔q F F T F T F

T F F

T T T

  • False implies anything
  • Logical equivalence compares two statements while if and only if forms statements
    • p ∧ q ≡ q ∧ p
  • De Morgan’s Law – conjunctions flipped to disjunctions and negation operator distributed across terms - ~ (p ∧ q) ≡ ~p ∨ ~q
  • Contrapositive – p q ≡ ~q ~p
  • More logical equivalences
    • ∼ a ∨ b ≡ a b
    • a ↔ b ≡ (∼ a ∨ b) ∧ (∼ b ∨ a)
  • satisfiability
    • truth table – takes 2n^ rows for n propositional symbols Circuits

A out 0 1 1 0

inverter – corresponds to the negation operation

  • AND gate – corresponds to conjunction p q^ r 0 0 0 0 1 0 1 0 0 1 1 1
  • n-bit adder
    • consists of n-1 full adders and 2n-1 half-adders Quantifiers
  • Ǝ – there exists
  • 2 C 6 F- for all
  • vacuously true: if no element exists in first quantifier, it doesn’t make the second part not true but rather just vacuously true
  • nesting quantifiers – order of quantifiers matters
  • (∃ x ∈ ℕ)(∀ y ∈ ℕ)[x < y]
  • To define even, odd, and prime
  • Even(x) ↔ ((∃ y ∈ Z) [x = 2y])
  • Prime(x) ↔ [y divides x → ((y=1) ∨ (y=x)]
  • Odd(x) ↔ ∼Even(x)
  • Existential statement - (Ǝ x ϵ D) [P(x)]
  • To prove true – need to find one instance
  • To prove false – must scan entire domain to show there is not x it holds for
  • Universal statement - (2 C 6 F^ x^ ϵ^ D) [P(x)]
  • To prove true – must show for entire domain
  • To prove false – must provide a counterexample
  • Negated quantifiers ∼Ǝ is the same as Ɐ
  • Dense: a set is dense if between any two elements of it there exists another element of it Set Theory
  • Set: collection of distinct objects
  • To show a member of a set say “y ∈ Z”
  • To represent sets
  • enumeration (“curly brace” notation)

■ A = {-1,2,8}

  • Through a property ■ S1 = {x| x ∈ ℝ ∧ x ≥ 100}
  • Subset: if every element in A is an element of B, A is a subset of B (A ⊆ B)
  • B is a superset of A
  • If there is one element that is an element of B but not A, then A is a proper subset of B (A ⊂ B)
  • Empty set, denoted either ∅ or {} – unique set with no elements
  • Union between A and B (A ∪ B): set of elements that belong either to A or to B
  • Intersection between A and B (A ∩ B): set of elements that belong to both A and B
  • Mutually disjoint: if there is no intersection between two sets A, B (A ∩ B = ∅)
  • Rule for union
  • Absolute complement of A (Ac): set of all elements that do not belong to A
  • Relative complement of A given B (B-A or B\A): set of all elements in B but not in A
  • Powerset: set of all subsets of A (includes null set)
  • Cardinality(|A|)
  • For a finite set – number of elements
  • For an infinite set – positive infinity
  • Partition - {A 1 , A^2 , …, An } is a partition of A if
  • A (^) i and A (^) j are mutually disjoint, for i, j ∈ {1, 2, …, n} with i ≠ j.
  • A 1 ∪ A 2 ∪ ⋯ ∪ An = A
  • Cartesian product (A X B): set of ordered pairs of elements of A and B Functions
  • Most basic representation – arrow diagrams
  • Also can represent a function as
  • f: A ↦ B ■ A – domain ■ B – co-domain
  • Every element of the domain should map to some co-domain element
  • Proof by contradiction – assume what we want to prove is false
    • Eventually leads to a contradiction and can prove what you assumed is false
  • Modular arithmetic – a ≡ b (mod m) or a is congruent to b mod m
    • m | (a-b)
  • Properties of equivalence
    • If a 1 ≡^ b^1 (mod m) and a 2 ≡^ b 2 (mod m), then (a 1 + a 2 )^ ≡^ (b 1 + b 2 ) (mod m)
      • If a 1 ≡ b 1 (mod m) and a 2 ≡ b 2 (mod m), then (a 1 * a 2 ) ≡ (b 1 * b 2 ) (mod m)
  • Proof by contraposition – proving the contrapositive may be easier (pq is the same as ~q ~p)
  • Unique Factorization Theorem: every natural number greater than or equal to 2 can be uniquely factored into a product of prime numbers p 1 , p2 ,…, pn :

Sequences and Series

  • Sequence: function from the naturals to the complex numbers
    • Can be written in three forms ■ Outlining terms ■ “closed form” formula ■ Recursive formula – must have base cases
  • Recursion vs closed formula
  • Computation ■ Recursion leads to a fast dynamic program ■ Closed form is faster but numerical issues arise
  • Rate of growth ■ Recursion gives no hint as how big F n is ■ Closed form gives approximate rate of growth
  • Summation notation – sum of sequence a 1 ,a 2 ,…,ak is denoted as
  • The i = 1 represents the index of term with which the sum begins
  • The k represents the index of last term to be included in the sum
  • Properties of summation notation
  • Product notation: product of sequence a 1 ,a 2 ,…,a (^) k is denoted as
  • Properties of product notation
  • Series: sum of all elements of an infinite sequence
  • Partial sum(Sn ): sum ranging from the first up to (and including) the nth^ term of a sequence
  • Arithmetic sequence: defined by the formula an = a 0 + n*d
  • Geometric sequence: defined by the formula m n*a (^0) Weak Induction
  • To prove a proposition P(n), want to prove two separate things
  • P(0) is true
  • For any k ≥ 0, if P is true for k, it then must be true for k + 1
  • Three different parts to a weak induction proof
  • Inductive base: prove that P(0) is true
  • Inductive hypothesis: assume P(k) for k ≥ 0
  • Inductive step: prove that if P(k) holds, then P(k+1) holds
  • Use weak induction for
  • Coin problems – usually have multiple cases
  • Summation problems
  • Inequalities
  • For two variable proofs – explicitly say at the beginning of the proof which variable you will be performing a proof by induction on Strong Induction
  • To prove P(n), want to prove two separate things
  • P(0), P(1), …, P(a) are true
  • For a k ≥ a, P(0) and P(1) and … and P(a) P(k+1)