---
author:
- |
    Robert G. Endres$^{1,2}$ and Ned S. Wingreen$^{1}$ \
     \
title: |
    Accuracy of direct gradient sensing by single cells\
     \
    Supplementary information\
     \
---

\[sec:one\]Accuracy of Concentration and Gradient Sensing by a Perfectly Absorbing Sphere
=========================================================================================

Consider as a measurement device a sphere of radius $a$ that is a perfect absorber for a certain dissolved chemical. The device can be used to measure both the local concentration and the local gradient of the chemical by sensing the chemical current density $\vec j$ impinging on the surface of the sphere. At steady-state, for the case of a uniform particle concentration $c_0$ far away from the absorbing sphere, the average current is $J=4\pi aDc_0$, where $D$ is the particle diffusion constant [@berg77]. Since the average number of particles $N=4\pi Dac_0T$ absorbed in time $T$ is Poisson distributed, [*i.e.*]{} $\langle(\delta N)^2\rangle=\langle N\rangle$, the perfectly absorbing sphere has a concentration-measurement uncertainty of $$\frac{\langle(\delta c)^2\rangle}{c^2}=\frac{\langle(\delta N)^2\rangle}{\langle N\rangle^2}
=\frac{1}{4\pi DacT}\label{eq:res_one_c}.$$

The perfectly absorbing sphere can also be used to measure the local gradient of the chemical. To calculate the current density $\vec{j}$ in this case, we utilize a standard analogy to electrostatics. In electrostatics the potential $\phi$ and electric field $\vec E$ in a charge-free environment are determined by Laplace’s equation, $\nabla^2\phi=0$, and $\vec{E}=-\vec{\nabla}\phi$, respectively. As a result, the surface-charge density $\sigma_\text{charge}$ on a conducting sphere (boundary condition $\phi=0$ at $r=a$) placed in an electric field of magnitude $E_z$ in the $z$-direction with an additional constant potential $\phi$ far away from the sphere is given by the superposition [@jackson] $$\sigma_\text{charge}=-\left.\frac{1}{4\pi}\frac{\partial \phi}{\partial r}\right|_{r=a}=
-\frac{1}{4\pi}\left(\frac{\phi}{a}-3E_z\cos\theta\right)\label{eq:EM}$$ in Gaussian units, where $\theta$ is the polar angle measured with respect to the $z$ axis. In the case of a chemical-absorbing sphere, the chemical concentration $c$ and the current density $\vec j$ obey equations analogous to the ones governing the potential $\phi$ and electric field $\vec E$ in electrostatics. Specifically, the spatial dependence of the concentration $c$ follows from the diffusion equation at steady-state, $\nabla^2c=0$, while the current density is given by $\vec{j}=-D\vec{\nabla}c$. Exploiting the result from electrostatics, Eq. \[eq:EM\], the average current density impinging on the perfectly absorbing sphere (boundary condition $c=0$ at $r=a$) in a background gradient $c_z=\partial c/\partial z$ in the $z$-direction is given by $$j(\theta)=\frac{Dc_0}{a}+3Dc_z\cos\theta\label{eq:Jz}.$$ This expression can be generalized to a gradient $\vec{\nabla} c$ in an arbitrary direction $\vec r$ via $$j(\theta,\phi)=\frac{Dc_0}{a}+3D\vec{\nabla} c\cdot \vec e(\theta,\phi)\label{eq:Jr},$$ where $\vec e(\theta,\phi)=(\cos\phi \sin\theta,\sin\phi \sin\theta,\cos\theta)$.

To best estimate the chemical gradient from an observed density of particles absorbed at the surface of the sphere during time $T$, we fit the observed density $\sigma_T^\text{obs}=\sum_{i=1}^{N}\delta(\vec r-\vec r_i)$, where $N$ is the total number of absorbed particles, to the expected density $j(\theta,\phi)T$ from Eq. \[eq:Jr\]. The best fit is obtained by minimizing the error between the observed density and the expected density $$\text{Error}=\int[\sigma_T^\text{obs}-C-\sum_{m=-1,0,1}G_m\,Y_{l=1}^{m}(\theta,\phi)]^2dA,\label{eq:error}$$ where $C$ and $G_m$ are the parameters to be determined. Note that in Eq. \[eq:error\] we write the expected contribution from the gradient in terms of the spherical harmonics $Y_{l=1}^{m}(\theta,\phi)$: $Y_1^{-1}=\sqrt{\frac{3}{8\pi}}\sin\theta e^{-i\phi}$, $Y_1^{0}=\sqrt{\frac{3}{4\pi}}\cos\theta$, $Y_1^{1}=-\sqrt{\frac{3}{8\pi}}\sin\theta e^{i\phi}$. Minimizing the error as a function of the parameters $C$ and $G_m$ ($m=-1,0,1$) is achieved by setting $\partial \text{Error}/\partial C=0$ and $\partial \text{Error}/\partial G_m=0$, which results in the best-fit values $$\begin{aligned}
 C&=&\frac{\int \sigma_T^\text{obs}\,dA}{\int dA}=\frac{\int  \sigma_T^\text{obs}\,dA}{4\pi a^2}\\
G_{-1}&=&\frac{\int  \sigma_T^\text{obs}Y_{1}^{-1}(\theta,\phi)\,dA}{\int |Y_1^{-1}(\theta,\phi)|^2\,dA}=
\frac{\sqrt{\frac{3}{2\pi}}\int \sigma_T^\text{obs}\sin\theta e^{-i\phi}\,dA}{a^2}\\
G_{0}&=&\frac{\int  \sigma_T^\text{obs}Y_{1}^{0}(\theta,\phi)\,dA}{\int |Y_1^{0}(\theta,\phi)|^2\,dA}=
\frac{\frac{1}{2}\sqrt{\frac{3}{\pi}}\int \sigma_T^\text{obs}\cos\theta\,dA}{a^2}\label{eq:G0}\\
G_{1}&=&\frac{\int  \sigma_T^\text{obs}Y_{1}^{1}(\theta,\phi)\,dA}{\int |Y_1^{1}(\theta,\phi)|^2\,dA}=
\frac{-\sqrt{\frac{3}{2\pi}}\int  \sigma_T^\text{obs}\sin\theta e^{i\phi}\,dA}{a^2}\end{aligned}$$ and therefore the following best estimates for the background concentration and the individual gradient components: $$\begin{aligned}
c_0&=&\frac{aC}{DT}\\
c_x&=&\frac{1}{6DT}\sqrt{\frac{3}{2\pi}}(G_{-1}-G_{1})\\
c_y&=&\frac{-i}{6DT}\sqrt{\frac{3}{2\pi}}(G_1+G_{-1})\\
c_z&=&\frac{1}{6DT}\sqrt{\frac{3}{\pi}}G_0\label{eq:cz}.\end{aligned}$$ Since $c_{x,y,z}$ are estimates of the independent, orthogonal components of the gradient, without loss of generality, we consider only the gradient estimate in the $z$-direction and generalize to an arbitrary gradient later. From Eq. \[eq:cz\], the best estimate for the gradient in the $z$-direction after absorption of particles for a time $T$ is given by $$c_{z}=\frac{\int  \sigma_T^\text{obs}\cos\theta\,dA}{4\pi Da^2T}
=\frac{\sum_{i=1}^{N}\cos\theta_i}{4\pi Da^2T}.\label{eq:gradz}$$

We are ultimately interested in the uncertainty (accuracy) of the gradient measurement by the absorbing sphere, which is given by the variance $$\begin{aligned}
\langle(\delta c_z)^2\rangle&=&\langle c_z^2\rangle-\langle c_z\rangle^2\\
&=&\frac{\langle\sum_{i=1}^{N}\cos^2\theta_i\rangle+
\langle\sum_{i=1}^{N}\sum_{i\neq j}^{N}\cos\theta_i\cos\theta_j\rangle}{(4\pi Da^2T)^2}-
\frac{\langle\sum_{i=1}^{N}\cos\theta_i\rangle^2}{(4\pi Da^2T)^2}\\
&=&\frac{\langle\sum_{i=1}^{N}\cos^2\theta_i\rangle}{(4\pi Da^2T)^2}\label{eq:dcz_with_1}
=\frac{\langle N\rangle\langle\cos^2\theta\rangle}{(4\pi Da^2T)^2}=\frac{c_0}{12\pi Da^3T}\label{eq:dcz_with_2}.\end{aligned}$$ Deriving Eq. \[eq:dcz\_with\_2\] made use of the independence of the particles to factorize the expectation value $\langle\sum_{i=1}^{N}\sum_{i\neq j}^{N}\cos\theta_i\cos\theta_j\rangle
=\langle N(N-1)\rangle\langle\cos\theta\rangle^2=\langle N\rangle^2\langle\cos\theta\rangle^2$, since $N$ is Poisson distributed. The last step is exact. We also used $\langle N\rangle=4\pi Dac_0T$, as well as $\langle\cos^2\theta\rangle=1/3$. The latter relation applied to absorbed particles holds even in the presence of a gradient in the $z$ direction since the average $\langle\cos^3\theta\rangle$ is zero.

Since the gradient may point in an arbitrary direction, the total uncertainty of the gradient, normalizedby $c_0/a$, is given by $$\frac{\langle(\delta c_{\vec r})^2\rangle}{(c_0/a)^2}=
\frac{3\langle(\delta c_{z})^2\rangle}
{(c_0/a)^2}=\frac{1}{4\pi Dac_0 T}\label{eq:res_one},$$ with the factor of 3 arising because each component of the gradient contributes independently to the total uncertainty. This result for the uncertainty in gradient sensing is independent of the magnitude of the actual gradient present (including the case when no gradient is present). Interestingly, the result is identical to the uncertainty in measureing the concentration by the same perfectly absorbing sphere ([*cf.*]{} Eq. \[eq:res\_one\_c\]).\
[**Special case: absorbing sphere with two polar measurement patches**]{}\
We consider a special case in which a whole sphere of radius $a$ is absorbing, but only two small circular patches of radius $s\, (<\!\!<a)$ opposite to each other on the sphere measure the number of absorbed particles. We start with the analogues of Eqs. \[eq:G0\] and \[eq:gradz\] for the estimated gradient in the $z$-direction $$\begin{aligned}
G_0&=&\frac{\int\sigma_T^\text{obs}\cos\theta\,dA}{\sqrt{3\pi}s^2}\\
c_{z}&=&\frac{G_0}{2\sqrt{3\pi}DT}=\frac{\int\sigma_T^\text{obs}\cos\theta\,dA}{6\pi Ds^2T}=\frac{N_1-N_2}{6\pi Ds^2T},\end{aligned}$$ where we have used $\cos\theta\approx 1$ for patch $1$ and $\cos\theta\approx -1$ for patch $2$. The variance is given by $$\begin{aligned}
\langle(\delta c_{z})^2\rangle&=&\langle c_z^2\rangle-\langle c_z\rangle^2\\
&=&\frac{\langle(N_1-N_2)^2\rangle}{(6\pi Ds^2T)^2}-\frac{\langle(N_1-N_2)\rangle^2}{(6\pi Ds^2T)^2}\\
&=&\frac{\langle (\delta N_1)^2\rangle+\langle (\delta N_2)^2\rangle}{(6\pi Ds^2T)^2}\\
&=&\frac{c_0}{18\pi Ds^2aT}\end{aligned}$$ where we have used $\langle\delta N_i^2\rangle=\langle N_i^2\rangle-\langle N_i\rangle^2=
\langle N_i\rangle$ ($i=1,2$) for a Poisson process, as well as $\langle N_1\rangle=\pi s^2DT(c_0+\langle c_z\rangle\,a)/a$ and $\langle N_2\rangle=\pi s^2DT(c_0-\langle c_z\rangle\,a)/a$. From this we obtain the normalized uncertainty of the gradient in the $z$ direction $$\frac{\langle(\delta c_{z})^2\rangle}{(c_0/a)^2}=\frac{1}{12\pi Dac_0T}\cdot\frac{2a^2}{3s^2},$$ [*i.e.*]{} $2a^2/(3s^2)$ times the uncertainty in the gradient using the whole sphere. Hence, the smaller the patch size $s$, the larger in the uncertainty of the gradient measurement.

Accuracy of Gradient Sensing by a Perfectly Monitoring Sphere
=============================================================

Berg and Purcell considered a “perfect instrument” for measuring the concentration of a certain dissolved chemical, namely a virtual sphere of radius $a$ that could exactly count the number of diffusing chemical molecules inside its volume [@berg77]. They showed that such an instrument, making measurements for a time $T$, could estimate a concentration with an uncertainty $$\frac{\langle(\delta c)^2\rangle}{c^2}=\frac{3}{5\pi DacT}\label{eq:res_two_c}.$$ We note that the “perfect instrument” is actually inferior by a factor 12/5 in variance to the perfectly absorbing sphere for concentration measurement (Eq. \[eq:res\_one\_c\]) because the absorbing sphere removes particles from the environment, and hence does not measure the same particle more than once.

We extend Berg and Purcell’s analysis of the perfect instrument to include gradient sensing by assuming that the virtual sphere also measures the positions of all particles in its volume. As in the previous section, we derive a best estimate for the gradient and the variance of this best estimate to find the uncertainty of the gradient determination. We start by fitting a gradient model $c=c_0+\vec r\cdot\vec c_r$ to the observed time-averaged number density $\frac{1}{T}\int dt\rho_\text{obs}(t)=
\frac{1}{T}\int dt\sum_{i=1}^{N}\delta(\vec r-\vec r(t))$, obtained by measuring the exact positions of the particles inside the volume of the sphere for a time $T$. Specifically, we minimize the error $$\text{Error}=\int\left(\frac{1}{T}\int\rho_\text{obs}(t)dt-c_0-\vec r\cdot\vec c_{r}\right)^2dV.$$ As before we focus on one component of the gradient, namely the gradient in the $z$-direction $c_z$. By setting $\partial \text{Error}/\partial c_z=0$, we obtain as a best estimate for the $z$ gradient $$c_{z}=\frac{\frac{1}{T}\int dt\int dV z \rho_\text{obs}(t)}{\int dV z^2}.$$ We are interested in the variance of this estimated gradient $$\begin{aligned}
 \langle(\delta c_z)^2\rangle&=&\langle c_z^2\rangle-\langle c_z\rangle^2\\
 &=&\left(\frac{15}{4\pi a^5}\right)^2\cdot\frac{1}{T^2}\left[\left\langle\left(\int dt\int dV z\rho_\text{obs}(t)\right)^2\right\rangle
 -\left\langle\left(\int dt\int dV z\rho_\text{obs}(t)\right)\right\rangle^2\right]\\
 &=&\left(\frac{15}{4\pi a^5}\right)^2\left[\langle m_{z,T}^2\rangle
 -\langle m_{z,T}\rangle^2\right]\label{eq:czT2},\end{aligned}$$ where we have used $\int dV z^2=4\pi a^5/15$ and we have defined $$\begin{aligned}
 \langle m_{z,T}^2\rangle&=&\frac{1}{T^2}\left\langle\left(\int dt\int dV z \rho_\text{obs}(t)\right)^2\right\rangle=
 \frac{1}{T^2}\int_0^T dt\int_0^T dt' \langle m_z(t)m_z(t')\rangle,\label{eq:mzmz}\\
 \langle m_{z,T}\rangle&=&\frac{1}{T}\left\langle\left(\int dt\int dV z \rho_\text{obs}(t)\right)\right\rangle=
 \frac{1}{T}\int_0^T dt\langle m_z(t)\rangle.\label{eq:mzT}\end{aligned}$$ The quantity $m_z(t)$ is the total of the $z$ coordinates of all the particles inside the sphere at time $t$. To calculate $m_z(t)$, consider the sphere imbedded inside a much larger volume containing a total of $M$ particles. This results in $m_z(t)=\sum_{i=1}^{M}z_i(t)$, where $z_i$ is the z-coordinate of particle $i$ if this particle is inside the sphere and zero if it is outside. If $N(t)$ is the number of particles inside the sphere at time $t$, then on average there will be $\langle N\rangle=\frac{4}{3}\pi a^3 c_0$ particles inside the sphere. The auto-correlation function $\langle m_z(t)m_z(t')\rangle$ of particles inside the sphere at time $t$ and time $t'$ can consequently be calculated $$\begin{aligned}
 \langle m_z(t)m_z(t')\rangle&=&\langle\sum_{i=1}^M\sum_{j=1}^Mz_i(t)z_j(t')\rangle\\
 &=&\langle\sum_{i=1}^Mz(i)z_i(t')\rangle+\langle\sum_{i=1}^Mz_i(t)\rangle\cdot\langle\sum_{j\neq i}^Mz_j(t')\rangle\\
 &=&\langle N\rangle\,\langle z(t)z(t')\rangle+\langle N\rangle^2\,\langle z(t)\rangle^2\label{eq:mzmz1}\\
 &=&\frac{4}{3}\pi a^3c_0\,u(t-t')+\langle m_z(t)\rangle^2\label{eq:mzmz2},\end{aligned}$$ where we defined $u(t-t')=\langle z(t)z(t')\rangle$. For Eq. \[eq:mzmz1\] we used that $\langle\sum_{j\neq i}^Mz_j(t')\rangle\approx\langle\sum_{j=1}^Mz_j(t')\rangle$, which is exact in the thermodynamic limit of the large embedding volume and large $M$. Furthermore, since $N(t)$ and $z(t)$ are independent, the factorization of the expectation values is exact as well. Plugging Eqs. \[eq:mzmz2\] and \[eq:mzT\] into Eq. \[eq:czT2\] results in $$\langle(\delta c_z)^2\rangle=\frac{75c_0}{4\pi a^7T^2}\int_0^T dt\int_0^T dt' u_0(t-t'),\label{eq:dcz2}$$ where the second term in Eq. \[eq:mzmz2\] cancels Eq. \[eq:mzT\].

By introducing a correlation time $\tau_z=1/a^2\cdot\int_0^\infty d\tau u(\tau)$ for $z(t)$, the double time integral in Eq. \[eq:dcz2\] can be simplified, provided time $T$ is much larger than $\tau_z$. Using time-reversal symmetry $u(\tau)=u(-\tau)$ for equilibrium diffusion (small gradients), the variance transforms into $$\langle(\delta c_z)^2\rangle=\frac{75 c_0\tau_z}{2 \pi a^5 T}\label{eq:czT3}.$$ The remaining task is to calculate $\tau_z$, the probability that a particle with coordinate $z$ inside the sphere at time $t=0$ is still (or again) inside the sphere at a later time $\tau$. Since the chemical concentration consists of a constant background concentration plus a gradient, we first consider the constant background and later consider the additional gradient.

Based on the solution of the diffusion equation, if a unit amount of chemical is released at point $\vec r\,'$, the concentration at point $\vec r$ at a later time $\tau$ is given by $$f(|\vec r-\vec r\,'|,\tau)=\frac{\exp\left(-\frac{|\vec r-\vec r\,'|^2}{4D\tau}\right)}{(4\pi D\tau)^\frac{3}{2}}.$$ Using the result for the time integral in Ref. [@berg77] $$\int_0^\infty d\tau\,f(|\vec r-\vec r\,'|,\tau)=\frac{1}{4\pi D|\vec r-\vec r\,'|},$$ the correlation time $\tau_z$ can be expressed as a volume integral over the sphere (the initial coordinate $\vec r'$ is uniform in the sphere because we assume a uniform background chemical concentration) $$\begin{aligned}
\tau_z&=&\frac{1}{\frac{4}{3}\pi a^3}\int_0^\infty d\tau\int\,dV\,z\int\,dV'\,z\,'f(|\vec r-\vec r\,'|,\tau)\\
&=&\frac{3}{16\pi^2 Da^3}\int\,dV\,z\int\,dV'\frac{z\,'}{|\vec r-\vec r\,'|}
=\frac{3}{16\pi^2 Da^3}\int\,dV\,z\,\psi(r,\theta)\label{eq:tauz},\end{aligned}$$ where $r=|\vec r|$. The function $\psi(r,\theta)$ is analogous to the potential of a charge density that is rotationally symmetric around the $z$-axis in electrostatics, [*i.e.*]{} $\rho(z\,')=z'=\rho(r\,',\theta')=r'\cos\theta'$ for $r'\leq a$ and $\rho(r\,')=0$ for $r'> a$. To solve the integral in Eq. \[eq:tauz\], we perform a multipole expansion of the potential $$\psi(r,\theta)=\int dV'\frac{r'\cos\theta'}{|\vec r-\vec r'|}$$ in terms of Legendre polynomials $P_l(\cos\theta)$, exploiting the rotational symmetry about the $z$ axis [@jackson]. One needs to differentiate two cases:\
[**Case I ($r'<r\leq a$):**]{}\
$$\psi_>(r,\theta)=\sum_{l=0}^\infty\left(\frac{Q_l}{r^{l+1}}\right)P_l(\cos\theta),$$ where the exterior multipole moments are given by $Q_l=\int dV'\rho(\vec r\,'){r'}^lP_l(\cos\theta')$ with $\rho(\vec r\,')=r'\cos\theta'$. Performing the integral, only the dipole moment survives $$Q_1=\frac{4\pi r^5}{15},$$ yielding $$\psi_>(r,\theta)=\frac{4\pi r^3}{15}\cos\theta.$$ [**Case II ($r<r'\leq a$):**]{}\
$$\psi_<(r,\theta)=\sum_{l=0}^\infty I_l r^l P_l(\cos\theta),$$ where the interior multipole moments are defined as $I_l=\int dV'\frac{\rho(\vec r')}{{r'}^{l+1}}P_l(\cos\theta')$ and, again, only the dipole moment survives $$I_1=\frac{2\pi (a^2-r^2)}{3},$$ yielding $$\psi_<(r,\theta)=\frac{2\pi r(a^2-r^2)}{3}\cos\theta.$$ Using these expressions for the potential, the remaining integral in Eq. \[eq:tauz\] can be performed by summing up the two contributions to the potential $\psi(r,\theta)=\psi_<(r,\theta)+\psi_>(r,\theta)$ $$\tau_z=\frac{2\pi}{\frac{16}{3}\pi^2Da^5}\int_0^a dr\,r^3\int_0^\pi d\theta\, \sin\theta\, \cos\theta 
\ [\psi_<(r,\theta)\ +\ \psi_>(r,\theta)]=\frac{2a^2}{105 D}\label{eq:tauz2}.$$ Now consider the contribution from an additional gradient with zero mean over the volume of the sphere. We need to integrate $\int\,d^3\vec r...$ over a non-uniform distribution in Eqs. \[eq:tauz\] and \[eq:tauz2\]. Since a gradient along the $z$-axis contributes a factor $\cos\theta$, leading to the vanishing integral $\int_0^\pi\sin\theta\cos^3\theta\,d\theta=0$, only the constant background contributes to the uncertainty in the gradient measurement.

The result for $\tau_z$ (Eq. \[eq:tauz2\]) can be used in Eq. \[eq:czT3\] to obtain the normalized uncertainty of the gradient measurement by the perfect instrument $$\frac{\langle(\delta c_z)^2\rangle}{(c_0/a)^2}=\frac{5}{7\pi Dac_0 T}.$$ Since each component of the gradient contributes independently, the total normalized uncertainty is finally $$\frac{\langle(\delta c_{\vec r})^2\rangle}{(c_0/a)^2}=\frac{15}{7\pi Dac_0 T}\label{eq:final}.$$ Hence, the “perfect instrument” is not only inferior to the perfectly absorbing sphere for concentration sensing by a factor of $12/5$ in variance ([*cf.*]{} Eqs. \[eq:res\_two\_c\] and \[eq:res\_one\_c\]), but is also inferior by an even larger factor of $60/7$ for gradient sensing (Eq. \[eq:res\_one\]).

Berg HC, Purcell EM (1977) Physics of chemoreception. [*Biophys J*]{} 20: 193-219.

Jackson JD (1975) [*Classical Electrodynamics*]{} (2rd Ed., Wiley, NewYork), Ch. 4.4.

![Main panel is reproduced from main text Fig. 1, showing the Chemotactic Index of [*Dictyostelium discoideum*]{} cells migrating toward a pipette. Symbols correspond to four different cAMP concentrations, 0.1 $\mu$M (squares), 1 $\mu$M (triangles), 10 $\mu$M (diamonds), 100 $\mu$M (circles). Inset: predicted distributions of cell-movement directions at the two points of the 100 $\mu$M cAMP curve indicated by arrows, distances 200 $\mu$m (solid curve and arrow) and 500 $\mu$m (dashed curve and arrow) from the pipette.[]{data-label="fig:figS1"}](Endres_figS1.eps){width="12cm"}
