Presentation is loading. Please wait.

Presentation is loading. Please wait.

Property Testing (a.k.a. Sublinear Algorithms )

Similar presentations


Presentation on theme: "Property Testing (a.k.a. Sublinear Algorithms )"— Presentation transcript:

1 Property Testing (a.k.a. Sublinear Algorithms )
Jesper Nederlof Trial lecture UiB

2 Outline Introduction ‘Easy’ testing (More) advanced testing
Vector identity testing ‘Easy’ testing Half-plane testing Sortedness testing (More) advanced testing Linearity testing Probalistically Checkable Proofs More results known Conclusion

3 Observations on applications
“Constant time is the new polynomial time” Massive datasets The Internet Scientific measurements (lhc) Online social networks Slow (or costly) access to data Implicit data (an experiment per data point) Huge datasets can’t be stored in RAM memory. Most convential algorithm do not seem to be suitable for such situations, so... Can we give algorithms using an amount of time smaller than the input size? Specifically: if     denotes The input size, what can be done in         time?

4 Origin of Property testing
[BLR93]: Implicit in their influential Linearity testing algorithm. [RS96]: Explicitly defined when testing whether a function is a low-degree polynomial. [GGR98]: initiated a more general studied, also testing combinatorial properties as graphs.

5 Vector identity testing
Given two vectors                      . Is           ? Not possible in         time! Example: suppose                                      and                                     , then the answer is no. Suppose we allow constant error probability. Still not possible: if we check    coordinates uniformly and independently at random and         differ on    coordinates, we get error probability                                                      . Solution in property testing: assume that    is high! Using                                

6 Property tester definition
Definition Given a property    , a tester for     is an algorithm that, given an input     and real number   , returns YES with probability at least        if     has property    , and NO with probability at least        if     is   -far from    .   -far means that we have to make at least        modifications to     to let it have property    . Unless otherwise specified a ‘modification’ is a simple bitflip. Tester returns NO with probability at least       . Tester returns YES with probability at least       . Don’t care. YES Far from       

7 Vector identity testing
Given two vectors                       . Property    : is           ? THEOREM Property     can be tested in      time. Proof. Sample      positions uniformly and indep. at random, If a difference is found, return NO, return YES otherwise. Clearly, if           , YES is returned On the other hand, if         differ in at least      coordinates, the error probability is                                             .

8 Outline Introduction ‘Easy’ testing (More) advanced testing
Vector identity testing ‘Easy’ testing Half-plane testing Sortedness testing (More) advanced testing Linearity testing Probalistically Checkable Proofs More results known Conclusion

9 Half-plane testing Given an ‘image’ represented as an
matrix (see on the right). Is an half-plane? Again, a conventional algo is impossible. How fast can we test the half-plane property?   -far is defined in the natural way: we have to modify at least        of the cells to obtain a half-plane. THEOREM The half-plane property can be tested in             time.

10 Half-plane testing The following input is       -far:

11 Half-plane testing The following input is       -far:

12 Half-plane testing The following input is       -far:

13 Half-plane testing The algorithm is the following:
Query the 4 corners. There are either 0,2 or 4 sides with different colors. ?

14 Half-plane testing The algorithm is the following:
Query the 4 corners. There are either 0,2 or 4 sides with different colors. If the number is 4, return NO

15 Half-plane testing The algorithm is the following:
Query the 4 corners. There are either 0,2 or 4 sides with different colors. If the number is 4, return NO If the number if 0, test if all pixels have the same color (as previously)

16 Half-plane testing The algorithm is the following:
Query the 4 corners. There are either 0,2 or 4 sides with different colors. If the number is 4, return NO If the number if 0, test if all pixels have the same color (as previously) So suppose there are two different sides

17 Takes time with binary search.
Half-plane testing So suppose there are two different sides On both sides find 2 differently colored pixels within distance at most         . Query         pixels from            . Return YES iff all pixels are correct. Analysis: If the picture is a half-plane,      and       only have correct pixels. The case where the picture is   -far remains.          B W Takes             time with binary search.

18 Half-plane testing B W If we need to modify at least
pixels to obtain a half-plane, then there are at least           wrong pixels in            . Hence, the probability that a uniformly at random taken pixel is wrong is at least       . The theorem follows similarly to the previous example.          B W          THEOREM The half-plane property can be tested in             time.

19 Sortedness Checking Given a trial lecture audience (you)
Test the property whether you are sorted on wealthiness. Private information, so minimize queries. We want to answer YES (with probability      ) if you are sorted and NO (with probability       ) if you are   -far from sorted.   -far means we have to give at least      people money to make you sorted (           ) Or take from [EKKRW98, Fischer01]:               is required THEOREM Can be done using                   queries.

20 Sortedness Checking Given integers Idea 1: choose random and reject if
Fails on Idea 2: choose random          and reject if        Fails on Idea 3: Create a directed graph      (on blackboard) Pick a random arc          from this graph Reject if               

21 Sortedness Checking . Idea 3: Create a directed graph
Pick a random arc          from this graph Reject if                If sorted this will never reject Lemma If   -far from sorted, this rejects with prob.               . Note that given this lemma the theorem follows since repeating the test            times gives error probability                                                                               .

22 Sortedness Checking Call an arc bad if and good otherwise.
Lemma If   -far from sorted, this rejects with prob.               . Proof. Call an arc          bad if              and good otherwise. Call a vertex      of      bad if it is adjacent to a bad arc and good otherwise. Claim All good number      are sorted. Proof. Take two good numbers      and     . They are connected by a path of at most two good edges              and             , thus                     .                                   

23 Sortedness Checking Call an arc bad if and good otherwise.
Lemma If   -far from sorted, this rejects with prob.               . Proof. Call an arc          bad if              and good otherwise. Call a vertex      of      bad if it is adjacent to a bad arc and good otherwise. Claim All good number      are sorted. Claim If the input is   -far, there are          bad edges. Proof. Then there are at least      bad numbers by first claim. Each bad number is caused by a bad edge; moreover, one edge can only cause two bad edges.

24 Sortedness Checking Call an arc bad if and good otherwise.
Lemma If   -far from sorted, this rejects with prob.               . Proof. Call an arc          bad if              and good otherwise. Call a vertex      of      bad if it is adjacent to a bad arc and good otherwise. Claim All good number      are sorted. Claim If the input is   -far, there are          bad edges. Now the lemma follows since      has at most             arcs. And at least          of them are bad.

25 Outline Introduction ‘Easy’ testing (More) advanced testing
Vector identity testing ‘Easy’ testing Half-plane testing Sortedness testing (More) advanced testing Linearity testing Probalistically Checkable Proofs More results known Conclusion

26 Linearity testing The most important property testing algorithm
Also called BLR test after it’s inventors (Blum, Luby and Rubinfeld (1993) In the following we work modulo   . A function                                 is linear if For two vectors                        we write                                                       , for some                                                                               .     is linear iff for every                                                .

27 Linearity testing This suggests the following test:
Pick     and     uniformly and independently at random Accept YES iff                                       . If     is linear, this answers YES Theorem If     is   -far from linear, at least a    fraction of the pairs                        fail the above test. Proof. (Fourier analysis)

28 Probabilistically Checkable Proofs
We all know that         is defined as the set of problems whose proofs of being a YES instance can be checked in polynomial time. For example the following problem is in         CNF-Sat Given:A CNF formula on     variables                 . Asked:Is it satisfiable? For example, the CNF formula is satisfied with                      ,                                                                                                                         ,

29 Probabilistically Checkable Proofs
Alice (verifier) Bob (prover) Initially, they can decide a protocol. Then a CNF-formula     appears. Bob is a genius and can write a proof of the satisfiability of     instantaneously, but cannot be trusted. Alice can solve problems in             . How much bits of Bob’s proof has Alice to query in order to be convinced? Easy:     bits suffices.

30 Probabilistically Checkable Proofs
Alice (verifier) Bob (prover) He will always try to convince Alice that     is not satisfiable. Initially, they can decide a protocol. Then a CNF-formula     appears. Bob is a genius and can write a proof of the satisfiability of     instantaneously, but cannot be trusted. Alice can solve problems in             . How much bits of Bob’s proof has Alice to query in order to be convinced? Easy:     bits suffices. ‘Convinced’ means: if     is satisfiable, there exists a proof that always convinces Otherwise, every proof fails to convince Alice with probability at least       .

31 PCP theorems [AS92] Only queries! [ALM+92] Only queries and
              coin flips!! [Hås97] Only 3 queries!!! Has applications to show lower bounds on approximations algorithms under                        . Obtained by finding a protocol such that Bob’s proof must either be valid or very invalid. Then Alice uses property testing techniques. (Variants of) linearity testing is one of the main ingredients.

32 Outline Introduction ‘Easy’ testing (More) advanced testing
Vector identity testing ‘Easy’ testing Half-plane testing Sortedness testing (More) advanced testing Linearity testing Probalistically Checkable Proofs More results known Conclusion

33 More results known . Given a function testing if
    is    -junta can be done using                  queries. Testing if     can be computed by a circuit of size    can be done using          queries.    -colorability:            Triangle freeness:                   (regularity lem.)                        .    times

34 Outline Introduction ‘Easy’ testing (More) advanced testing
Vector identity testing ‘Easy’ testing Half-plane testing Sortedness testing (More) advanced testing Linearity testing Probalistically Checkable Proofs More results known Conclusion

35 Conclusions Property testing is a very natural task, sublinear time is a very welcome property. Sublinear algorithms can be highly non-trivial. Many algorithms only depend on   , not on the input at all. Connections to coding theory (linearity testing), additive combinatorics(regularity lemma), approximation algorithms (PCP’s), learning theory,....

36 Further notes Part of this lecture where based on Lecture notes ‘Sublinear algorithms’ by Sofya Raskhodnikova. Survey ‘Algorithmic and Analysis Techniques in Property Testing’ by Dana Ron. ‘Computational Complexity’ by Arora and Barak (on PCP’s).

37 Thanks for listening!!


Download ppt "Property Testing (a.k.a. Sublinear Algorithms )"

Similar presentations


Ads by Google