WorksPhysics and Astronomy
Optimal concentration and gradient sensing by perfect monitors
Abstract
Cells often estimate chemical concentrations from only a few diffusing molecules, whose stochastic motion limits sensing precision. We consider a perfect monitoring instrument that records the instantaneous molecular density throughout a finite region without perturbing the concentration field or distinguishing molecular identities. The standard Berg-Purcell estimator weights all positions uniformly. Here we derive the optimal spatial weighting within a large class of unbiased estimators for both concentration and gradient sensing. Variance minimization maps to an electrostatic problem. Surprisingly, although the instrument monitors the entire volume, the optimal estimator assigns all weight to its boundary, reducing the uncertainty in both concentration and gradient sensing. We extend the results to arbitrary geometries and spatial dimensions.
Bacterial cells can climb concentration gradients in environments so dilute that they encounter only a few molecules at a time. Motivated by this observation, Berg and Purcell showed in 1977 that the precision of cellular concentration sensing is fundamentally limited by the diffusive arrival and stochastic counting of molecules [1]. Their work has motivated decades of research on the physical limits of cellular sensing [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26].
Berg and Purcell considered molecules with mean concentration , each diffusing with diffusion coefficient . They defined a “perfect monitoring instrument” as a permeable sphere of radius that can observe the molecules within its volume without disturbing them. They asked for the minimum uncertainty with which such an instrument could estimate over a measurement time . The standard estimator uniformly averages the instantaneous number of molecules within the volume. Concretely, let
denote the empirical density of the molecules, where the position of each molecule performs Brownian motion. In terms of , the standard Berg-Purcell estimator is
where is the volume of the observation region (see Figure 1(a)). For long measurement times, , Berg and Purcell found

Figure 1. Schematic illustration of concentration sensing: (a) The classic Berg-Purcell instrument monitors a region of space (in this case a sphere of radius ) and time averages the number of molecules within its volume (blue dots) as they diffuse in and out with a diffusion coefficient . (b) Weight optimization maps to the electrostatic problem of charges on a conducting sphere, whose solution is a uniform charge distribution on the surface. (c) The optimal instrument time-averages the weighted count of molecules with weights given by the uniform surface charge density, thereby only counting the molecules within an infinitesimal shell near the boundary (blue dot) and ignoring molecules within its volume (orange dots).
This estimator has commonly been interpreted as giving the best precision attainable by any physical measurement instrument that monitors molecules within its volume for a fixed time without disturbing the concentration field or distinguishing individual molecules [1, 4, 6, 8, 10]. Given that this estimator discards the positional information of the molecules, it is natural to ask if an instrument subject to these conditions can do better.
Here we define a family of position-weighted estimators for the concentration
subject to the constraint
and minimize their variance with respect to the weight distribution. We will show that optimizing the weight distribution is mathematically equivalent to letting the charge distribution in a conducting sphere relax to its minimal potential energy state with all the weight concentrated on the surface. In other words, a perfect instrument should ignore the molecules within its volume and only count the ones infinitesimally close to the surface.
We then extend these results to gradient sensing. Consider an instrument attempting to estimate the gradient vector in a concentration profile of the form
We define a family of estimators for as
and show that, with suitable constraints on the vector-valued weight distribution , this is an unbiased estimator of the gradient . Optimizing the variance of each component of over maps to the electrostatic problem of finding the charge distribution in a net-neutral conducting sphere in an external electric field in that direction, constrained to a fixed dipole moment. Again, the optimal configuration ignores the molecules in the bulk and considers only those infinitesimally close to the surface, thereby improving the previously proposed limit on gradient sensing of a perfect monitor [4], which corresponds to the case of .
We then generalize these results to dimensions and nonspherical instruments. We show that shape dependence enters the precision calculation only through the capacitance and the polarizability tensor in concentration and gradient sensing, respectively; that spheres are the worst instruments of a given volume for either concentration or gradient sensing; and that optimization improves sensing more in higher dimensions. In , recurrent diffusion (repeated return of particles) maps to a divergence of the corresponding electrostatic potential, increasing concentration-sensing noise, while this divergent contribution cancels for gradient sensing. Additionally, we show that the optimal monitor has exactly twice the variance of Berg and Purcell’s perfect absorber, independently of the instrument’s shape, and that the larger, shape-dependent gap traditionally quoted between the two instruments overestimates the cost of remeasuring returning particles. We now derive these results, starting with concentration sensing in a spherical instrument.
Concentration Sensing.— To find the optimal concentration estimator, we first find the variance of Eq. (4) and then solve the variational problem for constrained optimization. For the estimator to be unbiased, its expected value should be equal to ,
resulting in the constraint given in Eq. (5). To compute its variance, let us first define
The covariance of is given by (see Appendix A)
where is the diffusion propagator. The approximation from Eq. (10) to Eq. (11) assumes . The central idea is that the correlation function of the time-averaged density fluctuations is proportional to the time integral of the diffusion propagator, which is precisely the Green’s function of the Laplacian. This is the origin of the electrostatic mapping, which will extend to other dimensions and other geometries. Taking the variance of Eq. (4) and substituting the covariance from Eq. (11), we find
Therefore, the optimization of variance is identical to minimizing the Coulomb self-energy of the charge density under the constraint of charge conservation Eq. (5). This energy is minimized by the equilibrium charge distribution on a conductor, which lies entirely on its surface. The optimal concentration estimator therefore places all sensing weight at the boundary (see Figure 1).
For a sphere, the minimizing weight is the uniform surface charge density
with variance (see Appendix B)
The ideal surface expression is the limit of counting molecules in a permeable shell of thickness and dividing by its volume. Its instantaneous shot noise diverges as , but its integrated correlation time vanishes as , leaving the finite result in Eq. (14). Compared with Eq. (3), . This is in agreement with the recent permeable-shell calculation of Ref. [27].
Gradient Sensing.— In 2008, Endres and Wingreen extended the Berg and Purcell results and defined a “perfect monitoring instrument” for estimating a weak concentration gradient of the linear concentration profile given in Eq. (6) [4]. In a given snapshot, the mean position of molecules in the instrument is expected to point in the direction of the gradient. Therefore, the Endres-Wingreen estimator is defined to be proportional to the time average of the mean position of the molecules inside the region (see Figure 2(a))
Figure 2. Schematic illustration of gradient sensing: (a) The Endres-Wingreen estimator points toward the average position of molecules within its volume (blue dots). (b) The optimization problem maps each component of the estimator to the charge distribution of a net-neutral conducting sphere in an external electric field, with each component of the weight vector field becoming the charge density in the corresponding electric field. (c) The optimal estimator points toward the average position of molecules within an infinitesimal shell near the boundary (blue dot) where the charge distributions are localized, ignoring the bulk molecules (orange dots).
where the prefactor is derived by setting . The covariance of this estimator is given by
where is the identity matrix [4]. The Endres-Wingreen estimator is a special case of the family of estimators in Eq. (7) with the weight function proportional to the position vector . This estimator was originally derived by an ordinary least-squares fit of the time-averaged density to the linear profile. This procedure would minimize the variance if the density fluctuations were spatially uncorrelated; Eq. (11) shows they are not.
Now let us consider the generalized family defined in Eq. (7). For to be unbiased we need
which results in two constraints on ,
Taking the covariance of Eq. (7) using Eq. (11), we have
Minimizing the variance of each component of the gradient maps to the problem of minimizing electrostatic self-energy of the charge distribution , but now subject to the constraints in Eq. (18). The first constraint enforces that our conducting sphere is charge neutral, while the second fixes its dipole moment along the direction. Physically, this means that for each component , the optimal is exactly the induced charge distribution on a conducting sphere placed in a constant external electric field oriented along the -axis. While each solution is a dipolar charge distribution aligned with its respective axis, the full vector weight distribution , constructed by combining all three orthogonal components, is a radially symmetric vector field
This is an induced surface charge indicating that an optimal instrument only averages the positions of the molecules within an infinitesimal shell near the surface (see Figure 2). The corresponding covariance of the optimal estimator is given by (see Appendix § 2)
Comparing Eq. (16) and Eq. (21), the optimal surface estimator of the gradient improves the covariance relative to the Endres-Wingreen estimator by a factor 7/10.
Nonspherical Geometries.*— The electrostatic analogy extends to measurement instruments of arbitrary shapes. Consider a solid conductor with a simply connected smooth shape . For the concentration sensing case, the optimal solution minimizing the variance of the estimator Eq. (4) subject to charge conservation Eq. (5) gives a weight distribution equal to the equilibrium surface charge density of the conductor with unit charge,
where is the surface -function defined such that . The same equilibrium charge distribution was recently shown to maximize the total uptake flux of absorbing receptors on an arbitrarily shaped cell surface [23]. Here this distribution arises from minimizing variance instead of maximizing flux and for a nonperturbing estimator as opposed to an absorber.
To find the surface charge density , consider the solution to Laplace’s equation
outside of . Then the surface charge density is given by
where is the derivative of in the direction of the normal vector to the surface, and the capacitance is defined as
For reference, the capacitance of a sphere of radius is equal to . The variance of the optimal estimator is then given by (see Appendix § 2)
Plugging for a sphere recovers Eq. (14). For comparison, a rotationally symmetric ellipsoid with long semi-axis , two shorter semi-axes , and eccentricity has the capacitance . Among shapes of fixed volume, the sphere has the smallest capacitance [28], and therefore is the worst instrument for concentration sensing in the long-time limit. There is no best shape, since grows without bound as an ellipsoid of fixed volume is elongated.
Equation (26) also permits a direct comparison with the second idealized instrument considered by Berg and Purcell [1] and Endres and Wingreen [4]: a perfect absorber that removes each molecule upon first contact. A nonperturbing monitor may record the same molecule many times as it diffuses into and out of the observation region, since it cannot distinguish a returning molecule from a new one. By contrast, an absorber eliminates this additional source of uncertainty by removing the molecule after its first encounter. A perfectly absorbing body of shape captures molecules at the mean rate , giving . Comparing this expression with Eq. (26) gives
Therefore, the actual cost of not perturbing the concentration field is exactly a factor of two in variance, independent of the instrument’s shape. The larger, shape-dependent cost obtained by comparing the absorber with the original Berg-Purcell estimator overestimates this effect.
For gradient sensing, placing a neutral conductor in an external electric field induces a dipole moment , where is the polarizability tensor. For reference, the polarizability of a sphere of radius is . Now we need to solve the electrostatic problem subject to the two constraints in Eq. (18). The first is charge neutrality, while the second, for each component , fixes the dipole moment along direction . We first solve the electrostatic problem with a constant external electric field at infinity in each direction to find the polarizability tensor , then we use to find the external electric field that induces the dipole moment in direction , and solve the electrostatic problem again with the new external field to find the surface charge density and therefore the optimal . The covariance of the optimal estimator is given by (see Appendix § 2)
The trace of is the same for all ellipsoids of the same volume; elongating a sphere increases the gradient sensing precision in that direction, but reduces it in other directions, keeping the total mean square error (MSE) constant. Nonellipsoidal shapes have smaller total MSE and outperform spheres and ellipsoids of the same volume, since (see Appendix C) with equality if and only if is an ellipsoid [29].
Generalization to -Dimensions.— In dimensions, a particle that leaves the instrument will return to the instrument over and over again with probability one, whereas in it has a nonzero probability of escaping forever. We will see that this distinction determines whether the long-time approximation we used to go from Eq. (10) to Eq. (11) is valid. For , Eq. (11) becomes
where . The form of the correlations is also the Green’s function of Poisson’s equation in dimensions. The preceding electrostatic argument therefore carries over directly. For a -dimensional ball of radius ,
Comparing to the Berg-Purcell estimator, we have
which reduces to 5/6 in three dimensions. The optimization process is more beneficial in higher dimensions.
In , Eq. (10) cannot be approximated by Eq. (11), since the integral in Eq. (11) does not converge. While for , the integral of the diffusion propagator converges to a constant as , it increases with as in and as in dimension. The divergence is the recurrence anticipated earlier: is the mean time spent, up to , at distance from the starting point, which grows without bound when the walk is recurrent and saturates when the particle can escape. This divergence maps to the divergence of the Coulomb potential at large distances in and can therefore be isolated by shifting the reference potential (see Appendix D), giving
The recurrent contribution is independent of position and is therefore shared by all normalized concentration weights. Boundary localization remains optimal, but in it changes only the subleading part of the variance.
Gradient sensing does not inherit the low-dimensional problem, and the recurrent effects cancel out under the charge-neutrality condition . The optimal dipole surface estimator retains scaling in every dimension with covariance (see Appendix D)
where is the identity matrix. Compared to the linear estimator, we have
As with concentration sensing, the optimization has a larger effect in higher dimensions.
Conclusion.— We have shown that the standard Berg and Purcell estimator does not make optimal use of the spatial information available to a perfect monitoring instrument. Surprisingly, although the instrument observes molecules throughout its volume, the optimal estimator assigns all weight to its boundary, where molecules contribute less temporally redundant information than in the bulk. This result follows from an electrostatic mapping: concentration and gradient sensing correspond, respectively, to monopole and dipole variational problems, with the optimal precision for arbitrary geometries determined by capacitance and polarizability. The extension to different dimensions reveals that recurrence affects concentration sensing but cancels out in gradient sensing. Taken together, our results show that limits attributed to diffusive molecular noise can also depend on how an instrument combines the spatial information contained in its observations.
Although questions of concentration and gradient sensing were originally motivated by biology, the results presented here concern only the physical limits of measurement instruments under the stated constraints, and not how sensing is implemented in any particular biological or engineered system.
Acknowledgments.— I thank Andrew Mugler for helpful discussions and thoughtful feedback on the manuscript.
Time-averaged density covariance
Consider a sufficiently large volume of space in which boundary effects can be neglected, and the concentration profile is maintained ( for concentration sensing and for gradient sensing). For , the density correlator is
where is the diffusion propagator.
The covariance of the time average is
For concentration sensing and Eq. (36) reduces to Eq. (10). For gradient sensing inside the detector due to the shallow gradient assumption , recovering the same equation.
Variational solution and general geometry in
We would like to minimize the variance of the form
In dimensions ,
where is the -dimensional Coulomb potential satisfying . Let us define the energy functional
For concentration sensing, we would like to minimize the energy (the variance ) subject to charge conservation. We introduce a Lagrange multiplier and the Lagrangian
Let us define the electric potential
In terms of , the variation of the Lagrangian is
The optimal charge distribution yields a constant potential inside . Taking a Laplacian, , shows zero charge density in the interior of ; it is the equilibrium charge distribution on .
Let be the total charge and the constant potential of the equilibrium charge distribution. The capacitance of a conductor with shape is defined as . Because the potential is constant on the surface,
For concentration sensing , and therefore
This recovers Eq. (26) and its special case Eq. (14) for the sphere in with .
For gradient sensing, the claim is that there exists an admissible vector-valued weight such that it minimizes for every unit vector . Defining the scalar weight , we have
The unbiasedness constraints in Eq. (18) imply
We therefore minimize subject to zero total charge and fixed dipole moment using the Lagrangian
Its variation gives
The total potential generated by together with the external potential is therefore constant inside . Thus, is the charge induced on a neutral conductor in a uniform external electric field , constrained to have dipole moment . By definition of the polarizability tensor, , and therefore . The minimum energy is
Consequently, every admissible satisfies
It remains to show that a single vector-valued weight attains this bound for every . Let denote the charge induced on a neutral conductor by an external field , and define
We claim that this is the optimal vector-valued weight. The induced surface charge depends linearly on the external field. Therefore, for any ,
The scalar weight is the charge induced by the field , which has dipole moment . It is therefore the minimizing weight for estimating , and equality holds in Eq. (49) for every :
Equality of these quadratic forms for every gives
which recovers Eq. (28) and its special case Eq. (21) for the sphere in with .
Bound on Trace of Inverse Polarizability
Consider the weight function , where is the volume of and is the unit normal vector. It satisfies both conditions in Eq. (18) and is therefore an admissible weight. The optimal weight would by definition outperform whose covariance is given by Eq. (19),
or , where is defined as
with trace
Therefore, . One can show by explicit calculations that for ellipsoids, is indeed the optimal weight, and therefore the bound is saturated for ellipsoids.
Low Dimensions,
For , the approximation from Eq. (10) to Eq. (11) does not hold, since the time integral of the diffusion propagator does not converge as . We can still obtain a long-time limit that preserves the electrostatic analogy by using the fact that the integral converges as for some reference distance . This is done by adding and subtracting the term under the integral in Eq. (10) and then taking the long-time limit, obtaining
where the new still satisfies . This procedure is equivalent to shifting the zero-potential separation in the electrostatic analogy. For , is linear in , and we can pick , resulting in . For , depends logarithmically, so has to be nonzero and finite (a natural choice for a circle of radius would be , resulting in . For higher dimensions, we would pick , which would remove the constant term.
Using Eq. (37), we can write the variance as
The optimization is not affected by the constant recurrence cost ; the solution follows the same surface charge optimization and provides a constant potential on . The optimal energy is then , and
This result holds in general dimension and for arbitrary shape , special cases of which are given in Eq. (32) for spheres in .
The gradient sensing problem is simpler. As we saw in Eq. (45), the variance of each component of has exactly the same form as the variance of (now in Eq. (58)), but subject to a different set of constraints. Since the gradient case is charge neutral, the constant term in Eq. (58) drops out. The optimal covariance is still given by for any shape in any dimension. The special case of spheres in general dimension is given in Eq. (33).
References
- [1]H. C. Berg and E. M. Purcell, Biophys. J. 20, 193 (1977).
- [2]W. Bialek and S. Setayeshgar, Proc. Natl. Acad. Sci. 102, 10040 (2005).
- [3]T. Gregor, D. W. Tank, E. F. Wieschaus, and W. Bialek, Cell 130, 153 (2007).
- [4]R. G. Endres and N. S. Wingreen, Proc. Natl. Acad. Sci. 105, 15749 (2008).
- [5]W. Bialek and S. Setayeshgar, Phys. Rev. Lett. 100, 258101 (2008).
- [6]R. G. Endres and N. S. Wingreen, Phys. Rev. Lett. 103, 158101 (2009).
- [7]B. Hu, W. Chen, W.-J. Rappel, and H. Levine, Phys. Rev. Lett. 105, 048104 (2010).
- [8]T. Mora and N. S. Wingreen, Phys. Rev. Lett. 104, 248101 (2010).
- [9]M. Skoge, Y. Meir, and N. S. Wingreen, Phys. Rev. Lett. 107, 178101 (2011).
- [10]C. C. Govern and P. R. ten Wolde, Phys. Rev. Lett. 109, 218103 (2012).
- [11]P. Mehta and D. J. Schwab, Proc. Natl. Acad. Sci. 109, 17978 (2012).
- [12]M. Skoge, S. Naqvi, Y. Meir, and N. S. Wingreen, Phys. Rev. Lett. 110, 248102 (2013).
- [13]K. Kaizu, W. De Ronde, J. Paijmans, K. Takahashi, F. Tostevin, and P. R. Ten Wolde, Biophys. J. 106, 976 (2014).
- [14]T. Mora, Phys. Rev. Lett. 115, 038102 (2015).
- [15]D. Ellison, A. Mugler, M. D. Brennan, S. H. Lee, R. J. Huebner, E. R. Shamir, L. A. Woo, J. Kim, P. Amar, I. Nemenman, et al., Proc. Natl. Acad. Sci. 113, E679 (2016).
- [16]S. Fancher and A. Mugler, Phys. Rev. Lett. 118, 078101 (2017).
- [17]J. Varennes, S. Fancher, B. Han, and A. Mugler, Phys. Rev. Lett. 119, 188101 (2017).
- [18]T. Mora and I. Nemenman, Phys. Rev. Lett. 123, 198101 (2019).
- [19]S. Fancher, M. Vennettili, N. Hilgert, and A. Mugler, Phys. Rev. Lett. 124, 168101 (2020).
- [20]M. Vennettili, S. Saha, U. Roy, and A. Mugler, Phys. Rev. Lett. 127, 098102 (2021).
- [21]H. H. Mattingly, K. Kamino, B. B. Machta, and T. Emonet, Nat. Phys. 17, 1426 (2021).
- [22]R. LeFebre, J. A. Landsittel, D. E. Stone, and A. Mugler, Phys. Rev. Lett. 133, 138402 (2024).
- [23]D. Wu, S. Mao, and J. Lin, Phys. Rev. Lett. 135, 208401 (2025).
- [24]A. Alonso, R. G. Endres, and J. B. Kirkegaard, Phys. Rev. Lett. 134, 158401 (2025).
- [25]H. H. Mattingly, K. Kamino, J. Ong, R. Kottou, T. Emonet, and B. B. Machta, Nat. Phys. , 1 (2026).
- [26]A. Mugler and M. Rose, arXiv preprint arXiv:2606.17239 (2026).arxiv.org/abs/2606.17239
- [27]D. R. McCusker and D. K. Lubensky, Phys. Rev. E 111, 034404 (2025).
- [28]G. Pólya and G. Szegő, Isoperimetric Inequalities in Mathematical Physics, Annals of Mathematics Studies No. 27 (Princeton University Press, Princeton, NJ, 1951) sec. 1.13.
- [29]M. J. Colbrook and S. Sadeghi, arXiv preprint arXiv:2608.20466 (2026).arxiv.org/abs/2608.20466