NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Asymptotics of the number of 2-threshold functions

Elena Zamaraeva, Jovisa D. Zunic · DOI

Abstract

A $k$-threshold function on a rectangular grid of size $m \times n$ is the conjunction of $k$ threshold functions on the same domain. In this paper, we focus on the case $k=2$ and show that the number of two-dimensional 2-threshold functions is $\dfrac{25}{12\pi^4} m^4 n^4 + o(m^4n^4)$.

Introduction

In combinatorial geometry and machine learning, a fundamental question is how many ways points on a discrete grid can be classified using linear separators. A threshold function is a Boolean function where "true" and "false" points are separated by a single line. A $k$-threshold function is the conjunction of $k$ such functions, meaning the "true" points lie within the intersection of $k$ half-planes, forming a convex polygon.

A rectangular grid with segments $AB$ and $CD$ representing potential separators.

While the asymptotics for $k=1$ have been known since the 1990s, the $k=2$ case has remained elusive due to the complexity of counting distinct functions on a discrete grid. This paper provides the first precise asymptotic formula for the number of 2-threshold functions as the grid dimensions $m$ and $n$ tend to infinity.

Methodology

The authors transform the logical counting problem into a geometric and number-theoretic one through several key steps:

  1. Geometric Bijection: They utilize the fact that 2-threshold functions can be uniquely represented by "proper pairs" of oriented prime segments. A segment is "prime" if its only integer points are its endpoints.
  2. Convex Position Reduction: The proof demonstrates that the majority of these functions are defined by pairs of segments in "convex position," forming the opposite sides of a convex quadrilateral.
  3. Rectangle Circumscription: To facilitate counting, the authors consider the smallest axis-aligned rectangle circumscribing the segments, allowing for summation over all possible rectangle sizes $(u, v)$ within the $m \times n$ grid.
Oriented prime segments $A \to B$ and $C \to D$ used to uniquely represent 2-threshold functions.
  1. Number Theoretic Summation: The core evaluation involves sums of the Euler totient function ($\phi$) and the Möbius function ($\mu$). The requirement for segments to be prime introduces the Riemann zeta function constant $\zeta(2) = \pi^2/6$ into the final result.

Key Insights

  • Boundary Simplification: Functions whose "true" points do not touch the grid boundary are shown to be negligible in the limit, simplifying the geometric model.
  • Dominance of Convexity: Non-convex arrangements contribute only to lower-order terms ($O(m^3 n^3)$), focusing the problem on counting quadrilaterals.
  • The $25/12\pi^4$ Constant: This constant emerges from the specific density of 2-threshold functions within the space of all possible segment pairs, accounting for various endpoint configurations on the bounding boxes.

Results

The primary result is the asymptotic formula for the number of 2-threshold functions $t_2(m, n)$: $$t_2(m, n) = \frac{25}{12\pi^4} m^4 n^4 + o(m^4 n^4)$$

Comparatively, the number of single threshold functions ($k=1$) is approximately $\frac{6}{\pi^2} m^2 n^2$. Thus, the $k=2$ case grows quadratically faster relative to the number of grid points. Furthermore, this result allows for improved upper bounds for $k$-threshold functions where $3 \le k \le 23$.

Conclusion and Future Work

This work provides a rigorous foundation for counting intersections of half-planes on discrete grids. Future research will likely target the $k=3$ case (intersections of three half-planes), which presents significantly greater combinatorial challenges as the simple bijection to segment pairs no longer holds.

Summary updated

BibTeX
@article{zamaraeva2020asymptotics,
  author = {Elena Zamaraeva and Jovisa D. Zunic},
  title = {{Asymptotics of the number of 2-threshold functions}},
  journal = {Inf. Comput.},
  year = {2020},
  doi = {10.1016/j.ic.2021.104742},
}
Figure