Patent Publication Number: US-11048694-B2

Title: Median based estimation of database query responses

Description:
STATEMENT REGARDING PRIOR DISCLOSURES BY THE INVENTORS 
     The following disclosure is submitted under 35 U.S.C. § 102(b)(1)(A): “Generalization for Adaptively-chosen Estimators via Stable Median”; Vitaly Feldman, Thomas Steinke; Proceedings of Machine Learning Research vol 65:1-30, Jun. 20, 2017. 
     BACKGROUND 
     The present invention relates to computer systems, and more specifically, to database querying and related methods. 
     A database that includes data points selected randomly from a larger population may be queried for a pattern. The pattern, however, may not fully generalize the entire population or data points in the database, but instead, may occur by chance. 
     Modern data analysis may be considered an iterative process in which multiple algorithms are run on the same data points, often in an adaptive fashion. The algorithms used in each step of the iterative process may depend on the results from previous steps. Human decisions may also introduce additional, implicit dependencies between the data and the algorithms being run. In contrast, theoretical analysis in machine learning and statistical inference generally focuses on fixed and pre-specified algorithms run on “fresh” data. 
     SUMMARY 
     A computer system may include a processor and a memory coupled thereto. The memory may include a database. The processor may be configured to randomly split the database into a plurality of sub-databases, and apply a database query to the plurality of sub-databases. The processor may also be configured to generate a plurality of respective estimated query response values for each sub-database based upon applying the database query, calculate a median of the estimated query response values, generate a probability distribution based upon the estimated query response values and the calculated median, and select a final estimated query response value based upon the probability distribution. 
     The processor may be configured to generate the probability distribution by at least weighting the plurality of estimated query response values based upon proximity to the calculated median. The processor may be configured to select the final estimated query response by at least selecting one of the weighted plurality of respective estimated query response values based upon the weighting as the final estimated query response, for example. 
     The processor may be configured to generate the probability distribution by at least sampling each of the plurality of estimated query response values based upon e −ϵ|a     v     −b     v     |  wherein ϵ is a predetermined parameter, a v  is a number of the estimated query response values greater than the selected estimated query response value, and b v  is a number of the estimated query response values less than the selected estimated query response value. 
     Each of the plurality of estimated query response values may be sampled from a set of possible query response values proportional to e −ϵ|a     v     −b     v     | , for example. 
     The processor may be configured to determine ϵ according to 
               ϵ   =           log   e     ⁢        T          +   6     m       ,         
wherein T is a set of possible query response values. The processor may be configured to generate the probability distribution so that the probability distribution at any point is given by
 
             P     e       -   ϵ     ⁢           ⁢   l             
wherein P is the probability distribution, and l is a number of points between a given estimated query response value and the median, for example. The database may include a medical database of patient medical data. The database may include a machine learning database, for example.
 
     Another aspect is directed to a computer-implemented method for estimating a response to a database query. The method may include randomly splitting the database into a plurality of sub-databases, applying a database query to the plurality of sub-databases, and generating a plurality of respective estimated query response values for each sub-database based upon applying the database query. The method may also include calculating a median of the estimated query response values and generating a probability distribution based upon the estimated query response values and the calculated median. The method may further include selecting a final estimated query response value based upon the probability distribution. 
     Another aspect is directed to a computer-readable medium for estimating a response to a database query. The computer-readable medium may include computer-executable instructions that when executed by a processor cause the processor to perform operations that may include randomly splitting the database into a plurality of sub-databases, applying a database query to the plurality of sub-databases, and generating a plurality of respective estimated query response values for each sub-database based upon applying the database query. The operations may also include calculating a median of the estimated query response values, generating a probability distribution based upon the estimated query response values and the calculated median, and selecting a final estimated query response value based upon the probability distribution. 
    
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         FIG. 1  is a schematic block diagram of a computer system according to an embodiment. 
         FIG. 2  is a flow diagram of operation of the computer system of  FIG. 1 . 
     
    
    
     DETAILED DESCRIPTION 
     Referring initially to  FIG. 1  and the flowchart  40  in  FIG. 2 , a computer system  20  for estimating queries includes a memory  21  and a processor  22  coupled to the memory. The memory  21  includes a database  23 , which may include, for example, medical data. 
     Beginning at Block  42 , the processor  22  randomly splits the database  23  into smaller sub-databases  24   a - 24   n  (Block  44 ). More particularly, the database  23  (“Database  5 ”), as an input that includes n samples, is split into sub-databases  24   a - 24   n  that includes subsamples S 1 , S 2 , . . . , S m  each including t samples. Random disjoint subsets may be chosen so that 
     
       
         
           
             m 
             = 
             
               
                 ⌊ 
                 
                   n 
                   t 
                 
                 ⌋ 
               
               . 
             
           
         
       
     
     The processor  22  applies a database query ϕ to the sub-databases  24   a - 24   n  and generates respective estimated query response values for each sub-database based upon applying the database query (Blocks  46   a - 46   m ). The processor  22  calculates a median of the estimated query response values and generates a probability distribution based upon the estimated query response values and the calculated median. The processor  22  may generate the probability distribution by at least weighting the estimated query response values based upon proximity to the calculated median. 
     The processor  22  selects a final estimated query response value based upon the probability distribution. The processor  22  may select the final estimated query response value based upon the weighting. In other words, the processor  22  aggregated the estimated query response values and the answer v is chosen from T randomly according to how close it is to the median of the value, as will be explained in further detail below (Block  48 ) before ending at Block  50 . 
     More particularly, the processor  22 , for each query ϕ and response range T performs the following:
         a. Evaluates the query ϕ on each of the subsamples to obtain values v 1 =ϕ(S 1 ), v 2 =ϕ(S 2 ) . . . , v m =ϕ(S m ) (Blocks  46   a ,  46   b , . . .  46   m );   b. Selects a value v from T randomly according to a weighting that prioritizes values close to the median of obtained values: v 1 , v 2 , . . . , v m . (Block  48 ). One technique for this selection includes sampling each v from T based upon, for example, proportional to, e −ϵ|a     v     −b     v     | . Here ϵ is a predetermined parameter selected prior to selecting the value v. In some embodiments, ϵ may be set according to,       

     
       
         
           
             
               ϵ 
               = 
               
                 
                   
                     
                       log 
                       e 
                     
                     ⁢ 
                     
                        
                       T 
                        
                     
                   
                   + 
                   6 
                 
                 m 
               
             
             , 
           
         
       
         
         
           
              wherein a v  is the number of values v 1 , v 2 , . . . , v m  that are greater than v (i.e., v i &gt;v), and b v  is the number of values v 1 , v 2 , . . . , v m  that are less than v (i.e., v i &lt;v); and 
             c. Returns the randomly sampled value v as the answer to the query ϕ. 
           
         
       
    
     The processor  22 , according to the algorithm it is executing, also sets the set T of possible response values, which is provided as an input along with the query to the algorithm. The set can be specified explicitly or given as a range of values[A, B] with step size z. Thus, T={A, A+z, A+2z, . . . , B−z,B}. If z is not given then the preferred value is set as z=(B−A)/t. As described above, the representative value v is chosen from the set T. 
     As will be appreciated by those skilled in the art, the system advantageously answers multiple queries in a manner that responses are increasingly accurate even when each query is chosen in a way that depends on the answers returned for previous queries. The computer system  20  may thus answer arbitrary numerical (real-valued) queries. 
     In contrast to the computer system  20 , prior art approaches for answering queries may include running each query on the whole database once and using the value, running each query on a single random subset of the dataset and using the value, and running each query on several random subsets and using the median of the values. However, all of these approaches are known to produce answers that have a relatively low accuracy for the population on common sequences of queries that depend on each other. For example, in a binary classification problem, a standard sequence of queries arises as follows: (i) Use queries to find variables that are noticeably positively correlated with the label (e.g. more than two standard deviations larger than 0); (ii) Build a classifier that takes a majority vote of the selected positively correlated variables; and (iii) Use a further query to estimate the accuracy of this classifier. This classifier will often predict the label on the database much better than on the population. Therefore the final query that measures the accuracy of this classifier cannot be accurately answered by simply evaluating the query on the whole database and using that value. One prior art approach that addresses risks to accuracy that arise from dependencies between the queries is a different algorithm that evaluates the numerical query once and then adds a randomly chosen value to it. This algorithm is only known to provide accurate responses to certain types of queries (namely those whose value has low numerical sensitivity to each data point) and has a fixed level of accuracy. In contrast, the computer system  20  provides increased accuracy responses to arbitrary numerical queries and exploits the variability of the value of the query on the database. 
     1. Detailed System And Algorithm 
     Further details of the computer system  20  will now be described. The computer system  20  of the present embodiments demonstrates that a relatively straightforward algorithm may provide increasingly accurate answers to adaptively-chosen queries corresponding to arbitrary real-valued estimators. Specifically, let ϕ:X t →  be an arbitrary estimator, where the expectation E z ˜p t [ø(Z)] is equal (in which case the estimator is referred to as unbiased) or sufficiently close to some parameter or value of interest. The number of samples t that ϕ uses corresponds to the desired estimation accuracy (naturally, larger values of t allow more accurate estimators). The present algorithm estimates the expectation E z ˜p t [ø(Z)] to within (roughly) the standard deviation of ϕ(Z)—i.e. τ≈sd(ø(p t ))=√{square root over (Var z˜p     t   [ø(Z)])}—or, more generally, to within the interquartile range of the distribution of ϕ on fresh data (i.e. the distribution of ϕ(Z) for Z˜   t , which is denoted by ϕ(   t )). If 
               ϕ   ⁡     (   s   )       =       1   t     ⁢       ∑     i   =   1     t     ⁢     ψ   ⁡     (     s   i     )                 
for a function ψ:X→[−1,1], then the error roughly scales as τ≈sd(ψ( ))/√{square root over (t)}. This gives a natural interpretation of t as an accuracy parameter.
 
     In contrast, given a comparable number of samples, existing algorithms for statistical queries give an estimate with accuracy roughly τ≈√{square root over (1/t)} regardless of the variance of the query. This is not just an artifact of existing analysis since, to ensure the desired level of differential privacy, this algorithm adds noise whose standard deviation scales as √{square root over (1/t)}. For a statistical query, ψ:X→[−1,1], the standard deviation of ψ( ) is upper bounded by 1, but is often much smaller. For example, when estimating the accuracy of a binary classifier with (low) error p the present algorithm will give an estimate with accuracy that scales as √{square root over (p/t)}, rather than √{square root over (1/t)}. 
     The algorithm implemented by the system  20  will now be described more formally starting with a relatively simple case of statistical queries. Given a statistical query ψ:X→[−1,1] and t fresh random i.i.d. samples ZϵX t  drawn from  , the empirical mean estimator 
               ϕ   ⁡     (   Z   )       ⁢     =   .     ⁢       1   t     ⁢       ∑     i   ∈     [   t   ]                 ⁢     ψ   ⁡     (     Z   i     )                 
is an unbiased estimator of E X˜p [ψ(X)], with a standard deviation equal to sd(ψ(P))/√{square root over (t)}. Applied to such estimators, the algorithm answers adaptively-chosen statistical queries with accuracy that scales as sd(ψ( ))/√{square root over (t)}.
 
     Theorem 1.1: For all ζ&gt;0, tϵ , β&gt;0, kϵ , and n≥n 0 =O(t√{square root over (k log(1/β))} log(k/βζ), there exists an efficient algorithm M that, given n samples from an unknown distribution p, provides answers v 1 , . . . , v k ϵ[−1,1] to an adaptively-chosen sequence of queries ψ 1 , . . . , ψ k :X→[−1,1] and satisfies: 
     
       
         
           
             
               
                 Pr 
                 
                   
                     S 
                     ~ 
                     
                       𝒫 
                       n 
                     
                   
                   ⁢ 
                   
                     
 
                   
                   ⁢ 
                   
                     M 
                     ⁡ 
                     
                       ( 
                       S 
                       ) 
                     
                   
                 
               
               ⁡ 
               
                 [ 
                 
                   ∀ 
                   
                     j 
                     ∈ 
                     
                       
                         
                           [ 
                           k 
                           ] 
                         
                         ⁢ 
                         
                            
                           
                             
                               v 
                               j 
                             
                             - 
                             
                               
                                 E 
                                 
                                   X 
                                   ~ 
                                   𝒫 
                                 
                               
                               ⁡ 
                               
                                 [ 
                                 
                                   
                                     ψ 
                                     j 
                                   
                                   ⁡ 
                                   
                                     ( 
                                     X 
                                     ) 
                                   
                                 
                                 ] 
                               
                             
                           
                            
                         
                       
                       ≤ 
                       
                         
                           2 
                           · 
                           
                             
                               sd 
                               ⁡ 
                               
                                 ( 
                                 
                                   
                                     ψ 
                                     j 
                                   
                                   ⁡ 
                                   
                                     ( 
                                     𝒫 
                                     ) 
                                   
                                 
                                 ) 
                               
                             
                             
                               t 
                             
                           
                         
                         + 
                         ζ 
                       
                     
                   
                 
                 ] 
               
             
             ≥ 
             
               1 
               - 
               
                 β 
                 . 
               
             
           
         
       
     
     Note that the present algorithm also has an additional ζ precision term. The dependence of sample complexity on 1/ζ is logarithmic and can be further improved using more involved algorithms. Thus the precision term, ζ, like the failure probability β, can be made negligibly small at little cost. Prior technique give an error bound of √{square root over (1/t)}, which is at least as large (up to constant factors) as the bound sd(ψ j ( ))/√{square root over (t)}+ζ, when ζ≤1/t. For comparison, in the non-adaptive setting the same error may be obtained using n=O(t log(k/β)) samples (with ζ=1/t). 
     Note that, for simplicity, in Theorem 1.1 the range of each query is normalized to [−1,1]. However this normalization affects only the precision term ζ. In particular, for queries whose range is in an interval of length at most b, the number of samples desired for the result to get precision ζ scales logarithmically in b/ζ. In contrast, the sample complexity of previous results scales quadratically in b. Further, a more refined statement discussed below allows handling queries with arbitrary range. 
     For general real-valued estimators of the form ϕ:X t →[−1,1], the algorithm gives the following: (For simplicity it is assumed that t is fixed for all the queries.) 
     Theorem 1.2 For all ζ&gt;0, tϵ , β&gt;0, kϵ , and n≥n 0 =O(t√{square root over (k log(1/β))} log(k/βζ)), there exists an efficient algorithm M that, given n samples from an unknown distribution  , provides answers v 1 , . . . , v k ϵ[−1,1] to an adaptively-chosen sequence of queries ϕ 1 , . . . , ϕ k :X t →[−1,1] and satisfies: 
                 Pr       S   ~     𝒫   n       ⁢     
     ⁢     M   ⁡     (   S   )           [     ∀     j   ∈         [   k   ]     ⁢            v   j     -       E     Z   ~     𝒫   t         ⁡     [       ϕ   j     ⁡     (   Z   )       ]                ≤       2   ·     sd   ⁡     (       ϕ   j     ⁡     (     𝒫   t     )       )         +   ζ           ]     ≥     1   -     β   .             
For general estimators, prior technique given accuracy or accuracy guarantees in terms of the worst-case sensitivity. More formally, for ϕ:X n → , let Δ(ϕ) denote the worst-case sensitivity of ϕ—that is, Δ(ϕ)=max z,z′ ,ϕ(z)−ϕ(z′), where the maximum is over z, z′ϵX n  that differ in a single element. Prior techniques and analysis show that for k adaptively-chosen queries ϕ 1 , . . . , ϕ k , each query ϕ i , can be answered with accuracy
 
                 n   ·     k         ·     Δ   ⁡     (     ϕ   i     )             
(ignoring logarithmic factors and the dependence on the confidence β). This setting is somewhat more general than the seeing in the present algorithm, since each query is applied to the entire dataset available to the algorithm, whereas with respect to the present setting, each query is applied to fixed-size sub-samples of the dataset. This means that in this setting, the space of estimators that can be applied to data is richer than the present space of estimators and might allow better estimation of some underlying quantity of interest. At the same time, the present techniques give better accuracy guarantees for finding the expectation of each estimator.
 
     To see the difference between the present setting and that in prior approaches, consider estimation of the lowest expected loss of a function from a family  , namely L*≅   [L(f, X)], where L: ×X→[−R, R] is some loss function. Given a dataset s of size n, the standard ERM estimator is defined as 
                 ϕ   n     ⁡     (   s   )       ⁢     =   .     ⁢       min     f   ∈   ℱ       ⁢       1   n     ⁢       ∑     i   ∈     [   n   ]                 ⁢       L   ⁡     (     f   ,     s   i       )       .                 
Using uniform convergence results, one can often obtain that |L*− [ϕ n (S)]|=O(d/√{square root over (n)}), for some d that measures the capacity of   and also depends on L. The sensitivity of the estimator ϕ n  is upper bounded by 2R/n. Thus prior art algorithms give an estimate of  [ϕ n  (S)] within (roughly)
 
             R   ·         k     n             
and an upper bound on the total error will scale as (d+R·k 1/4 )/√{square root over (n)}. In the present setting, the estimator ϕ t  will be used, where t scales as n/√{square root over (k)}. The bias of this estimator is |L*− [ϕ t (S)]|=O (d/√{square root over (t)})=O(d·k 1/4 /√{square root over (n)}). At the same time  [ϕ t (S)] can be estimated within (roughly) the standard deviation of ϕ t . The standard deviation of ϕ t  is typically always upper bounded by 2R·√{square root over (t)}=R·k 1/4 /√{square root over (n)}, but is often much smaller. Hence, depending on the setting of the parameters and the distribution  , the present approach described herein gives an error bound that is either higher by a factor of k 1/4  or lower by a factor of R/d than the prior art approaches. In other words, the prior art approaches and the present approach provide incomparable guarantees for this problem.
 
     Both Theorem 1.2 and Theorem 1.1 are corollaries of the following more general result. Define
 
 qi   ( a,b )≐{ v ϵ : [ Y≤v ]&gt; a ∧ [ Y&lt;v ]&lt; b  
 
to be the (a, b)-quantile interval of the distribution  . The (¼,¾)-quantile interval is referred to as the interquartile interval.
 
     Theorem 1.3: 
     For all T⊂  with |T|&lt;∞, tϵ , β&gt;0, kϵ , and n≥n 0 =O(t√{square root over (k log(1/β))} log(|T|k/β)), there exists an efficient algorithm M that, given n samples from an unknown distribution  , provides answers v 1 , . . . , v k ϵT to an adaptively-chosen sequence of queries ϕ 1 , . . . , ϕ k :X t →T and satisfies: 
     
       
         
           
             
               
                 Pr 
                 
                   
                     S 
                     ~ 
                     
                       𝒫 
                       n 
                     
                   
                   ⁢ 
                   
                     
 
                   
                   ⁢ 
                   
                     M 
                     ⁡ 
                     
                       ( 
                       S 
                       ) 
                     
                   
                 
               
               [ 
               
                 ∀ 
                 
                   j 
                   ∈ 
                   
                     
                       [ 
                       k 
                       ] 
                     
                     ⁢ 
                     
                       v 
                       j 
                     
                   
                   ∈ 
                   
                     
                       qi 
                       
                         
                           ϕ 
                           j 
                         
                         ⁡ 
                         
                           ( 
                           
                             𝒫 
                             t 
                           
                           ) 
                         
                       
                     
                     ⁡ 
                     
                       ( 
                       
                         
                           1 
                           4 
                         
                         , 
                         
                           3 
                           4 
                         
                       
                       ) 
                     
                   
                 
               
               ] 
             
             ≥ 
             
               1 
               - 
               
                 β 
                 . 
               
             
           
         
       
     
     Two remarks may be made about the guarantee of the theorem: 
     Accuracy in Terms of Interquartile Interval: 
     The accuracy guarantee of Theorem 1.3 is that each returned answer lies in the (¼,¾)-quantile interval of the distribution of the query function on fresh data (i.e. the distribution ϕ(   t )). The length of this interval is referred to as the interquartile range. This guarantee may appear strange at first sight, but it is actually a strengthening of Theorem 1.2 by Chebyshev&#39;s inequality, the interquartile interval of any distribution   lies within two standard deviations of the mean: 
     
       
         
           
             
               
                 qi 
                 𝒟 
               
               ⁡ 
               
                 ( 
                 
                   
                     1 
                     4 
                   
                   , 
                   
                     3 
                     4 
                   
                 
                 ) 
               
             
             ⊆ 
             
               
                 [ 
                 
                   
                     
                       
                         E 
                         
                           Y 
                           ~ 
                           𝒟 
                         
                       
                       ⁡ 
                       
                         [ 
                         Y 
                         ] 
                       
                     
                     - 
                     
                       2 
                       · 
                       
                         sd 
                         ⁡ 
                         
                           ( 
                           𝒟 
                           ) 
                         
                       
                     
                   
                   , 
                   
                     
                       
                         E 
                         
                           Y 
                           ~ 
                           𝒟 
                         
                       
                       ⁡ 
                       
                         [ 
                         Y 
                         ] 
                       
                     
                     - 
                     
                       2 
                       · 
                       
                         sd 
                         ⁡ 
                         
                           ( 
                           𝒟 
                           ) 
                         
                       
                     
                   
                 
                 ] 
               
               . 
             
           
         
       
     
     However, the interquartile interval may be significantly smaller if   is heavy-tailed. If, for example, the distribution   has infinite variance, then the present guarantee is still useful, whereas bounds in terms of standard deviation will be meaningless. This formulation does not even assume that the quantity of interest is the expectation of ϕ(   t ) (or even that this expectation exists). In fact, ϕ could be a biased estimator of some other parameter of interest. 
     Intuitively, this accuracy guarantee may be interpreted as follows. If it is know that a sample from ϕ(   t ) is an acceptable answer with probability at least ¾, and the set of acceptable answers forms an interval, then with high probability the answer returned by the present algorithm is acceptable. The constants ¼ and ¾ are, of course, arbitrary. More generally, v j ϵ ( a, b ) for any 0≤a&lt;b≤1 may be demanded. However, this reduction increases the sample complexity n 0  by a factor of 1/(b−a) 2 . 
     Finite Range T: 
     Theorem 1.3 assumes that the queries have a finite range. This is necessary for the present algorithm, as the required number of samples grows with the size of T, albeit slowly. Using a more involved algorithm, it may be possible to improve the dependence on the size of T from O(log|T|) to 2 O(log*|T|) , where log* denotes the iterated logarithm—an extremely slow-growing function. To obtain Theorem 1.2 from Theorem 1.3, T is set to be the discretization of [−1,1] with granularity and round the output of ϕ:X t →[−1,1] to the nearest point in T; this introduces the additive error ζ. However, allowing T to be arbitrary provides further flexibility. For example, T could be a grid on a logarithmic scale, yielding a multiplicative, rather than additive, accuracy guarantee. Furthermore, in some settings the range of the query is naturally finite and the scale-free guarantee of Theorem 1.3 comes at no additional cost. It should also be noted that, in general, the present result allows a different T j  to be chosen (adaptively) for each query ϕ j  as long as the size of each T j  is upper-bounded by some fixed value. 
     Another advantage of this formulation is that it removes the dependence on the entire range of ϕ: If it is known that the interquartile interval of ϕ(   t ) lies in some interval [a, b], the output range of ϕ to [a, b] may be truncated (and then discretize if desired). This operation does not affect the interquartile interval of ϕ(   t ), and hence does not affect the guarantees of the present algorithm. In particular, this means that in Theorem 1.2 the range of each ϕ is bounded in [−1,1] does not need to be assumed; it is sufficient to assume that the interquartile interval of ϕ(   t ) lies in [−1,1] to obtain the same guarantee. For example, if it is known beforehand that the mean of ϕ(   t ) lies in [−1,1], and its standard deviation is at most 1, then the range of ϕ may be truncated to [−3,3]. 
     Verification Queries: 
     Queries that ask for “verification” of a given estimate of the expectation of a given estimator will not be considered—each query is specified by a function ϕ:X t →  and a value (or “guess”) vϵ . The task of the present algorithm is to check whether or not vϵ (ρ,1−ρ) for some ρ chosen in advance. Such queries are used in a reusable holdout setting and in the EffectiveRounds algorithm that uses fresh subset of samples when a verification query fails. Provided is an algorithm for answering adaptively-chosen verification queries with the following guarantees. 
     Theorem 1.4 For all α, β, ρϵ(0,1/4) with α&lt;ρ and t, l, k, nϵ  with 
                 n   ≥     n   0       =     O   (       t   ⁢       ℓlog   ⁡     (     1   αβ     )         ⁢     log   ⁡     (     k   β     )       ⁢   ρ       α   2       )       ,         
there exists an efficient algorithm M that, given n samples from an unknown distribution  , provides answers to an adaptively-chosen sequence of queries (ϕ 1 , v 1 ), . . . , (ϕ k , v k ) (where ϕ j :X t →  and v j ϵ  for all jϵ[k]) and satisfies the following with probability at least 1−β: for all jϵ[k]
         If v j ϵ (ρ,1−ρ), then the algorithm outputs “Yes”.   If v j ∈ (ρ−α,1−ρ+α) the algorithm outputs “No”.       

     If neither of these two cases applies, the algorithm may output either “Yes” or “No.” 
     However, once the algorithm outputs “No” in response to l queries, it stops providing answers. 
     To answer the l queries that do not pass the verification step the present algorithm may be used for answering queries in Theorem 1.3 (with k there set to l here). 
     Answering Many Queries: 
     Finally, described herein is an (inefficient) algorithm that requires a dataset whose size scales as log k at the expense of an additional √{square root over (t log|X|)} factor. 
     Theorem 1.5 
     For all T⊂  with |T|&lt;∞, tϵ , β&gt;0, kϵ , and 
                 n   ≥     n   0       =     O   ⁡     (       t     3   2       ·       log   ⁢        𝒳        ⁢     log   ⁡     (     1   β     )           ·     log   ⁡     (       k   ⁢           ⁢   log   ⁢        T          β     )         )         ,         
there exists an algorithm M that, given n samples from an unknown distribution   supported on X, provides answers v 1 , . . . , v k ϵT to an adaptively-chosen sequence of queries ϕ 1 , . . . ϕ k :X t →T and satisfies
 
     
       
         
           
             
               
                 Pr 
                 
                   
                     S 
                     ~ 
                     
                       𝒫 
                       n 
                     
                   
                   ⁢ 
                   
                     
 
                   
                   ⁢ 
                   
                     M 
                     ⁡ 
                     
                       ( 
                       S 
                       ) 
                     
                   
                 
               
               ⁡ 
               
                 [ 
                 
                   ∀ 
                   
                     j 
                     ∈ 
                     
                       
                         [ 
                         k 
                         ] 
                       
                       ⁢ 
                       
                         v 
                         j 
                       
                     
                     ∈ 
                     
                       
                         qi 
                         
                           
                             ϕ 
                             j 
                           
                           ⁡ 
                           
                             ( 
                             
                               𝒫 
                               i 
                             
                             ) 
                           
                         
                       
                       ⁡ 
                       
                         ( 
                         
                           
                             1 
                             4 
                           
                           , 
                           
                             3 
                             4 
                           
                         
                         ) 
                       
                     
                   
                 
                 ] 
               
             
             ≥ 
             
               1 
               - 
               
                 β 
                 . 
               
             
           
         
       
     
     It should be noted that when applied to low-sensitivity queries with t=1/τ 2 , this algorithm improves dependence on |X| and τ from n=Õ(log(|X|)/τ 4 ) in prior art techniques to n=Õ(√{square root over (log|X|)}/τ 3 ) (although, as pointed out above, the setting in the prior art technique is not always comparable to the present setting). 
     Techniques 
     Similar to prior techniques, the present embodiments rely on properties of differential privacy. Differential privacy is a stability property of an algorithm, namely it requires that replacing any element in the input dataset results in a small change in the output distribution of the algorithm. As a result, a function output by a differentially private algorithm on a given dataset generalizes to the underlying distribution. Specifically, if a differentially private algorithm is run on a dataset drawn i.i.d from any distribution and the algorithm outputs a low-sensitivity function, then the empirical value of that function on the input dataset is close to the expectation of that function on a fresh dataset drawn from the same distribution. 
     The second relatively important property of differential privacy is that it composes adaptively: running several differentially private algorithms on the same dataset still satisfies differential privacy (with somewhat worse parameters) even if each algorithm depends on the output of all the previous algorithms. This property makes it possible to answer adaptively-chosen queries with differential privacy and a number of algorithms have been developed for answering different types of queries. The generalization property of differential privacy then implies that such algorithms can be used to provide answers to adaptively-chosen queries while ensuring generalization. 
     For each query, the algorithm of Theorem 1.3 first splits its input, including n samples, into m=n/t disjoint subsamples of size t, and computes the estimator ϕ:X t →  on each. It then outputs an approximate median of the resulting values in a differentially private manner. Here an approximate median is any value that falling between the (1−α)/2-quantile and the (1+α)/2-quantile of the m computed values (for some approximation parameter α). In addition to making the resulting estimator more stable, this step also amplifies the probability of success of the estimator. For comparison, prior art algorithms compute the estimator once on the whole sample and then output the value in a differentially private manner. 
     It is thus shown that differential privacy ensures that an approximate empirical median with high probability falls within the true interquartile interval of the estimator on the input distribution. Here, the known strong connection between differential privacy and generalization is relied upon. However, the present embodiments rely on stability to replace of any one of the m subsamples (including t points) used to evaluate the estimator, whereas previous analyses used the stability under replacement of any one out of the n data points. The use of this stronger condition is crucial for bypassing the limitations of previous techniques while achieving improved accuracy guarantees. 
     A number of differentially-private algorithms for approximating the empirical median of values in a dataset have been studied in the literature. One common approach to this problem is the use of local sensitivity. This approach focuses on additive approximation guarantees and requires stronger assumptions on the data distribution to obtain explicit bounds on the approximation error. 
     In the present embodiments, a data-dependent notion of approximation to the median is relied upon in which the goal is to output any value v between the (1−α)/2-quantile and the (1+α)/2-quantile of the empirical distribution for some approximation parameter α. It may thus be easy to see that this version is essentially equivalent to the interior point problem in which the goal is to output a value between the smallest and largest values in the dataset. A prior art technique recently showed that the optimal sample complexity of privately finding an interior point in a range of values T lies between m=2 (1+o(1))log*|T|  and m=Ω(log*|T|), where log* is iterated logarithm or inverse tower function satisfying log*(2 x )=1+log*(x). 
     The prior art algorithm is relatively complex and, therefore, a simple and efficient algorithm is used herein that is based on an exponential mechanism, and is similar to an algorithm to estimate quantiles of a distribution. This algorithm has sample complexity m=O(log|T|) (for constant α&gt;0). In addition, for the present algorithm that answers many queries another simple algorithm is used based on approximate binary search, which can yield sample complexity m=O(√{square root over (log|T|)}); it has the advantage that it reduces the problem to a sequence of statistical queries. It is generally known that the exponential mechanism and binary search can be used to privately find an approximate median in the context of the applications described herein. 
     Now the second part of the proof: an approximate empirical median is also in the interquartile interval of the distribution. i.e., any value in the empirical (⅜,⅝)-quantile interval falls in the distribution&#39;s (¼,¾)-quantile interval. A value vϵT is an approximate empirical median if the empirical cumulative distribution function at v is close to ½ that is, cdf S (v)≐Pr Y˜S [Y≤v]≈½, where S˜   n  is the random samples and Y˜S denotes picking a sample from S randomly and uniformly. Note that cdf S (v) is the empirical mean of a statistical query over S, whereas the true cumulative distribution function  ( v )≐ [Y≤v] is the true mean of the same statistical query. Hence, the known strong connection between differential privacy and generalization for statistical queries can be applied to obtain that  ( v )≈cdf S (v). This ensures  ( v )≈½ and hence v falls in qi D (¼,¾) (with high probability). 
     For estimators that produce an accurate response with high probability (such as any well-concentrated estimator) a different, substantially simpler way to prove high probability bounds on the accuracy of the whole adaptive procedure is provided. This allows bypassing the known proofs of high-probability bounds that rely on relatively involved arguments. 
     The present algorithm for answering verification queries (Theorem 1.4), is obtained by reducing the verification step to verification of two statistical queries for which the domain of the function is X t  and the expectation is estimated relative to    t . To further improve the sample complexity, it is observed that it is possible to calibrate the algorithm for verifying statistical queries from to introduce less noise when ρ is small. This improvement relies on sharper analysis of the known generalization properties of differential privacy that has already found some additional uses. 
     The present algorithm for answering many queries (Theorem 1.5) is also obtained by a reduction to statistical queries over X t . In this case statistical queries are used to find a value in the interquartile interval of the estimator via a binary search. 
     Finally, the differentially private algorithms that are used to answer queries might also be of interest for applications in private data analysis. These algorithms demonstrate that meaningful privacy and error guarantees can be achieved without any assumptions on the sensitivity of estimators. From this point of view, the present approach is an instance of subsample-and-aggregate technique of a prior art technique, where the approximate median algorithm is used for aggregation. It is noted that a prior technique used a somewhat related approach that also takes advantage of the concentration of the estimator around its mean during the aggregation step. That algorithm first clips the tails of the estimator&#39;s distribution via a differentially private quantile estimation and then uses simple averaging with Laplace noise addition as the aggregation step. That analysis is specialized to estimators that are approximately normally distributed and hence the results are not directly comparable with the present more general setting. 
     2. Preliminaries 
     For kϵ , it is denoted that [k]={1, 2, . . . , k} and a [k]  is used as a shorthand for the k-tuple (a 1 , a 2 , . . . , a k ). For a condition E (E) is used to denote the indicator function of E. Thus E[ (E)]=Pr[E]. 
     For a randomized algorithm M Y˜M to denote that Y is random variable obtained by running M. For a distribution  , Y˜D is used to denote that Y is a random variable distributed according to  . For 0≤α≤β≤1 and a distribution  , it denoted by the (α, β)-quantile interval of   by
 
 (α,β)≐{ v ϵ : [ Y≤v ]&gt;α∧ [ Y&lt;v ]&lt;β}.
 
     qi D (¼,¾) is referred to as the interquartile interval of   and the length of this interval is the interquartile range. For sϵ   n  qi S (α, β) is denoted by the empirical version of the quantity above, that is the (α, β)-quantile interval obtained by taking   to be the uniform distribution over the elements of s. In general, the datasets are viewed as being equivalent to a distribution, namely the uniform distribution on elements of that dataset. 
     For the present algorithms, a query is specified by a function ϕ:X t → . For notational simplicity,  =X t  and partition a dataset sϵX n  into m points s 1 , . . . ,s m ϵ . Therefore throughout the discussion n=mt. For sϵ   m , ϕ(s)=(ϕ(s 1 ), . . . ,ϕ(s m )) is the transformed dataset. Similarly, for a distribution   on X,  =   t  is defined to be the corresponding distribution on   and ϕ( ) to be the distribution obtained by applying ϕ to a random sample from  . The expectations of these distributions are denoted 
     
       
         
           
             
               s 
               ⁡ 
               
                 [ 
                 ϕ 
                 ] 
               
             
             = 
             
               
                 
                   1 
                   m 
                 
                 ⁢ 
                 
                   
                     ∑ 
                     
                       i 
                       ∈ 
                       
                         [ 
                         m 
                         ] 
                       
                     
                   
                   ⁢ 
                   
                     
                       ϕ 
                       ⁡ 
                       
                         ( 
                         
                           s 
                           i 
                         
                         ) 
                       
                     
                     ⁢ 
                     
                         
                     
                     ⁢ 
                     and 
                     ⁢ 
                     
                         
                     
                     ⁢ 
                     
                       𝒟 
                       ⁡ 
                       
                         [ 
                         ϕ 
                         ] 
                       
                     
                   
                 
               
               = 
               
                 
                   
                     E 
                     
                       Z 
                       ⁢ 
                       
                         ~ 
                       
                       ⁢ 
                       𝒟 
                     
                   
                   ⁡ 
                   
                     [ 
                     
                       ϕ 
                       ⁡ 
                       
                         ( 
                         Z 
                         ) 
                       
                     
                     ] 
                   
                 
                 . 
               
             
           
         
       
     
     2.1 Adaptivity 
     A central topic described herein is the interaction between two algorithms A—the analyst—and M—the present query-answering algorithm. Let Q be the space of all possible queries and   be the set of all possible answers. In the present applications, Q will be a set of functions ϕ:Z→ , possibly with some additional parameters and   will be (a subset of)  . The notation for this interaction is thus:
         Input sϵ   m  is given to M.   For j=1, 2, . . . , k:   A computes a query q j ϵQ and passes it to M   M produces answer a j ϵ  and passes it to A   The output is the transcript (q 1 q 2 , . . . , q k , a 1 , a 2 , . . . , a k )ϵQ k ×   k          

     Given interactive algorithms A and M, define A⇄M (s) to be function which produces a random transcript of the interaction between A and M, where s is the input given to M. Formally, the above specifies how A⇄M:X n →Q k ×   k  is defined. 
     The transcript function A⇄M provides a “non-interactive view” of the output of an interactive process. The goal is thus to construct M such that, for all A, the output of A⇄M has the desired accuracy and stability properties. 
     2.2 Differential Privacy 
     Definition 2.1 (Differential Privacy) An algorithm M:   m →  is (ε, δ)-differentially private if, for all datasets s, s′ϵ   m  that differ on a single element,
 
∀ E⊆     Pr [ M ( s )ϵ E ]≤ e   ε   Pr [ M ( s ′)ϵ E ]+δ.
 
     It should be noted that, throughout, an algorithm M:X n →  is considered whereby  =X t  with n=mt so that M:   m → . Then the differential privacy is defined with respect to the latter view (that is, with respect to changing a whole tuple of t elements in the original view of M). This is a stronger condition. 
     However, Definition 2.1 only covers non-interactive algorithms. Thus, it can extended to interactive algorithms: 
     Definition 2.2 (Interactive Differential Privacy) An interactive algorithm M is (ε, δ)-differentially private if, for all interactive algorithms A, the (non-interactive) algorithm A⇄M:   m →  is (ε, δ)-differentially private. 
     Theorem 2.3 (Post-processing) Let M:   m →  be (ε, δ)-differentially private. Let F: → ′ be an arbitrary randomized algorithm. Define M′:   m → ′ by M′(s)=F(M(s)). Then M′ is also (ε, δ)-differentially private. 
     Post-processing may be considered relatively important as it allows performance of further computation on the output of a differentially private algorithm without breaking the privacy guarantee. 
     The key adaptive composition property of differential privacy is now stated, which bounds how rapidly differential privacy degrades under repeated use of the same dataset 
     Theorem 2.4 (Prior Adaptive Composition Technique): Fix kϵ  and ε 1 , . . . , ε k , δ 1 , . . . , δ k &gt;0. Let M 1 , . . . , M k :   m × →  be randomized algorithms. Suppose that for all jϵ[k] and all fixed yϵ , the randomized algorithm x M j  (x, y) is (ε j , δ j )-differentially private. Define {circumflex over (M)} 1 , . . . , {circumflex over (M)} k :   m →  inductively by {circumflex over (M)} 1  (x)=M 1 (x, y 0 ) where y 0 ϵ  is fixed and {circumflex over (M)} i+1  (x)=M j+1 (x, {circumflex over (M)} j  (x)) for jϵ[k−1]. Then {circumflex over (M)} k  is ({circumflex over (ε)},{circumflex over (δ)})-differentially private for 
                 ɛ   ^     =           1   2     ⁢       ∑     j   ∈     [   k   ]         ⁢     ɛ   j   2         +         2   ⁢     log   ⁡     (     1     δ   ′       )       ⁢       ∑     j   ∈     [   k   ]         ⁢     ɛ   j   2           ⁢           ⁢   and   ⁢           ⁢     δ   ^         =       δ   ′     +       ∑     j   ∈     [   k   ]         ⁢     δ   j             ,         
where δ′ϵ(0,1) is arbitrary.
 
     The analyst that asks queries can be seen as a post-processing step on the output of a differentially private algorithm that answers the queries. Thus, by combining the adaptive composition and post-processing properties of differential privacy are obtained to ensure that an interactive algorithm is differentially private it is sufficient to ensure that each of the individual queries is answered with differential privacy. 
     Theorem 2.5: Fix kϵ  and ε, δ&gt;0. Let M:   m ×Q→  be an algorithm, such that M(s, q) provides an answer to the query q using the dataset s and M is (ε, δ)-differentially private for every fixed sϵ   m . Define an interactive algorithm M ⊕k  that takes as input sϵ   m  and answers k adaptively-chosen queries q 1 , . . . , q k ϵQ where, for each jϵ[k], M ⊕k  produces an answer by independently running M(s, q j ). Then M ⊕k  is (½kε 2 +ε√{square root over (2kln(1/δ′))}, δ′+kδ)-differentially private for all δ′ϵ(0,1). 
     3. Approximate Median 
     In this section, differentially private algorithms for outputting an approximate median of a real-valued dataset are presented. Namely, for sϵ   m , an α-approximate median of s is defined to be any element of the set 
                 qi   s     ⁡     (         1   -   α     2     ,       1   +   α     2       )       .         
In the present application, each real value is obtained by applying the given query function to a single subsample.
 
     Several differentially private algorithms for computing an approximate median are known. All of these algorithms assume that the input elements and the range of the algorithm are restricted to some finite set T⊆ . They describe an (ε, δ)-differentially private algorithm which, on input sϵT m , outputs an α-approximate median of s as long as m≥(2+o(1)) log*|T| ·O(log(1/εδ)/εα). Consider the problem of outputting an interior point which is equivalent to the definition of a 1-approximate median. However, by removing the elements of the dataset that are not in 
               qi   s     ⁡     (         1   -   α     2     ,       1   +   α     2       )           
α-approximate median reduces to the interior point problem.
 
     Prior techniques also prove a nearly tight lower bound of m≥Ω(log*|T|) for α=ε=1 and δ= 1/100 m 2 . This lower bound implies that privately outputting an approximate median is only possible if the data points are restricted to a finite range. It is noted that that for the stricter ε-differential privacy the sample complexity of this problem for constant α&gt;0 is θ(log(|T|)/ε). Any differentially private algorithm for finding an approximate median can be used in the results. The prior art algorithm in is relatively involved and hence a relatively simple algorithm for the problem that relies on a “folklore” application of the exponential mechanism will be described. 
     Theorem 3.1: For all ε, α, β&gt;0, finite T⊂ : and all m≥4 ln(|T|/β)εα, there exists an (ε, 0)-differentially private randomized algorithm M that given a dataset sϵ   m  and a query ϕ: →T outputs an α-approximate median of ϕ(s)ϵT m  with probability at least 1−β. The running time of the algorithm is O(m·log|T|). 
     Proof: The algorithm is an instantiation of the exponential mechanism with the utility function c:T→  defined as
 
 c   ϕ(s) ( v )≐max{|{ i ϵ[ m ]:ϕ( s   i )&lt; v}|,|{i ϵ[ m ]:ϕ( s   i )&gt; v}|}.  
 
     The algorithm outputs each vϵT with probability 
     
       
         
           
             
               
                 Pr 
               
               ⁡ 
               
                 [ 
                 
                   
                     M 
                     ⁡ 
                     
                       ( 
                       
                         s 
                         , 
                         ϕ 
                       
                       ) 
                     
                   
                   = 
                   v 
                 
                 ] 
               
             
             = 
             
               
                 
                   exp 
                   ⁡ 
                   
                     ( 
                     
                       
                         
                           - 
                           ɛ 
                         
                         2 
                       
                       ⁢ 
                       
                         
                           c 
                           
                             ϕ 
                             ⁡ 
                             
                               ( 
                               s 
                               ) 
                             
                           
                         
                         ⁡ 
                         
                           ( 
                           v 
                           ) 
                         
                       
                     
                     ) 
                   
                 
                 
                   
                     ∑ 
                     
                       u 
                       ∈ 
                       T 
                     
                   
                   ⁢ 
                   
                     exp 
                     ⁡ 
                     
                       ( 
                       
                         
                           
                             - 
                             ɛ 
                           
                           2 
                         
                         ⁢ 
                         
                           
                             c 
                             
                               ϕ 
                               ⁡ 
                               
                                 ( 
                                 s 
                                 ) 
                               
                             
                           
                           ⁡ 
                           
                             ( 
                             u 
                             ) 
                           
                         
                       
                       ) 
                     
                   
                 
               
               . 
             
           
         
       
     
     Since c ϕ(s) (v) has sensitivity 1 as a function of s, this algorithm is (ε, 0)-differentially private (Theorem 3.1). Moreover, there is the accuracy guarantee (Corollary 3.12) 
                     ∀   s     ,       β   ⁢           ⁢       Pr     V   ⁢       ~       ⁢     M   ⁡     (     s   ,   ϕ     )           ⁡     [         c     ϕ   ⁡     (   s   )         ⁡     (   V   )       &lt;       OPT     ϕ   ⁡     (   s   )         +       2   ⁢     ln   ⁡     (          T        /   β     )         ɛ         ]         ≥     1   -   β       ,           (   1   )               
where OPT ϕ(s) ⊥min uϵT c ϕ(s) (u)≤m/2. Assuming the event in (1) happens for V=v (that is,
 
                     c     ϕ   ⁡     (   s   )         ⁡     (   v   )       &lt;       OPT     ϕ   ⁡     (   s   )         +       2   ⁢     ln   ⁡     (          T        /   β     )         ɛ         )     ,         
so that
 
                   Pr     Y   ⁢     ~     ⁢     ϕ   ⁡     (   s   )           ⁡     [     Y   ≤   v     ]       =       1   -       1   m     ⁢          {     i   ∈         [   m   ]     ⁢     :     ⁢     ϕ   ⁡     (     s   i     )         &gt;   v       }              &gt;       1   2     -       2   ⁢     ln   ⁡     (          T        /   β     )           ɛ   ⁢   m         ≥       1   -   α     2         ,         
as long as α≥4 ln(|T|/β)/εm, which is equivalent to m≥4 ln(|T|/β)/εα. Similarly, the event in (1) implies that
 
     
       
         
           
             
               
                 Pr 
                 
                   Y 
                   ⁢ 
                   
                     ~ 
                   
                   ⁢ 
                   
                     ϕ 
                     ⁡ 
                     
                       ( 
                       s 
                       ) 
                     
                   
                 
               
               ⁡ 
               
                 [ 
                 
                   Y 
                   &lt; 
                   v 
                 
                 ] 
               
             
             = 
             
               
                 
                   1 
                   m 
                 
                 ⁢ 
                 
                    
                   
                     { 
                     
                       i 
                       ∈ 
                       
                         
                           
                             [ 
                             m 
                             ] 
                           
                           ⁢ 
                           
                             : 
                           
                           ⁢ 
                           
                             ϕ 
                             ⁡ 
                             
                               ( 
                               
                                 s 
                                 i 
                               
                               ) 
                             
                           
                         
                         &lt; 
                         v 
                       
                     
                     } 
                   
                    
                 
               
               &lt; 
               
                 
                   1 
                   2 
                 
                 + 
                 
                   
                     2 
                     ⁢ 
                     
                       ln 
                       ⁡ 
                       
                         ( 
                         
                           
                              
                             T 
                              
                           
                           / 
                           β 
                         
                         ) 
                       
                     
                   
                   
                     ɛ 
                     ⁢ 
                     
                         
                     
                     ⁢ 
                     m 
                   
                 
               
               ≤ 
               
                 
                   
                     1 
                     + 
                     α 
                   
                   2 
                 
                 . 
               
             
           
         
       
     
     Thus, 
                 Pr     V   ⁢     ~     ⁢     M   ⁡     (     s   ,   ϕ     )           ⁡     [     V   ∈       qi     ϕ   ⁡     (   s   )         ⁡     (         1   -   α     2     ,       1   +   α     2       )         ]       ≥     1   -   β           
as long as m≥4 ln(|T|/β)/εα.
 
     To get an upper bound on the running time it is observed that using binary search, the elements of T can be split into m+1 “intervals” (that is contiguous subsets of T) with all elements of each interval having equal probability. This partition permits the computation of the normalization factor as well as the total probability of all the elements of T in each interval in O(m log|T|) time. A random point from the desired distribution can now be produced by first picking the interval proportionally to its probability and then outputting a point in that interval randomly and uniformly. (It is implicitly assumed that the structure of T is simple enough so that such operations can be performed in O(log|T|) time and ignore the time to evaluate ϕ on each of the elements of s.) 
     Another relatively simple and prior “folklore” algorithm will now be described finding an approximate median of a distribution that reduces the problem to O(log|T|) statistical queries. Recall, that an α-accurate response to a statistical query ψ: →[−1,1] relative to distribution   over   is any value v such that |v− [ψ]|≤α. 
     Lemma 3.2: For all α&gt;0, finite T⊂ , a query ϕ: →T and any distribution   over T, a value 
             v   ∈       qi     ϕ   ⁡     (   𝒟   )         ⁡     (         1   -   α     2     ,       1   +   α     2       )             
can be found using α/4-accurate responses to at most 2[log 2 (|T|)] (adaptively-chosen) statistical queries relative to distribution  .
 
     Proof: Using binary search, a point vϵT that satisfies the conditions p ≤ (v)&gt;½−α/4 and p &lt; (v)&lt;½+α/4, where p ≤ (v) (or p &lt; (v)) is the response to the statistical query ψ(z)= (v≤ϕ(z))(ψ(z)=1(v&lt;ϕ(z)), respectively). By the accuracy guarantees of the responses, |p ≤ (v)−Pr Z˜   [ϕ(Z)≤v]|≤α/4, and similarly for p &lt; (v). The next point is chosen to test depending on which of the conditions fails (It can be assumed that p &lt; (v)≤p ≤ (v) so at most one condition can fail). Further, for the true median point of ϕ( ) (that is the point v*ϵT for which  [ϕ(Z)&lt;v*]&lt;½ and  [ϕ(Z)≤v*]≥½) both conditions will be satisfied by the accuracy guarantees. Finally, by the accuracy guarantees, any point v′ that satisfies both of these conditions is an α-approximate median for ϕ( ). 
     To find the α-approximate median of values ϕ(s)ϵT m  this reduction needs to be applied to the uniform distribution over the elements of ϕ(s). Answering statistical queries relative to this empirical distribution (commonly referred to as linear or counting queries) with differential privacy is a well-studied problem. For example, by using the standard Laplace or Gaussian noise addition algorithm one can obtain the following algorithm for finding an α-approximate median. 
     Corollary 3.3: For all ε, δ, α, βϵ(0,1/2), finite T⊂  and all 
                 m   ≥       12   ⁢       2   ⁢       ⌈       log   2     ⁢        T          ⌉     ·     ln   ⁡     (     1   δ     )       ·     ln   ⁡     (       2   ⁢     ⌈       log   2     ⁢        T          ⌉       β     )               ɛα       =     O   (         log   ⁢          T        ·     log   ⁡     (     1   δ     )       ·     log   ⁡     (       log   ⁢        T          β     )             ɛα     )       ,         
there exists an (ε, δ)-differentially private randomized algorithm M that given sϵ   m  and ϕ: →T outputs an α-approximate median of ϕ(s) with probability at least 1−β. The running time of the algorithm is O(m·log|T|).
 
     4. Generalization from Differential Privacy 
     In this section two proofs are provided that differential privacy gives generalization guarantees for statistical queries. The first proof—which may be called a strong generalization—is most similar to previous work, whereas the second proof—which may be called simple generalization—is much simpler, but gives a weaker bound that may only be suitable for estimators that are well-concentrated. 
     4.1 Strong Generalization 
     Theorem 4.1 in this subsection shows that any differentially private algorithm generalizes with high probability, with a small blowup in the allowed generalization error. This proof closely follows that of prior technique, but is quantitatively sharper. This quantitative sharpening allows estimation of the probability that a given value v is outside of  (ρ,1−φ with higher accuracy (that scales with ρ as in the non-adaptive case). The sharper version in Section 5.1 is used; however, for results in this section ρ=¼ and therefore the bounds from prior art approaches suffice. 
     The mean absolute deviation of a distribution   over   is defined as
 
 mad ( )⊥ [| Y ′− [ Y ]|].
 
     Theorem 4.1: Fix α, β, γϵ(0,1) and m, k ϵ . Set ε=½ ln(1+γ) and δ=αβ/16. Suppose 
             m   ≥       8   ɛα     ⁢       ln   ⁡     (     2   ⁢     k   /   β       )       .             
Let M:   m →   [0,1]   k  be a (ε, δ)-differentially private algorithm with    [0,1]  being the set of functions ϕ: →[0,1]. Let   be a distribution on  . The
 
     
       
         
           
             
               
                 
                   Pr 
                   
                     S 
                     ∼ 
                     
                       D 
                       m 
                     
                   
                 
                 
                   
                     ϕ 
                     
                       [ 
                       k 
                       ] 
                     
                   
                   ∼ 
                   
                     M 
                     ⁡ 
                     
                       ( 
                       S 
                       ) 
                     
                   
                 
               
               ⁡ 
               
                 [ 
                 
                   ∀ 
                   
                     j 
                     ∈ 
                     
                       
                         
                           
                             [ 
                             k 
                             ] 
                           
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           
                             S 
                             ⁡ 
                             
                               [ 
                               
                                 ϕ 
                                 j 
                               
                               ] 
                             
                           
                         
                         - 
                         
                           𝒟 
                           ⁡ 
                           
                             [ 
                             
                               ϕ 
                               j 
                             
                             ] 
                           
                         
                       
                       ≤ 
                       
                         α 
                         + 
                         
                           γ 
                           · 
                           
                             mad 
                             ⁡ 
                             
                               ( 
                               
                                 
                                   ϕ 
                                   j 
                                 
                                 ⁡ 
                                 
                                   ( 
                                   𝒟 
                                   ) 
                                 
                               
                               ) 
                             
                           
                         
                       
                     
                   
                 
                 ] 
               
             
             ≥ 
             
               1 
               - 
               
                 β 
                 . 
               
             
           
         
       
     
     Note that, by Jensen&#39;s inequality, mad(ϕ( ))≤sd(ϕ( )). Thus, Theorem 4.1 gives an error bound that scales with the standard deviation of the query (plus the absolute α term). Also, by the triangle inequality and the fact that ϕ(z)≥0 for all z, it holds that
 
 mad (ϕ( ))≤2· [ϕ].
 
     Thus Theorem 4.1 can also be interpreted as giving a multiplicative accuracy guarantee (plus the additive α). In comparison, the bound of prior techniques can be obtained (up to constants) by substituting the upper bound mad(ϕ( ))≤1 into Theorem 4.1. Thus, when mad(ϕ( ))&lt;&lt;1, the present bound is sharper. 
     As stated, Theorem 4.1 only applies in the non-adaptive setting and to statistical queries. However, this may be extended to prior monitoring techniques of and the cumulative probability function: 
     Theorem 4.2 Fix βϵ(0,1) and k,mϵ  with m≥2560 ln(2k/β). Let M be an ( 1/20, β/256)-differentially private interactive algorithm that takes as input sϵ   m  and provides answers v 1 , . . . , v k ϵ  to an adaptively-chosen sequence of queries ϕ 1 , . . . , ϕ k : → . Suppose that, for all sϵ   m  and all interactive algorithms A, 
     
       
         
           
             
               
                 
                   
                     ⁢ 
                     
                       
                         Pr 
                         
                           
                             
                               ( 
                               
                                 
                                   ϕ 
                                   
                                     [ 
                                     k 
                                     ] 
                                   
                                 
                                 , 
                                 
                                   v 
                                   
                                     [ 
                                     k 
                                     ] 
                                   
                                 
                               
                               ) 
                             
                             ⁢ 
                             
                               ~ 
                             
                             ⁢ 
                             A 
                           
                           ⇄ 
                           
                             M 
                             ⁡ 
                             
                               ( 
                               S 
                               ) 
                             
                           
                         
                       
                       ⁡ 
                       
                         [ 
                         
                           ∀ 
                           
                             j 
                             ∈ 
                             
                               
                                 [ 
                                 k 
                                 ] 
                               
                               ⁢ 
                               
                                 v 
                                 j 
                               
                             
                             ∈ 
                             
                               
                                 qi 
                                 
                                   
                                     ϕ 
                                     ⁢ 
                                     j 
                                   
                                   ⁡ 
                                   
                                     ( 
                                     s 
                                     ) 
                                   
                                 
                               
                               ⁡ 
                               
                                 ( 
                                 
                                   
                                     3 
                                     8 
                                   
                                   , 
                                   
                                     5 
                                     8 
                                   
                                 
                                 ) 
                               
                             
                           
                         
                         ] 
                       
                     
                   
                   ≥ 
                   
                     1 
                     - 
                     
                       β 
                       . 
                     
                   
                 
               
               
                 
                   ( 
                   3 
                   ) 
                 
               
             
           
         
       
     
     Then, for all distributions   and all interactive algorithm 
     
       
         
           
             
               
                 Pr 
                 
                   
                     S 
                     ⁢ 
                     
                       ~ 
                     
                     ⁢ 
                     
                       𝒟 
                       m 
                     
                   
                   
                     
                       
                         ( 
                         
                           
                             ϕ 
                             
                               [ 
                               k 
                               ] 
                             
                           
                           , 
                           
                             v 
                             
                               [ 
                               k 
                               ] 
                             
                           
                         
                         ) 
                       
                       ⁢ 
                       
                         ~ 
                       
                       ⁢ 
                       A 
                     
                     ⇄ 
                     
                       M 
                       ⁡ 
                       
                         ( 
                         S 
                         ) 
                       
                     
                   
                 
               
               ⁡ 
               
                 [ 
                 
                   ∀ 
                   
                     j 
                     ∈ 
                     
                       
                         [ 
                         k 
                         ] 
                       
                       ⁢ 
                       
                         v 
                         j 
                       
                     
                     ∈ 
                     
                       
                         qi 
                         
                           
                             ϕ 
                             ⁢ 
                             j 
                           
                           ⁡ 
                           
                             ( 
                             𝒟 
                             ) 
                           
                         
                       
                       ⁡ 
                       
                         ( 
                         
                           
                             1 
                             4 
                           
                           , 
                           
                             3 
                             4 
                           
                         
                         ) 
                       
                     
                   
                 
                 ] 
               
             
             ≥ 
             
               1 
               - 
               
                 2 
                 ⁢ 
                 
                   β 
                   . 
                 
               
             
           
         
       
     
     Proof: Let Q be the set of functions ϕ: →  and let A be an arbitrary algorithm that asks queries in Q. Define f:Q k ×   k →   [0,1]  as follows, where    [0,1]  is the set of functions ψ: →[0,1]. Given (ϕ, v)ϵQ k ×   k , define ψ 1 , ψ −1 , ψ 2 , ψ −2 , . . . , ψ k , ψ −k : →{0,1} by 
     
       
         
           
             
               
                 ψ 
                 j 
               
               ⁡ 
               
                 ( 
                 x 
                 ) 
               
             
             ≐ 
             
               ⁢ 
               
                 ( 
                 
                   
                     
                       ϕ 
                       j 
                     
                     ⁡ 
                     
                       ( 
                       x 
                       ) 
                     
                   
                   ≤ 
                   
                     v 
                     j 
                   
                 
                 ) 
               
               ⁢ 
               
                   
               
               ⁢ 
               and 
               ⁢ 
               
                   
               
               ⁢ 
               
                 
                   ψ 
                   
                     - 
                     j 
                   
                 
                 ⁡ 
                 
                   ( 
                   x 
                   ) 
                 
               
             
             ≐ 
             
               ⁢ 
               
                 ( 
                 
                   
                     
                       ϕ 
                       j 
                     
                     ⁡ 
                     
                       ( 
                       x 
                       ) 
                     
                   
                   ≥ 
                   
                     v 
                     j 
                   
                 
                 ) 
               
               ⁢ 
               
                   
               
               ⁢ 
               and 
               ⁢ 
               
                   
               
               ⁢ 
               let 
             
           
         
       
       
         
           
             
               f 
               ⁡ 
               
                 ( 
                 
                   ϕ 
                   , 
                   v 
                 
                 ) 
               
             
             ≐ 
             
               
                 argmin 
                 
                   ψ 
                   ∈ 
                   
                     { 
                     
                       
                         ψ 
                         1 
                       
                       , 
                       
                         ψ 
                         
                           - 
                           1 
                         
                       
                       , 
                       
                         ψ 
                         2 
                       
                       , 
                       
                         ψ 
                         
                           - 
                           2 
                         
                       
                       , 
                       … 
                       ⁢ 
                       
                           
                       
                       , 
                       
                         ψ 
                         k 
                       
                       , 
                       
                         ψ 
                         
                           - 
                           k 
                         
                       
                     
                     } 
                   
                 
               
               ⁢ 
               
                 
                   𝒟 
                   ⁡ 
                   
                     [ 
                     ψ 
                     ] 
                   
                 
                 . 
               
             
           
         
       
     
     By the post-processing property of differential privacy (Theorem 2.3), f (A⇄M (s)) is a (ε, δ)-differentially private algorithm (relative to its input sϵ   m ). Moreover, by assumption (3), 
     
       
         
           
             ∀ 
             
               s 
               ∈ 
               
                 
                   
                     m 
                   
                   ⁢ 
                   
                     
                       Pr 
                       
                         ψ 
                         ∼ 
                         
                           f 
                           ⁡ 
                           
                             ( 
                             
                               A 
                               ⇄ 
                               
                                 M 
                                 ⁡ 
                                 
                                   ( 
                                   s 
                                   ) 
                                 
                               
                             
                             ) 
                           
                         
                       
                     
                     ⁡ 
                     
                       [ 
                       
                         
                           s 
                           ⁡ 
                           
                             [ 
                             ψ 
                             ] 
                           
                         
                         ≥ 
                         
                           3 
                           8 
                         
                       
                       ] 
                     
                   
                 
                 ≥ 
                 
                   1 
                   - 
                   
                     β 
                     . 
                   
                 
               
             
           
         
       
     
     However, by Theorem 4.1, 
     
       
         
           
             
               
                 
                   Pr 
                   
                     S 
                     ∼ 
                     
                       𝒟 
                       m 
                     
                   
                 
                 
                   ψ 
                   ∼ 
                   
                     f 
                     ⁡ 
                     
                       ( 
                       
                         A 
                         ⇄ 
                         
                           M 
                           ⁡ 
                           
                             ( 
                             S 
                             ) 
                           
                         
                       
                       ) 
                     
                   
                 
               
               ⁡ 
               
                 [ 
                 
                   
                     
                       S 
                       ⁡ 
                       
                         [ 
                         ψ 
                         ] 
                       
                     
                     - 
                     
                       𝒟 
                       ⁡ 
                       
                         [ 
                         ψ 
                         ] 
                       
                     
                   
                   ≤ 
                   
                     1 
                     8 
                   
                 
                 ] 
               
             
             ≥ 
             
               
                 
                   Pr 
                   
                     S 
                     ∼ 
                     
                       𝒟 
                       m 
                     
                   
                 
                 
                   ψ 
                   ∼ 
                   
                     f 
                     ⁡ 
                     
                       ( 
                       
                         A 
                         ⇄ 
                         
                           M 
                           ⁡ 
                           
                             ( 
                             S 
                             ) 
                           
                         
                       
                       ) 
                     
                   
                 
               
               ⁡ 
               
                 [ 
                 
                   
                     
                       S 
                       ⁡ 
                       
                         [ 
                         ψ 
                         ] 
                       
                     
                     - 
                     
                       𝒟 
                       ⁡ 
                       
                         [ 
                         ψ 
                         ] 
                       
                     
                   
                   ≤ 
                   
                     
                       1 
                       16 
                     
                     + 
                     
                       
                         1 
                         8 
                       
                       · 
                       
                         mad 
                         ⁡ 
                         
                           ( 
                           
                             ψ 
                             ⁡ 
                             
                               ( 
                               𝒟 
                               ) 
                             
                           
                           ) 
                         
                       
                     
                   
                 
                 ] 
               
             
             ≥ 
             
               1 
               - 
               
                 β 
                 . 
               
             
           
         
       
     
     Thus, by a union bound and the construction of f 
     
       
         
           
             
               
                 
                   Pr 
                   
                     S 
                     ∼ 
                     
                       𝒟 
                       m 
                     
                   
                 
                 
                   
                     
                       ( 
                       
                         
                           ϕ 
                           
                             [ 
                             k 
                             ] 
                           
                         
                         , 
                         
                           v 
                           
                             [ 
                             k 
                             ] 
                           
                         
                       
                       ) 
                     
                     ∼ 
                     A 
                   
                   ⇄ 
                   
                     M 
                     ⁡ 
                     
                       ( 
                       S 
                       ) 
                     
                   
                 
               
               ⁡ 
               
                 [ 
                 
                   ∀ 
                   
                     j 
                     ∈ 
                     
                       
                         [ 
                         k 
                         ] 
                       
                       ⁢ 
                       
                         v 
                         j 
                       
                     
                     ∈ 
                     
                       
                         qi 
                         
                           
                             ϕ 
                             j 
                           
                           ⁡ 
                           
                             ( 
                             𝒟 
                             ) 
                           
                         
                       
                       ⁡ 
                       
                         ( 
                         
                           
                             1 
                             4 
                           
                           , 
                           
                             3 
                             4 
                           
                         
                         ) 
                       
                     
                   
                 
                 ] 
               
             
             = 
             
               
                 
                   
                     Pr 
                     
                       S 
                       ∼ 
                       
                         𝒟 
                         m 
                       
                     
                   
                   
                     ψ 
                     ∼ 
                     
                       f 
                       ⁡ 
                       
                         ( 
                         
                           A 
                           ⇄ 
                           
                             M 
                             ⁡ 
                             
                               ( 
                               S 
                               ) 
                             
                           
                         
                         ) 
                       
                     
                   
                 
                 ⁡ 
                 
                   [ 
                   
                     
                       𝒟 
                       ⁡ 
                       
                         [ 
                         ψ 
                         ] 
                       
                     
                     ≥ 
                     
                       1 
                       4 
                     
                   
                   ] 
                 
               
               ≥ 
               
                 1 
                 - 
                 
                   2 
                   ⁢ 
                   
                     β 
                     . 
                   
                 
               
             
           
         
       
     
     Combining generalization (Theorem 4.2) with the present approximate median algorithm (Theorem 3.1) and composition (Theorem 2.4) yields the main result, Theorem 1.3. A somewhat more general statement that allows using different range T j  for every query ϕ j  is thus proven. The same generalization applies to other results, but this is not stated for brevity. 
     Theorem 4.3: For any βϵ(0,1), t,k,rϵ  and  =X t , and with 
               n   ≥     n   0       =     O   ⁡     (     t   ⁢         k   ⁢           ⁢     log   ⁡     (     1   β     )           ·     log   ⁡     (     kr   β     )           )             
there exists an interactive algorithm M that takes as input a dataset sϵX′ and provides answers v 1 , . . . , v k ϵ  to adaptively-chosen queries (T 1 ,ϕ 1 ), . . . , (T k , ϕ k ), where for all jϵ[k], |T j |≤r and ϕ j :X t →T j  with the following accuracy guarantee. For all interactive algorithms A and distributions   on X,
 
     
       
         
           
             
               ⁢ 
               
                 
                   
                     Pr 
                     
                       S 
                       ∼ 
                       
                         𝒫 
                         n 
                       
                     
                   
                   
                     
                       
                         ( 
                         
                           
                             T 
                             
                               [ 
                               k 
                               ] 
                             
                           
                           , 
                           
                             ϕ 
                             
                               [ 
                               k 
                               ] 
                             
                           
                           , 
                           
                             v 
                             
                               [ 
                               k 
                               ] 
                             
                           
                         
                         ) 
                       
                       ∼ 
                       A 
                     
                     ⇄ 
                     
                       M 
                       ⁡ 
                       
                         ( 
                         S 
                         ) 
                       
                     
                   
                 
                 ⁡ 
                 
                   [ 
                   
                     ∀ 
                     
                       j 
                       ∈ 
                       
                         
                           [ 
                           k 
                           ] 
                         
                         ⁢ 
                         
                           v 
                           j 
                         
                       
                       ∈ 
                       
                         
                           qi 
                           
                             
                               ϕ 
                               j 
                             
                             ⁡ 
                             
                               ( 
                               
                                 𝒫 
                                 t 
                               
                               ) 
                             
                           
                         
                         ⁡ 
                         
                           ( 
                           
                             
                               1 
                               4 
                             
                             , 
                             
                               3 
                               4 
                             
                           
                           ) 
                         
                       
                     
                   
                   ] 
                 
               
             
             ≥ 
             
               1 
               - 
               
                 β 
                 . 
               
             
           
         
       
     
     Proof The algorithm M promised by Theorem 4.3 is described below.
         Input SϵX mt .   Partition S into S 1 , . . . , S m ϵX t      For j=1, 2, . . . , k:
           Receive a set T j  and a query ϕ j :X t →T j .   Run the ({tilde over (ε)}, 0)-differentially private ¼-approximate median algorithm {tilde over (M)} from   
           Thm. 3.1 for T j  and with inputs (S 1 , . . . , S m ) and ϕ j  to obtain output v j ϵT j .
           Return answer v j .   
               

     Let  ≐X t  and assume that for some r fixed in advance, r≥max jϵ[K] |T j |. Theorem 3.1 says that if m≥4 ln(kr/β)/(α {tilde over (ε)}), then each execution of the median algorithm is ({tilde over (ε)}, 0)-differentially private and outputs an α-approximate median with probability at least 1−β/k. Here α=¼, so this rearranges to {tilde over (ε)}=16 ln(kr/β)/m. This implies that for all interactive algorithms A and every sϵ   m   
     
       
         
           
             
               
                 
                   
                     ⁢ 
                     
                       
                         Pr 
                         
                           
                             
                               ( 
                               
                                 
                                   T 
                                   
                                     [ 
                                     k 
                                     ] 
                                   
                                 
                                 , 
                                 
                                   ϕ 
                                   
                                     [ 
                                     k 
                                     ] 
                                   
                                 
                                 , 
                                 
                                   v 
                                   
                                     [ 
                                     k 
                                     ] 
                                   
                                 
                               
                               ) 
                             
                             ∼ 
                             A 
                           
                           ⇄ 
                           
                             M 
                             ⁡ 
                             
                               ( 
                               S 
                               ) 
                             
                           
                         
                       
                       ⁡ 
                       
                         [ 
                         
                           ∀ 
                           
                             j 
                             ∈ 
                             
                               
                                 [ 
                                 k 
                                 ] 
                               
                               ⁢ 
                               
                                 v 
                                 j 
                               
                             
                             ∈ 
                             
                               
                                 qi 
                                 
                                   
                                     ϕ 
                                     j 
                                   
                                   ⁡ 
                                   
                                     ( 
                                     d 
                                     ) 
                                   
                                 
                               
                               ⁡ 
                               
                                 ( 
                                 
                                   
                                     3 
                                     8 
                                   
                                   , 
                                   
                                     5 
                                     8 
                                   
                                 
                                 ) 
                               
                             
                           
                         
                         ] 
                       
                     
                   
                   ≥ 
                   
                     1 
                     - 
                     
                       β 
                       . 
                     
                   
                 
               
               
                 
                   ( 
                   4 
                   ) 
                 
               
             
           
         
       
     
     Interactive composition (Theorem 2.5 implies that M is (ε, δ)-differentially private for any δϵ(0,1) and 
     
       
         
           
             
               
                 
                   ɛ 
                   = 
                   
                     
                       
                         k 
                         2 
                       
                       ⁢ 
                       
                         
                           ( 
                           
                             
                               16 
                               ⁢ 
                               
                                 ln 
                                 ⁡ 
                                 
                                   ( 
                                   
                                     kr 
                                     / 
                                     β 
                                   
                                   ) 
                                 
                               
                             
                             m 
                           
                           ) 
                         
                         2 
                       
                     
                     + 
                     
                       
                         
                           16 
                           ⁢ 
                           
                             ln 
                             ⁡ 
                             
                               ( 
                               
                                 kr 
                                 / 
                                 β 
                               
                               ) 
                             
                           
                         
                         m 
                       
                       ⁢ 
                       
                         
                           
                             2 
                             ⁢ 
                             k 
                             ⁢ 
                             
                                 
                             
                             ⁢ 
                             
                               ln 
                               ⁡ 
                               
                                 ( 
                                 
                                   1 
                                   / 
                                   δ 
                                 
                                 ) 
                               
                             
                           
                         
                         . 
                       
                     
                   
                 
               
               
                 
                   ( 
                   5 
                   ) 
                 
               
             
           
         
       
     
     By Theorem 4.2, if, in addition to (4), it is had that ε&lt; 1/20 for δ=β/256 in (5) and m≥2560 ln(2k/β), then, for all distributions  , ≐   t  and all interactive algorithms A, 
                 ⁢         Pr     S   ∼     𝒟   m               (       T     [   k   ]       ,     ϕ     [   k   ]       ,     v     [   k   ]         )     ∼   A     ⇄     M   ⁡     (   S   )           ⁡     [     ∀     j   ∈       [   k   ]     ⁢     v   j       ∈       qi       ϕ   j     ⁡     (   𝒟   )         ⁡     (       1   4     ,     3   4       )           ]         ≥     1   -     2   ⁢   β         ,         
which is the desired conclusion.
 
     It only remains to find the appropriate bound on the parameter m. m≥2560 ln(2k/β) and 
     
       
         
           
             
               
                 1 
                 20 
               
               ≥ 
               ɛ 
             
             = 
             
               
                 
                   k 
                   2 
                 
                 ⁢ 
                 
                   
                     ( 
                     
                       
                         16 
                         ⁢ 
                         
                           ln 
                           ⁡ 
                           
                             ( 
                             
                               kr 
                               β 
                             
                             ) 
                           
                         
                       
                       m 
                     
                     ) 
                   
                   2 
                 
               
               + 
               
                 
                   
                     16 
                     ⁢ 
                     
                       ln 
                       ⁡ 
                       
                         ( 
                         
                           kr 
                           β 
                         
                         ) 
                       
                     
                   
                   m 
                 
                 ⁢ 
                 
                   
                     
                       2 
                       ⁢ 
                       k 
                       ⁢ 
                       
                           
                       
                       ⁢ 
                       
                         ln 
                         ⁡ 
                         
                           ( 
                           
                             256 
                             β 
                           
                           ) 
                         
                       
                     
                   
                   . 
                 
               
             
           
         
       
     
     Setting m=640√{square root over (max{k, 16}·ln(256/β))}·ln(kr/β) achieves this. 
     A relatively simple corollary of Theorem 4.3 is now described that converts the (¼, ¾)-quantile interval guarantees to explicit additive error guarantees. The error will be measured in terms of the mean absolute deviation of the query ϕ on inputs sampled from    t  (eq. 2). For normalization purposes it is also assumed that queries are scaled by the analyst is such a way that both    t [ϕ]ϵ[−1,1] and mad(ϕ(   t ))≤1. Note that this assumption is implied by ϕ having range [−1,1] and, in general, allows ϕ to have an infinite range. 
     Corollary 4.4: For tϵ  and a distribution   over X, let   denote the set of functions ϕ:X t →  such that    t [ϕ]ϵ[−1,1] and mad(ϕ(   t ))≤1. For all ζ&gt;0, β&gt;0, kϵ , and n≥n 0 =O(t√{square root over (k log(1/β))}·log(k/(ζβ))), there exists an efficient algorithm M which takes a dataset sϵX n  as an input and provides answers v 1 , . . . , v k ϵ  to an adaptively-chosen sequence of queries ϕ 1 , . . . , ϕ k :X t →  satisfying: for all interactive algorithms A and distributions   over X 
     
       
         
           
             
               
                 
                   Pr 
                   
                     S 
                     ∼ 
                     
                       𝒫 
                       m 
                     
                   
                 
                 
                   
                     
                       ( 
                       
                         
                           ϕ 
                           
                             [ 
                             k 
                             ] 
                           
                         
                         , 
                         
                           v 
                           
                             [ 
                             k 
                             ] 
                           
                         
                       
                       ) 
                     
                     ∼ 
                     A 
                   
                   ⇄ 
                   
                     M 
                     ⁡ 
                     
                       ( 
                       S 
                       ) 
                     
                   
                 
               
               [ 
               
                   
               
               ⁢ 
               
                 ∀ 
                 
                   j 
                   ∈ 
                   
                     
                       [ 
                       k 
                       ] 
                     
                     ⁢ 
                     
                       s 
                       . 
                       t 
                       . 
                       
                           
                       
                       ⁢ 
                       
                         ϕ 
                         j 
                       
                     
                   
                   ∈ 
                   
                     
                       ℱ 
                       
                         𝒫 
                         , 
                         t 
                       
                     
                     : 
                     
                       
                          
                         
                           
                             v 
                             j 
                           
                           - 
                           
                             
                               𝒫 
                               t 
                             
                             ⁡ 
                             
                               [ 
                               
                                 ϕ 
                                 j 
                               
                               ] 
                             
                           
                         
                          
                       
                       ≤ 
                       
                         
                           4 
                           · 
                           
                             ( 
                             
                               
                                 ϕ 
                                 j 
                               
                               ⁡ 
                               
                                 ( 
                                 
                                   𝒫 
                                   t 
                                 
                                 ) 
                               
                             
                             ) 
                           
                         
                         + 
                         ζ 
                       
                     
                   
                 
               
               ] 
             
             ≥ 
             
               1 
               - 
               
                 β 
                 . 
               
             
           
         
       
     
     Proof It should first be observed that by Markov&#39;s inequality,
 
 Pr   Z˜       t   [|ϕ( Z )−   t [ϕ]|≥4· mad (ϕ(   t ))]≤¼.
 
     Therefore, 
     
       
         
           
             
               
                 qi 
                 
                   ϕ 
                   ⁡ 
                   
                     ( 
                     
                       𝒫 
                       t 
                     
                     ) 
                   
                 
               
               ⁡ 
               
                 ( 
                 
                   
                     1 
                     4 
                   
                   , 
                   
                     3 
                     4 
                   
                 
                 ) 
               
             
             ⊆ 
             
               
                 [ 
                 
                   
                     
                       
                         𝒫 
                         t 
                       
                       ⁡ 
                       
                         [ 
                         ϕ 
                         ] 
                       
                     
                     - 
                     
                       4 
                       · 
                       
                         mad 
                         ⁡ 
                         
                           ( 
                           
                             ϕ 
                             ⁡ 
                             
                               ( 
                               
                                 𝒫 
                                 t 
                               
                               ) 
                             
                           
                           ) 
                         
                       
                     
                   
                   , 
                   
                     
                       
                         𝒫 
                         t 
                       
                       ⁡ 
                       
                         [ 
                         ϕ 
                         ] 
                       
                     
                     + 
                     
                       4 
                       · 
                       
                         mad 
                         ⁡ 
                         
                           ( 
                           
                             ϕ 
                             ⁡ 
                             
                               ( 
                               
                                 𝒫 
                                 t 
                               
                               ) 
                             
                           
                           ) 
                         
                       
                     
                   
                 
                 ] 
               
               . 
             
           
         
       
     
     Hence for all jϵ[k] such that φ j ϵ   (¼,¾)⊆[−5,5]. Now T is defined to be the interval [−5,5] discretized with step ζ, or T≐{r·ζ:rϵ }∩[−5,5]. To answer a query ϕ j  define ϕ′ j :X t →T as ϕ′ j (z)=argmin vϵT |v−ϕ′ j (z)| and then use the algorithm from Theorem 4.3 to answer the query ϕ′ j . The projection of the values of ϕ to T simultaneously truncates the range to [−5,5] and discretizes it. The (¼,¾)-quantile interval of φ j (   t ) is inside the interval [−5,5] and therefore is not affected by the truncation step. The discretization can affect this interval by at most ζ. Combining this with (6) it is obtained that if ϕ j ϵ  then 
     
       
         
           
             
               
                 qi 
                 
                   
                     ϕ 
                     ′ 
                   
                   ⁢ 
                   
                     j 
                     ⁡ 
                     
                       ( 
                       
                         𝒫 
                         t 
                       
                       ) 
                     
                   
                 
               
               ⁡ 
               
                 ( 
                 
                   
                     1 
                     4 
                   
                   , 
                   
                     3 
                     4 
                   
                 
                 ) 
               
             
             ⊆ 
             
               
                 [ 
                 
                     
                 
                 ⁢ 
                 
                   
                     
                       
                         𝒫 
                         t 
                       
                       ⁡ 
                       
                         [ 
                         
                           ϕ 
                           j 
                         
                         ] 
                       
                     
                     - 
                     
                       4 
                       · 
                       
                         mad 
                         ⁡ 
                         
                           ( 
                           
                             
                               ϕ 
                               j 
                             
                             ⁡ 
                             
                               ( 
                               
                                 𝒫 
                                 t 
                               
                               ) 
                             
                           
                           ) 
                         
                       
                     
                     - 
                     ζ 
                   
                   , 
                   
                     
                       
                         𝒫 
                         t 
                       
                       ⁡ 
                       
                         [ 
                         
                           ϕ 
                           j 
                         
                         ] 
                       
                     
                     + 
                     
                       4 
                       · 
                       
                         mad 
                         ⁡ 
                         
                           ( 
                           
                             
                               ϕ 
                               j 
                             
                             ⁡ 
                             
                               ( 
                               
                                 𝒫 
                                 t 
                               
                               ) 
                             
                           
                           ) 
                         
                       
                     
                     + 
                     ζ 
                   
                 
                 ] 
               
               . 
             
           
         
       
     
     Therefore the value v j  returned by the algorithm from Theorem 4.3 to query ϕ′ j  satisfies:
 
| v   j −   t [ϕ j ]|≤4· mad (ϕ j (   t ))+ζ.
 
     Now to obtain the claimed bound on the sample complexity it is observed that |T|≤10/ζ. 
     Remark 1: Note that mean absolute deviation of ϕ is upper-bounded by the standard deviation of ϕ. Therefore Corollary 4.4 also holds with mad(ϕ j (   t )) replaced by sd(ϕ j (   t )) both in the definition of   and the accuracy bound (with the constant factor 4 being replaced by 2 since Chebyshev&#39;s inequality can be used instead of Markov&#39;s). The obtained statement generalizes Theorem 1.2 described. The quantile-based guarantees of the other algorithms can be converted to additive error guarantees in an analogous way. 
     Somewhat sharper (asymptotic) bounds can be obtained by using the approximate median algorithm based on linear queries (Lemma 3.2) together with the algorithm for answering linear queries in prior techniques. Specifically, this algorithm can solve the problem given n=O(t√{square root over (k·log(1/ζ)·log(1/β)·log(log(k log(1/ζ))/β))} samples. 
     4.2 Simple Generalization 
     A relatively simple and seemingly weak generalization result that shows the output of a differentially private algorithm cannot “overfit” its input dataset will now be described. Namely, if an (ε, δ) differentially private algorithm outputs a function ϕ: →  on a dataset sϵ   m  sampled from    m , then the value of ϕ on any element of the dataset is within the (ρ,1−ϕ)-quantile interval of ϕ( ) with probability at least 1−(2e ε ρ+δ). To obtain meaningful guarantees about the whole dataset from such generalization result, p must be relatively small (much smaller than the desired ¼). The good news is that for an estimator that is well-concentrated around its mean, even values within (ρ,1−φ-quantile interval for small p are close to the mean. Note that, in principle, any estimator can be amplified by sampling and taking a median before being used in this analysis and hence generalization guarantees can be obtained from such relatively simple analysis even in the general case (although the algorithm in this case would need to use two median steps). 
     Theorem 4.5 Let M:   m →   [0,1]  be a (ε, δ)-differentially private algorithm with    [0,1]  being the set of functions ϕ: →[0,1]. Let   be a distribution on  . Then for all iϵ[m], 
     
       
         
           
             
               
                 Pr 
                 
                   
                     S 
                     ~ 
                     
                       𝒟 
                       m 
                     
                   
                   ⁢ 
                   
                     
 
                   
                   ⁢ 
                   
                     ϕ 
                     ~ 
                     
                       M 
                       ⁡ 
                       
                         ( 
                         S 
                         ) 
                       
                     
                   
                 
               
               ⁡ 
               
                 [ 
                 
                   
                     ϕ 
                     ⁡ 
                     
                       ( 
                       
                         S 
                         i 
                       
                       ) 
                     
                   
                   ∉ 
                   
                     
                       qi 
                       
                         ϕ 
                         ⁡ 
                         
                           ( 
                           𝒟 
                           ) 
                         
                       
                     
                     ⁡ 
                     
                       ( 
                       
                         ρ 
                         , 
                         
                           1 
                           - 
                           ρ 
                         
                       
                       ) 
                     
                   
                 
                 ] 
               
             
             ≤ 
             
               
                 2 
                 ⁢ 
                 ρ 
                 ⁢ 
                 
                     
                 
                 ⁢ 
                 
                   e 
                   ɛ 
                 
               
               + 
               δ 
             
           
         
       
     
     By differential privacy, for all iϵ[m] 
                       Pr       S   ~     𝒟   m       ⁢     
     ⁢     ϕ   ~     M   ⁡     (   S   )             ⁡     [       ϕ   ⁡     (     S   i     )       ∉       qi     ϕ   ⁡     (   𝒟   )         ⁡     (     ρ   ,     1   -   ρ       )         ]       ≤       ⁢         e   ɛ     ⁢       Pr           (     S   ,   Z     )     ~     𝒟   m       ×   𝒟     ⁢     
     ⁢     ϕ   ~     M   ⁡     (       S     -   i       ,   Z     )             ⁡     [       ϕ   ⁡     (     S   i     )       ∉       qi     ϕ   ⁡     (   𝒟   )         ⁡     (     ρ   ,     1   -   ρ       )         ]         +                 =       ⁢         e   ɛ     ⁢       Pr           (     S   ,   Z     )     ~     𝒟   m       ×   𝒟     ⁢     
     ⁢     ϕ   ~     M   ⁡     (   S   )             ⁡     [       ϕ   ⁡     (   Z   )       ∉       qi     ϕ   ⁡     (   𝒟   )         ⁡     (     ρ   ,     1   -   ρ       )         ]         +                   ≤       ⁢         e   ɛ     ⁢   2   ⁢   ρ     +   δ       ,               
where the equalities follow from the fact that the pairs (S, Z) and ((S −i , Z), Z i ) are identically distributed and the definition of the (ρ,1−φ-quantile interval.
 
     Now for ρ and δ that are sufficiently small, Theorem 4.5 ensures that with probability at least 1−β, for all iϵ[m], φ(s i )ϵ )(ρ, 1−φ. This means that to get a value in  (ρ,1−φ, an algorithm that outputs a value that is in between the smallest and the largest values of ϕ on the elements of a dataset s may be used. Such value is referred to as an interior point of ϕ(s) (and is equivalent to a 1-approximate median). This argument gives the following theorem. 
     Theorem 4.6: For any βϵ(0,1), t, kϵ , a finite set T⊂  and  =X t , and with 
               n   ≥     n   0       =     O   ⁡     (     t   ·     k     ·     log   ⁡     (          T        β     )       ·       log     1   2       ⁡     (       k   ⁢           ⁢     log   ⁡     (        T        )         β     )         )             
there exists an interactive algorithm M that takes as input a dataset sϵX n  and provides answers v 1 , . . . , v k ϵT to adaptively-chosen queries ϕ 1 , . . . , ϕ k :X t →T such that, for all interactive algorithms A and distributions   on X,
 
     
       
         
           
             
               
                 
                   
                     Pr 
                     
                       S 
                       ∼ 
                       
                         𝒫 
                         n 
                       
                     
                   
                   
                     
                       
                         ( 
                         
                           
                             ϕ 
                             
                               [ 
                               k 
                               ] 
                             
                           
                           , 
                           
                             v 
                             
                               [ 
                               k 
                               ] 
                             
                           
                         
                         ) 
                       
                       ∼ 
                       A 
                     
                     ⇄ 
                     
                       M 
                       ⁡ 
                       
                         ( 
                         S 
                         ) 
                       
                     
                   
                 
                 [ 
                 
                     
                 
                 ⁢ 
                 
                   ∀ 
                   
                     j 
                     ∈ 
                     
                       
                         [ 
                         k 
                         ] 
                       
                       ⁢ 
                       
                         v 
                         j 
                       
                     
                     ∈ 
                     
                       
                         qi 
                         
                           
                             ϕ 
                             j 
                           
                           ⁡ 
                           
                             ( 
                             
                               𝒫 
                               t 
                             
                             ) 
                           
                         
                       
                       ⁡ 
                       
                         ( 
                         
                           ρ 
                           , 
                           
                             1 
                             - 
                             ρ 
                           
                         
                         ) 
                       
                     
                   
                 
                 ] 
               
               ≥ 
               
                 1 
                 - 
                 β 
               
             
             , 
             
               
 
             
             ⁢ 
             
               
                 where 
                 ⁢ 
                 
                     
                 
                 ⁢ 
                 ρ 
               
               = 
               
                 
                   β 
                   · 
                   
                     t 
                     
                       4 
                       ⁢ 
                       kn 
                     
                   
                 
                 = 
                 
                   
                     
                       Ω 
                       ~ 
                     
                     ( 
                     
                       β 
                       
                         
                           
                             k 
                             
                               3 
                               2 
                             
                           
                           · 
                           log 
                         
                         ⁢ 
                         
                            
                           T 
                            
                         
                       
                     
                     ) 
                   
                   . 
                 
               
             
           
         
       
     
     The algorithm for answering adaptive queries above is used, but with 1-approximate median, instead of ¼. As in the proof of Theorem 1.3,  ≐X t  and  =   t . Theorem 3.1 says that if m≥4 ln(2k|T|/β)/{tilde over (ε)}, then each execution of the median algorithm is ({tilde over (ε)}, 0)-differentially private for every input query ϕ j : →T j . This implies that for all interactive algorithms A and every sϵ   m , 
     
       
         
           
             
               
                 
                   
                     
                       Pr 
                       
                         
                           
                             ( 
                             
                               
                                 ϕ 
                                 
                                   [ 
                                   k 
                                   ] 
                                 
                               
                               , 
                               
                                 v 
                                 
                                   [ 
                                   k 
                                   ] 
                                 
                               
                             
                             ) 
                           
                           ~ 
                           A 
                         
                         ⇄ 
                         
                           M 
                           ⁡ 
                           
                             ( 
                             s 
                             ) 
                           
                         
                       
                     
                     ⁡ 
                     
                       [ 
                       
                         ∀ 
                         
                           j 
                           ∈ 
                           
                             
                               [ 
                               k 
                               ] 
                             
                             ⁢ 
                             
                                 
                             
                             ⁢ 
                             
                               v 
                               j 
                             
                           
                           ∈ 
                           
                             
                               qi 
                               
                                 
                                   ϕ 
                                   j 
                                 
                                 ⁡ 
                                 
                                   ( 
                                   s 
                                   ) 
                                 
                               
                             
                             ⁡ 
                             
                               ( 
                               
                                 0 
                                 , 
                                 1 
                               
                               ) 
                             
                           
                         
                       
                       ] 
                     
                   
                   ≥ 
                   
                     1 
                     - 
                     
                       
                         β 
                         2 
                       
                       . 
                     
                   
                 
               
               
                 
                   ( 
                   7 
                   ) 
                 
               
             
           
         
       
     
     The interactive composition (Theorem 2.5) implies that M is (ε, δ)-differentially private for any δϵ(0,1) and 
     
       
         
           
             ɛ 
             = 
             
               
                 
                   k 
                   2 
                 
                 ⁢ 
                 
                   ( 
                   
                     
                       4 
                       ⁢ 
                       
                         ln 
                         ⁡ 
                         
                           ( 
                           
                             
                               2 
                               ⁢ 
                               
                                  
                                 T 
                                  
                               
                             
                             β 
                           
                           ) 
                         
                       
                     
                     m 
                   
                   ) 
                 
               
               + 
               
                 
                   
                     4 
                     ⁢ 
                     
                       ln 
                       ⁡ 
                       
                         ( 
                         
                           
                             2 
                             ⁢ 
                             
                                
                               T 
                                
                             
                           
                           β 
                         
                         ) 
                       
                     
                   
                   m 
                 
                 ⁢ 
                 
                   
                     
                       2 
                       ⁢ 
                       k 
                       ⁢ 
                       
                           
                       
                       ⁢ 
                       
                         ln 
                         ⁡ 
                         
                           ( 
                           
                             1 
                             δ 
                           
                           ) 
                         
                       
                     
                   
                   . 
                 
               
             
           
         
       
     
     Now applying Theorem 4.5 and a union bound: 
     
       
         
           
             
               
                 Pr 
                 
                   
                     S 
                     ~ 
                     
                       𝒟 
                       m 
                     
                   
                   ⁢ 
                   
                     
 
                   
                   ⁢ 
                   
                     
                       
                         ( 
                         
                           
                             ϕ 
                             
                               [ 
                               k 
                               ] 
                             
                           
                           , 
                           
                             v 
                             
                               [ 
                               k 
                               ] 
                             
                           
                         
                         ) 
                       
                       ~ 
                       A 
                     
                     ⇄ 
                     
                       M 
                       ⁡ 
                       
                         ( 
                         S 
                         ) 
                       
                     
                   
                 
               
               ⁡ 
               
                 [ 
                 
                   
                     ∃ 
                     
                       j 
                       ∈ 
                       
                         [ 
                         k 
                         ] 
                       
                     
                   
                   , 
                   
                     i 
                     ∈ 
                     
                       
                         [ 
                         m 
                         ] 
                       
                       ⁢ 
                       
                           
                       
                       ⁢ 
                       
                         
                           ϕ 
                           j 
                         
                         ⁡ 
                         
                           ( 
                           
                             S 
                             i 
                           
                           ) 
                         
                       
                     
                     ∉ 
                     
                       
                         qi 
                         
                           ϕj 
                           ⁡ 
                           
                             ( 
                             𝒟 
                             ) 
                           
                         
                       
                       ⁡ 
                       
                         ( 
                         
                           ρ 
                           , 
                           
                             1 
                             - 
                             ρ 
                           
                         
                         ) 
                       
                     
                   
                 
                 ] 
               
             
             ≤ 
             
               
                 km 
                 ⁡ 
                 
                   ( 
                   
                     
                       
                         e 
                         ɛ 
                       
                       ⁢ 
                       2 
                       ⁢ 
                       ρ 
                     
                     + 
                     δ 
                   
                   ) 
                 
               
               . 
             
           
         
       
     
     Combining this with (7): 
                 Pr         S   ~     𝒟   m       ⁢     
     ⁢       (       ϕ     [   k   ]       ,     v     [   k   ]         )     ~   A       ⇄     M   ⁡     (   S   )           ⁡     [     ∀     j   ∈       [   k   ]     ⁢           ⁢     v   j       ∈       qi     ϕ   ⁢           ⁢     j   ⁡     (   𝒟   )           ⁡     (     ρ   ,     1   -   ρ       )           ]       ≥     1   -     β   2     -       km   ⁡     (         e   ɛ     ⁢   2   ⁢   ρ     +   δ     )       .             
Setting m=8 log(2|T|/β)√{square root over (2k ln(1/δ))} ensures that √≤ln 2. Hence for δ=β/(10 km) and ρ=β/(10 km) it is obtained that km(e ε 2ρ+δ)≤β/2.
 
     For example, if each ϕ j  is (1/√{square root over (t)})-subgaussian with the mean    t [ϕ j ]ϵ[−1,1] then for every α&gt;0, setting t=Õ(log(k/β)/α 2 ) ensures that  (ρ, 1−ρ)⊆[   t [ϕ j ]−α,    t [ϕ j ]+α]. This implies that the means can be estimated with accuracy α given Õ(√{square root over (k)}·log 2 (1/β)/α 2 ) samples. Note that low-sensitivity queries are (1/√{square root over (t)})-subgaussian and therefore the sample complexity of the present algorithm given by this simple analysis is comparable to the best known for this problem. 
     As pointed out above, this analysis can also be used to deal with general estimators by adding an additional amplification step. Namely, computing the estimator on several independent subsamples and taking (the exact) median. The resulting algorithm would have sample complexity that is identical to that obtained in Theorem 4.3 up to an additional logarithmic factor (which can be removed with careful calibration of parameters). 
     5. Dealing with a Large Number of Queries 
     In this section ways to use the approach described herein when the number of queries that needs to be answered is (relatively) large are described. Namely, an algorithm for answering verification queries and an algorithm whose complexity scales as log k, rather than √{square root over (k)} is provided. 
     5.1 Verification Queries 
     Another application of techniques from differential privacy given by prior art techniques is an algorithm that given a statistical query and a proposed estimate of the expectation of this query, verifies the estimate. This problem requires less data if most proposed answers are correct. Specifically, the number of samples needed by this algorithm is (just) logarithmic in the number of queries k but also scales linearly in √{square root over (l)}, where l is the number of queries that fail the verification step. This result is extended to low-sensitivity queries using these results also based upon prior art techniques. In addition, prior art techniques describe a query verification algorithm that can handle arbitrary queries (not just real-valued), which however has sample complexity with linear dependence on l. Its analysis is based on a simple description length-based argument. 
     A natural way to apply such algorithms is the reusable holdout technique. In this technique the dataset is split into two disjoint parts: the “training” set s t  and the holdout set s h . The analyst then uses the training set to answer queries and perform other arbitrary analyses. The holdout set is used solely to check whether the answers that were obtained on the training set generalize. Another application is an algorithm referred to as Effective Rounds. This algorithm splits the dataset into several disjoint subsets and at each time uses only one of the subsets to answer queries. An algorithm for verifying answers to queries is used to switch to a new subset of samples whenever a query fails the verification step (and uses its own subset of samples). 
     Here, an algorithm for verifying answers to queries about general estimators is described. Formally, the algorithm satisfies the following guarantees. 
     Theorem 5.1 Fix ρ&gt;α&gt;0, β&gt;0, l, t, kϵ , and n≥n 0 =O(t√{square root over (l log(1/αβ))} log(k/β)ρ/α 2 ). There exists an interactive algorithm M that takes as input sϵX n  and provides answers a 1 , . . . , a k ϵ{Y, N, ⊥} to adaptively-chosen queries (ϕ 1 ,v 1 ), . . . , (ϕ k ,v k ) (where ϕ j :X t →  and v j ϵ  for all jϵ[k]) satisfying the following: for all interactive algorithms A and distributions   over X, 
     
       
         
           
             
               
                 Pr 
                 
                   
                     S 
                     ~ 
                     
                       
                         𝒫 
                         n 
                       
                       ⁢ 
                       
                         
 
                       
                       ( 
                       
                         
                           ϕ 
                           
                             [ 
                             k 
                             ] 
                           
                         
                         , 
                         
                           
                             v 
                             
                               [ 
                               k 
                               ] 
                             
                           
                           ⁢ 
                           
                             a 
                             
                               [ 
                               k 
                               ] 
                             
                           
                         
                       
                       ) 
                     
                     ~ 
                     A 
                   
                   ⇄ 
                   
                     M 
                     ⁡ 
                     
                       ( 
                       S 
                       ) 
                     
                   
                 
               
                 
             
             ⁢ 
             
                 
               
                 
                   [ 
                   
                       
                   
                   ⁢ 
                   
                     ∀ 
                     
                       j 
                       ∈ 
                       
                         
                           [ 
                           k 
                           ] 
                         
                         ⁢ 
                         
                             
                         
                         ⁢ 
                         
                           
                             
                               
                                 
                                   v 
                                   j 
                                 
                                 ∈ 
                                 
                                   
                                     qi 
                                     
                                       
                                         ϕ 
                                         j 
                                       
                                       ⁡ 
                                       
                                         ( 
                                         
                                           𝒫 
                                           i 
                                         
                                         ) 
                                       
                                     
                                   
                                   ⁡ 
                                   
                                     ( 
                                     
                                       ρ 
                                       , 
                                       
                                         1 
                                         - 
                                         ρ 
                                       
                                     
                                     ) 
                                   
                                 
                               
                             
                             
                               ⟹ 
                             
                             
                               
                                 
                                   a 
                                   j 
                                 
                                 ∈ 
                                 
                                   { 
                                   
                                     Y 
                                     , 
                                     ⊥ 
                                   
                                   } 
                                 
                               
                             
                           
                           
                             
                               
                                 
                                     
                                 
                                 ⁢ 
                                 
                                   
                                     v 
                                     j 
                                   
                                   ∉ 
                                   
                                     
                                       qi 
                                       
                                         
                                           ϕ 
                                           j 
                                         
                                         ⁡ 
                                         
                                           ( 
                                           
                                             𝒫 
                                             i 
                                           
                                           ) 
                                         
                                       
                                     
                                     ⁡ 
                                     
                                       ( 
                                       
                                         
                                           ρ 
                                           - 
                                           α 
                                         
                                         , 
                                         
                                           1 
                                           - 
                                           ρ 
                                           + 
                                           α 
                                         
                                       
                                       ) 
                                     
                                   
                                 
                               
                             
                             
                               ⟹ 
                             
                             
                               
                                 
                                   a 
                                   j 
                                 
                                 ∈ 
                                 
                                   { 
                                   
                                     N 
                                     , 
                                     ⊥ 
                                   
                                   } 
                                 
                               
                             
                           
                           
                             
                               
                                 
                                    
                                   
                                     { 
                                     
                                       
                                         
                                           
                                             j 
                                             ′ 
                                           
                                           ∈ 
                                           
                                             [ 
                                             
                                               j 
                                               - 
                                               1 
                                             
                                             ] 
                                           
                                         
                                         : 
                                         
                                           a 
                                           
                                             j 
                                             ′ 
                                           
                                         
                                       
                                       = 
                                       N 
                                     
                                     } 
                                   
                                    
                                 
                                 = 
                                 ℓ 
                               
                             
                             
                               ⟺ 
                             
                             
                               
                                 
                                   a 
                                   j 
                                 
                                 = 
                                 ⊥ 
                               
                             
                           
                         
                       
                     
                   
                   ⁢ 
                   
                       
                   
                   ] 
                 
                 ≥ 
                 
                   1 
                   - 
                   
                     β 
                     . 
                   
                 
               
             
           
         
       
     
     First, the accuracy promise of this algorithm is described. Each query is specified by a function ϕ j :X t →  as well as a “guess” v j ϵ . The guess is “good” if v j ϵ (ρ,1−ρ) and “bad” if v j ϵ (ρ−α,1−ρ+α). Essentially, the guarantee is that, if the guess is good, the algorithm answers Y and, if the guess is bad, the algorithm answers N. However, there are two caveats to this guarantee—(i) if the guess is neither good nor bad, then the algorithm may output either Y or N and, —(ii) once the algorithm has given the answer N to l queries, its failure budget is “exhausted” and it only outputs ⊥. 
     Note that this algorithm handles only the verification and does not provide correct answers to queries that failed the verification step. To obtain correct responses one can run an instance of the query-answering algorithm from Theorem 1.3 in parallel with the verification algorithm. The query-answering algorithm would be used only l times and hence the dataset size it would require would be independent of k and scale linearly in √{square root over (l)}. (The two algorithms can either be run on disjoint subsets of data or on the same dataset since differential privacy composes.) 
     The proof is a reduction of the verification step to verification of answers to statistical queries (relative to    t ). Hence the results may be directed applied from prior approaches to analyze the present algorithm. However, as mentioned above, for small values of ρ, the existing algorithm has suboptimal dependence of sample complexity on ρ and α. Specifically, the dependence is 1/α 2  instead of ρ/α 2  which, in particular, is quadratically worse for the typical setting of α=Θ(ρ). Note that the dataset size grows with l—the number of times that “No” is returned to a verification query. Therefore choosing a small ρ is useful for ensuring that “No” is returned only when overfitting is substantial enough to require correction. 
     To improve this dependence the sharper generalization result is used (Theorem 4.2). But first, the stability properties of the sparse vector technique that are the basis of this algorithm. 
     Theorem 5.2 For all α, β, ε, δ&gt;0, m, k, lϵ  with 
                 m   ≥     m   0       =     O   (           ℓlog   ⁡     (     1   δ     )         ⁢     log   ⁡     (     k   β     )         ɛα     )       ,         
there exists an interactive (ε, δ)-differentially private algorithm {tilde over (M)} that takes as input sϵ   m  and provides answers b 1 , . . . , b k ϵ{Y, N, ⊥} to adaptively chosen queries (ψ 1 , u 1 ), . . . , (ψ k , u k ) (where ψ j : →  and u j ϵ  for all jϵ[k]) with the following accuracy guarantee. For all interactive algorithms A and all sϵ   m 
 
     
       
         
           
             
               
                 Pr 
                 
                   
                     
                       ( 
                       
                         
                           ψ 
                           
                             [ 
                             k 
                             ] 
                           
                         
                         , 
                         
                           
                             u 
                             
                               [ 
                               k 
                               ] 
                             
                           
                           ⁢ 
                           
                             b 
                             
                               [ 
                               k 
                               ] 
                             
                           
                         
                       
                       ) 
                     
                     ~ 
                     A 
                   
                   ⇄ 
                   
                     
                       M 
                       ^ 
                     
                     ⁡ 
                     
                       ( 
                       s 
                       ) 
                     
                   
                 
               
                 
             
             ⁢ 
             
                 
               
                 
                   [ 
                   
                       
                   
                   ⁢ 
                   
                     ∀ 
                     
                       j 
                       ∈ 
                       
                         
                           [ 
                           k 
                           ] 
                         
                         ⁢ 
                         
                             
                         
                         ⁢ 
                         
                           
                             
                               
                                 
                                   s 
                                   ⁡ 
                                   
                                     [ 
                                     
                                       ψ 
                                       j 
                                     
                                     ] 
                                   
                                 
                                 &gt; 
                                 
                                   u 
                                   j 
                                 
                               
                             
                             
                               ⟹ 
                             
                             
                               
                                 
                                   b 
                                   j 
                                 
                                 ∈ 
                                 
                                   { 
                                   
                                     Y 
                                     , 
                                     ⊥ 
                                   
                                   } 
                                 
                               
                             
                           
                           
                             
                               
                                 
                                   s 
                                   ⁡ 
                                   
                                     [ 
                                     
                                       ψ 
                                       j 
                                     
                                     ] 
                                   
                                 
                                 ≤ 
                                 
                                   
                                     u 
                                     j 
                                   
                                   - 
                                   α 
                                 
                               
                             
                             
                               ⟹ 
                             
                             
                               
                                 
                                   b 
                                   j 
                                 
                                 ∈ 
                                 
                                   { 
                                   
                                     N 
                                     , 
                                     ⊥ 
                                   
                                   } 
                                 
                               
                             
                           
                           
                             
                               
                                 
                                    
                                   
                                     { 
                                     
                                       
                                         
                                           
                                             j 
                                             ′ 
                                           
                                           ∈ 
                                           
                                             [ 
                                             
                                               j 
                                               - 
                                               1 
                                             
                                             ] 
                                           
                                         
                                         : 
                                         
                                           b 
                                           
                                             j 
                                             ′ 
                                           
                                         
                                       
                                       = 
                                       N 
                                     
                                     } 
                                   
                                    
                                 
                                 = 
                                 ℓ 
                               
                             
                             
                               ⟺ 
                             
                             
                               
                                 
                                   b 
                                   j 
                                 
                                 = 
                                 ⊥ 
                               
                             
                           
                         
                       
                     
                   
                   ⁢ 
                   
                       
                   
                   ] 
                 
                 ≥ 
                 
                   1 
                   - 
                   
                     β 
                     . 
                   
                 
               
             
           
         
       
     
     Proof [of Theorem 5.1]: As before,  ≐X t ,  ≐   t  and the input dataset is viewed as an element of    m  sampled from    m . 
     The sparse vector algorithm of Theorem 5.2 is used. Theorem 4.1 is used to convert the empirical guarantee into a guarantee relative to the data distribution, as in Theorem 4.2. However, every verification query is converted into two statistical queries to check the two “ends” of the quantile interval. That is, given a verification query (ϕ j , v j ) for which it is desirable to know whether v j ϵ (ρ, 1−ρ) or v j ϵ (Σ−α,1−ρ+α), two statistical queries ψ 2j-1  and ψ 2j  are presented for which it is desirable to know if  [ϕ]&gt;ρ or D[ψ]&lt;ρ−α (with ψϵ{ψ 2j-1 , ψ 2j }). Formally, there is the following reduction. 
     The sparse vector algorithm {tilde over (M)} of Theorem 5.2 is converted into an algorithm M of the desired form of Theorem 5.1: Each query (ϕ j , v j ) to M is converted into two queries (ψ 2j-1 , u 2j-1 ) and (ψ 2j , u 2j ) to {tilde over (M)}, where 
     
       
         
           
             
               
                 
                   ψ 
                   
                     
                       2 
                       ⁢ 
                       j 
                     
                     - 
                     1 
                   
                 
                 ⁡ 
                 
                   ( 
                   z 
                   ) 
                 
               
               = 
               
                 1 
                 ⁢ 
                 
                   ( 
                   
                     
                       
                         ϕ 
                         j 
                       
                       ⁡ 
                       
                         ( 
                         x 
                         ) 
                       
                     
                     ≤ 
                     
                       v 
                       j 
                     
                   
                   ) 
                 
               
             
             , 
             
               
                 
                   ψ 
                   
                     
                       2 
                       ⁢ 
                       j 
                     
                     - 
                     1 
                   
                 
                 ⁡ 
                 
                   ( 
                   z 
                   ) 
                 
               
               = 
               
                 1 
                 ⁢ 
                 
                   ( 
                   
                     
                       
                         ϕ 
                         j 
                       
                       ⁡ 
                       
                         ( 
                         x 
                         ) 
                       
                     
                     ≥ 
                     
                       v 
                       j 
                     
                   
                   ) 
                 
               
             
             , 
             
               
                 u 
                 
                   
                     2 
                     ⁢ 
                     j 
                   
                   - 
                   1 
                 
               
               = 
               
                 
                   u 
                   
                     2 
                     ⁢ 
                     j 
                   
                 
                 = 
                 
                   ρ 
                   - 
                   
                     
                       α 
                       3 
                     
                     . 
                   
                 
               
             
           
         
       
     
     These queries have the following key property: (†) If v j ϵ (ρ, 1−ρ), then  [ψ 2j-1 ]&gt;ρ and  [ψ 2j ]&gt;ρ. If v j ϵ  (ρ−α,1−ρ+α), then either  [ψ 2j-1 ]≤ρ−α or  [ψ 2j ]≤ρ−α (but not both). Let b 2j-1  and b 2j  be the answers produced by {tilde over (M)} to (ψ 2j-1 , u 2j-1 ) and (ψ 2j , u 2j ) respectively. If b 2j-1 =b 2j =Y, then M returns a j =Y. If b 2j-1 =⊥ or b 2j =⊥ (or both), then M returns a j =⊥. Otherwise M returns a j =N. 
     Note that {tilde over (M)} must answer twice as many queries as M; thus {tilde over (M)} must be instantiated with the value k being twice as large as for M. {tilde over (M)} is also instantiated with a reduced by a factor of 3 and β reduced by a factor of 2. The values ε and δ used by {tilde over (M)} will be determined later in this proof. 
     In particular, {tilde over (M)} is instantiated to achieve the following accuracy guarantee. For all interactive algorithms A and all sϵ   m   
     
       
         
           
             
               
                 Pr 
                 
                   
                     
                       ( 
                       
                         
                           ψ 
                           
                             [ 
                             k 
                             ] 
                           
                         
                         , 
                         
                           
                             u 
                             
                               [ 
                               k 
                               ] 
                             
                           
                           ⁢ 
                           
                             b 
                             
                               [ 
                               k 
                               ] 
                             
                           
                         
                       
                       ) 
                     
                     ~ 
                     A 
                   
                   ⇄ 
                   
                     
                       M 
                       ^ 
                     
                     ⁡ 
                     
                       ( 
                       s 
                       ) 
                     
                   
                 
               
                 
             
             ⁢ 
             
                 
               
                 
                   [ 
                   
                       
                   
                   ⁢ 
                   
                     ∀ 
                     
                       j 
                       ∈ 
                       
                         
                           [ 
                           k 
                           ] 
                         
                         ⁢ 
                         
                             
                         
                         ⁢ 
                         
                           
                             
                               
                                 
                                   s 
                                   ⁡ 
                                   
                                     [ 
                                     
                                       ψ 
                                       j 
                                     
                                     ] 
                                   
                                 
                                 &gt; 
                                 
                                   u 
                                   j 
                                 
                               
                             
                             
                               ⟹ 
                             
                             
                               
                                 
                                   b 
                                   j 
                                 
                                 ∈ 
                                 
                                   { 
                                   
                                     Y 
                                     , 
                                     ⊥ 
                                   
                                   } 
                                 
                               
                             
                           
                           
                             
                               
                                 
                                   s 
                                   ⁡ 
                                   
                                     [ 
                                     
                                       ψ 
                                       j 
                                     
                                     ] 
                                   
                                 
                                 ≤ 
                                 
                                   
                                     u 
                                     j 
                                   
                                   - 
                                   
                                     α 
                                     / 
                                     3 
                                   
                                 
                               
                             
                             
                               ⟹ 
                             
                             
                               
                                 
                                   b 
                                   j 
                                 
                                 ∈ 
                                 
                                   { 
                                   
                                     N 
                                     , 
                                     ⊥ 
                                   
                                   } 
                                 
                               
                             
                           
                           
                             
                               
                                 
                                    
                                   
                                     { 
                                     
                                       
                                         
                                           
                                             j 
                                             ′ 
                                           
                                           ∈ 
                                           
                                             [ 
                                             
                                               j 
                                               - 
                                               1 
                                             
                                             ] 
                                           
                                         
                                         : 
                                         
                                           b 
                                           
                                             j 
                                             ′ 
                                           
                                         
                                       
                                       = 
                                       N 
                                     
                                     } 
                                   
                                    
                                 
                                 = 
                                 ℓ 
                               
                             
                             
                               ⟺ 
                             
                             
                               
                                 
                                   b 
                                   j 
                                 
                                 = 
                                 ⊥ 
                               
                             
                           
                         
                       
                     
                   
                   ⁢ 
                   
                       
                   
                   ] 
                 
                 ≥ 
                 
                   1 
                   - 
                   
                     
                       β 
                       2 
                     
                     . 
                   
                 
               
             
           
         
       
     
     Now is will be shown that M satisfies the promised accuracy requirement relative to the distribution   rather than relative to the empirical values. Given the key property (†) above, it suffices to show that, with probability at least 1−β/2 over a random choice of S˜ m, for all jϵ[2k] and (ψ [k] , u [k] , b [k] )˜A⇄{tilde over (M)} (S), so that
 
 [ψ j ]ρ⇒ S [ψ j ]&gt; u   j =ρ−α/3 and  [ψ j ]ρ−α⇒ S [ψ j ]≤ u   j −α/3=ρ−2α/3.  (8)
 
     Furthermore, to prove (8), it suffices to have 
     
       
         
           
             
               
                 
                   
                     𝒟 
                     ⁡ 
                     
                       [ 
                       
                         ψ 
                         j 
                       
                       ] 
                     
                   
                   · 
                   
                     
                       ρ 
                       - 
                       
                         α 
                         4 
                       
                     
                     ρ 
                   
                 
                 - 
                 
                   α 
                   12 
                 
               
               ≤ 
               
                 S 
                 ⁡ 
                 
                   [ 
                   
                     ψ 
                     j 
                   
                   ] 
                 
               
               ≤ 
               
                 
                   
                     𝒟 
                     ⁡ 
                     
                       [ 
                       
                         ψ 
                         j 
                       
                       ] 
                     
                   
                   · 
                   
                     
                       ρ 
                       - 
                       
                         
                           3 
                           ⁢ 
                           α 
                         
                         4 
                       
                     
                     
                       ρ 
                       - 
                       α 
                     
                   
                 
                 + 
                 
                   α 
                   12 
                 
               
             
             , 
           
         
       
     
     which is, in turn, implied by 
     
       
         
           
             
                
               
                 
                   S 
                   ⁡ 
                   
                     [ 
                     
                       ψ 
                       j 
                     
                     ] 
                   
                 
                 - 
                 
                   𝒟 
                   ⁡ 
                   
                     [ 
                     
                       ψ 
                       j 
                     
                     ] 
                   
                 
               
                
             
             ≤ 
             
               
                 
                   α 
                   
                     4 
                     ⁢ 
                     ρ 
                   
                 
                 · 
                 
                   𝒟 
                   ⁡ 
                   
                     [ 
                     
                       ψ 
                       j 
                     
                     ] 
                   
                 
               
               + 
               
                 
                   α 
                   12 
                 
                 . 
               
             
           
         
       
     
     Theorem 4.1 is now used to prove that (9) holds simultaneously for all jϵ[2k] with probability at least 1−β/2, as required to complete the proof. First, define f:   {0,1}   2k ×   2k ×{Y, N, ⊥} 2k →   {0,1}   4k  by f(ψ, u, b)=(ψ 1 , 1−ψ 1 , ψ 2 , 1−ψ 2 , . . . , ψ 2k , 1−ψ 2k ). By post-processing (Theorem 2.3), f (A⇄{tilde over (M)} (s)), is an (ε, δ)-differentially private function of sϵ   m  for all interactive algorithms A. The output of f (A⇄M (s)), is 4k functions mapping   to {0,1}. Set 
             ɛ   =       1   2     ⁢     ln   ⁡     (     1   +     α     8   ⁢   ρ         )               
and δ=αβ/(16·2·12).
 
     Suppose 
             m   ≥         8   ·   12     ɛα     ⁢       ln   ⁡     (     16   ⁢     k   /   β       )       .             
By theorem 4.1,
 
     
       
         
           
             
               
                 
                   
                     ⁢ 
                     
                       
                         
                           Pr 
                           
                             S 
                             ~ 
                             
                               𝒟 
                               m 
                             
                           
                         
                         
                           
                             ψ 
                             ^ 
                           
                           ~ 
                           
                             f 
                             ⁡ 
                             
                               ( 
                               
                                 A 
                                 ⇄ 
                                 
                                   M 
                                   ⁡ 
                                   
                                     ( 
                                     S 
                                     ) 
                                   
                                 
                               
                               ) 
                             
                           
                         
                       
                       ⁡ 
                       
                         [ 
                         
                           ∀ 
                           
                             j 
                             ∈ 
                             
                               
                                 [ 
                                 
                                   2 
                                   ⁢ 
                                   k 
                                 
                                 ] 
                               
                               ⁢ 
                               
                                 
                                   
                                     
                                       
                                         
                                           S 
                                           ⁡ 
                                           
                                             [ 
                                             
                                               ψ 
                                               j 
                                             
                                             ] 
                                           
                                         
                                         - 
                                         
                                           𝒟 
                                           ⁡ 
                                           
                                             [ 
                                             
                                               ψ 
                                               j 
                                             
                                             ] 
                                           
                                         
                                       
                                       ≤ 
                                       
                                         
                                           α 
                                           12 
                                         
                                         + 
                                         
                                           
                                             α 
                                             
                                               S 
                                               ρ 
                                             
                                           
                                           · 
                                           
                                             mad 
                                             ⁡ 
                                             
                                               ( 
                                               
                                                 
                                                   ψ 
                                                   j 
                                                 
                                                 ⁡ 
                                                 
                                                   ( 
                                                   𝒟 
                                                   ) 
                                                 
                                               
                                               ) 
                                             
                                           
                                         
                                       
                                     
                                   
                                 
                                 
                                   
                                     
                                       
                                         
                                           S 
                                           ⁡ 
                                           
                                             [ 
                                             
                                               1 
                                               - 
                                               
                                                 ψ 
                                                 j 
                                               
                                             
                                             ] 
                                           
                                         
                                         - 
                                         
                                           𝒟 
                                           ⁡ 
                                           
                                             [ 
                                             
                                               1 
                                               - 
                                               
                                                 ψ 
                                                 j 
                                               
                                             
                                             ] 
                                           
                                         
                                       
                                       ≤ 
                                       
                                         
                                           α 
                                           12 
                                         
                                         + 
                                         
                                           
                                             α 
                                             
                                               8 
                                               ρ 
                                             
                                           
                                           · 
                                           
                                             mad 
                                             ⁡ 
                                             
                                               ( 
                                               
                                                 
                                                   ψ 
                                                   j 
                                                 
                                                 ⁡ 
                                                 
                                                   ( 
                                                   𝒟 
                                                   ) 
                                                 
                                               
                                               ) 
                                             
                                           
                                         
                                       
                                     
                                   
                                 
                               
                             
                           
                         
                         ] 
                       
                     
                   
                   ≥ 
                   
                     1 
                     - 
                     
                       
                         β 
                         2 
                       
                       . 
                     
                   
                 
               
               
                 
                   ( 
                   10 
                   ) 
                 
               
             
           
         
       
     
     Note that max{S[ψ j ]− [ψ j ], S[1−ψ j ]− [ 1 −ψ j ]}=|S[ψ j ]− [ψ j ]| and mad of ψ j  is equal to mad of 1−ψ j . Since mad(ψ j (D))≤2· [ψ j ], the generalization bound (10) implies the desired bound (9) holds simultaneously for all jϵ[2k] with probability at least 1−β/2, as required. 
     It only remains to work out the parameters. Thus, ε≥α/18ρ. Theorem 4.1 requires m≥m 1  where 
                 m   1     =           8   ·   12     ɛα     ⁢     ln   ⁡     (     16   ⁢   k   ⁢     /     ⁢   β     )         ≤       8   ·   12   ·   18     ⁢           ⁢     ρ     α   2       ⁢     ln   ⁡     (     16   ⁢   k   ⁢     /     ⁢   β     )             ,         
while Theorem 5.2 requires
 
               m   ≥     m   0       =       O   (           ℓ   ⁢           ⁢     log   ⁡     (     1   δ     )           ⁢     log   ⁡     (     k   β     )         ɛα     )     =       O   (           ℓ   ⁢           ⁢     log   ⁡     (     1   αβ     )           ⁢     log   ⁡     (     k   β     )       ⁢   ρ       α   2       )     .             
Thus the final sample complexity is max{m 0 , m 1 }, as required.
 
     5.2 Private Multiplicative Weights 
     A result in which the dependence of the required dataset size on the number of queries k is logarithmic (at the expense of some additional terms and computational efficiency) is now described. It is known that in this general setting, the dependence on the data universe size and the loss of computational efficiency are unavoidable. 
     The present result follows from a direct combination of an algorithm for answering statistical queries and the reduction from the approximate median problem to the problem of answering statistical queries relative to distribution  =   t  (given in Lemma 3.2). Specifically, the following result that is based on the private multiplicative weights algorithm of prior approaches. 
     Theorem 5.3 For all α, βϵ(0,1) and m, kϵ  with 
                 m   ≥     m   0       =     O   (           log   ⁢        𝒵            ·   log     ⁢           ⁢     k   ·         log     3   2       ⁡     (     1   αβ     )         α   3           )       ,         
there exists an interactive algorithm M that takes as input a dataset sϵ   m  and provides answers v 1 , . . . , v k ϵ[−1,1] to adaptively-chosen queries ψ 1 , . . . , ψ k : →[−1,1] such that, for all interactive algorithms A and distributions  over  ,
 
     
       
         
           
             
               ⁢ 
               
                 
                   
                     Pr 
                     
                       S 
                       ~ 
                       
                         𝒟 
                         m 
                       
                     
                   
                   
                     
                       
                         ( 
                         
                           
                             ψ 
                             
                               [ 
                               k 
                               ] 
                             
                           
                           , 
                           
                             υ 
                             
                               [ 
                               k 
                               ] 
                             
                           
                         
                         ) 
                       
                       ~ 
                       A 
                     
                     ⇄ 
                     
                       M 
                       ⁡ 
                       
                         ( 
                         s 
                         ) 
                       
                     
                   
                 
                 ⁡ 
                 
                   [ 
                   
                     
                       ∀ 
                       
                         j 
                         ∈ 
                         
                           [ 
                           k 
                           ] 
                         
                       
                     
                     ❘ 
                     
                       
                         
                           v 
                           j 
                         
                         - 
                         
                           𝒟 
                           ⁡ 
                           
                             [ 
                             
                               
                                 ψ 
                                 j 
                               
                               ⁡ 
                               
                                 ( 
                                 𝒟 
                                 ) 
                               
                             
                             ] 
                           
                         
                       
                       ≤ 
                       α 
                     
                   
                   ] 
                 
               
             
             ≥ 
             
               1 
               - 
               
                 β 
                 . 
               
             
           
         
       
     
     Now, by Lemma 3.2, for  =X t  and  =   t  and any query ϕ: →T, responses to 2└ log 2 |T|┘ statistical queries relative to   with accuracy ⅛ can be used to find a value vϵqi ϕ(     ) (¼,¾). By plugging this reduction into Theorem 5.3 the following result is obtained 
     Theorem 5.4 For any βϵ(0,1), t, kϵ , a finite set T⊆  and  =X t  and with 
               n   ≥     n   0       =     O   ⁡     (       t     3   2       ·       log   ⁢        𝒳            ·     log   ⁡     (       k   ⁢           ⁢   log     |   T   |     )       ·       log     3   2       ⁡     (     1   β     )         )             
there exists an interactive algorithm M that takes as input a dataset sϵ   n  and provides answers v 1 , . . . , v k ϵT to adaptively-chosen queries ϕ 1 , . . . , ϕ k :X t →T such that, for all interactive algorithms A and distributions   over X,
 
     
       
         
           
             
               
                 
                   Pr 
                   
                     S 
                     ~ 
                     
                       P 
                       m 
                     
                   
                 
                 
                   
                     
                       ( 
                       
                         
                           ϕ 
                           
                             [ 
                             k 
                             ] 
                           
                         
                         , 
                         
                           υ 
                           
                             [ 
                             k 
                             ] 
                           
                         
                       
                       ) 
                     
                     ~ 
                     A 
                   
                   ⇄ 
                   
                     M 
                     ⁡ 
                     
                       ( 
                       S 
                       ) 
                     
                   
                 
               
               ⁢ 
               
                 ⁡ 
                 
                   [ 
                   
                     ∀ 
                     
                       j 
                       ∈ 
                       
                         
                           [ 
                           k 
                           ] 
                         
                         ⁢ 
                         
                           υ 
                           j 
                         
                       
                       ∈ 
                       
                         
                           qi 
                           
                             
                               ϕ 
                               j 
                             
                             ⁡ 
                             
                               ( 
                               
                                 𝒫 
                                 t 
                               
                               ) 
                             
                           
                         
                         ⁡ 
                         
                           ( 
                           
                             
                               1 
                               4 
                             
                             , 
                             
                               3 
                               4 
                             
                           
                           ) 
                         
                       
                     
                   
                   ] 
                 
               
             
             ≥ 
             
               1 
               - 
               
                 β 
                 . 
               
             
           
         
       
     
     For example, this algorithm may be used to obtain a new algorithm for answering a large number of low-sensitivity queries (that is queries ϕ:X t →[−1,1] such that Δ(ϕ)=1/t). To answer queries with accuracy α t=16/α 2  can be used and set T that is the interval [−1,1] discretized with step α/2. Thus the number of samples that the present algorithm uses is n=O(√{square root over (log|X|)}·log(k/α)·log 3/2 (1/β)/α 3 ). For comparison, the best previously known algorithm for this problem uses 
             n   =     O   (     log   ⁢          𝒳        ·     log   ⁡     (     k   α     )       ·         log     3   2       ⁡     (     1   β     )         α   4           )           
Although, as pointed out herein, the setting in which each query is applied to the entire dataset is more general than the present dataset.
 
     The present invention may be a system, a method, and/or a computer program product at any possible technical detail level of integration. The computer program product may include a computer readable storage medium (or media) having computer readable program instructions thereon for causing a processor to carry out aspects of the present invention. The computer readable storage medium can be a tangible device that can retain and store instructions for use by an instruction execution device. The computer readable storage medium may be, for example, but is not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. A non-exhaustive list of more specific examples of the computer readable storage medium includes the following: a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanically encoded device such as punch-cards or raised structures in a groove having instructions recorded thereon, and any suitable combination of the foregoing. A computer readable storage medium, as used herein, is not to be construed as being transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission media (e.g., light pulses passing through a fiber-optic cable), or electrical signals transmitted through a wire. 
     Computer readable program instructions described herein can be downloaded to respective computing/processing devices from a computer readable storage medium or to an external computer or external storage device via a network, for example, the Internet, a local area network, a wide area network and/or a wireless network. The network may comprise copper transmission cables, optical transmission fibers, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. A network adapter card or network interface in each computing/processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium within the respective computing/processing device. 
     Computer readable program instructions for carrying out operations of the present invention may be assembler instructions, instruction-set-architecture (ISA) instructions, machine instructions, machine dependent instructions, microcode, firmware instructions, state-setting data, configuration data for integrated circuitry, or either source code or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C++, or the like, and procedural programming languages, such as the “C” programming language or similar programming languages. The computer readable program instructions may execute entirely on the user&#39;s computer, partly on the user&#39;s computer, as a stand-alone software package, partly on the user&#39;s computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer may be connected to the user&#39;s computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet Service Provider). In some embodiments, electronic circuitry including, for example, programmable logic circuitry, field-programmable gate arrays (FPGA), or programmable logic arrays (PLA) may execute the computer readable program instructions by utilizing state information of the computer readable program instructions to personalize the electronic circuitry, in order to perform aspects of the present invention. 
     Aspects of the present invention are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer readable program instructions. 
     These computer readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer readable program instructions may also be stored in a computer readable storage medium that can direct a computer, a programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer readable storage medium having instructions stored therein comprises an article of manufacture including instructions which implement aspects of the function/act specified in the flowchart and/or block diagram block or blocks. 
     The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other device to produce a computer implemented process, such that the instructions which execute on the computer, other programmable apparatus, or other device implement the functions/acts specified in the flowchart and/or block diagram block or blocks. The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the blocks may occur out of the order noted in the Figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts or carry out combinations of special purpose hardware and computer instructions. 
     While several embodiments have been described herein, it will be appreciated that elements from any given embodiment may be used with any one or more elements from any one or more of other embodiments described herein. Moreover, the descriptions of the various embodiments of the present invention have been presented for purposes of illustration, but are not intended to be exhaustive or limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein was chosen to best explain the principles of the embodiments, the practical application or technical improvement over technologies found in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.