Professional Documents
Culture Documents
CS2800-Probability Part e v.2
CS2800-Probability Part e v.2
CS 2800
Module
Probability --- Part e)
2 2
The Probabilistic Method
Thm. If the probability that a randomly selected element of the set S does
not have a particular property is less than 1, then there exists an
element in S with this property.
Note: We saw an earlier example of the probabilistic method when discussing the 7/8
alg. for 3-CNF.
3
Example: Lower bound for Ramsey numbers
Let R(k,k) be the minimal n such that if the edges of the complete
graph on n nodes are colored Red and Blue, then there either is a
complete subgraph of k nodes with all edges Red or a complete
subgraph of k nodes with all edges Blue.
E.g.
So, R(3,3) > 5.
I.e., we have a lower
bound on the Ramsey
Number for k=3.
So, e.g., k = 20, then there exists a Red/Blue coloring of the complete graph
with 2^10 – 1 = 1023 nodes that does not have any complete
monochromatic sub graph of size 20. (But we have no idea of how to
find such a coloring!)
Why?
? <1
So, we have “upper bounded” our probability. What’s left?
We need to show that the left hand side is strictly less than 1.
“Just” combinatorics…
k
O(n
Note: We have many ) terms in the sum, but p(E_i) can
be pretty small.
Ex. 17, 5.4
by assumption:
by assumption:
So,
Note: Proof is non-constructive.
No effective method known
for finding such coverings!
So, when
and
14 14
Monte Carlo Algorithm
Decision problems --- problems for which the answer is True or False.
E.g., is this number composite?
Monte Carlo algorithms – there is a small probability that they will return
an incorrect answer.
15
Probabilistic Primality Test:
Miller’s Test
Let n be a positive integer and let n-1 = 2s t (i.e. divide out the
factors of 2), where s is a non-negative integer and t is an odd
positive integer.
We say that n passes the Miller test for the base b if either
bt ≡1 (mod n)
or
2jt
b 1(mod n), for some j, 0 j s 1
It can be shown that a composite integer n passes the Miller’s test
for fewer than n/4 bases b, with 1 < b < n.
16
Probabilistic Primality Testing
17
Probabilistic primality testing
Note:
This algorithm can only make mistakes when the answer is unknown.
The probability that a composite integer n passes the Miller’s test for
a
randomly selected base b is less than ¼.
19
Probability theory is a very rich topic of
increasing importance in computer science, but
for now, this ends our probabilistic adventures.