Cheat Sheet
Cheat Sheet
Cheat Sheet
Propositional Logic
Logical Equivalences
Equivalence Name
𝑝∧T≡ 𝑝
Identity Laws
𝑝∨F≡ 𝑝
𝑝∨T≡T
Domination Laws
𝑝∧F≡F
𝑝∨𝑝≡ 𝑝
Idempotent Laws
𝑝∧𝑝≡ 𝑝
𝑝∨𝑞 ≡𝑞∨𝑝
Commutative Laws
𝑝∧𝑞 ≡𝑞∧𝑝
( 𝑝 ∨ 𝑞) ∨ 𝑟 ≡ 𝑝 ∨ (𝑞 ∨ 𝑟)
Associative laws
( 𝑝 ∧ 𝑞) ∧ 𝑟 ≡ 𝑝 ∧ (𝑞 ∧ 𝑟)
𝑝 ∨ (𝑞 ∧ 𝑟) ≡ ( 𝑝 ∨ 𝑞) ∧ ( 𝑝 ∨ 𝑟)
Distributive laws
𝑝 ∧ (𝑞 ∨ 𝑟) ≡ ( 𝑝 ∧ 𝑞) ∨ ( 𝑝 ∧ 𝑟)
¬( 𝑝 ∨ 𝑞) ≡ ¬𝑝 ∧ ¬𝑞
De Morgan’s Laws
¬( 𝑝 ∧ 𝑞) ≡ ¬𝑝 ∨ ¬𝑞
𝑝 ∨ ( 𝑝 ∧ 𝑞) ≡ 𝑝
Absorption Laws
𝑝 ∧ ( 𝑝 ∨ 𝑞) ≡ 𝑝
𝑝 ∨ ¬𝑝 ≡ T
Negation Laws
𝑝 ∧ ¬𝑝 ≡ F
1
Logical Equivalences Logical Equivalences Involving
Identifier Identifier
Involving Conditional Statements Biconditional Statements
𝑝 → 𝑞 ≡ ¬𝑝 ∨ 𝑞 1.1 𝑝 ↔ 𝑞 ≡ ( 𝑝 → 𝑞) ∧ (𝑞 → 𝑝) 2.1
𝑝 → 𝑞 ≡ ¬𝑞 → ¬𝑝 1.2 𝑝 ↔ 𝑞 ≡ ¬𝑝 ↔ ¬𝑞 2.2
Definitions:
• 𝑞 → 𝑝 is the converse of 𝑝 → 𝑞
• ¬𝑝 → ¬𝑞 is the inverse of 𝑝 → 𝑞
• ¬𝑞 → ¬𝑝 is the contrapositive of 𝑝 → 𝑞
• A Disjunctive Normal Form (DNF) is a disjunction of conjunctions where every variable or its negation is
represented once in each conjunction
• A Conjunctive Normal Form (CNF) is a conjunction of disjunctions where every variable or its negation
is represented once in each disjunction
2
Predicate Logic
De Morgan’s Laws for Quantifiers
Equivalent When is
Negation When False ?
Statement Negation True ?
There is an 𝑥 for
¬∃𝑥𝑃(𝑥) ∀𝑥¬𝑃(𝑥) For every 𝑥, 𝑃(𝑥) is false.
which 𝑃(𝑥) is true.
3
Proofs
Rules of Inference
𝑝→𝑞
∴𝑞
𝑝→𝑞
∴ ¬𝑝
𝑞→𝑟
∴ 𝑝→𝑟
¬𝑝
∴𝑞
𝑝 𝑝 → ( 𝑝 ∨ 𝑞) Addition
∴ 𝑝∨𝑞
𝑝∧𝑞 ( 𝑝 ∧ 𝑞) → 𝑝 Simplification
∴𝑝
𝑝 (( 𝑝) ∧ (𝑞)) → ( 𝑝 ∧ 𝑞) Conjunction
∴ 𝑝∧𝑞
¬𝑝 ∨ 𝑟
∴ 𝑞∨𝑟
4
In the following, unless stated oterhwise, we are going to assume that 𝑝 is the premise and 𝑞 is the conclusion.
Definitions:
• Proofs of equivalence: To prove a theorem that is a biconditional statement, i.e. a statement of the form
𝑝 ↔ 𝑞, we show that 𝑝 → 𝑞 and 𝑞 → 𝑝 are both true.
• Existence Proofs: The theorem is in the form of a statement ∃𝑥𝑃(𝑥)
5
Rules of inference for Quantified Statements
∀𝑥𝑃(𝑥)
Universal instantiation
∴ 𝑃(𝑐)
∃𝑥𝑃(𝑥)
Existential instantiation
∴ 𝑃(𝑐) for some element 𝑐
∀𝑥(𝑃(𝑥) → 𝑄(𝑥))
∴ ∃𝑥𝑄(𝑥)
∀𝑥(𝑃(𝑥) → 𝑄(𝑥))
∴ ¬𝑃(𝑐)
6
Sets, Functions
Sets of Numbers:
Sets:
• The set of all subsets of a set 𝐴, denoted as P ( 𝐴), is called the power set of 𝐴.
• The Cartesian Product of two sets 𝐴 and 𝐵, denoted by 𝐴 × 𝐵, is the set of ordered pairs (𝑎, 𝑏) where 𝑎 ∈ 𝐴
and 𝑏 ∈ 𝐵: 𝐴 × 𝐵 = {(𝑎, 𝑏)|𝑎 ∈ 𝐴 ∧ 𝑏 ∈ 𝐵}
• Let 𝑆 be a finite set with 𝑛 elements. |𝑆| = 𝑛 is the cardinality of S.
• Let 𝐴 and 𝐵 be sets. The union of the sets A and B, denoted by 𝐴 ∪ 𝐵, is the set: {𝑥|𝑥 ∈ 𝐴 ∨ 𝑥 ∈ 𝐵}
• Let 𝐴 and 𝐵 be sets. The intersection of the sets A and B, denoted by 𝐴 ∩ 𝐵, is the set: {𝑥|𝑥 ∈ 𝐴 ∧ 𝑥 ∈ 𝐵}
• Inclusion-Exclusion: | 𝐴 ∪ 𝐵| = | 𝐴| + |𝐵| − | 𝐴 ∩ 𝐵|
• The difference of sets A and B, denoted by 𝐴 − 𝐵, is the set containing the elements of A that are not in B:
𝐴 − 𝐵 = {𝑥|𝑥 ∈ 𝐴 ∧ 𝑥 ∉ 𝐵}
• The symmetric difference of sets 𝐴 and 𝐵, denoted by 𝐴 ⊕ 𝐵 is the set: 𝐴 ⊕ 𝐵 = ( 𝐴 − 𝐵) ∪ (𝐵 − 𝐴)
• The complement of the 𝐴 with respect to the universe 𝑈, denoted by 𝐴 is the set: 𝐴 = 𝑈 − 𝐴
• A partition of a set 𝑆 is a collection of disjoint nonempty subsets of 𝑆 that have 𝑆 as their union.
7
Set Identities (𝑈 is the universal set)
Identity Name
𝐴∩𝑈 = 𝐴
Identity Laws
𝐴∪∅= 𝐴
𝐴∪𝑈 =𝑈
Domination Laws
𝐴∩∅=∅
𝐴∪𝐴= 𝐴
Idempotent Laws
𝐴∩𝐴= 𝐴
( 𝐴) = 𝐴 Complementation Law
𝐴∪𝐵= 𝐵∪𝐴
Commutative Laws
𝐴∩𝐵= 𝐵∩𝐴
𝐴 ∪ (𝐵 ∪ 𝐶) = ( 𝐴 ∪ 𝐵) ∪ 𝐶
Associative laws
𝐴 ∩ (𝐵 ∩ 𝐶) = ( 𝐴 ∩ 𝐵) ∩ 𝐶
𝐴 ∪ (𝐵 ∩ 𝐶) = ( 𝐴 ∪ 𝐵) ∩ ( 𝐴 ∪ 𝐶)
Distributive laws
𝐴 ∩ (𝐵 ∪ 𝐶) = ( 𝐴 ∩ 𝐵) ∪ ( 𝐴 ∩ 𝐶)
𝐴∩𝐵= 𝐴∪𝐵
De Morgan’s Laws
𝐴∪𝐵= 𝐴∩𝐵
𝐴 ∪ ( 𝐴 ∩ 𝐵) = 𝐴
Absorption Laws
𝐴 ∩ ( 𝐴 ∪ 𝐵) = 𝐴
𝐴∪𝐴=𝑈
Complement Laws
𝐴∩𝐴=∅
Functions:
• Let 𝐴 and 𝐵 be nonempty sets. A function 𝑓 from 𝐴 to 𝐵 is an assignment of exactly one element of 𝐵 to
each element of 𝐴. We write 𝑓 : 𝐴 → 𝐵.
– 𝐴 is the domain of 𝑓
– 𝐵 is the codomain of 𝑓
– if 𝑓 (𝑎) = 𝑏, we design 𝑏 as the image of 𝑎 and 𝑎 as the preimage of 𝑏
• Injection: A function 𝑓 is said to be one-to-one, or injective, if and only if 𝑓 (𝑎) = 𝑓 (𝑏) implies that 𝑎 = 𝑏
for all 𝑎 and 𝑏 in the domain of 𝑓 .
• Surjection: A function 𝑓 from 𝐴 to 𝐵 is called onto or surjective, if and only if for every element 𝑏 ∈ 𝐵
there is an element 𝑎 ∈ 𝐴 with 𝑓 (𝑎) = 𝑏.
8
• Bijection: A function 𝑓 from 𝐴 to 𝐵 is a one-to-one correspondence, or a bijection, if it is both one-to-one
and onto (surjective and injective).
• Let 𝑓 be a bijection from 𝐴 to 𝐵. Then the inverse of 𝑓 , denoted as 𝑓 −1 , is the function from 𝐵 to 𝐴 defined
as: 𝑓 −1 (𝑦) = 𝑥 iff 𝑓 (𝑥) = 𝑦
• Let 𝑓 : 𝐵 → 𝐶 and 𝑔 : 𝐴 → 𝐵. The composition of 𝑓 with 𝑔, denoted 𝑓 ◦ 𝑔 is the function from 𝐴 to 𝐶
defined as: 𝑓 ◦ 𝑔(𝑥) = 𝑓 (𝑔(𝑥))
• A partial function 𝑓 from 𝐴 to 𝐵 is a mapping of each element 𝑎 ∈ 𝑆 ⊆ 𝐴, called the domain of definition
of 𝑓 , to a unique element 𝑏 ∈ 𝐵.
– We say that 𝑓 is undefined for elements in 𝑆 that are not in the domain of definition 𝐴 of 𝑓 .
– When 𝑆 = 𝐴, we say that 𝑓 is a total function.
9
Relations:
• Two elements 𝑎, and 𝑏 that are related by an equivalence relation are called equivalent.
• Let 𝑅 be an equivalence relation on a set 𝐴. The set of all elements that are related to an element a of 𝐴 is
called the equivalence class of 𝑎. It is denoted by [𝑎] 𝑅 .
• Theorem: Let 𝑅 be an equivalence relation on a set 𝑆. Then the set of equivalence classes of 𝑅 form a
partition of 𝑆.
• A relation 𝑅 on a set 𝑆 is called a partial ordering, or partial order, if it is reflexive, antisymmetric, and
transitive.
• A set together with a partial ordering 𝑅 is called a partially ordered set, or poset, and is denoted by (𝑆, 𝑅).
10
Sequences:
Countability:
• The cardinality of a set 𝐴 is equal to the cardinality of a set 𝐵, denoted by | 𝐴| = |𝐵| iff there is a bijection
from 𝐴 to 𝐵.
• If there is an injection from 𝐴 to 𝐵, the cardinality of 𝐴 is less than or the same as the cardinality of 𝐵 and
we write | 𝐴| ≤ |𝐵|.
• If there is an surjection from 𝐴 to 𝐵, the cardinality of 𝐵 is less than or the same as the cardinality of 𝐴 and
we write |𝐵| ≤ | 𝐴|.
• A set that is either finite or has the same cardinality as the set of positive integers 𝑍 + is called countable. A
set that is not countable is uncountable.
• Theorem: An infinite set 𝑆 is countable iff it is possible to list the elements of the set in a sequence indexed
by the positive integers.
11
– The union of finitely many countable sets is countable
– The set of all strings associated to a finite alphabet is countable
– If there is an injective function from A to B and B is countable: then A is countable
– If there is a surjective function from A to B and A is countable: then B is countable
• Cantor’s Diagonal Argument for [0, 1]:
1. We assume that we can list the real numbers in [0, 1] in a sequence indexed by the positive integers
{𝑎 𝑛 }
2. We associate each element of {𝑎 𝑛 } to the decimal representation of each real numbers in [0, 1]
3. We show that we can build a real number in [0, 1] that is not in {𝑎 𝑛 }
4. By contradiction, our initial assumption is False
12
Algorithms
Searching:
Sorting:
Greedy Algorithms:
• Optimization problems minimize or maximize some parameter over all possible inputs.
• A greedy algorithm, which makes the optimal or "best" choice at each step.
• Cashier’s Algorithm:
– Task: Given a set of coin values find for an amount of any 𝑛 cents the least total number of coins that
adds up to 𝑛.
– Greedy Approach: At each step choose the coin with the largest possible value that does not exceed
the amount left.
– Theorem: Cashier’s Algorithm for U.S. coins (1, 5, 10, 25) leads to an optimal solution.
13
Matching:
• Given a finite set 𝐴, a matching of 𝐴 is a set of (unordered) pairs of distinct elements of 𝐴 where any element
occurs in at most one pair (such pairs are called independent).
• A maximum matching is a matching that contains the largest possible number of independent pairs.
• A preference list 𝐿 𝑥 defines for every element 𝑥 ∈ 𝐴 the order in which the element prefers to be paired
with another element. 𝑥 prefers 𝑦 over 𝑧 if 𝑦 precedes 𝑧 on 𝐿 𝑥 .
• A matching is unstable if there are two pairs (𝑥, 𝑦), (𝑣, 𝑤) in the matching such that 𝑥 prefers 𝑣 to 𝑦 and 𝑣
prefers 𝑥 to 𝑤.
Gale-Shapley Algorithm
𝑀=∅
while |𝑀 | < | 𝐴1 | do
Select an unpaired 𝑥 ∈ 𝐴1
Let 𝑥 propose to the first element 𝑦 ∈ 𝐴2 on 𝐿 𝑥
if y is unpaired then
add the pair (𝑥, 𝑦) to 𝑀
else
Let 𝑥 ′ ∈ 𝐴1 be the element that 𝑦 is paired to, (i.e., (𝑥 ′ , 𝑦) ∈ 𝑀)
if 𝑥 ′ precedes 𝑥 on 𝐿 𝑦 then
remove 𝑦 from 𝐿 𝑥
else
Replace (𝑥 ′ , 𝑦) ∈ 𝑀 by (𝑥, 𝑦) and remove 𝑦 from 𝐿 𝑥 ′
end if
end if
end while
return 𝑀
14
Complexity
A few log formulas. If the base of the log is not specified, you can assume it is 2:
• log(𝑎 · 𝑏) = log(𝑎) + log(𝑏)
• log(𝑎 𝑛 ) = 𝑛 log(𝑎)
• 𝑎 log𝑎 (𝑛) = 𝑛
log𝑏 (𝑛)
• log𝑎 (𝑛) = log𝑏 (𝑎)
Big-𝑂 Notation:
– Let 𝑓 and 𝑔 be functions from the set of integers (or real numbers) to the set of real numbers. We say that
𝑓 (𝑥) is 𝑂 (𝑔(𝑥)), if there are constants 𝐶 and 𝑘, with 𝐶 positive, such that: ∀𝑥 > 𝑘, | 𝑓 (𝑥)| ≤ 𝐶 |𝑔(𝑥)|
– 𝑛𝑐 is 𝑂 (𝑛 𝑑 ), but 𝑛 𝑑 is not 𝑂 (𝑛𝑐 ) for 𝑑 > 𝑐 > 1
– (log𝑏 (𝑛)) is 𝑂 (𝑛 ), but 𝑛 is not 𝑂 ((log𝑏 (𝑛)) ) for 𝑏 > 1, 𝑐, 𝑑 > 0
𝑐 𝑑 𝑑 𝑐
15
Induction and Recursion
Mathematical induction:
– To prove that 𝑃(𝑛) is true for all positive integers 𝑛, where 𝑃(𝑛) is a propositional function, we complete
two steps:
1. Basis Step: Show that 𝑃(1) is true.
2. Inductive Step: Show that the conditional statement 𝑃(𝑘) → 𝑃(𝑘 + 1) is true for all positive
integers 𝑘.
Strong induction:
– To prove that 𝑃(𝑛) is true for all positive integers 𝑛, where 𝑃(𝑛) is a propositional function, we complete
two steps:
1. Basis Step: Show that 𝑃(1) is true.
2. Inductive Step: Show that [𝑃(1) ∧ · · · ∧ 𝑃(𝑘)] → 𝑃(𝑘 + 1) is true for all positive integers 𝑘.
Recursively Defined Functions:
– A recursive or inductive definition of a function 𝑓 with the set of nonnegative integers as its domain
consists of two steps:
1. Basis Step: Specify the value of 𝑓 at 0.
2. Recursive Step: Give a rule for finding its value at an integer from its values at smaller integers.
Recursively Defined Sets and Structures:
– Recursive definitions of sets have two parts:
1. Basis Step: Specify an initial collection of elements.
2. Recursive Step: Give the rules for forming new elements in the set from those already known to
be in the set.
Structural Induction:
– To prove a property of the elements of a recursively defined set, we use structural induction.
1. Basis Step: Show that the result holds for all elements specified in the basis step of the recursive
definition to be in the set.
2. Recursive Step: Show that if the statement is true for each of the elements used to construct new
elements in the recursive step of the definition, the result holds for these new elements.
Recursive Algorithms:
– An algorithm is called recursive if it solves a problem by reducing it to an instance of the same problem
with smaller input.
– For the algorithm to terminate, the instance of the problem must eventually be reduced to some initial
case for which the solution is known.
16
1. Divide:
- if 𝑛 > 1: divide the problem of size 𝑛 into 2 (almost) equally sized subproblems
- else: solve the problem of size 1 directly
2. Conquer: Solve the sub-problems in the same way (recursively).
3. Merge: Merge the sub-solutions into an overall solution.
17
Number Theory
Base 𝑏 expansion of 𝑛:
– Find 𝑘 by computing successive powers of 𝑏 until you find the smallest 𝑘 such that 𝑏 𝑘 ≤ 𝑛 < 𝑏 𝑘+1
– For each value of 𝑖 from 0 to 𝑘
∗ Set 𝑎 𝑘−𝑖 to be the largest number between 0 and 𝑏 - 1 for which 𝑎 𝑘−𝑖 𝑏 𝑘−𝑖 ≤ 𝑛.
∗ Update remaining value: 𝑛 = 𝑛 − 𝑎 𝑘−𝑖 𝑏 𝑘−𝑖
Division
– If 𝑎 and 𝑏 are integers with 𝑎 ≠ 0, then 𝑎 divides 𝑏 if there exists an integer 𝑐 such that 𝑏 = 𝑎𝑐
– The notation 𝑎|𝑏 denotes that 𝑎 divides 𝑏.
– The notation 𝑎 ∤ 𝑏 denotes that 𝑎 does not divide 𝑏.
– Theorem: If 𝑎 is an integer and 𝑑 a positive integer, then there are unique integers 𝑞 and 𝑟, with
0 ≤ 𝑟 < 𝑑, such that 𝑎 = 𝑑𝑞 + 𝑟. 𝑞 = 𝑎 div 𝑑 is called the quotient and 𝑟 = 𝑎 mod 𝑑 is called the
remainder.
18
Counting
The Product Rule:
The number of sequences (𝑠1 , 𝑠2 , . . . , 𝑠 𝑛 ) such that there are 𝑎 𝑖 choices for 𝑠𝑖 after having chosen
𝑠1 , 𝑠2 , . . . , 𝑠𝑖−1 for each 𝑖 = 1, 2, . . . 𝑛 is exactly 𝑎 1 · 𝑎 2 · · · · · 𝑎 𝑛 .
Pascal’s Identity:
𝑛+1 𝑛 𝑛
If 𝑛 and 𝑘 are integers with 𝑛 ≤ 𝑘 ≤ 0, then: 𝑘 = 𝑘−1 + 𝑘
Characteristic Equation:
– The characteristic equation of the recurrence relation 𝑎 𝑛 = 𝑐 1 𝑎 𝑛−1 + 𝑐 2 𝑎 𝑛−2 + · · · + 𝑐 𝑘 𝑎 𝑛−𝑘 is: 𝑟 𝑘 −
𝑐 1 𝑟 𝑘−1 − 𝑐 2 𝑟 𝑘−2 − · · · − 𝑐 𝑘 = 0
19
– Let 𝑐 1 and 𝑐 2 be real numbers. Suppose that the characteristic equation 𝑟 2 −𝑐 1 𝑟 −𝑐 2 = 0 has two distinct
roots 𝑟 1 and 𝑟 2 . Then the sequence {𝑎 𝑛 } is a solution of the recurrence relation 𝑎 𝑛 = 𝑐 1 𝑎 𝑛−1 + 𝑐 2 𝑎 𝑛−2 ,
if and only if 𝑎 𝑛 = 𝛼1 𝑟 1𝑛 + 𝛼2 𝑟 2𝑛 for 𝑛 = 0,1,2, ... , where 𝛼1 and 𝛼2 are constants.
– Let 𝑐 1 and 𝑐 2 be real numbers with 𝑐 2 ≠ 0. Suppose that the characteristic equation 𝑟 2 − 𝑐 1 𝑟 − 𝑐 2 = 0 has
only one root 𝑟 0 . Then the sequence {𝑎 𝑛 } is a solution of the recurrence relation 𝑎 𝑛 = 𝑐 1 𝑎 𝑛−1 + 𝑐 2 𝑎 𝑛−2 ,
if and only if 𝑎 𝑛 = 𝛼1 𝑟 0𝑛 + 𝛼2 𝑛𝑟 0𝑛 for 𝑛 = 0,1,2, ... , where 𝛼1 and 𝛼2 are constants.
Derangements:
A derangement is a permutation of objects that leaves no object in the original position.
The number of derangements of a set with 𝑛 elements is
1 1 1 1
𝐷 𝑛 = 𝑛! 1 − + − + · · · + (−1) 𝑛
1! 2! 3! 𝑛!
20
Probabilities
Definition (Laplace):
If 𝑆 is a finite sample space of equally likely outcomes, and 𝐸 is an event, that is, a subset of 𝑆, then the
probability of 𝐸 is: 𝑝(𝐸) = ||𝑆𝐸 ||
Let 𝐸 be an event in sample space 𝑆. The probability of the event 𝐸 = 𝑆 − 𝐸, the complementary event
of 𝐸, is given by: 𝑝(𝐸) = 1 − 𝑝(𝐸)
Probability of an Event:
Í
The probability of the event 𝐸 is the sum of the probabilities of the outcomes in 𝐸: 𝑝(𝐸) = 𝑠∈𝐸 𝑝(𝑠)
Combination of disjoint events:
Ð Í
If 𝐸 1 , 𝐸 2 , ... is a sequence of pairwise disjoint events in a sample space 𝑆, then: 𝑝 𝐸𝑖 = 𝑝(𝐸 𝑖 )
𝑖 𝑖
Conditional Probability:
Let 𝐸 and 𝐹 be events with 𝑝(𝐹) > 0. The conditional probability of 𝐸 given 𝐹, denoted by 𝑝(𝐸 |𝐹),
is defined as: 𝑝(𝐸 |𝐹) = 𝑝 (𝐸∩𝐹
𝑝 (𝐹 )
)
Independence:
– The events 𝐸 and 𝐹 are independent if and only if 𝑝(𝐸 ∩ 𝐹) = 𝑝(𝐸) 𝑝(𝐹)
– If 𝐸 and 𝐹 are independent, then 𝑝(𝐸 |𝐹) = 𝑝(𝐸)
Pairwise and Mutual Independence:
– The events 𝐸 1 , 𝐸 2 , ... 𝐸 𝑛 are pairwise independent if and only if 𝑝(𝐸 𝑖 ∩ 𝐸 𝑗 ) = 𝑝(𝐸 𝑖 ) 𝑝(𝐸 𝑗 ) for all
pairs 𝑖 and 𝑗 with 𝑖 ≤ 𝑗 ≤ 𝑛
– These events are mutually independent if 𝑝(𝐸 𝑖1 ∩ 𝐸 𝑖2 ∩ · · · ∩ 𝐸 𝑖𝑚 ) = 𝑝(𝐸 𝑖1 ) · 𝑝(𝐸 𝑖2 ) · · · 𝑝(𝐸 𝑖𝑚 )
whenever 𝑖 𝑗 , 𝑗 = 1, 2, . . . , 𝑚 are integers with 1 ≤ 𝑖 1 < 𝑖2 < · · · < 𝑖 𝑚 ≤ 𝑛 and 𝑚 ≥ 2.
– Mutual independence implies pairwise independence
Bernoulli Trials:
21
Each performance of the experiment is called a Bernoulli trial.
One outcome is called a success and the other a failure.
If 𝑝 is the probability of success and 𝑞 the probability of failure, then 𝑝 + 𝑞 = 1.
– The probability of exactly 𝑘 successes in 𝑛 independent Bernoulli trials, with probability of success 𝑝
and probability of failure 𝑞 = 1 − 𝑝 is: 𝐶 (𝑛, 𝑘) · 𝑝 𝑘 · 𝑞 𝑛−𝑘 .
Binomial Distribution:
– We denote by 𝑏(𝑘 : 𝑛, 𝑝) the probability of 𝑘 successes in 𝑛 independent Bernoulli trials with 𝑝
the probability of success. Viewed as a function of 𝑘, 𝑏(𝑘 : 𝑛, 𝑝) is the Binomial Distribution:
𝑏(𝑘 : 𝑛, 𝑝) = 𝐶 (𝑛, 𝑘) · 𝑝 𝑘 · 𝑞 𝑛−𝑘
Bayes’ Theorem:
– Suppose that 𝐸 and 𝐹 are events from a sample space 𝑆 such that 𝑃(𝐸) ≠ 0 and 𝑃(𝐹) ≠ 0. Then:
𝑝(𝐸 |𝐹) 𝑝(𝐹) 𝑝(𝐸 |𝐹) 𝑝(𝐹)
𝑝(𝐹 |𝐸) = =
𝑝(𝐸) 𝑝(𝐸 |𝐹) 𝑝(𝐹) + 𝑝(𝐸 |𝐹) 𝑝(𝐹)
Generalized Bayes’ Theorem:
– Suppose that 𝐸 is an event from a sample space 𝑆 and that 𝐹1 , 𝐹2 , . . . , 𝐹𝑛 are mutually exclusive events
Ð𝑛
such that 𝑖=1 𝐹𝑖 = 𝑆. Assume that 𝑃(𝐸) ≠ 0 and 𝑃(𝐹𝑖 ) ≠ 0 for 𝑖 = 1, · · · , 𝑛. Then:
𝑝(𝐸 |𝐹 𝑗 ) 𝑝(𝐹 𝑗 ) 𝑝(𝐸 |𝐹 𝑗 ) 𝑝(𝐹 𝑗 )
𝑝(𝐹 𝑗 |𝐸) = = Í𝑛
𝑝(𝐸) 𝑖=1 𝑝(𝐸 |𝐹𝑖 ) 𝑝(𝐹𝑖 )
Random Variable:
– A random variable 𝑋 is a function 𝑋 : 𝑆 → 𝑅 from the sample space 𝑆 of an experiment to the set of
real numbers 𝑅.
– The distribution of a random variable 𝑋 on a sample space 𝑆 is the set of pairs (𝑟, 𝑝(𝑋 = 𝑟)) for all
Í
𝑟 ∈ 𝑋 (𝑠) where 𝑝(𝑋 = 𝑟) is the probability that 𝑋 takes the value 𝑟: 𝑝(𝑋 = 𝑟) = 𝑠∈𝑆 | 𝑋 (𝑠)=𝑟 𝑝(𝑠)
Probability Mass Function:
If the range of the function 𝑋 is countable, then 𝑝(𝑋 = 𝑟) can be interpreted as a function 𝑝 : 𝑋 (𝑆) → 𝑅.
This function is called probability mass function and it is a probability distribution over the sample
space 𝑋 (𝑆).
Expected Value:
– The expected value of the random variable 𝑋 on the sample space 𝑆 is equal to:
∑︁
𝐸 (𝑋) = 𝑝(𝑠) 𝑋 (𝑠)
𝑠∈𝑆
– Let 𝑋 denote the number of successes, when 𝑛 mutually independent Bernoulli trials are performed,
where 𝑝 is the probability of each trial. Then the expected value of 𝑋 is 𝑛𝑝.
– If 𝑋𝑖 , 𝑖 = 1, . . . , 𝑛 with 𝑛 a positive integer, are random variables on 𝑆, and if 𝑎 and 𝑏 are real numbers,
then:
1. 𝐸 (𝑋1 + 𝑋2 + · · · + 𝑋𝑛 ) = 𝐸 (𝑋1 ) + 𝐸 (𝑋2 ) + · · · + 𝐸 (𝑋𝑛 )
2. 𝐸 (𝑎𝑋 + 𝑏) = 𝑎𝐸 (𝑋) + 𝑏
Variance:
– Let 𝑋 be a random variable on the sample space 𝑆. The variance of 𝑋, denoted by 𝑉 (𝑋) is:
∑︁
𝑉 (𝑋) = (𝑋 (𝑠) − 𝐸 (𝑋)) 2 · 𝑝(𝑠)
𝑠∈𝑆
22
√︁
– The standard deviation of 𝑋, denoted by 𝜎(𝑋) is defined as 𝑉 (𝑋).
– If 𝑋 is a random variable on a sample space 𝑆, then 𝑉 (𝑋) = 𝐸 (𝑋 2 ) − 𝐸 (𝑋) 2 :
– If 𝑋 is a random variable on a sample space 𝑆, and 𝐸 (𝑋) = 𝜇, then 𝑉 (𝑋) = 𝐸 (𝑋 − 𝜇) 2
23