Probability
U: finite set (e.g. U={0,1}n) {0,1}2 = {00,01,10,11}
Probability distribution P over U is a function P:U→[0,1] such that
For example:
● Uniform distribution: for all x ∊U: P(x)= 1/|U|
P(00)=¼ P(01)=¼ P(10)=¼ P(11)=¼
● Point distribution at x0: P(x0)=1, ∀ x≠x0: P(x)=0
Distribution vector: (P(000), P(001), ..., P(111))
Events:
● For a set A ⊆ U:
● The set A is called an event.
● Example:
U={0,1}8
A={all x in U such that lsb2(x)=11} ⊆ U
for the uniform distribution on {0,1}8:
Pr(A)=
Def: a random variable X is a function X:U⟶V
X takes values in V and defines a distribution on V
Example: X(y) = lsb(y) ∈{0,1}
For the uniform distribution on U:
Pr[ X=0 ] = 1/2 , Pr[ X=1 ] = ½
The uniform random variable
Let r be a uniform random variable on {0,1}2
Define the random variable X = r1 + r2
Then Pr[X=2] =
Independence:
events A and B are independent if Pr[ A and B ] = Pr[A] ∙ Pr[B]
Same goes for random variables, random variables X,Y taking values in V are
independent if ∀a,b∈V: Pr[ X=a and Y=b] = Pr[X=a] ∙ Pr[Y=b]
Example:
U = {0,1}2 = {00, 01, 10, 11} and
Define r.v. X and Y as: X = lsb(r) , Y = msb(r)
Pr[ X=0 and Y=0 ] = Pr[ r=00 ] = ¼ = Pr[X=0] ∙ Pr[Y=0]
Y is a random variable over {0,1}n, X is an independent uniform variable on {0,1}n
Then Z:=Y⊕X is a uniform variable on {0,1}n
Proof:
For n=1
pr(Z=0)=
Modular arithmetic
Modular arithmetic/clock arithmetic: A system of arithmetic for integers.
Wrap around after reaching the modulus
15≡3(mod 12) 38≡2(mod 12)
27≡3(mod 12) 38≡14(mod 12)
23≡11(mod 12) 2≡ -3(mod 5)
33≡3(mod 10)
10≡ -2(mod 12)
a≡b(mod m)
a=km+b
Properties of modular arithmetic:
● ((a mod n)土(b mod n)) mod n = (a土b) mod n
For example:
((15 mod 8) + (11 mod 8)) mod 8 = (15+11) mod 8 = 2
((15 mod 8) - (11 mod 8)) mod 8 = (15-11) mod 8 = 4
● ((a mod n) x (b mod n)) mod n = (a x b) mod n
For example:
((15 mod 8) x (11 mod 8)) mod 8 = (15x11) mod 8 = 5
Groups
A group is a collection of elements G, together with one operation ⬤ which has the
following properties:
1. Closure: for a, b ∈G, a⬤b ∈G
2. Associativity: a⬤(b⬤c)=(a⬤b)⬤ c
3. Identity: there is an element e∈G such that
e⬤g=g⬤e=g for all g∈G
4. Inverse: for every g∈G there exists g-1∈G such that g⬤g-1=g-1⬤g=e
5. Commutativity for an Abelian group only: for a, b ∈G, a⬤b=b⬤a
Example:
Additive integer mod 6 {0,1,2,3,4,5}
● 1+3=4 4 mod 6=4
● (a+b)+c=a+(b+c)
● I=0
● a=1
1+5=6, 6 mod 6=0
a=3
3+3=6, 6 mod 6=0
● a+b=b+a Abelian group