Upload
others
View
3
Download
0
Embed Size (px)
Citation preview
9/15/2020
Sublinear Algorithms
LECTURE 4Last timeβ’ Testing if a graph is connected.
β’ Estimating the number of connected
components.
β’ Estimating the weight of a MST
Todayβ’ Limitations of sublinear-time algorithms
β’ Yaoβs Minimax Principle
Sofya Raskhodnikova;Boston University
Query Complexity
β’ Query complexity of an algorithm is the maximum number of queries the algorithm makes.
β Usually expressed as a function of input length (and other parameters)
β Example: the test for sortedness (from Lecture 2) had query complexity
π log π for constant π, more precisely πlog π
π
β running time β₯ query complexity
β’ Query complexity of a problem π, denoted π π , is the query complexity of the best algorithm for the problem.β What is π(testing sortednesπ )? How do we know that there is no
better algorithm?
Today: Techniques for proving lower bounds on π π .
2
Yaoβs Minimax Principle
4
Consider a computational problem on a finite domain.
β’ The following statements are equivalent.
β’ Need for lower bounds
Yaoβs Minimax Principle (easy direction): Statement 2 β Statement 1.
Statement 1
For any probabilistic algorithm A of complexity π there exists an input π₯ s.t.
Prππππ π‘ππ π ππ ππ π΄
[A(π₯) is wrong] > 1/3.
Statement 2
There is a distribution D on the inputs, s.t. for every deterministic algorithm of complexity q,
Prπ₯βπ·
[A(π₯) is wrong] > 1/3.
Proof of Easy Direction of Yaoβs Principle
5
β’ Consider a finite set of inputs π (e.g., all inputs of length n).
β’ Consider a randomized algorithm that takes an input π₯ β π,makes β€ π queries to π₯ and outputs accept or reject.
β’ Every randomized algorithm can be viewed as a distribution πon deterministic algorithms (which are decision trees).
β’ Let Y be the set of all π-query deterministic algorithms that run on inputs in X.
Proof of Easy Direction of Yaoβs Principle
6
β’ Consider a matrix M with
β rows indexed by inputs π₯ from X,
β columns indexed by algorithms π¦ from π,
β entry π π₯, π¦ = α1 if algorithm π¦ is correct on input π₯0 if algorithm π¦ is wrong on input π₯
β’ Then an algorithm A is a distribution π over columns π with probabilities satisfying Οπ¦βπ π(π¦) = 1.
ππ ππ β¦
ππ 1 0
ππ 1 1
β¦ β±
Rephrasing Statements 1 and 2 in Terms of M
β’ For all distributions π over columns π, there exists a row π₯ s.t.Prπ¦βπ
[π(π₯, π¦) = 0] > 1/3.
β’ There is a distribution D over rows X, s.t. for all columns π¦,Prπ₯βπ·
[π(π₯, π¦) = 0] > 1/3.
7
Statement 1
For any probabilistic algorithm A of complexity q there exists an input π₯ s.t.
Prππππ π‘ππ π ππ ππ π΄
[A(π₯) is wrong] > 1/3.
Statement 2
There is a distribution D on the inputs, s.t. for every deterministic algorithm of complexity q,
Prπ₯βπ·
[A(π₯) is wrong] > 1/3.
Statement 2 β Statement 1
β’ Suppose there is a distribution D over X, s.t. for all columns π¦,Prπ₯βπ·
[π(π₯, π¦) = 0] > 1/3.
β’ Then for all distributions π over Y,Prπ₯βπ·π¦βπ
[π(π₯, π¦) = 0] > 1/3.
β’ Then for all distributions π over Y, there exists a row π₯,Prπ¦βπ
[π(π₯, π¦) = 0] > 1/3.
8
ππ ππ β¦
ππ 1 0
ππ 1 1
β¦ β±
Yaoβs Principle (Easy Direction)
9
β’ Need for lower bounds
Yaoβs Minimax Principle (easy direction): Statement 2 β Statement 1.
NOTE: Also applies to restricted algorithms
β’ 1-sided error tests
β’ nonadaptive tests
Statement 1
For any probabilistic algorithm A of complexity q there exists an input x s.t.
Prππππ π‘ππ π ππ ππ π΄
[A(x) is wrong] > 1/3.
Statement 2
There is a distribution D on the inputs, s.t. for every deterministic algorithm of complexity q,
Prπ₯βπ·
[A(x) is wrong] > 1/3.
Yaoβs Minimax Principle as a game
10
Players: Evil algorithms designer Al and poor lower bound prover Lola.
Game1
Move 1. Al selects a q-query randomized algorithm A for the problem.
Move 2. Lola selects an input on which A errs with largest probability.
Game2
Move 1. Lola selects a distribution on inputs.
Move 2. Al selects a q-query deterministic algorithm with as large probability of success on Lolaβs distribution as possible.
Toy Example: a Lower Bound for Testing 0*
Input: string of n bits
Question: Does the string contain only 0βs or is it π-far form the all-0 string?
Claim. Any algorithm needs (1/π) queries to answer this question w.p. β₯ π/π.
Proof: By Yaoβs Minimax Principle, enough to prove Statement 2.
11
Distribution D on n-bit strings
β’ Divide the input string into 1/Ξ΅ blocks of size Ξ΅π.
β’ Let yi be the string where the ith block is 1s and remaining bits are 0.
β’ Distribution D gives the all-0 string w.p. 1/2 and yi with w.p. 1/2,
where π is chosen uniformly at random from 1, β¦, 1/Ξ΅.
0 0 0 0 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
πΊππΊπ πΊπ πΊπ
A Lower Bound for Testing 0*
Claim. Any π-test for 0* needs (1/π) queries.
Proof (continued): Now fix a deterministic tester A making q < 1/3π queries.
1. A must accept if all answers are 0. Otherwise, it would be wrong on all-0 string, that is, with probability 1/2 with respect to D.
2. Let π1, . . . , ππ be the positions A queries when it sees only 0s. The test can choose its queries based on previous answers. However, since all these answers are 0 and since A is deterministic, the query positions are fixed.
β’ At least 1/π β q > 2
3πof the blocks do not hold any queried indices.
β’ Therefore, A accepts > 2/3 of the inputs yi. Thus, it is wrong with probability
> 2
3πβ π
2=
1
3
Context: [Alon Krivelevich Newman Szegedy 99]
Every regular language can be tested in O(1/π polylog 1/π) time12
0 0 0 0 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
πΊππΊπ πΊπ πΊπ
A Lower Bound for Testing Sortedness
Input: a list of n numbers x1 , x2 ,..., xn
Question: Is the list sorted or π-far from sorted?
Already saw: two different O((log n)/π) time testers.
Known [ErgΓΌn Kannan Kumar Rubinfeld Viswanathan 98, Fischer 01]:
(log n) queries are required for all constant π β€ 1/2
Today: (log n) queries are required for all constant π β€ 1/2
for every 1-sided error nonadaptive test.
β’ A test has 1-sided error if it always accepts all
YES instances.
β’ A test is nonadaptive if its queries do not
depend on answers to previous queries.
13
1-sided Error Property Tester
Far from
YES
YES
Reject with probability β₯ π/π
Donβt care
Accept with probability β₯ π/π
π
1-Sided Error Tests Must Catch βMistakesβ
β’ A pair (π, π) is violated if π < π but π₯π > π₯π
Proof: Every sorted partial list can be extended to a sorted list.
14
Claim. A 1-sided error test can reject only if it finds a violated pair.
1 ? ? 4 β¦ 7 ? ? 9
Yaoβs Principle Game [Jha]
Lolaβs distribution is uniform over the following log π lists:
15
Claim 2. Every pair (π, π) is violated in exactly one list above.
1 1 1 1 1 1 1 1 0 00 0 0 0 0 0β1
β2 1 1 1 1 0 0 0 0 2 22 2 1 1 1 1
1 1 0 0 2 2 1 1 3 23 2 4 4 3 3β3
1 0 2 1 3 2 4 3 5 64 5 7 6 8 7βlog π
...
Claim 1. All lists above are 1/2-far from sorted.
Yaoβs Principle Game: Alβs Move
Al picks a set π = {π1, π2, β¦ , π|π|} of positions to query.
β’ His test must be correct, i.e., must find a violated pair with probability β₯2/3 when input is picked according to Lolaβs distribution.
β’ π contains a violated pair β (ππ , ππ+1) is violated for some π
PrββLolaβ²s distribution
[ ππ , ππ+1 for some π is vilolated in list β] β€π β 1
log π
β’ If π β€2
3log π then this probability is <
2
3
β’ So, π = Ξ©(log π)
β’ By Yaoβs Minimax Principle, every randomized 1-sided error nonadaptive test for sortedness must make Ξ©(log π) queries.
16
? ? ? ?
π1 π2 π3 π|π|β¦
By the Union Bound
18
f(000)
f(111) f(011)
f(100)
f(101)
f(110)f(010)
f(001)
Boolean Functions π βΆ π, π π β {π, π}
Graph representation:
π-dimensional hypercube
β’ 2π vertices: bit strings of length π
β’ 2πβ1π edges: (π₯, π¦) is an edge if π¦ can be obtained from π₯ by increasing one bit from 0 to 1
β’ each vertex π₯ is labeled with π(π₯)
001001
011001
π₯π¦
19
Boolean Functions π βΆ π, π π β {π, π}
Graph representation:
π-dimensional hypercube
β’ 2π vertices: bit strings of length π
β’ 2πβ1π edges: (π₯, π¦) is an edge if π¦ can be obtained from π₯ by increasing one bit from 0 to 1
β’ each vertex π₯ is labeled with π(π₯)
001001
011001
π₯π¦
π(00β―00)
π(11β―11)
Vertices: increasing weight
Monotonicity of Functions
20
[Goldreich Goldwasser Lehman Ron Samorodnitsky,
Dodis Goldreich Lehman Raskhodnikova Ron Samorodnitsky
Fischer Lehman Newman Raskhodnikova Rubinfeld Samorodnitsky]
β’ A function π βΆ 0,1 π β {0,1} is monotone
if increasing a bit of π₯ does not decrease π(π₯).
β’ Is π monotone or π-far from monotone(π has to change on many points to become monontone)?
β Edge π₯π¦ is violated by π if π (π₯) > π (π¦).
Time:
β π(π/π), logarithmic in the size of the input, 2π
β Ξ©( π/π) for 1-sided error, nonadaptive tests
β Advanced techniques: Ξ( π/π2) for nonadaptive tests, Ξ© 3 π
[Khot Minzer Safra 15, Chen De Servidio Tang 15, Chen Waingarten Xie 17]
0
0 0
01
1
1
1
1
1 0
00
0
1
1
monotone
1
2-far from monotone
Hypercube 1-sided Error Lower Bound
21
β’ 1-sided error test must accept if no violated pair is uncovered.
Violated pair:
β A distribution on far from monotone functions suffices.
LemmaEvery 1-sided error nonadaptive test for monotonicity of functions π βΆ
0,1 π β {0,1} requires Ξ© π queries.
01
[Fischer Lehman Newman Raskhodnikova Rubinfeld Samorodnitsky]
Hypercube 1-sided Error Lower Bound
22
β’ Hard distribution: pick coordinate π at random and output ππ.
2 π 1 β coordinate π
1
0
ππ βΆ
ππ(π₯) =
1 if π₯ >π
2+ π
1 β π₯π if π₯ =π
2Β± π
0 if π₯ <π
2β π
The Fraction of Nodes in Middle Layers
E[Y]=
π =
23
Let Y1, β¦ , Ys be independently distributed random variables in [0,1].
Let Y =1
π β Ο
π
π=1Yi (called sample mean). Then Pr Y β E Y β₯ π β€ 2eβ2π π
2.
Hoeffding Bound
2 π 1 β coordinate π
1
0
ππ βΆ
Hypercube 1-sided Error Lower Bound
24
β’ Hard distribution: pick coordinate π at random and output ππ.
Analysis
2 π 1 β coordinate π
1
0
ππ βΆ
β’ Edges from (π₯1, β¦ , π₯πβ1, 0, π₯π+1, β¦ , π₯π) to (π₯1, β¦ , π₯πβ1, 1, π₯π+1, β¦ , π₯π) are violated if both endpoints are in the middle.
β’ The middle contains a constant fraction of vertices.β’ All π functions are π-far from monotone for some constant π.
ππ(π₯) =
1 if π₯ >π
2+ π
1 β π₯π if π₯ =π
2Β± π
0 if π₯ <π
2β π
Hypercube 1-sided Error Lower Bound
25
β’ How many functions does a set of π queries expose?
# functions that a query pair (π₯, π¦) exposesβ€ # coordinates on which π₯ and π¦ differ
β€ 2 π
111011
001001
π₯π¦
π π π
Pair (π₯, π¦)can expose only
functions ππ , ππ and ππ
queries
2 π
1
0
π
π₯
π¦
Only pairs of queries in the Green Band can be violated β disagreements β€ 2 π
Naive Analysis
# functions exposed by π queriesβ€ π2 β 2 π
Hypercube 1-sided Error Lower Bound
26
β’ How many functions does a set of π queries expose?
# functions that a query pair (π₯, π¦) exposesβ€ # coordinates on which π₯ and π¦ differ
β€ 2 π
111011
001001
π₯π¦
π π π
Pair (π₯, π¦)can expose only
functions ππ , ππ and ππ
queries
2 π
1
0
π
π₯
π¦
Only pairs of queries in the Green Band can be violated β disagreements β€ 2 π
Claim# functions exposed by π queries
β€ (π β 1) β 2 π
Hypercube 1-sided Error Lower Bound
27
β’ How many functions does a set of π queries expose?
queries
2 π
1
0
π
π₯
π¦
Claim# functions exposed by π queries
β€ (π β 1) β 2 π
(π₯, π¦) a violation pairβ
Some adjacent pair of vertices in a minimum spanning forest on the query set
is also violatedsufficient to consider adjacent vertices in a minimum spanning forest
on the query set
Hypercube 1-sided Error Lower Bound
28
β’ How many functions does a set of π queries expose?
queries
2 π
1
0
π
π₯
π¦
Claim# functions exposed by π queries
β€ (π β 1) β 2 π
β
ClaimEvery deterministic test that makes a set π of π queries (in the middle)
succeeds with probability ππ
πon our distribution. ⨳