Computing majority with low-fan-in majority queries

by   Gleb Posobin, et al.

In this paper we examine the problem of computing majority function MAJ_n on n bits by depth-two formula, where each gate is a majority function on at most k inputs. We present such formula that gives the first nontrivial upper bound for this problem, with k = 2/3 n + 4. This answers an open question in [Kulikov, Podolskii, 2017]. We also look at this problem in adaptive setting - when we are allowed to query for value of MAJ_k on any subset, and wish to minimize the number of such queries. We give a simple lower bound for this setting with n/k queries, and we present two algorithms for this model: the first one makes ≈ 2n/k k queries in the case when we are limited to the standard majority functions, and the second one makes n/k k queries when we are allowed to change the threshold of majority function.



page 1

page 2

page 3

page 4


Testing convexity of functions over finite domains

We establish new upper and lower bounds on the number of queries require...

Generalized Framework for Group Testing: Queries, Feedbacks and Adversaries

In the Group Testing problem, the objective is to learn a subset K of so...

The effective entropy of next/previous larger/smaller value queries

We study the problem of storing the minimum number of bits required to a...

The Optimal Majority Threshold as a Function of the Variation Coefficient of the Environment

Within the model of social dynamics determined by collective decisions i...

The Price of Majority Support

We consider the problem of finding a compromise between the opinions of ...

Learning Bayesian Nets that Perform Well

A Bayesian net (BN) is more than a succinct way to encode a probabilisti...

Semi-verified Learning from the Crowd with Pairwise Comparisons

We study the problem of crowdsourced PAC learning of Boolean-valued func...
This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

1 Introduction

We study the problem of computing majority function if we are only allowed to query values of (that is, majority on variables) functions.

Majority functions and circuits consisting of them arise in various areas of computational complexity (see e.g. [9, 3, 4]). Particularly, iterated (or recursive) majority that consists of iterated application of majority of small number of inputs to itself, provides an example of a function with interesting complexity properties in various models ([5, 8, 10, 6]), and helps in various constructions.

Another motivation for this problem comes from the studies of boolean circuits of constant depth. is defined as the class of functions computable by constant-depth polynomial-sized circuits consisting of majority gates, and it plays one of the major roles in this area ([4]).

The first model we look at is a standard boolean circuit of depth two, but where all the gates are threshold functions of at most variables. It was shown in [1] that to be able to compute such circuits must be . There is a trivial upper bound : just take all the gates on the first level to match inputs (that is, gate ), and the output gate is a standard majority . [7] did not provide any nontrivial upper bound on and posed an open question whether such bound exists. We answer this question positively and present the depth-two circuit with gates that computes function. This result was independently obtained by Bruno Bauwens by computer search, as told to us in personal communication. For the sake of completeness, we also give a simple proof of lower bound .

The second model is an adaptive one — algorithm can query the function on any subset of size at most , and we are interested in the worst case number of queries made to compute . This problem was motivated by the proof in [7], which does not use any properties of the function in the output gate except for its monotonicity, and also by [2], where they study adaptive computation of with discrepancy queries on elements. We give a simple proof for the lower bound of queries, and we also present two algorithms for adaptive setting: one that runs in fixed-threshold setting and which requires queries, and another that runs in adjustable-threshold adaptive model (that is, when the algorithm can specify majority’s threshold) and requires queries.

2 Definitions

By we denote binary logarithm and

always means the length of input vector


We are going to study majority functions , where if condition is true, and otherwise. We will also call standard majority functions. By we denote . We define for as . We also define .

Threshold functions are a generalization of majority functions: .

The first (“static“) model that we look at is — it is defined as depth-two formula, consisting of threshold gates such that and are positive integers.

In the second (“adaptive“) model an algorithm is given access to an oracle that knows vector . There are two variations of this model that we look at.

In the adaptive model with adjustable threshold the oracle receives a pair , where is a set such that and is an integer, and responds with the value of .

In the adaptive model with fixed threshold the oracle receives a set such that and responds with the value of .

3 Static model

3.1 Lower bound

For large enough , should be at least in order to compute in model.

This is not the best currently known lower bound, for a more involved proof of see [7]. This proof is simpler and is adapted from the proof of a stronger claim in [7] that shows that for some function in to differ from on small fraction (less than ) of inputs with , must be . We provide this proof just for the sake of completeness.


Let’s look at the boolean hypercube . It is known ([11]) that among all monotone boolean functions majority is the one with the largest influence — that is, its value changes on the largest possible number of edges of the hypercube. The number of such edges for is . So if some gate depends on variables, then it changes its value on at most edges of .

Obviously, on each edge in such that , there must be at least one function in the first level of the formula, such that . There are such edges.

Let be some gate in the first level of the formula, without loss of generality assume that depends only on for . Then, for each there are at most possible continuations of that have . This is so, since must sum to , and the number of such assignments of is a binomial coefficient. The largest binomial coefficient for fixed is the central one: , for which there is a well-known bound .

This means that for a fixed there are at most such edges that and (note that for large enough , if ). Summing this for all we get:

3.2 Upper bound

For any is computable by some circuit in .


Case 1. is divisible by , .
We need to define first-level threshold functions in the formula. Let , each equivalently being a majority function on one corresponding element. Denote indices of yet unused inputs by . Then let . The output gate is a standard majority on all .

If , then , that means that both output gate and will be equal to one.

If , then . Then the circuit attains value iff . Rearranging, we get that the value of the circuit is iff , which is equivalent to .

If , and the formula’s value is also , since .

Case 2. for some integer , .
Let for . Let . Then let for , so there are gates in the first level of the circuit. The output gate is again a majority on all .

If , then both and the output gate are equal to one.

If , then . Then the circuit attains value iff . Rearranging, we get that the value of the circuit is iff . Rounding the last part to the smallest greater integer we get that the circuit attains value iff , exactly when .

If , then , so both and the circuit will have value .

Case 3. for some integer , .
Let for . Let . Then let for , so there are gates in the first level of the circuit. The output gate is again a majority on all .

If , then both and the output gate are equal to one.

If , then . Then the circuit attains value iff . Rearranging, we get that the value of the circuit is iff . Rounding the last part to the smallest greater integer we get that the circuit attains value iff , exactly when .

If , then , so both and the circuit will have value .

4 Adaptive model

4.1 Lower bound

Any algorithm for computing in adaptive model requires queries to oracle.


We will set bits of vector the algorithm has not yet asked about right before answering a query from the algorithm. Initialize a set — this will be the set of all the indices that appeared in algorithm’s requests. When algorithm makes a request for , we firstly set for in : set any variables to and the rest variables to . Then we update . After that we answer the query with .

Clearly, at each step. If algorithm has made less than requests, then , so there are some variables that the algorithm knows nothing about.

There are such variables. If we set with to , then , and will be equal to . If we set with to , then , and will be equal to .

So, whichever answer the algorithm chooses, there will be two vectors and consistent with all our answers, such that , so on either or the algorithm will err. ∎

4.2 Upper bound in adjustable-threshold setting

There exists an algorithm for adjustable-threshold adaptive model that determines in queries to the oracle.


Split into disjoint blocks of size at most each. We know that , so using binary search we can find such value that . This means that . Since binary search works in steps, in queries we will know , and so we will easily find . ∎

The upper bound for the adaptive model with adjustable threshold turns out to be at most two times better than the one we get in the case of the adaptive model with fixed threshold.

4.3 Upper bound in fixed-threshold setting

There exists an algorithm such that it accepts two disjoint sets , , , and if given access to the oracle from the definition of fixed-threshold adaptive model it finds in at most queries to the oracle a set such that and .


We will define such procedure find_balanced_set(A, B, x).

Let be some enumeration of elements from and be some enumeration of elements from .

Define , if , otherwise , and . Also define . From the specification of find_balanced_set(A, B, x) we know that , so we can use binary search to find position such that . This implies that , and, moreover, .

If is even, this implies , so either , if , or , if . The procedure find_balanced_set(A, B, x) then returns the set .


is odd,

, so the procedure returns the set .

Clearly, this procedure makes at most queries. ∎

Claim 1.

Suppose that for some set we know that . Then, , so we can forget about indices from and not take them into consideration, as though vector has size .

The basic idea of our adaptive algorithm is simple: on each iteration we find some large set with , and remove the variables with indices in by claim 1. We find such set by splitting into subsets of similar sizes, querying each of them, finding two sets of sizes with different values on them, and running the find_balanced_set procedure from lemma 4.3. This is the main idea, but we have to be careful with the sizes of subsets, since may not divide evenly, and if we are too careless, after several iterations we may have to split the set of current indices again and make queries for each of new subsets, which could significatnly increase the total number of queries.

There exists an algorithm for computing function in the fixed-threshold adaptive setting using at most queries.


Split the set into disjoint sets of sizes or each. Enumerate in such way that are of size each, and the rest are of size . , since . For all query . If all the answers are the same and equal to , then and we are done.

Case 1. Suppose that there are sets of both sizes and . Then, since not all the answers are the same, there are two indices and such that , and (otherwise, all with size have for all of size , so all the subsets have the same answer, a contradiction).

Now we will find a large (with size ) subset of indices to exclude from our consideration (by claim 1) in at most logarithmic in number of queries.

Choose any element from and query . Suppose that . Clearly, then is equal to .

If is , then and , implying is odd and . This means that we can ignore indices from by claim 1.

If is , then and , implying is even and . Again, this means that we can remove indices from from our consideration by claim 1.

So, if there are sets with different sizes, we are left with the case when .

Let . We know that and that .

We run find_balanced_set from lemma 4.3 on sets and , and get the set such that . Note that will be of size (in case when is even) or . Since total number of elements in is , .

We then forget about indices in by claim 1, query and repeat the case 1 until all are of the same size or have the same answer.

After several iterations we either get sets with the same answer each and we are done, or we get the sets with the same sizes .

Case 2. All of the sets have same sizes.
Take two sets and with different answers and run the procedure find_balanced_set(S_i, S_j, x). Let be the answer. If is even, , so just exclude from further considerations, query the oracle , and repeat the procedure until all the sets left have the same .

The case of odd requires more careful consideration, since if we simply leave elements from (which has size ) out, will be , and that may become greater than after several iterations. If we look at the case of odd in find_balanced_set, we will see that instead of the set of size it can as well return the set of size , since .

So if , then we add elements to : . We can remove indices from from future considerations by claim 1, and we query the oracle the value of . Now we again have sets of two different sizes, so we return to case 1.

The analysis of number of queries this algorithm makes is rather straightforward: it starts with making queries, then on each iteration it discards at least indices after making at most queries. So the total number of queries made is . As was stated in the beginning, . On the other hand, . This gives the following upper bound on the number of queries:

5 Conclusion

We have presented new upper bounds for computing majority functions in two models.

In static model we have constructed the depth-two circuit for with gates, which gives the first nontrivial upper bound for this problem.

We have defined an adaptive model with two variations, and presented an algorithm for computing function using queries to the oracle in the fixed-threshold setting, and a simple algorithm for with queries in the adjustable-threshold setting.

There is a large gap between current lower and upper bounds for the static model: the best lower bound [1] is , and our upper bound is . In the adaptive model there is also a gap between the bounds, albeit a logarithmic (in ) one: our lower bound is . So the natural questions for future consideration are those of narrowing these gaps.

Another interesting possible direction in the adaptive case is the addition of noise to oracle’s answers — with some probability

oracle gives us a uniformly random answer.

6 Acknowledgements

I would like to thank Vladimir Podolskii for posing the problem and for fruitful discussions.