Professional Documents
Culture Documents
is a mapping from
a set of events
to the reals such that
Algorithms
Professor John Reif
ALG 2.0
Probability Theory
(Prob)
Bayes' Theorem
If A
,..., A
are
Conditional Probability
then
Pi
Prob (A i | B ) =
Pj
j =1
where P
define Prob(A|B) =
= Prob(B|A j)
Prob (A B)
Prob (B)
Prob(A j)
B
A1
A2
...
Ai
...
An
Random Variable
F A(x) = Prob (A x) =
Density Function
f A(x) dx
f (x)=Prob(A=x)
A
f (x)
FA
(x)
FA (x)
0
x
0
x
6
"x
F A (x) F B (x)
then
"A upper bounds B"
and
"B lower bounds A"
E(A) = A =
x f A(x) dx
FB
(X)
FA
(X)
F A (x) = Prob (A x)
F B (x) = Prob (B x)
s A = (A-A) = A
- (A)
A2 =
f A(x) dx
MA(s ) =
f (x)
A
small
x 2 fA (x) dx
small variance
example
sx
f A(x) dx
( s A)
= E e
x
note
large variance
example
s is a formal parameter
n
large
A =
f (x)
A
d MA (s)
ds
n
s= 0
x
9
10
Discrete
Random Variable A
density function
f (x)
expectation E(A) = A =
= prob (A=x)
n' th moment A =
x f A(x)
f A(x)
x=0
x=0
1
. . .
G A(z) =
distribution function
x
F (x) =
A
i =0
x=0
f A(x) = E
( zA)
fA ( i ) = prob (A x)
1st derivative
2nd derivative
'
GA (1) = A
GA" (1) = A2 - A
...
11
12
A,B independent if
Prob(A B) = Prob(A)
Combinatorics
Prob(B)
f A B (x) = f
MA B (s) = M
GA B (z) = G
If A1 ,...,A n
independent
(x) f B (x)
(s) M B(s)
(z) GB(z)
Stirling's formula
n! = f(n) (1+o(1))
n
for i=1 , . . . , n
where f(n) = n e
Then if B = A1 A2 . . . An
(M
A1
note
tighter bound
(
)
(s ) , G (z) = G
)
(
f A (x)
f B (x) =
MB (s ) =
2 1
f A (x) = f A (x)
1
n! = n (n-1)
f(n) e
A1
(z)
1
(12n+1)
-n
pn
2p
1
12n
n!
= number of permutations of n
(n-k)!
object s taken k at a time
13
14
( )
n
k
n!
k! (n-k)!
Bernoulli Variable
and 0 with prob 1-P
A i is 1 with prob P
= number of (unordered)
Binomial Variable
combinations of n objects
B is sum of n independent
Bernoulli variables A i
each with some probability p
taken k at a time
Bounds (due to Erdos & Spencer, p. 18)
2
( )
n
k
n e
procedure
k
k
2n 6n2
begin
(1-o(1))
k!
for k = o
end
B0
for i=1
output
to n do
with probability P
B
do B B+1
()
n
3
4
15
16
B 0
i 0
i i + 1
m
i>n
yes
output B
1-P
mean
random
choice
m = n p
variance
s = np (1-p )
d ensity fn =
B B+1
Prob(B=x) =
()
( nk) p
n
x
x) =
distribution fn = Prob(B
17
(1-p)
k
n-x
(1-p)
n-k
k=0
18
GENERATING FUNCTION
Poisson Trial
n
G(z) = (1-p+pz) =
zk
k=0
k
n -k
n
( k ) p (1-p)
Ai is 1 with prob Pi
and 0 with prob 1-Pi
interesting fact
( )
m) = W
Prob(B=m
1
n
19
20
Geometric Variable
Hoeffding's Theorem
B' is upper bound
V parameter p
"x 0
by a Binomial Variable
B
p(1-p)
procedure
GEOMETRIC parameter p
n
parameters n, p w here p =
Prob(V=x)
V 0
loop: with probability p
goto exit
Pi
i=1
begin
V
F
V+1
goto loop
B'
exit: output
1-p
m ean m =
21
1-p
p
output V
V
V+1
22
Probabilistic Inequalities
for Random Variable A
GENERATING FUNCTION
G(Z) =
k=0
(p(1-p) ) =
p
1-(1-p)Z
mean m = A
2
v ariance s = A - (A)
lower tail
D D
23
upper tail
24
Markov Inequality
(uses only
Prob (A x)
Chebychev Inequality
(uses
m
x
mean )
m| D ) s 2
Prob (|A-m
D
Y(x) =
1
P
2P
x
2
example
If B is a Binomial
np
x) x
Then Prob (B
Prob (|B-np| D)
np (1-p)
m=0
s=1
25
26
Normal Distribution
F (X ) =
Let S n be the
Y (Y) dY
sum of n independently
distributed variables
A 1 ,...,A n
Bounds
"x > 0
(Feller, p. 175)
Y (x)
1
1
- 3
x x
2
m
s
variance
each w ith mean n and
n
Y(x)
1 - F(x)
x
"x e [0, 1]
1
x
= x Y(1) F (x) - x Y(0) =
2
Pe
2P
27
28
Chernoff Bound
of Random Variable A
(uses all moments)
(S n - m)
s
limits as n
Prob (A x)
e
e
Henc e Prob
m| sx) F (x) as n
(|S n-m
s o Prob
(|S n - m| sx) 2(1- F (x))
2 Y (x)/x
-s x
MA (s )
g ( s )-s x
for s 0
w here g (s ) = ln (MA(s ))
g (s ) - s g ' (s )
by s etting
x = g' (s )
F (x) Y (x)/x)
(s ince 1-F
29
30
Chernoff Bounds
Chernoff Bound
for
of
Discrete
Binomial B
Random Variable A
-x
Prob (A x) z
Prob (B x)
need
Probability Generating
G A(z) =
x 0
( )
z f A(x) = E z
m
n-m
n-x
m
x-m
e
31
n-x
( ) ( )
function
x
x m
Abov e mean
G A ( z ) for z 1
m
x
( )
m
-x -m
m
x
s ince
for x m e
1 -
1
x
<
e-1
32
Anguin-Valiant's Bounds
for
Binomial B
Below Mean x m
Prob (B x)
( ) ()
m
n-m
n-x
m
x
m = np for 0<
e <1
Prob ( B (1 + e ) m ) e
-e 2
m
2
33
-e 2m / 3
34
Binomial Variable B
with Parameters p, N
and expectation m = pN
-ee2 m / 2
e
(1- e)m
-ee2 m /3
By Chernoff
Bound for p < 1/2
(1+e)m
N
Prob ( B ) < 2 N p 2
2
Raghavan-Spencer
bound
For any
>0
Prob ( B (1 + ) m )
(1 + )(1+ )
in FOCS'86.
35
36