Randomness in Computing L ECTURE 19 Last time Finding Hamiltonian - - PowerPoint PPT Presentation

โ–ถ
randomness in computing
SMART_READER_LITE
LIVE PREVIEW

Randomness in Computing L ECTURE 19 Last time Finding Hamiltonian - - PowerPoint PPT Presentation

Randomness in Computing L ECTURE 19 Last time Finding Hamiltonian cycles in random graphs Today Probabilistic method 4/7/2020 Sofya Raskhodnikova;Randomness in Computing The probabilistic method To prove that an object with required


slide-1
SLIDE 1

4/7/2020

Randomness in Computing

LECTURE 19

Last time

  • Finding Hamiltonian cycles in

random graphs

Today

  • Probabilistic method

Sofya Raskhodnikova;Randomness in Computing

slide-2
SLIDE 2

The probabilistic method

To prove that an object with required properties exists:

  • 1. Define a distribution on objects.
  • 2. Sample an object.
  • 3. Prove that a sampled object has required properties with

positive probability.

  • Sometimes proof of existence can be converted into efficient

randomized constructions.

  • Sometimes they can be converted into deterministic

constructions (derandomization).

4/7/2020

Sofya Raskhodnikova; Randomness in Computing

slide-3
SLIDE 3

Method 1: The counting argument

  • ๐ฟ๐‘œ = complete graph on ๐‘œ vertices (๐‘œ-clique)

Proof: Define a random experiment:

Color each edge of ๐‘ณ๐’ independently and uniformly blue or red.

  • Fix an ordering of the ๐‘œ

๐‘™ different ๐‘™-cliques.

  • Let ๐‘๐‘— be the event that clique ๐‘— is monochromatic, for ๐‘— = 1, โ€ฆ , ๐‘œ

๐‘™ Pr ๐‘๐‘— = 2 โ‹… 2โˆ’ ๐‘™

2

  • Pr โ‹ƒ๐‘—=1

๐‘œ ๐‘™ ๐‘๐‘— โ‰ค ฯƒ๐‘—=1 ๐‘œ ๐‘™ Pr[๐‘๐‘—] = ๐‘œ

๐‘™ โ‹… 2โˆ’ ๐‘™

2 +1 < 1

  • Probability of a coloring with no monochromatic ๐‘™-clique is > 0.

4/7/2020

Sofya Raskhodnikova; Randomness in Computing Image by Richtom80 at English Wikipedia, CC BY-SA 3.0

Theorem

If ๐‘œ ๐‘™ โ‹… 2โˆ’ ๐‘™

2 +1 < 1 then it is possible to color the edges

  • f ๐ฟ๐‘œ with two colors so that no ๐ฟ๐‘™ is monochromatic.

Union Bound

slide-4
SLIDE 4

Converting an existence proof into an efficient randomized construction

  • Can we efficiently sample a coloring?
  • How many samples do we need to generate

a coloring with no monochromatic ๐’-clique?

โ€“ Probability of success is ๐‘ž = 1 โˆ’ ๐‘œ ๐‘™ โ‹… 2โˆ’ ๐‘™

2 +1

โ€“ # of samples โˆผGeom(๐‘ž), expectation: 1/๐‘ž โ€“ Want: 1/๐‘ž to be polynomial in the problem size โ€“ If ๐‘ž = 1 โˆ’ ๐‘(1), we get a Monte Carlo construction algorithm that errs w. p. ๐‘(1).

  • To get a Las Vegas algorithm (always correct answers),

we need a poly-time procedure for checking if the coloring is monochromatic.

โ€“ If ๐‘™ is constant, we can check that all ๐‘œ ๐‘™ cliques are not monochromatic.

4/7/2020

Sofya Raskhodnikova; Randomness in Computing

Yes

slide-5
SLIDE 5

Method 2: The expectation argument

  • It canโ€™t be that everybody is better (or worse) than the average.

Proof: Suppose to the contrary that Pr ๐‘Œ โ‰ฅ ๐œˆ = 0. Then ๐œˆ = ๐”ฝ ๐‘Œ = เท

๐‘ฆ

๐‘ฆ Pr ๐‘Œ = ๐‘ฆ < เท

๐‘ฆ

๐œˆ Pr ๐‘Œ = ๐‘ฆ = ๐œˆ เท

๐‘ฆ

Pr ๐‘Œ = ๐‘ฆ = ๐œˆ, a contradiction.

4/7/2020

Sofya Raskhodnikova; Randomness in Computing

Claim Let ๐‘Œ be a R.V. with ๐”ฝ ๐‘Œ = ๐œˆ. Then Pr ๐‘Œ โ‰ฅ ๐œˆ > 0 and Pr ๐‘Œ โ‰ค ๐œˆ > 0.

โ‰ค >

slide-6
SLIDE 6

Example: Finding a large cut

Recall:

  • A cut in a graph ๐ป = (๐‘Š, ๐น) is a partition of ๐‘Š into two nonempty sets.
  • The size of the cut is the number of edges that cross it.
  • Finding a max cut is NP-hard.

4/7/2020

Sofya Raskhodnikova; Randomness in Computing

Theorem

Let ๐ป be an undirected graph with ๐‘› edges. Then ๐ป has a cut of size โ‰ฅ ๐‘›/2.

slide-7
SLIDE 7

Example: Existence of a large cut

Proof: Construct sets ๐ต and ๐ถ of vertices by assigning each vertex to ๐ต or ๐ถ uniformly and independently at random.

  • For each edge ๐‘“, let ๐‘Œ๐‘“ = แ‰Š1 if edge connects ๐ต to ๐ถ

0 otherwise ๐”ฝ ๐‘Œ๐‘“ =1/2

  • Let ๐‘Œ = # of edges crossing the cut.

๐”ฝ[๐‘Œ] = ๐”ฝ ฯƒ๐‘“โˆˆ๐น ๐‘Œ๐‘“ = ฯƒ๐‘“โˆˆ๐น ๐”ฝ ๐‘Œ๐‘“ = ๐‘› โ‹…

1 2 = ๐‘› 2

There exists a cut (๐ต, ๐ถ) of size ๐‘›/2.

4/7/2020

Sofya Raskhodnikova; Randomness in Computing

Theorem

Let ๐ป be an undirected graph with ๐‘› edges. Then ๐ป has a cut of size โ‰ฅ ๐‘›/2.

slide-8
SLIDE 8

Example: Finding a large cut

  • It is easy to choose a random cut
  • Probability of success: ๐‘ž = Pr ๐‘Œ โ‰ฅ

๐‘› 2

  • An upper bound on ๐‘Œ?

๐‘› 2 = ๐”ฝ ๐‘Œ = เท

๐‘—<๐‘›/2

๐‘— โ‹… Pr[๐‘Œ = ๐‘—] + เท

๐‘—โ‰ฅ๐‘›/2

๐‘— โ‹… Pr[๐‘Œ = ๐‘—] โ‰ค ๐‘› โˆ’ 1 2 โ‹… 1 โˆ’ ๐‘ž + ๐‘› โ‹… ๐‘ž ๐‘› โ‰ค ๐‘› โˆ’ 1 โˆ’ ๐‘› โˆ’ 1 โ‹… ๐‘ž + 2๐‘› โ‹… ๐‘ž ๐‘ž โ‰ฅ 1 ๐‘› + 1

  • Expected # of samples to find a large cut:
  • Can test if a cut has โ‰ฅ

๐‘› 2 edges by counting edges crossing the cut (poly time)

4/7/2020

Sofya Raskhodnikova; Randomness in Computing

X โ‰ค ๐‘› Las Vegas โ‰ค ๐‘› + 1

slide-9
SLIDE 9

Derandomization: conditional expectations

Finding a large cut

Idea: Place each vertex deterministically, ensuring that ๐”ฝ ๐‘Œ| placement so far โ‰ฅ ๐”ฝ ๐‘Œ โ‰ฅ ๐‘› 2

  • R.V. ๐‘

๐‘— is ๐ต or ๐ถ, indicating which set vertex ๐‘— is placed in, โˆ€๐‘— โˆˆ [๐‘œ]

Base case: ๐”ฝ ๐‘Œ|๐‘

1 = ๐ต = ๐”ฝ ๐‘Œ|๐‘ 1 = ๐ถ = ๐”ฝ ๐‘Œ

Inductive step: Let ๐‘ง1, โ€ฆ , ๐‘ง๐‘™ be placements so far (each is ๐ต or ๐ถ) and suppose ๐”ฝ ๐‘Œ|๐‘

1 = ๐‘ง1, โ€ฆ , ๐‘ ๐‘™ = ๐‘ง๐‘™ โ‰ฅ ๐”ฝ ๐‘Œ .

๐”ฝ ๐‘Œ|๐‘

1 = ๐‘ง1, โ€ฆ , ๐‘ ๐‘™ = ๐‘ง๐‘™ = 1 2 ๐”ฝ ๐‘Œ|๐‘ 1 = ๐‘ง1, โ€ฆ , ๐‘ ๐‘™ = ๐‘ง๐‘™, ๐‘ ๐‘™+1 = ๐ต

+ 1 2 ๐”ฝ ๐‘Œ|๐‘

1 = ๐‘ง1, โ€ฆ , ๐‘ ๐‘™ = ๐‘ง๐‘™, ๐‘ ๐‘™+1 = ๐ถ

Then ๐”ฝ ๐‘Œ|๐‘

1 = ๐‘ง1, โ€ฆ , ๐‘ ๐‘™+1 = ๐‘ง๐‘™+1 โ‰ฅ ๐”ฝ ๐‘Œ|๐‘ 1 = ๐‘ง1, โ€ฆ , ๐‘ ๐‘™ = ๐‘ง๐‘™ โ‰ฅ ๐”ฝ ๐‘Œ

4/7/2020

Sofya Raskhodnikova; Randomness in Computing

By symmetry (it doesnโ€™t matter where the first node is) By Law of Total Expectation Pick ๐’›๐’+๐Ÿ to maximize conditional probability Pick ๐’›๐’+๐Ÿ to maximize conditional probability

slide-10
SLIDE 10

Finding a large cut: derandomization

When the dust settles

  • Place vertex ๐‘™ + 1 on the side with fewer neighbors,

breaking ties arbitrarily

4/7/2020

Sofya Raskhodnikova; Randomness in Computing

๐ต ๐ถ undecided

1 1 1/2

๐’ + ๐Ÿ

slide-11
SLIDE 11

Example 2: Maximum satisfiability (MAX-SAT)

Logical formulas

  • Boolean variables: variables that can take on values T/F (or 1/0)
  • Boolean operations: โˆจ, โˆง, and ยฌ
  • Boolean formula: expression with Boolean variables and ops

SAT (deciding if a given formula has a satisfying assignment) is NP-complete

  • Literal:

A Boolean variable or its negation.

  • Clause:

OR of literals.

  • Conjunctive normal form (CNF): AND of clauses.

MAX-SAT: Given a CNF formula, find an assignment satisfying as many clauses as possible.

  • Assume no clause contains ๐‘ฆ and าง

๐‘ฆ (o.w., it is always satisfied).

4/7/2020

Sofya Raskhodnikova; Randomness in Computing

Ex: x1 = 1, x2 = 1, x3 = 0 satisfies the formula.

เธ€๏€  x1 ๏ƒš x2 ๏ƒš x3

๏€จ ๏€ฉ ๏ƒ™

x1 ๏ƒš x2 ๏ƒš x3

๏€จ ๏€ฉ ๏ƒ™

x2 ๏ƒš x3

๏€จ ๏€ฉ ๏ƒ™

x1 ๏ƒš x2 ๏ƒš x3

๏€จ ๏€ฉ

๐‘ฆ๐‘— or เดฅ ๐‘ฆ๐‘— ๐ท1 = ๐‘ฆ1 โˆจ ๐‘ฆ2 โˆจ ๐‘ฆ3 ๐ท1 โˆง ๐ท2 โˆง ๐ท3 โˆง ๐ท4

slide-12
SLIDE 12

Example 2: MAX-SAT

Proof: Assign values 0 or 1 uniformly and independently to each variable.

  • ๐‘Œ๐‘— = indicator R.V. for clause ๐‘— being satisfied.
  • ๐‘Œ = # of satisfied clauses = ฯƒ๐‘—โˆˆ[๐‘›] ๐‘Œ๐‘—
  • Pr ๐‘Œ๐‘— = 1 = 1 โˆ’ 2โˆ’๐‘™๐‘—

๐”ฝ[๐‘Œ] = เท

๐‘—โˆˆ[๐‘›]

๐”ฝ ๐‘Œ๐‘— = เท

๐‘—โˆˆ[๐‘›]

(1 โˆ’ 2โˆ’๐‘™๐‘—) โ‰ฅ ๐‘›(1 โˆ’ 2โˆ’๐‘™)

  • There exists an assignment satisfying that many clauses.

4/7/2020

Sofya Raskhodnikova; Randomness in Computing

Theorem

Given ๐‘› clauses, let ๐‘™๐‘— = # literals in clause ๐‘—, for ๐‘— โˆˆ [๐‘›]. Let ๐‘™ = min

๐‘—โˆˆ[๐‘›] ๐‘™๐‘—. There is a truth assignment that satisfies at least

เท

๐‘—โˆˆ[๐‘›]

1 โˆ’ 2โˆ’๐‘™๐‘— โ‰ฅ ๐‘› 1 โˆ’ 2โˆ’๐‘™ clauses.

slide-13
SLIDE 13

Example 3: Large sum-free subset

  • Given a set ๐‘ฉ of positive integers, a sum-free subset ๐‘ป โІ ๐‘ฉ

contains no three elements ๐’‹, ๐’Œ,๐’ โˆˆ ๐‘ป satisfying ๐’‹ + ๐’Œ = ๐’.

  • Goal: find as large as ๐‘ป as possible.
  • Examples: A = {2, 3, 4, 5, 6, 8, 10}

A = {1, 2, 3, 4, 5, 6, 8, 9, 10, 18}

4/7/2020

Sofya Raskhodnikova; Randomness in Computing

Theorem

Every set ๐‘ฉ of ๐’ positive integers contains a sum-free subset of size greater than ๐’/3.

slide-14
SLIDE 14

Finding a large sum-free subset

A randomized algorithm

  • 1. Let ๐’’ > max element of ๐‘ฉ be a prime, where ๐’’ = ๐Ÿ’๐’ + ๐Ÿ‘.

//The other choice, ๐Ÿ’๐’ + ๐Ÿ, would also work.

  • 2. Select a number ๐’“ uniformly at random from {1, ๐’’ โˆ’ ๐Ÿ}.
  • 3. Map each element ๐’– โˆˆ ๐‘ฉ to ๐’–๐’“ mod ๐’’.

4. ๐‘ป ๏ƒŸ all elements of ๐‘ฉ that got mapped to {๐’ + ๐Ÿ, โ€ฆ , ๐Ÿ‘๐’ + ๐Ÿ}.

  • 5. Return ๐‘ป.

Need to prove:

  • ๐‘ป is sum-free
  • The expected number of elements from ๐‘ฉ that are mapped to

{๐’ + ๐Ÿ, โ€ฆ , ๐Ÿ‘๐’ + ๐Ÿ} is > ๐’/๐Ÿ’.

4/7/2020

Sofya Raskhodnikova; Randomness in Computing; based on slides by Surender Baswana

slide-15
SLIDE 15

Showing that ๐‘ป is sum-free

16

  • Let ๐’‹ and ๐’Œ be any two elements in ๐‘ป.
  • Say ๐’‹ is mapped to ๐œท; ๐’Œ is mapped to ๐œธ; ๐œท, ๐œธ โˆˆ ๐’ + ๐Ÿ, 2๐’ + ๐Ÿ
  • Then ๐œท = ๐’‹๐’“ ๐ง๐ฉ๐ž ๐’’

and ๐œธ = ๐’Œ๐’“ ๐ง๐ฉ๐ž ๐’’

  • We need to show that ๐’‹ + ๐’Œ, if present in ๐‘ฉ, is not mapped to

[๐’ + ๐Ÿ, 2๐’ + ๐Ÿ].

  • ๐’‹ + ๐’Œ is mapped to ??

Argue that

  • (๐œท + ๐œธ) must be greater than 2๐’ + ๐Ÿ.
  • If (๐œท + ๐œธ) > ๐’’, then (๐œท + ๐œธ) ๐ง๐ฉ๐ž ๐’’ is at most ๐’.

1 2 โ€ฆ ๐’ ๐’ + ๐Ÿ โ€ฆ โ€ฆ โ€ฆ ๐Ÿ‘๐’ + ๐Ÿ โ€ฆ 3๐’ + ๐Ÿ ๐œท ๐œธ (๐œท + ๐œธ) ๐ง๐ฉ๐ž ๐’’

Sofya Raskhodnikova; Randomness in Computing; based on slides by Surender Baswana

slide-16
SLIDE 16

The expected size of ๐‘ป

  • 1. Let ๐’’ > max element of ๐‘ฉ be a prime, where ๐’’ = ๐Ÿ’๐’ + ๐Ÿ‘.
  • 2. Select a number ๐’“ uniformly at random from {1, ๐’’ โˆ’ ๐Ÿ}.
  • 3. Map each element ๐’– โˆˆ ๐‘ฉ to ๐’–๐’“ mod ๐’’.

4. ๐‘ป ๏ƒŸ all elements of ๐‘ฉ that got mapped to {๐’ + ๐Ÿ, โ€ฆ , ๐Ÿ‘๐’ + ๐Ÿ}. Main idea: Every element ๐’– โˆˆ ๐‘ฉ gets mapped to ๐’–๐’“ mod ๐’’, which is a uniformly random element of {๐Ÿ, โ€ฆ , ๐Ÿ’๐’ + ๐Ÿ}. Pr ๐’– is selected to be in ๐‘ป = |{๐’ + ๐Ÿ, โ€ฆ , ๐Ÿ‘๐’ + ๐Ÿ}| |{๐Ÿ, โ€ฆ , ๐Ÿ’๐’ + ๐Ÿ}| > 1/3

4/7/2020

Sofya Raskhodnikova; Randomness in Computing; based on slides by Surender Baswana

slide-17
SLIDE 17

Example 3: Large sum-free subset

  • Given a set ๐‘ฉ of positive integers, a sum-free subset ๐‘ป โІ ๐‘ฉ

contains no three elements ๐’‹, ๐’Œ,๐’ โˆˆ ๐‘ป satisfying ๐’‹ + ๐’Œ = ๐’.

  • Goal: find as large as ๐‘ป as possible.
  • Examples: A = {2, 3, 4, 5, 6, 8, 10}

A = {1, 2, 3, 4, 5, 6, 8, 9, 10, 18}

4/7/2020

Sofya Raskhodnikova; Randomness in Computing

Theorem

Every set ๐‘ฉ of ๐’ positive integers contains a sum-free subset of size greater than ๐’/3.