The Probabilistic Method in Computer Science
The Probabilistic Method in Computer Science
Combinatorics in Computer Science
Combinatorics in Computer Science
Paul Erdós (1913-1996)
Mathematical Achievements• ~1500 papers
• ~500 co-authors
• Invented new branches of mathematics
• Solved a LARGE number of beautiful problems
• Posed a HUGE number of beautiful problems
Some Facts
• Devoted his entire life to Math:• never had a woman• never had an house• never had an office• never had possessions (except for
a small suitcase with silk shirts and underwears necessary for his skin)
• never had much money (once he won 50000$ and he kept just 720$ for himself)
Some Other Facts• Took Amphetamines to be
able to sleep 4 hours per day (clearly spending the remaining 20 hours doing math)• Waking you up at 4 o’clock: “Is your brain open?”
• “Another roof, another proof”• Prizes for problems, for a total of
15000$: What if all problems are solved at once?
Number Theory• Branch of math studying integer
numbers and, in particular, prime numbers• First Erdós success: at 17 years, a proof “from the Book” that there is always a prime number between n and 2n (Bertrand’s postulate)
• Prime Number Theorem (simple proof by Erdós and Selberg): The number of primes up to x approaches x/log(x) as x->∞.
Number Theory
• Exercise: Prove that prime numbers are infinite
• Exercise: Design a method for generating all prime numbers
Number Theory
• Question 1: Does a closed formula exists generating (all and) only prime numbers?
Number Theory
• Question 2: Does an infinite number of friendly numbers exist?• Two numbers are friendly if each
one is the sum of the divisors of the other one.
• 284=1+2+4+5+10+11+20+22+44+55+110
• 220=1+2+4+71+142• Divisori(284)={1,2,4,71,142}• Divisori(220)={1,2,4,5,10,11,20,22,
44, 55,110}
Number Theory
• Question 3: Does an odd perfect number exists?• A perfect number is such that the
sum of its divisors is equal to itself• 6=1+2+3• 28=1+2+4+7+14• ….
Erdós Vocabulary• Supreme Fascist -> God• Epsilon ->
Children• Bosses -> Women• Slaves -> Men• Poison -> Alcohol• Preaching -> Lecturing• Dying -> Stop doing Math• Leaving -> Dying
Happy Ending Problem• Esther Klein:
• Is it true that, for all n, there exists an integer g(n) such that any set of g(n) points in general position contains a convex n-gon?
Happy Ending Problem• g(4)=5
Happy Ending Problem
• Erdós and Szekeres:
)(12 2 ngn ( 42 n2n )
• Szekeres and Klein got married
Ramsey Theory
• About unavoidable occurrences of patterns in a large instance of the problem• In a party, every two persons either know each other or they don’t
• Is it true that in a party with a sufficiently large number r(n) of persons, there are always n persons pairwise knowing each other or n persons pairwise not knowing each other?
Ramsey Theory
• Exercise: r(3)=?
• Exercise: translate the problem into a graph problem
hint: (if two persons know each other, then the graph has an edge…)
• Exercise: translate the problem into a graph coloring problem hint: (use complete graphs…)
Ramsey Theory
• Actual bounds for r(n)
n
cn
nnrne
log2
1
222
( 42 n2n )
Ramsey Theory
• Erdós LB:• There are ways to bicolor ( m2 )2 mK
( m2 )2( mn ) ( n2 ) 1
nK
nK
( m2 )2 ( m2 )2( mn ) ( n2 ) 1
• There are at most colorings with a monochromatic
• Therefore, a coloring with no monochromatic exists if
Ramsey Theory
• Exercise: construct a sequence of the first 100 integers containing no subsequence of 11 decreasing numbers and no subsequence of 11 increasing numbers• Exercise: construct a sequence of the first 101 integers containing no subsequence of 11 decreasing numbers and no subsequence of 11 increasing numbers
Ramsey Theory
• Every sequence of n2 +1 distinct numbers contains a decreasing sequence of n+1 numbers or an increasing sequence of n+1 numbers
Ramsey Theory• Proof: • Consider any sequence S of n2 +1
distinct numbers, and associate to the i-th number of S a pair (ai,bi) such that ai and bi are the sizes of the longest increasing and decreasing subsequences of S till the i-th number.
• Then (ai,bi)≠(ak,bk)
• Hence, an > n or bn > n
Ramsey Theory• The largest value of k such that r(k) is
known is…
• Erdós, aliens, and Ramsey numbers…
Erdós skills• Never done laundry• Never payed bills• Never cooked (“I can make very good
cold cereals and I could probably boil an egg but I never tried”)
• Never drived• János Pach: “I entered the kitchen and
saw pools of blood-like red liquid trailing to the refrigerator, where there was a tomato juice carton with a large hole on its side. Erdós must have been thirsty…”
Random Graph Theory
• Exercise: design a method to construct a random graph with n vertices
• Exercise: design a method to construct a random graph with n vertices and m edges
Random Graph Theory• Start with G having n vertices and no
edge. At each step choose a random edge among those not belonging to G. Stop when G has m edges.
• For a given p, 0 ≤ p ≤ 1, each potential edge is chosen with probability p, independent of the other edges. The obtained graph is Gn,p .
Random Graph Theory• Random Graphs are useful for:
• Analyzing deterministic algorithms• Designing random solutions
Random Graph Theory• Which is the right value of p?
• p=0?• p=1?• p=1/2?• p=1/2n?• p=1/n?
Random Graph Theory• As G acquires more and more edges,
various properties and substructures emerge. The problem of interest is to study the (sudden) appearance of graph properties as p varies.
• A random graph has property A, if the probability that Gn,p has property A approaches to 1, as n approaches infinity.
Random Graph Theory• Erdós-Rényi phases• Phase 1:• Gn,p is the disjoint union of trees on k
vertices• Trees on k vertices appear when
n
op1
1
1
k
k
n
p
Random Graph Theory• Phase 2:• Gn,p contains cycles of any given size
with probability tending to a positive limit
• Almost all vertices are in trees or in connected components with a single cycle
• The largest component is a tree with Θ(log n) vertices
10, cn
cp
Random Graph Theory• Phase 3: the double jump • The behavior of Gn,p when is
dramatically different from when • Most of the vertices are into a giant
component which has Θ(n) vertices• All other vertices are in trees or in
connected components with a single cycle. Each small component has O(log n) vertices.
nnp
1
np
1
np
1
Random Graph Theory• Phase 4:• All components other than the giant one
are very small and are trees
1, cn
cp
• Phase 5:• There is one connected component
1,log
cn
ncp
• Phase 6:• There is one connected component and
the degrees of all vertices are asymptotically equal.
nwn
nnwp ,
log
Erdós Number• Erdós had so many co-authors
that they started classifying mathematicians by their Erdós number:• Erdós has Erdós number 0• Its co-authors have Erdós number 1• The co-authors of its co-authors
have Erdós number 2• …• Erdós number is either ≤7 or ∞
The Probabilistic Method• Trying to prove that a structure with
certain desired properties exists, one defines an appropriate space of structures and then shows that the desired property holds in this space with positive probability.
The Probabilistic Method
• Consider a random 2-coloring of .• For any set R of k vertices, let AR be the
event that R is monochromatic.• Then,• Since there are choices for R, the
probability that one of events AR occurs is at most
22)(
k
kr
nK
12)Pr( RAk( 2)
( )nk
12 ( )( )nkk2
The Probabilistic Method• If , then 12 ( )( )nk
k2
22
k
n
!2!2
!
2
2
!!
!
k
kkkn
n
2
1
2
2
!
11kkk
knnn
2
2
2
2
22
!
11k
k
k
knnn 1
2!
2
2
12
2
k
kk
n
k
22)(
k
kr• Hence,
The Probabilistic Method• Tournament T: orientation of the
edges of Kn. Vertices are players. An edge (u,v) means that a player u beats a player v.
• T has property Sk if for every set K of k players there is a player not in K that beats all players in K.
• Is it true that for every k there is a tournament T with property Sk ?
The Probabilistic Method• Erdós solution:• If ,then there is a
tournament on n players which has property Sk
• Take a random tournament on Kn=(V,E).
• For any fixed set K of k players, let AK be the event that no player in V-K beats them all.
121 knk( )nk
The Probabilistic Method• Then, , as for every
player v in V-K, the probability that v does not beat all players in K is and all the n-k events corresponding to the different choices of v are independent. It follows that:
• Therefore, with positive probability there is a tournament on n players with property Sk
kn
kkA
2
11)Pr(
k2
11
)Pr( ||, kkKVK A )Pr(||, kkKVK A 12
11
kn
k( )nk
Finally I’m becoming stupider no more