Randomized Algorithms I Probability Contention Resolution Minimum - - PowerPoint PPT Presentation

β–Ά
randomized algorithms i
SMART_READER_LITE
LIVE PREVIEW

Randomized Algorithms I Probability Contention Resolution Minimum - - PowerPoint PPT Presentation

Randomized Algorithms I Probability Contention Resolution Minimum Cut Philip Bille Randomized Algorithms I Probability Contention Resolution Minimum Cut Probability Probability spaces. Set of possible outcomes


slide-1
SLIDE 1

Philip Bille

Randomized Algorithms I

  • Probability
  • Contention Resolution
  • Minimum Cut
slide-2
SLIDE 2

Randomized Algorithms I

  • Probability
  • Contention Resolution
  • Minimum Cut
slide-3
SLIDE 3
  • Probability spaces.
  • Set of possible outcomes

.

  • Each element

has probability and .

  • Event is a subset of

and probability of is .

  • The complementary event is

and .

  • Example. Flip two fair coins.
  • .
  • for each outcome i.
  • Event = "the coins are the same"
  • .

Ξ© 𝗃 ∈ Ξ© π—Š(𝗃) β‰₯ 𝟣 βˆ‘

π—ƒβˆˆΞ©

π—Š(𝗃) = 𝟀 π–₯ Ξ© E Pr(π–₯) = βˆ‘

π—ƒβˆˆπ–₯

π—Š(𝗃) π–₯ Ξ© βˆ’ 𝖰 Pr(π–₯) = 𝟀 βˆ’ Pr(π–₯) Ξ© = {𝖨𝖨, 𝖨𝖴, 𝖴𝖨, 𝖴𝖴} π—Š(𝗃) = 𝟀/𝟧 π–₯ Pr(π–₯) = 𝟀/πŸ₯

Probability

𝖨𝖨 𝖴𝖴 𝖴𝖨 𝖨𝖴 Ξ© π–₯ π–₯

slide-4
SLIDE 4
  • Conditional probability.
  • What is the probability that event occurs given that event occurred?
  • The conditional probability of given :
  • Example.
  • π–₯

𝖦 π–₯ 𝖦 Pr(π–₯ ∣ 𝖦) = Pr(π–₯ ∩ 𝖦) Pr(𝖦) Pr(π–₯ ∣ 𝖦) = Pr(π–₯ ∩ 𝖦) Pr(𝖦) = 2/8 5/8 = 2 5

Probability

π–₯ 𝖦

slide-5
SLIDE 5
  • Independence.
  • Events and are independent if information about does not affect outcome
  • f and vice versa.
  • Same as

π–₯ 𝖦 π–₯ 𝖦 Pr(π–₯ ∣ 𝖦) = Pr(π–₯) Pr(𝖦 ∣ π–₯) = Pr(𝖦) Pr(π–₯ ∩ 𝖦) = Pr(π–₯) β‹… Pr(𝖦)

Probability

slide-6
SLIDE 6
  • Union bound.
  • What is the probability that any of event E1, ..., Ek will happen, i.e., what is

?

  • If events are disjoint,

.

  • If events overlap,

.

  • In both cases, the union bound holds:

Pr(π–₯𝟀 βˆͺ π–₯πŸ₯ βˆͺ β‹― βˆͺ π–₯𝗅) Pr(π–₯𝟀 βˆͺ β‹― βˆͺ π–₯𝗅) = Pr(π–₯𝟀) + β‹― + Pr(π–₯𝗅) Pr(π–₯𝟀 βˆͺ β‹― βˆͺ π–₯𝗅) < Pr(π–₯𝟀) + β‹― + Pr(π–₯𝗅) Pr(π–₯𝟀 βˆͺ β‹― βˆͺ π–₯𝗅) ≀ Pr(π–₯𝟀) + β‹― + Pr(π–₯𝗅)

Probability

π–₯𝟀 π–₯πŸ₯ π–₯𝟦 π–₯𝟀 π–₯πŸ₯ π–₯𝟦

slide-7
SLIDE 7

Randomized Algorithms I

  • Probability
  • Contention Resolution
  • Minimum Cut
slide-8
SLIDE 8
  • Contention resolution. Consider n processes

trying to access a shared database:

  • If two or more processes access database at the same time, all processes are

locked out.

  • Processes cannot communicate.
  • Goal. Come up with a protocol to ensure all processes will access database.
  • Challenge. Need symmetry breaking paradigm.

π–°πŸ€, …, π–°π—ˆ

Contention Resolution

database

π–°πŸ€ 𝖰πŸ₯ π–°π—ˆ

slide-9
SLIDE 9
  • Applications.
  • Distributed communication and interference.
  • Illustrates simplicity and power of randomized algorithms.

Contention Resolution

slide-10
SLIDE 10
  • Protocol. Each process accesses the database at time t with probability p = 1/n.

Contention Resolution

database

π–°πŸ€ 𝖰πŸ₯ π–°π—ˆ

slide-11
SLIDE 11
  • Analysis. How do we analyze the protocol?

Contention Resolution

database

π–°πŸ€ 𝖰πŸ₯ π–°π—ˆ

slide-12
SLIDE 12
  • Success for a single process in a single round.
  • event that

successfully accesses database at time .

𝖳𝗃,π—Ž = 𝖰𝗃 π—Ž Pr (𝖳𝗃,π—Ž) = π—Š(𝟀 βˆ’ π—Š)π—ˆβˆ’πŸ€ = 𝟀 π—ˆ (𝟀 βˆ’ 𝟀 π—ˆ )

π—ˆβˆ’πŸ€

β‰₯ 𝟀 π–Ώπ—ˆ

Contention Resolution

probability that process i requests access. probability that no other process requests access. converges to from above.

(𝟀 βˆ’ 𝟀 π—ˆ )

π—ˆβˆ’πŸ€

𝟀/𝖿

slide-13
SLIDE 13
  • Failure for a single process in rounds

.

  • event that

fails to access database in any of rounds .

  • 𝟀, …, π—Ž

𝖦𝗃,π—Ž = 𝖰𝗃 𝟀, …, π—Ž Pr (𝖦𝗃,π—Ž) = Pr (

π—Ž

β‹‚

π—Œ=𝟀

𝖳𝗃,π—Œ) =

π—Ž

∏

π—Œ=𝟀

Pr (𝖳𝗃,π—Œ) = (𝟀 βˆ’ 𝟀 π—ˆ (𝟀 βˆ’ 𝟀 π—ˆ )

π—ˆβˆ’πŸ€

)

π—Ž

≀ (𝟀 βˆ’ 𝟀 π–Ώπ—ˆ )

π—Ž

π—Ž = βŒˆπ–Ώπ—ˆβŒ‰ β‡’ Pr (𝖦𝗃,π—Ž) ≀ (𝟀 βˆ’ 𝟀 π–Ώπ—ˆ )

βŒˆπ–Ώπ—ˆβŒ‰

≀ (𝟀 βˆ’ 𝟀 π–Ώπ—ˆ )

π–Ώπ—ˆ

≀ 𝟀 𝖿 π—Ž = βŒˆπ–Ώπ—ˆβŒ‰(𝖽 ln π—ˆ) β‡’ Pr (𝖦𝗃,π—Ž) ≀ ( 𝟀 𝖿 )

𝖽 ln π—ˆ

= 𝟀 π—ˆπ–½

Contention Resolution

probability that does not succeed in round 1 and round 2 and ... and round t.

𝖰𝗃

independence.

Pr (𝖳𝗃,π—Ž) β‰₯ 𝟀 π–Ώπ—ˆ

converges to from below.

(𝟀 βˆ’ 𝟀 π—ˆ )

π—ˆ

𝟀/𝖿

slide-14
SLIDE 14
  • Failure for at least one process in rounds

.

  • event that at least one of n processes fails to access database in any of

rounds .

  • .
  • β‡’ Probability that all processes successfully access the database after

rounds is at least .

𝟀, …, π—Ž π–¦π—Ž = 𝟀, …, π—Ž Pr (π–¦π—Ž) = Pr (

π—ˆ

⋃

𝗃=𝟀

𝖦𝗃,π—Ž) ≀

π—ˆ

βˆ‘

𝗃=𝟀

Pr (𝖦𝗃,π—Ž) ≀ π—ˆ (𝟀 βˆ’ 𝟀 π–Ώπ—ˆ )

π—Ž

π—Ž = βŒˆπ–Ώπ—ˆβŒ‰πŸ₯ ln π—ˆ β‡’ Pr (π–¦π—Ž) ≀ π—ˆ (𝟀 βˆ’ 𝟀 π–Ώπ—ˆ )

βŒˆπ–Ώπ—ˆβŒ‰πŸ₯ ln π—ˆ

≀ π—ˆ ( 𝟀 𝖿 )

πŸ₯ ln π—ˆ

= π—ˆ π—ˆπŸ₯ = 𝟀 π—ˆ βŒˆπ–Ώπ—ˆβŒ‰πŸ₯ ln π—ˆ 𝟀 βˆ’ 𝟀/π—ˆ

Contention Resolution

probability that any

  • ne of

fails in rounds

π–°πŸ€, …, π–°π—ˆ 𝟀, …, π—Ž

union bound

Pr (𝖦𝗃,π—Ž) ≀ (𝟀 βˆ’ 𝟀 π–Ώπ—ˆ )

π—Ž

slide-15
SLIDE 15
  • Conclusion. After

rounds all processes have accessed database with probability at least .

  • Success probability.
  • For large probability is very close to 1.
  • More rounds will further increase probability of success.
  • Simplicity.
  • Very simple and effective protocol.
  • Difficult to solve deterministically.

βŒˆπ–Ώπ—ˆβŒ‰πŸ₯ ln π—ˆ 𝟀 βˆ’ 𝟀/π—ˆ π—ˆ

Contention Resolution

slide-16
SLIDE 16

Randomized Algorithms I

  • Probability
  • Contention Resolution
  • Minimum Cut
slide-17
SLIDE 17
  • Graphs. Consider undirected, connected graph G = (V,E).
  • Cuts.
  • A cut (A,B) is a partition of V into two non-empty disjoint sets A and B.
  • The size of a cut (A,B) is the number of edges crossing the cut.
  • A minimum cut is a cut of minimum size.

Minimum Cut

A B

slide-18
SLIDE 18
  • Applications.
  • Network fault tolerance.
  • Image segmentation.
  • Parallel computation
  • Social network analysis.
  • ...

Minimum Cut

slide-19
SLIDE 19
  • Which solutions do we know?

Minimum Cut

slide-20
SLIDE 20
  • Contraction algorithm.
  • Pick edge e = (u,v) uniformly at random.
  • Contract e.
  • Replace e by single vertex w.
  • Preserve edges, updating endpoints of u and v to w.
  • Preserve parallel edges, but remove self-loops.
  • Repeat until two vertices a and b left.
  • Return cut (all vertices contracted into a, all vertices contracted into b).

Minimum Cut

b a c d c d {a,b}

slide-21
SLIDE 21

b a c d c d {a,b} d {a,b,c}

cut is ({a,b,c}, {d}) of size 2

slide-22
SLIDE 22
  • Analysis.
  • Consider minimum cut (A,B) with crossing edges F

.

  • What is the probability that the contraction algorithm returns (A,B)?

Minimum Cut

A B F

slide-23
SLIDE 23
  • Round 1.
  • What is the probability that we contract an edge from F in round 1?
  • Each vertex has deg

(otherwise smaller cut exists) .

  • .
  • Probability we contract edge from F is

.

β‰₯ |𝖦| β‡’ βˆ‘

π—βˆˆπ–Ά

𝖾𝖿𝗁(𝗐) β‰₯ |𝖦|π—ˆ βˆ‘

π—βˆˆπ–Ά

𝖾𝖿𝗁(𝗐) = πŸ₯𝗇 β‡’ 𝗇 = βˆ‘π—βˆˆπ–Ά 𝖾𝖿𝗁(𝗐) πŸ₯ β‰₯ |𝖦|π—ˆ πŸ₯ = |𝖦| 𝗇 ≀ |𝖦| |𝖦|π—ˆ/πŸ₯ = πŸ₯ π—ˆ

Minimum Cut

A B F

slide-24
SLIDE 24
  • Round j+1.
  • What is the probability that we contract an edge in round

from , given that no edge from was contracted in rounds ?

  • is graph after rounds with

nodes and no edges from was contracted in rounds .

  • Every cut in

is a cut in β‡’ at least edges incident to every node in

  • β‡’

contains at least edges β‡’ probability is .

𝗄 + 𝟀 𝖦 𝖦 𝟀, …, 𝗄 𝖧′ 𝗄 π—ˆ βˆ’ 𝗄 𝖦 𝟀, …, 𝗄 𝖧′ 𝖧 |𝖦| 𝖧′ 𝖧′ |𝖦|(π—ˆ βˆ’ 𝗄) πŸ₯ ≀ |𝖦| 𝗇 = πŸ₯ π—ˆ βˆ’ 𝗄

Minimum Cut

A B F

slide-25
SLIDE 25
  • Success after all rounds.
  • event that an edge from F is not contracted in round j.
  • The probability that we return the correct minimum cut is

.

  • We know:
  • .
  • .
  • Conditional probability definition + algebra

.

π–₯𝗄 = Pr (π–₯π—ˆβˆ’πŸ₯ ∩ β‹― ∩ π–₯𝟀) Pr (π–₯𝟀) β‰₯ 𝟀 βˆ’ πŸ₯ π—ˆ Pr (π–₯𝗄+𝟀 ∣ π–₯𝟀 ∩ β‹― ∩ π–₯𝗄) β‰₯ 𝟀 βˆ’ πŸ₯ π—ˆ βˆ’ 𝗄 β‡’ Pr (π–₯𝟀 ∩ β‹― ∩ π–₯𝗄+𝟀) β‰₯ πŸ₯ π—ˆπŸ₯

Minimum Cut

slide-26
SLIDE 26
  • Conclusion.
  • We return the correct minimum cut with probability

in polynomial time.

  • Probability amplification.
  • Correct solution only with very small probability
  • Run contraction algorithm many times and return smallest cut.
  • With

runs with independent random choices the probability of failure to find minimum cut is .

  • Time.
  • Ο΄(n2 log n) iterations that take Ξ©(m) time each.
  • More techniques and tricks β‡’ m logO(1) n time solution. [Karger 2000]

β‰₯ πŸ₯/π—ˆπŸ₯ π—ˆπŸ₯ ln π—ˆ ≀ (𝟀 βˆ’ πŸ₯ π—ˆπŸ₯ )

π—ˆπŸ₯ ln π—ˆ

≀ ( 𝟀 𝖿 )

πŸ₯ ln π—ˆ

= 𝟀 π—ˆπŸ₯

Minimum Cut

slide-27
SLIDE 27
  • Monte Carlo algorithm.
  • Randomized algorithm.
  • Guarantee on running time, likely to find correct answer.
  • Las Vegas algorithm.
  • Randomized algorithm.
  • Guaranteed to find the correct answer, likely to be fast.

Minimum Cut

slide-28
SLIDE 28

Randomized Algorithms I

  • Probability
  • Contention Resolution
  • Minimum Cut