class 11 - stanford universityweb.stanford.edu/.../cs265/lectures/lecture11/inclass11.pdf · 2020....

17
Class 11 Practice with LLL and Second Moment Method

Upload: others

Post on 21-Mar-2021

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Class 11 - Stanford Universityweb.stanford.edu/.../cs265/Lectures/Lecture11/InClass11.pdf · 2020. 10. 19. · Setting up theUse Lovas LLL g Local Lemma Let Xi Xz,. . ., Xn be TRUE

Class 11Practice with LLL and Second Moment Method

Page 2: Class 11 - Stanford Universityweb.stanford.edu/.../cs265/Lectures/Lecture11/InClass11.pdf · 2020. 10. 19. · Setting up theUse Lovas LLL g Local Lemma Let Xi Xz,. . ., Xn be TRUE

Plan for today

• More practice with LLL• Application to k-SAT• (Closure on the example set up in the minilecture video!)

• More practice with the second-moment method• Isolated vertices in random graphs

Page 3: Class 11 - Stanford Universityweb.stanford.edu/.../cs265/Lectures/Lecture11/InClass11.pdf · 2020. 10. 19. · Setting up theUse Lovas LLL g Local Lemma Let Xi Xz,. . ., Xn be TRUE

𝑘-SATLLL for h - SAT Question Say each var appears in E X clauses

.

What's the biggest you can take X to be andstill conclude that y is satisfiable? Elin lams of k)

Hint LLL . Bad events are the event that y is NOTsat .

if= ( x, VXZVXJ V - - - VX

, ) A (XaV XIV - - -Vxao) A - - .

I• n variables

• k literals per clause X, ,Xz , . . . . Xn

• m clauses

The Say each clause has EXACTLY k literals,

and each variable appears in E 2k-4k Clauses.

-Then y is satisfiable .

this is our t

• For today, each clause has exactly 𝑘 distinct variables.• Goal: a statement of the form:

As long as each variable appears in no more than ______ clauses, then 𝜑 is satisfiable.

Page 4: Class 11 - Stanford Universityweb.stanford.edu/.../cs265/Lectures/Lecture11/InClass11.pdf · 2020. 10. 19. · Setting up theUse Lovas LLL g Local Lemma Let Xi Xz,. . ., Xn be TRUE

Group work! Use the LLL to do this.

Page 5: Class 11 - Stanford Universityweb.stanford.edu/.../cs265/Lectures/Lecture11/InClass11.pdf · 2020. 10. 19. · Setting up theUse Lovas LLL g Local Lemma Let Xi Xz,. . ., Xn be TRUE

Solutions to group work.

LLL for h - SAT Question Say each var appears in E X clauses.

What's the biggest you can take X to be andstill conclude that y is satisfiable? Elin lams of k)

Hint LLL . Bad events are the event that y is NOTsat .

if= ( x, VXZVXJ V - - - VX

, ) A (XaV XIV - - -Vxao) A - - .

I• n variables

• k literals per clause X, ,Xz , . . . . Xn

• m clauses

The Say each clause has EXACTLY k literals,

and each variable appears in E 2k-4k Clauses.

-Then y is satisfiable .

this is our t

Page 6: Class 11 - Stanford Universityweb.stanford.edu/.../cs265/Lectures/Lecture11/InClass11.pdf · 2020. 10. 19. · Setting up theUse Lovas LLL g Local Lemma Let Xi Xz,. . ., Xn be TRUE

Setting up the LLLUse Lovasg Local Lemma .

Let Xi, Xz , . . ., Xn be TRUE or FALSE randomly (

"Ini form)

Ai = { ith clause NOT satisfied }

Pf Ai ] = 112k ← only one out of 2k waysto NOT satisfy a clause .

Use Lovasg Local Lemma .

Let Xi, Xz , . . ., Xn be TRUE or FALSE randomly (

"Ini form)

Ai = { ith clause NOT satisfied }

Pf Ai ] = 112k ← only one out of 2k waysto NOT satisfy a clause .

Use Lovasg Local Lemma .

Let Xi, Xz , . . ., Xn be TRUE or FALSE randomly (

"Ini form)

Ai = { ith clause NOT satisfied }

Pf Ai ] = 112k ← only one out of 2k waysto NOT satisfy a clause .

Page 7: Class 11 - Stanford Universityweb.stanford.edu/.../cs265/Lectures/Lecture11/InClass11.pdf · 2020. 10. 19. · Setting up theUse Lovas LLL g Local Lemma Let Xi Xz,. . ., Xn be TRUE

What is the parameter “d”?

Use Lovasg Local Lemma .

Let Xi, Xz , . . ., Xn be TRUE or FALSE randomly (

"Ini form)

Ai = { ith clause NOT satisfied }

Pf Ai ] = 112k ← only one out of 2k waysto NOT satisfy a clause .

Ai is mutually indeep . ofSi .- { ai : TI:b.bg" him:b::info }

(No matter how we set variables in clause j , won't affect Ai )

f#i sit . I mating" Inimitable:" ) #Igf . tk vars in

( each of themClause i

is in s tclauses

.

Ai is mutually indeep . ofSi .- { ai : TI:b.bg" him:b::info }

(No matter how we set variables in clause j , won't affect Ai )

f#i sit . I mating" Inimitable:" ) #Igf . tk vars in

( each of themClause i

is in s tclauses

.

Ai is mutually indeep . ofSi .- { ai : TI:b.bg" him:b::info }

(No matter how we set variables in clause j , won't affect Ai )

f#i sit . I mating" Inimitable:" ) #Igf . tk vars in

( each of themClause i

is in s tclauses

.

Ai is mutually indeep . ofSi .- { ai : TI:b.bg" him:b::info }

(No matter how we set variables in clause j , won't affect Ai )

f#i sit . I mating" Inimitable:" ) #Igf . tk vars in

( each of themClause i

is in s tclauses

.

⇒ Each Ai is mutually indep . ofall but d : = ht clauses.

other events.

LLL with D= ht, p - 2-

k:

If d p e 14 , then Pf Ai Ai ] s ( t - 2pm > O- -

aka, k t - 2- KE 44 aka, y is satisfied

aka t = 2h44

⇒ Each Ai is mutually indep . ofall but d : = ht clauses.

other events.

LLL with D= ht, p - 2-

k:

If d p e 14 , then Pf Ai Ai ] s ( t - 2pm > O- -

aka, k t - 2- KE 44 aka, y is satisfied

aka t = 2h44

Page 8: Class 11 - Stanford Universityweb.stanford.edu/.../cs265/Lectures/Lecture11/InClass11.pdf · 2020. 10. 19. · Setting up theUse Lovas LLL g Local Lemma Let Xi Xz,. . ., Xn be TRUE

Applying the LLL⇒ Each Ai is mutually indep . ofall but d : = ht clauses

.

other events.

LLL with D= ht, p - 2-

k:

If d p e 14 , then Pf Ai Ai ] s ( t - 2pm > O- -

aka, k t - 2- KE 44 aka, y is satisfied

aka t = 2h44

⇒ Each Ai is mutually indep . ofall but d : = ht clauses.

other events.

LLL with D= ht, p - 2-

k:

If d p e 14 , then Pf Ai Ai ] s ( t - 2pm > O- -

aka, k t - 2- KE 44 aka, y is satisfied

aka t = 2h44k

Page 9: Class 11 - Stanford Universityweb.stanford.edu/.../cs265/Lectures/Lecture11/InClass11.pdf · 2020. 10. 19. · Setting up theUse Lovas LLL g Local Lemma Let Xi Xz,. . ., Xn be TRUE

Conclusion

LLL for h - SAT Question Say each var appears in E X clauses.

What's the biggest you can take X to be andstill conclude that y is satisfiable? Elin lams of k)

Hint LLL . Bad events are the event that y is NOTsat .

if= ( x, VXZVXJ V - - - VX

, ) A (XaV XIV - - -Vxao) A - - .

I• n variables

• k literals per clause X, ,Xz , . . . . Xn

• m clauses

The Say each clause has EXACTLY k literals,

and each variable appears in E 2k-4k Clauses.

-Then y is satisfiable .

this is our t

• For example, if 𝑘 = 10, then as long as each variable appears in at most !!

"# = 25.6 clauses (aka, in ≤ 25 clauses), then 𝜑 is ALWAYS satisfiable!!• No matter how many variables or how many clauses!

Page 10: Class 11 - Stanford Universityweb.stanford.edu/.../cs265/Lectures/Lecture11/InClass11.pdf · 2020. 10. 19. · Setting up theUse Lovas LLL g Local Lemma Let Xi Xz,. . ., Xn be TRUE

Next up:

Practice with the second moment method• Consider a random graph 𝐺!,#• 𝑛 vertices, and each of the

𝑛2 edges is present with probability 𝑝,

independently.

• If 𝑝 < $%& !'!

, say, then in expectation, there are isolated vertices:• Pr[ 𝑣 is isolated ] = 1 − 𝑝 $%" ≈ 𝑒%& $%" ≈ "

$• Thus 𝐄 number of isolated vertices ≈ 𝑛 ≫ 1.

• How likely is it that we actually have isolated vertices?• Maybe it’s the case that with tiny probability, tons of vertices are

isolated, but with some decent probability there are no isolated vertices?

v

The 𝑛 − 1 other vertices

None of these edges exist.

Page 11: Class 11 - Stanford Universityweb.stanford.edu/.../cs265/Lectures/Lecture11/InClass11.pdf · 2020. 10. 19. · Setting up theUse Lovas LLL g Local Lemma Let Xi Xz,. . ., Xn be TRUE

Group work!

Page 12: Class 11 - Stanford Universityweb.stanford.edu/.../cs265/Lectures/Lecture11/InClass11.pdf · 2020. 10. 19. · Setting up theUse Lovas LLL g Local Lemma Let Xi Xz,. . ., Xn be TRUE

SolutionsIt’s unlikely that there are no isolated vertices.

• Let G - Gn , p , p = ctongn for cc 1.

• Let X = # isolated vertices inG , so X = ¥ I{ v is isolated}• Notice that IP{v is isolated} = ( t -p)

"- t

a exp f- in -hp) -- n'" ""sync

• EX = [vP{ vis isolated ) - Mnc = n'"← since cc e , ni

-c ⇒ I

• Varlxl = LECK ] - CEXT

• Let G - Gn , p , p = ctongn for cc 1.

• Let X = # isolated vertices inG , so X = ¥ I{ v is isolated}• Notice that IP{v is isolated} = ( t -p)

"- t

a exp f- in -hp) -- n'" ""sync

• EX = [vP{ vis isolated ) - Mnc = n'"← since cc e , ni

-c ⇒ I

• Varlxl = LECK ] - CEXT

• Let G - Gn , p , p = ctongn for cc 1.

• Let X = # isolated vertices inG , so X = ¥ I{ v is isolated}• Notice that IP{v is isolated} = ( t -p)

"- t

a exp f- in -hp) -- n'" ""sync

• EX = [vP{ vis isolated ) - Mnc = n'"← since cc e , ni

-c ⇒ I

• Varlxl = LECK ] - CEXT

• Let G - Gn , p , p = ctongn for cc 1.

• Let X = # isolated vertices inG , so X = ¥ I{ v is isolated}• Notice that IP{v is isolated} = ( t -p)

"- t

a exp f- in -hp) -- n'" ""sync

• EX = [vP{ vis isolated ) - Mnc = n'"← since cc e , ni

-c ⇒ I

• Varlxl = LECK ] - CEXT

Let’s quickly sanity-check that the expected number of isolated vertices is large:

Page 13: Class 11 - Stanford Universityweb.stanford.edu/.../cs265/Lectures/Lecture11/InClass11.pdf · 2020. 10. 19. · Setting up theUse Lovas LLL g Local Lemma Let Xi Xz,. . ., Xn be TRUE

Second moment methodWe need to compute the variance

• Let G - Gn , p , p = ctongn for cc 1.

• Let X = # isolated vertices inG , so X = ¥ I{ v is isolated}• Notice that IP{v is isolated} = ( t -p)

"- t

a exp f- in -hp) -- n'" ""sync

• EX = [vP{ vis isolated ) - Mnc = n'"← since cc e , ni

-c ⇒ I

• Varlxl = LECK ] - CEXT• ElX' ] = E@If isolated})

'

= IE Er Er If isolated } I { isolated}

rPl ::: :::B

-

- Erm:*!iii.is +⇐Misiak:'T }=n . (n

- c

) t n in - i ) ( n-" )

• ElX' ] = E@If isolated})'

= IE Er Er If isolated } I { isolated}

rPl ::: :::B

-

- Erm:*!iii.is +⇐Misiak:'T }=n . (n

- c

) t n in - i ) ( n-" )

• ElX' ] = E@If isolated})'

= IE Er Er If isolated } I { isolated}

rPl ::: :::B

-

- Erm:*!iii.is +⇐Misiak:'T }=n . (n

- c

) t n in - i ) ( n-" )

• ElX' ] = E@If isolated})'

= IE Er Er If isolated } I { isolated}

rPl ::: :::B

-

- Erm:*!iii.is +⇐Misiak:'T }=n . (n

- c

) t n in - i ) ( n-" )

What is thisterm?

This term is ≈ 𝑛 ⋅ 𝑛!"

Page 14: Class 11 - Stanford Universityweb.stanford.edu/.../cs265/Lectures/Lecture11/InClass11.pdf · 2020. 10. 19. · Setting up theUse Lovas LLL g Local Lemma Let Xi Xz,. . ., Xn be TRUE

Pr[ both 𝑢 and 𝑣 are isolated ]for 𝑢 ≠ 𝑣

n-2 edges¥#-

•⇐-• U

v←n - 2

edges.

U and vboth isolated

⇐ noneof theseun - 2) t1 edgesexisting

n-2 edges¥#-

•⇐-• U

v←n - 2

edges.

U and vboth isolated

⇐ noneof theseun - 2) t1 edgesexisting

P {9%3%7} - H -plan -3 - exp f- Can -3) p )

= N- c ( 2 - 3h )

un n- 2C

SECOND MOMENT METHOD :

PIX -03 ⇐ TEETH - Tna .- no

P {9%3%7} - H -plan -3 - exp f- Can -3) p )

= N- c ( 2 - 3h )

un n- 2C

SECOND MOMENT METHOD :

PIX -03 ⇐ TEETH - Tna .- no

P {9%3%7} - H -plan -3 - exp f- Can -3) p )

= N- c ( 2 - 3h )

un n- 2C

SECOND MOMENT METHOD :

PIX -03 ⇐ TEETH - Tna .- no

P {9%3%7} - H -plan -3 - exp f- Can -3) p )

= N- c ( 2 - 3h )

un n- 2C

SECOND MOMENT METHOD :

PIX -03 ⇐ TEETH - Tna .- no

𝑝 =𝑐 ⋅ ln 𝑛𝑛

Page 15: Class 11 - Stanford Universityweb.stanford.edu/.../cs265/Lectures/Lecture11/InClass11.pdf · 2020. 10. 19. · Setting up theUse Lovas LLL g Local Lemma Let Xi Xz,. . ., Xn be TRUE

Returning to our computation

• ElX' ] = E@If isolated})'

= IE Er Er If isolated } I { isolated}

rPl ::: :::B

-

- Erm:*!iii.is +⇐Misiak:'T }=n . (n

- c

) t n in - i ) ( n-" )

• ElX' ] = E@If isolated})'

= IE Er Er If isolated } I { isolated}

rPl ::: :::B

-

- Erm:*!iii.is +⇐Misiak:'T }=n . (n

- c

) t n in - i ) ( n-" )

• ElX' ] = E@If isolated})'

= IE Er Er If isolated } I { isolated}

rPl ::: :::B

-

- Erm:*!iii.is +⇐Misiak:'T }=n . (n

- c

) t n in - i ) ( n-" )

• ElX' ] = E@If isolated})'

= IE Er Er If isolated } I { isolated}

rPl ::: :::B

-

- Erm:*!iii.is +⇐Misiak:'T }=n . (n

- c

) t n in - i ) ( n-" )

• ElX' ] = E@If isolated})'

= IE Er Er If isolated } I { isolated}

rPl ::: :::B

-

- Erm:*!iii.is +⇐Misiak:'T }=n . (n

- c

) t n in - i ) ( n-" )

T Nt- c

t n211 - c )

• Var [XI -- Efx. ] - (EXTanti-o,Te Gi-ok. nai -d

un nl - C

Page 16: Class 11 - Stanford Universityweb.stanford.edu/.../cs265/Lectures/Lecture11/InClass11.pdf · 2020. 10. 19. · Setting up theUse Lovas LLL g Local Lemma Let Xi Xz,. . ., Xn be TRUE

To finish up…T Nt- c

t n211 - c )

• Var [XI -- Efx. ] - (EXTanti-o,Te Gi-ok. nai -d

un nl - C

P {9%3%7} - H -plan -3 - exp f- Can -3) p )

= N- c ( 2 - 3h )

un n- 2C

SECOND MOMENT METHOD :

PIX -03 ⇐ TEETH - Tna .- noSince cat , this is of 1) AM

Page 17: Class 11 - Stanford Universityweb.stanford.edu/.../cs265/Lectures/Lecture11/InClass11.pdf · 2020. 10. 19. · Setting up theUse Lovas LLL g Local Lemma Let Xi Xz,. . ., Xn be TRUE

Recap

• More practice with the LLL and Second Moment Method!• You’ll get even more on your HW J

• We saw how the LLL applies to k-SAT – if you haven’t already watched minilectures for Wednesday on the algorithmic LLL, this will come upagain.