title: Benfords law in the Gaia universe
authors: Jurjen de Jong Jos de Bruijne Joris De Ridder
text: 
  
  
  
  
  
  
  
  Science Support Office, Directorate of Science, European Space Research and Technology Centre (ESA/ESTEC), Keplerlaan 1, 2201 AZ Noordwijk, The Netherlands
  Institute of Astronomy, KU Leuven, Celestijnenlaan 200D, 3001 Leuven, Belgium
  Matrixian Group, Transformatorweg 104, 1014 AK Amsterdam, The Netherlands
  
  
  
  
  
      
      
          Benford's law states that for scale- and base-invariant data sets covering a wide dynamic range, 
          the distribution of the first significant digit is biased towards low values.
          This has been shown to be true for wildly different datasets, including financial, geographical, and atomic data.
          In astronomy, earlier work showed that Benford's law also holds for distances estimated as the inverse of
           parallaxes from the ESA Hipparcos mission.    
      
      
      
          We investigate whether Benford's law still holds for the 1.3 billion parallaxes contained 
          in the second data release of Gaia (Gaia DR2). In contrast to previous work, we also include negative parallaxes. We examine whether distance estimates computed using a Bayesian approach
          instead of parallax inversion still follow Benford's law. Lastly, we investigate the use of Benford's law as a validation tool for the zero-point of the Gaia parallaxes.
      
      
      
          We computed histograms of the observed most significant digit of the parallaxes and distances, and compared them with the predicted values from Benford's law, as well as with 
          theoretically expected histograms. The latter were derived from a simulated Gaia catalogue based on the 
          Besançon galaxy model.  
      
      
      
          The observed parallaxes in Gaia DR2 indeed follow Benford's law. 
          Distances computed with the Bayesian approach of <cit.> no longer follow Benford's law,
          although low-value ciphers are still favoured for the most significant digit. The prior that is used 
          has a significant effect on the digit distribution. Using the simulated
          Gaia universe model snapshot, we demonstrate that the true distances underlying the Gaia catalogue are not 
          expected to follow Benford's law, 
          essentially because the interplay between the luminosity function of the Milky Way 
          and the mission selection function results in a bi-modal distance distribution, corresponding to nearby dwarfs in the 
          Galactic disc and distant giants in the Galactic bulge. In conclusion, Gaia DR2 parallaxes only follow Benford’s Law as a result of observational errors.
          Finally, we show that a zero-point
          offset of the parallaxes derived by optimising the fit between the observed most-significant digit frequencies and 
          Benford's law leads to a value that is inconsistent with the value that is derived from quasars. The underlying reason
          is that such a fit primarily corrects for the difference in the number of positive and negative parallaxes, and can thus not be used to obtain a reliable zero-point.
      
      
      
      
      
      
      Benford's law in the Gaia universe
      
  Jurjen de Jong<ref>,<ref>,<ref> Jos de Bruijne<ref> Joris De Ridder<ref>
  
      Received XXX 2019 / Accepted XXX 2020
  ==============================================================================
  
  
  
  
  
  
  § INTRODUCTION
  
  
  Benford's law, sometimes referred to as the law of anomalous numbers or the significant-digit law, was put forward by Simon Newcomb in 1881 and later made famous by Frank Benford <cit.>. The law states that the frequency distribution of the first significant digit of data sets representing (natural) phenomena covering a wide dynamic range such as terrestrial river lengths and mountain heights is non-uniform, with a strong preference for low numbers. As an example, Benford's law states that digit 1 appears as the leading significant digit 30.1% of the time, while digit 9 occurs as first significant digit for only 4.6% of data points taken from data sets that adhere to Benford's law. Although Benford's law has been known for more than a century and has received significant attention in a wide range of fields covering natural and (socio-)economic sciences <cit.>, a statistical derivation was only published fairly recently, showing that Benford's law is the consequence of a central-limit-theorem-like theorem for significant digits <cit.>.
  
  
  <cit.> investigated the presence of Benford's law in the Universe and demonstrated that the ∼118,000 stellar parallaxes from the ESA Hipparcos astrometry satellite <cit.>, converted into distances by inversion, follow Benford's law. In this paper, we extend this work and present an investigation into the intriguing question whether the ∼1.3 billion parallaxes and the associated Bayesian-inferred distances that are contained in the second data release of the Hipparcos successor mission, Gaia <cit.>, follow Benford's law as well. Moreover, we investigate the prospects of using Benford's law as tool for validating the Gaia parallaxes. The idea of using Benford's law as a tool for anomaly detection is not new: <cit.> described that Benford's law was used to detect fraud in income-tax declarations. We adapt this idea and investigate the effect of the parallax zero-point offset that is known to be present in the Gaia DR2 parallax data set <cit.> with the aim to determine whether Benford's law can be used to derive the value of the offset.
  
  This paper is organised as follows. Section <ref> presents a short overview of Benford's law. Section <ref> summarises and discusses the Hipparcos-based study by <cit.> that inspired this work. Section <ref> presents our work, which is based on Gaia DR2. The effect of the parallax zero-point is discussed in Section <ref>, and a discussion and conclusions can be found in Section <ref>.
  
  
  
  § BENFORD'S LAW
  
  
  Benford's law is an empirical, mathematical law that gives the probabilities of occurrence of the first, second, third, and higher significant digits of numbers in a data set. In this paper, we limit ourselves to the first significant digit. We also investigated the second and third significant digits, but this did not yield additional insights into this study.
  
  Every number X ∈ℝ_> 0 can be written in scientific notation as X = x · 10^m, where 1 ≤ x < 10 and x ∈ℝ_> 0, m ∈ℤ. The quantity x is called the . The first significant digit is therefore also the first digit of the significand. This formulation allows us to define the first-significant digit operator D_1 on number X with a floor function:
  
      D_1X = ⌊x⌋.
  
  
  According to Benford's law, the probability for a first significant digit d = 1, …, 9 to occur is
  
  
      P(D_1X=d) = log_10(1+1/d).
  
  
  Benford's law states that the probability of occurrence of 1 as first significant digit (d=1) equals P(D_1X=1) = 0.301. This probability decreases monotonically with higher numbers d, with P(D_1X=2) = 0.176, P(D_1X=3) = 0.125, down to P(D_1X=9) = 0.046 for d=9 as first significant digit.
  
  
  
  
  
  
  
  Figure <ref> shows the first significant digit of randomly drawn numbers from an exponential distribution (e^-X) versus Benford's law. This shows that the exponential distributed data approaches Benford's law.
  
  Benford's law is an empirical law. This means that there is no solid proof to show that a data set agrees with Benford's law. Nonetheless, the following conditions make it very likely that a data set follows Benford's law:
  
  
  
    * The data shall be non-truncated and rather uniformly distributed over several orders of magnitude. This can be understood through Eq. (<ref>), which shows that on a logarithmic scale, the probability P(D_1X=d) is proportional to the space between d and d+1. In other words: Benford's law results naturally if the mantissae (the fractional part)  of the logarithms of the numbers are uniformly distributed. For example, the mantissa of log_10(2· 10^m) ≈ m + 0.30103 for m ∈ℤ, equals 0.30103. This is graphically illustrated in Figure <ref>, in which we intuitively show that a distribution close to a uniform logarithmic distribution should obey Benford's law. In particular, the red bins with d=1 occupy ∼30% of the axis, compared to the ∼5% length of the blue bins that contain numbers where d=8. Even though the distribution is not perfectly uniform (the heights of the bins vary), the cumulative areas of all red and all blue bins are determined more by the (fixed) widths of the bins than by their heights, such that Benford's law is approximated when adding (i.e., averaging over) several orders of magnitude.
  
    * From the previous point, it follows intuitively that if a data set follows Benford's law, it must be scale invariant (see Appendix <ref>). In particular, a change of units, for instance from parsec to light year when stellar distances are considered, should not (significantly) change the probabilities of occurrence of the first significant digit. 
  This can be understood by looking at Figure <ref> and by considering a uniform logarithmic distribution for which the logarithmic property logCx = logC + logx holds for variable x ∈ℝ_> 0 and constant (scaling factor) C ∈ℝ_> 0.
  
    * <cit.> demonstrated that scale-invariance implies base-invariance (but not conversely). It therefore follows that if a data set follows Benford's law, it must be base invariant (see Appendix <ref>). In particular, a change of base, for instance from base 10 as used in Eq. (<ref>) to base 6, should not (significantly) change the probabilities of occurrence of the first significant digit in comparison to Benford's law.
  
  
  For reasons explained in Appendix <ref>, we used a simple Euclidean distance to quantify how well the distribution of the first significant digit of Gaia data is described by Benford's law. Although this sample-size-independent metric is not a formal test statistic, with associated statistical power, this limitation is acceptable in this work because we only use the Euclidean distance as a relative measure (see Appendix <ref> for an extensive discussion).
  
  
  
  
  
  
  
  
  
  § HIPPARCOS
  
  
  <cit.> presented an assessment of Benford's law in relation to stellar distances. Unfortunately, the authors provide very limited information and just state that they used the distances from the HYG [Hipparcos-Yale-Gliese] database, which includes 115 256 stars with distances reaching up to 14 kpc. Based on various tests we conducted, trying to reproduce the results presented by , we conclude the following:
  
  
    * The assessment of  has been based on the HYG 2.0 database (September 2011), which consists of the original Hipparcos catalogue <cit.> that contains 118 218 entries, 117 955 of which have five-parameter astrometry (position, parallax, and proper motion), merged with the fifth edition of the Yale Bright Star Catalog that contains 9110 stars  and the third edition of the Gliese Catalog of Nearby Stars that contains 3803 stars. We verified that changing the data set to the latest version of the catalogue, HYG 3.0 (November 2014), which is based on the new reduction of the Hipparcos data by <cit.>, does not dramatically change the results.
  
    * The assessment of  has simply removed the small number of entries with non-positive parallax measurements. Presumably, this was done because negative parallaxes, which are a natural but possibly non-intuitive outcome of the astrometric measurement process underlying the Hipparcos and also the Gaia mission, cannot be directly translated into distance estimates (see the discussion in Section <ref>). Because the fraction of Hipparcos entries with zero or negative parallaxes is small (4245 and 4013 objects, corresponding to 3.6% and 3.4% for the data from  or , respectively), excluding or including them does not fundamentally change the statistics.
  
    * Distances have been estimated by  from the parallax measurements through simple inversion. Whereas the  parallax and distance of a star are inversely proportional to each other, the estimation of a distance from a  parallax, which has an associated uncertainty (and which can even be formally negative) requires care to avoid biases and to derive meaningful uncertainties <cit.>. While for relative parallax errors below ∼10–20% a distance estimation by parallax inversion is an acceptable approach, Bayesian methods are superior for a distance estimation for larger relative parallax errors (see the discussion in Section <ref>). In the case of the Hipparcos data sets, only 42% and 51% of the objects from  and , respectively, have relative parallax errors below 20%. In general,  the “distances” inferred by  are therefore biased as well as unreliable.
  
  
  Figure <ref> shows the histogram of the parallax measurements in the Hipparcos data set from <cit.> and the associated first-significant-digit distribution. The latter resembles Benford's law, at least trend-wise, although we recognise that it is statistically speaking not an acceptable description. Nonetheless, the overabundance of low-number compared to high-number digits is striking and significant. 
  
  Following Appendix <ref>, the distribution of inverse parallaxes, that suggestively but incorrectly are referred to as “distances” by <cit.>, should also follow (the trends of) Benford's law. This is confirmed in Figure <ref>. It shows that because small, positive parallaxes (0 < ϖ 1 mas) are abundant in the Hipparcos data set, many stars are placed (well) beyond 1 kpc in inverse parallax (“distance”). As a result, the inverse parallaxes (“distances”) span several orders of magnitude and resemble Benford’s Law. We conclude that the results obtained by <cit.> are reproducible but that their interpretation of inverse Hipparcos parallaxes as distances can be improved.
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  § GAIA DR2
  
  
  The recent release of the Gaia DR2 catalogue <cit.> offers a unique opportunity to make a study of Benford's law and stellar distances not based on 0.1 million, but 1 000+ million objects. We discuss the parallaxes in Section <ref> and the associated distance estimates in Sections <ref> and <ref>. We compare our findings with simulations in Section <ref>.
  
  
  
   §.§ Gaia DR2 parallaxes
  
  
  Gaia DR2 contains five-parameter astrometry (position, parallax, and proper motion) for 1 331 909 727 sources. One feature of the Gaia DR2 catalogue is the presence of spurious entries and non-reliable astrometry. Suspect data can be filtered out using quality filters recommended in <cit.>, <cit.>, and <cit.>. Rather than filtering on the astrometric unit weight error (UWE), we filtered on the renormalised astrometric unit weight error (RUWE).[
  
    See the Gaia DR2 known issues website <https://www.cosmos.esa.int/web/gaia/dr2-known-issues> and Appendix <ref> for details.
  
  ] In this study, we consistently applied the standard photometric excess factor filter published in April 2018 plus the revised astrometric quality filter published in August 2018 (see Appendix <ref> for a detailed discussion). Another point worth mentioning is that in contrast to the Hipparcos case (Section <ref>), the percentage of non-positive parallaxes (Gaia DR2 does not contain objects with parallaxes that are exactly zero) in Gaia DR2 is substantial, at 26% (Figure <ref>). Throughout this study, when we consider the first significant digit of Gaia DR2 parallaxes, we take the absolute value of the parallaxes first. The justification and implications of this choice are discussed in Appendix <ref>.
  
  Figure <ref> shows the distribution of the first significant digit of the Gaia DR2 parallaxes. In practice, to save computational resources, we use randomly selected subsets of the data throughout this paper, unless stated otherwise (see Appendix <ref> for a detailed discussion). The first significant digit of the parallax sample follows Benford's law well. 
  
  This is expected because at least two conditions identified in Section <ref> are met. First of all, the histogram of the Gaia DR2 parallaxes shows that the distributions cover four orders of magnitude. Secondly, the distribution of the first significant digit of the parallaxes is not sensitive to scaling. That is, we verified that multiplying all parallaxes with a constant C does not fundamentally change the distribution of the first significant digit: for instance, the probabilities for digit d=1 do not change by more than 5%  points by scaling the data with any factor C in the range 1–10 (see also Appendix <ref>). 
  We postpone the discussion of why the first significant digit of the parallaxes follows Benford's law so closely to Section <ref>.
  
  
  
  
   §.§ Gaia DR2 distance estimates
  
  
  
  As we reported in Section <ref>, astrometry missions such as Hipparcos and Gaia do not measure stellar distances but parallaxes. These measurements are noisy such that as a result of the non-linear relation between (true) parallax and (true) distance (distance∝ parallax^-1), distances estimated as inverse parallaxes are fundamentally biased <cit.>. Whereas this bias is small and can hence be neglected, for small relative parallax errors (e.g. below ∼10–20%), it becomes significant for less precise data. Figure <ref> shows a histogram of the relative parallax error of the Gaia DR2 catalogue. It shows that only 9.9% of the objects with positive parallax have 1 /  parallax_over_error < 0.2, indicating that great care is needed in distance estimation.
  
  As explained in <cit.>, distance estimation from measured parallaxes is a classical inference problem that is ideally amenable to a Bayesian interpretation. this approach has the advantage that negative parallax measurements can also be physically interpreted and that meaningful uncertainties on distance estimates can be reconstructed. Using a distance prior based on an exponentially decreasing space density (EDSD) model, <cit.> presented Bayesian distance estimates for (nearly) all sources in Gaia DR2 that have a parallax measurement. Figure <ref> compares the distribution of the first significant digit of these distance estimates to Benford's law. This time, a poor match can be noted: instead of 1 as the most frequent digit, digits 2 and 3 appear more frequently. Why the first significant digits of the Bailer-Jones distance estimates do not follow Benford's law is evident from their histogram: Most stars in Gaia DR2 are located at ∼2–3 kpc from the Sun (see also Figure <ref>). This is mostly explained by the EDSD prior adopted by  in their Bayesian framework. For the (small) set of (nearby) stars with highly significant parallax measurements, the choice of this prior is irrelevant and the distance estimates are strongly constrained by the measured parallaxes themselves. For the (vast) majority of (distant) stars, however, the low-quality parallax measurements contribute little weight, and the distance estimates mostly reflect the choice of the prior. The EDSD prior has one free parameter, namely the exponential length scale L, which can be tuned independently for each star. <cit.> opted to model this parameter as function of galactic coordinates (ℓ,b) based on a mock galaxy model. Because the EDSD prior has a single mode at 2 L and because L (r_len in the data model) has been published along with the Bayesian distance estimates for each star, a prediction for the distribution of the first significant digit of the mode of the prior can be made accordingly. Figure <ref> shows this prediction, along with the actual distribution of the mode of the EDSD prior, for a random sample of one million stars. The digit distribution compares qualitatively well with that of the Bayesian distance estimates (cf. Figure <ref>), with digit 2 appearing most frequently, followed by digits 1 and 3, followed by digit 4, and with digits 5–9 being practically absent. Quantitative differences between the digit distributions can be understood by comparing the left panels of Figures <ref> and <ref>. Whereas the distance distribution has a smooth, Rayleigh-type shape, extending out to ∼8 kpc, the prior mode distribution is noisy as a result of the extinction law applied in the mock galaxy model used by <cit.> and lacks signal below ∼700 pc and above ∼5 kpc. This finite range is a direct consequence of the way in which the length scale was defined by , who opted to compute it for 49 152 pixels on the sky as one-third of the median of the (true) distances to all the stars from the galaxy model in that pixel (and subsequently creating a smooth representation as function of Galatic coordinates ℓ,b by fitting a spherical harmonic model). This resulted in a lowest value of L of 310 pc and a highest value of 3.143 kpc (such that the EDSD prior mode 2L can only take values between 620 pc and 6.286 kpc).
  
  <cit.> published a set of 265 637 087 photo-astrometric distance estimates obtained by combining Gaia DR2 parallaxes for stars with G < 18 mag with PanSTARRS-1, 2MASS, and AllWISE photometry based on the StarHorse code. The recommended quality filters SH_GAIAFLAG="000" to select non-variable objects that meet the RUWE and photometric excess-factor filters from Appendix <ref> and SH_OUTFLAG="00000" to select high-quality StarHorse distance estimates leave 136 606 128 objects. Figure <ref> shows their distance histogram and the associated distribution of the first significant digit. The strong preference for digits 1 and 2, followed by digits 7 and 8, is explained by the bi-modality of the distance histogram, showing a strong peak of main-sequence dwarfs at ∼1.5 kpc and a secondary peak of (sub)giants in the Bulge around 7.5 kpc.
  
  Our main conclusion of this section is that all available, large-volume, Gaia-based distance estimates prefer small leading digits. This fact, however, foremost reflects the structure of the Milky Way, combined with its luminosity function and extinction law, and the magnitude-limited nature of the Gaia survey.
  
  
  
  
   §.§ Gaia DR2 distance estimates in the solar neighbourhood
  
  
  
  
  It is to be expected that the distribution of the first significant digit of stellar distances is (much) less dependent on the prior for high-quality parallaxes, for which the distance estimates are strongly constrained by the parallax measurements themselves. To verify this, we show this distribution in Figure <ref> for the subset of 243 291 stars in Gaia DR2 that have distance estimates below 100 pc and hence have typically small relative parallax errors (e.g. the mean and median values of parallax over error are 261 and 214, respectively). In this case, in contrast to the case of Benford's law, digit 1 appears least frequently and digit 9 appears most frequently. Assuming that stars in the solar neighbourhood are approximately uniformly distributed with a constant density, this can be understood because the volume between equidistant (thin) shells centred on the Sun increases with the cube of the shell radius (e.g. there are [100^3-90^3]/[20^3-10^3] ∼ 39 times as many objects in the shell between 10 and 20 pc compared to the shell between 90 and 100 pc). As shown in Figure <ref>, the model of a constant-density solar neighbourhood is an almost perfect match with the data. 
  
  In order to determine out to which distance this is true, Figure <ref> shows how the expectation value of the first significant digit of the distance distribution for all stars located within a sphere around the Sun with radius R_⋆ varies with this radius and compares this expectation value with the one from the constant-density model. The (maybe initially surprising) variation in the expectation value between digits 2 and 7 with the distance limit of the sample (or the model) can be understood using the same argument as used before, linked to the cube dependence of the volume on distance. Fair agreement between data and model (difference < 10%) occurs up to ∼720 pc, which depending on extinction corresponds to early-M dwarfs for a faint limiting magnitude of 20.7 mag. To find a value of 720 pc is not surprising given the ∼300 pc vertical scale height of the thin disc <cit.>. We conclude that whereas the distribution of the first significant digit of distances of the full Gaia DR2 catalogue is biased to digits 2 and 3 (Section <ref>) and mostly reflects the prior that has been used in the Bayesian estimation of the distances, local samples (720 pc) with high-quality parallaxes show a preference for a range of digits, with the most frequent digit depending on the limiting distance, which is fully compatible with a distribution of stars with uniform, constant density.
  
  
  
  
   §.§ Comparison with Gaia simulations
  
  
  
  
  
  
  
  <cit.> presented the Gaia universe model snapshot (GUMS). GUMS is a customised and extended incarnation of the Besançon galaxy model, fine-tuned to a perfect Gaia spacecraft that makes error-less observations. GUMS represents a sophisticated, realistic, simulated catalogue of the Milky Way (plus other objects accessible to Gaia, such as asteroids and external galaxies) observable by Gaia, containing more than one billion stars down to G < 20 mag. According to the Besançon galaxy model, the Milky Way consists of an exponentially thin disc (67% of the objects), an exponentially thick disc (22% of the objects), a bulge (10% of the objects), and a halo (1% of the objects). Not surprisingly, given the luminosity function and magnitude-limited nature of the Gaia survey, the majority of the stars in GUMS are within a few kiloparsec from the Sun, with 69% being main-sequence objects and 29% being sub(giants). Figure <ref> shows the histogram of the true (i.e. noise-less, simulated) GUMS distances and the associated distribution of the first significant digits, which does not resemble Benford’s Law at all. The aforementioned bi-modality in distances, with a main disc peak around 2–3 kpc and a strong secondary bulge peak around 5-7 kpc, explains the relatively even occurrence of the numbers 1-7 as leading significant digit.
  
  <cit.> presented an observed version of the GUMS catalogue resulting from application of Gaia-specific error models that implement realistic observational errors that depend, as in reality, on object properties such as magnitude, on the Gaia instrument characteristics such as read-out noise, and on the number of observations made over the nominal five-year operational lifetime. The vast majority of the 523 million individual, single stars
  
  are main-sequence dwarfs of spectral types F, G, K, and M (381 million, corresponding to 73%) and (sub)giants of spectral type F, G, and K (133 million, corresponding to 25%). Figure <ref> shows the parallax distribution of this observed GUMS sample, together with the distribution of their first significant digit. When we compare Figure <ref> with Figure <ref>, we recall that the first reflects a five-year Gaia mission and the second refers to Gaia DR2, which is based on 22 months of data (which implies that the formal uncertainties are to first order a factor √(60/22)≈ 1.7 larger). Nonetheless, the agreement between simulations and Gaia DR2 is striking.
  
  When we compare Figure <ref> with Figure <ref>, it is striking that the distribution of noise-free GUMS distances shows a larger departure from Benford's law than the distribution of noisy parallaxes simulated from them.
  
  When the noise-free GUMS distances are inverted to noise-free parallaxes, the Euclidean distance of the first-significant-digit distribution with respect to Benford’s Law does not drastically change (<10%), suggesting that not the inversion in itself, but the observational (parallax) errors are responsible for the improved match to Benford’s Law. This agrees with the inverse-invariance of first-significant-digit distributions that follow Benford's law (see Appendix <ref>). In order to investigate this further, we took the noise-free GUMS parallaxes and perturbed them with a parallax error that was randomly drawn (for each individual object) from a Gaussian distribution with zero mean and a fixed standard deviation that reflects the parallax standard error. The first significant digits of the associated distribution of noisy parallaxes can then be compared to Benford’s Law, and the agreement quantified through the Euclidean distance metric. When we repeated this for ever-increasing parallax standard errors (σ_ϖ), we found that the Euclidean distance with respect to Benford’s Law rapidly decreased by a factor ∼2, from 0.13 for σ_ϖ = 0 mas (noise-free GUMS parallaxes) to 0.06 for σ_ϖ = 0.7 mas (which is a typical parallax standard error for a representative faint star in Gaia DR2). In other words, the distribution of the first significant digits of the parallaxes approaches Benford’s Law more and more when the parallaxes are made more and more noisy. The reason for this significant reduction in Euclidean distance when observational parallax errors are added is shown in Figures 4 and 9 in <cit.>. These figures show that for the vast majority of stars, the (end-of-life, so surely the Gaia DR2) parallax error is larger than the true parallax itself. Combined with the fact that more than 40% of the GUMS stars have d=1 as leading significant digit for their true parallax, as dictated by the nature of the Milky Way and the Gaia survey, this causes a bell-shape of the distribution of observed parallaxes around a low mean parallax value (Figures <ref> and <ref>, left panels) such that the first significant digits nicely follow Benford’s Law (Figures <ref> and <ref>, right panels).
  
  
  
  
  § PARALLAX ZERO-POINT
  
  
  
  
   §.§ Background
  
  
      The global parallax zero-point offset in the Gaia DR2 data set should have come as no surprise. It has been known from Hipparcos times <cit.> that a scanning, global space astrometry mission with a design such as that of Hipparcos and Gaia will have a (almost) full degeneracy between spin-synchronous variations of the basic angle between the (viewing directions of the) two telescopes and the zero-point of the parallaxes in the catalogue <cit.>. The zero-point offset was determined during the data processing and was published in <cit.> as -29 ± 1 μas, in the sense of Gaia parallaxes being too small, based on the median parallax of a sample of half a million primarily faint quasars contained in Gaia DR2. During the internal validation of the data processing prior to release, the zero-point was investigated using ∼30 different methods and samples, systematically resulting in a negative offset of order a few dozen μas <cit.>. During these early inspections, hints already appeared that the zero-point offset depends on sky position, magnitude, and colour of the source.
  
  Subsequent external studies, using a variety of methods and primarily bright stellar samples, and often combined with external data, often resulted in a zero-point offset of about -50 μas. Some recent examples, ordered from low to high offset values, include
  -28 ±  2 μas from <cit.> based on mixture modelling of globular clusters,
  -31 ± 11 μas from <cit.> based on eclipsing binaries,
  -35 ± 16 μas from <cit.> based on asteroseismology,
  -41 ± 10 μas from <cit.> based on asteroseismology,
  -42 ± 13 μas from <cit.> based on RR Lyraes,
  -46 ± 13 μas from <cit.> based on classical Cepheids,
  -48 ±  1 μas from <cit.> based on hierarchical modelling of red clump stars,
  -49 ± 18 μas from <cit.> based on classical Cepheids,
  -50 ±  5 μas from <cit.> based on asteroseismology,
  -52 ±  2 μas from <cit.> based on APOGEE spectrophotometric distances,
  -53 ±  9 μas from <cit.> based on asteroseismology and spectroscopy,
  -54 ±  6 μas from <cit.> based on Gaia DR2 radial velocities,
  -57 ±  3 μas from <cit.> based on RR Lyraes,
  -75 ± 29 μas from <cit.> based on VLBI astrometry,
  -76 ± 25 μas from <cit.> based on VLBI data of radio stars, and
  -82 ± 33 μas from <cit.> based on eclipsing binaries.
  
  
  
  
  
   §.§ Varying the parallax zero-point offset
  
  
  
  
  The question arises whether the already fair agreement between the Gaia DR2 parallaxes and Benford's law, as discussed in Section <ref> and displayed in Figure <ref>, would further improve when due account of the parallax zero-point offset would be taken. Naively, we would expect that a distribution of a quantity such as the parallax that covers several orders of magnitude, a small, uniform shift would not drastically change its behaviour with respect to Benford's law.
  
  Our findings are summarised in Figure <ref>. It shows for a range of trial zero-point offsets Δϖ the Euclidean distance between the distribution of the first significant digit of the Gaia DR2 parallaxes, after subtracting a zero-point offset Δϖ such that ϖ_ corrected = ϖ_Gaia DR2 - Δϖ, and Benford's law. With this convention, the zero-point offset from <cit.> translates into Δϖ = -29 μas (see Section <ref>). The plot shows that changing the offset from Δϖ = 0 to -29 μas only changes the Euclidean distance metric by 0.007, and even in the direction of worsening the agreement between the offset-corrected parallaxes and Benford's law.
  
  A striking feature in Figure <ref> is the pronounced minimum seen around Δϖ∼ +260 μas. This minimum can be understood as follows. The Gaia DR2 parallax histogram itself (Figure <ref>) roughly resembles a Lorentzian of half-width γ = 360 μas and with a mean that is offset by some -260 μas. Table <ref> shows that such a Lorentzian has a distribution of first significant digits that already resembles that of Benford's law (see Appendix <ref>), with digit 1 appearing most frequently and digit 9 appearing least frequently. By applying a uniform offset of +260 μas, the corrected parallax distribution becomes roughly symmetric and the match between the Lorentzian and the shifted Gaia DR2 data improves even further. We conclude that the conspicuous minimum in Figure <ref> around Δϖ∼ +260 μas has a mathematical reason, namely that this particular parallax offset causes the distribution of the shifted Gaia DR2 parallaxes to become optimally symmetric, instead of being caused by the zero-point offset.
  
  
  
  
  § SUMMARY AND CONCLUSIONS
  
  
  
  We investigated whether Benford's law applies to Gaia DR2 data. Although it has been known for a long time that this law applies to a wide variety of physical data sets, it was only recently shown by <cit.> that it also holds for Hipparcos astrometry. We showed that the 1.3 billion observed parallaxes in Gaia DR2 follow Benford's law even closer. Stars with a parallax starting with digit 1 are five times more numerous than stars with a parallax starting with digit 9.
  
  We reached a very different conclusion concerning the astrometric . Using Hipparcos astrometry, <cit.> computed distance estimates as the reciprocal of the parallax, and found that this data set also follows Benford's law closely. However, <cit.> and <cit.> showed that the reciprocal of the observed parallax ϖ^-1 is a poor estimate of the distance when the relative parallax error exceeds ∼10-20%. The distance estimate can be improved by adding prior information about our Galaxy <cit.> and/or by including additional data such as photometry <cit.>. We unambiguously demonstrated that in neither case does the improved distance estimates follow Benford's law, although distances with small starting digits are still more abundant. Moreover, using realistic simulations of the stellar content of the Milky Way <cit.>, we showed that the distances  to follow Benford's law, essentially because the interplay between the luminosity function of the Milky Way and Gaia mission selection function results in a bi-modal distance distribution, corresponding to nearby dwarfs in the Galactic disc and distant giants in the Galactic bulge. The fact that the true distances underlying the Gaia catalogue do not follow Benford's law, while the observed parallaxes do follow this law, probably due to observational errors, is the most intriguing result of this paper.
  
  One of our objectives was to use Benford's law (or the deviation from it) as an indicator of anomalous behaviour, not necessarily giving hard evidence, but rather providing an indicator whose subsets warrant a deeper analysis <cit.>. We investigated the application of several astrometric and photometric quality filters applied to the Gaia DR2 parallaxes, but none changed the adherence to Benford's law by more than a few percent points.
  
  Finally, we analysed the parallax zero-point that would be needed to optimise the fit to Benford's law, to compare it with the roughly -50 μas zero-point offset that is known to be present in the Gaia DR2 parallaxes <cit.>. An offset value of +260 μas was recovered. This can be understood by the negative tail of the Lorentzian-like Gaia DR2 parallax distribution, which for this offset value results in an optimally symmetric corrected-parallax distribution that closely follows Benford's law. We therefore conclude that Benford's law should not be used to validate the parallax zero-point in Gaia DR2.
  
  
  
    This work has made use of data from the European Space Agency (ESA) mission Gaia (<https://www.cosmos.esa.int/gaia>), processed by the Gaia Data Processing and Analysis Consortium (DPAC, <https://www.cosmos.esa.int/web/gaia/dpac/consortium>). Funding for the DPAC has been provided by national institutions, in particular the institutions participating in the Gaia Multilateral Agreement. We would like to thank Timo Prusti, Daniel Michalik, Alice Zocchi, and Eero Vaher for stimulating discussions and Eduard Masana for tips on how to create a (pseudo-)random query on the Paris-Meudon TAP server containing observed GUMS parallaxes. We would like to thank the anonymous referee for her/his constructive feedback. This research is based on data obtained by ESA’s Hipparcos satellite and has made use of the ADS (NASA), SIMBAD / VizieR (CDS), and TOPCAT <cit.> tools. We acknowledge support from the ESTEC Faculty Visiting Scientist Programme. The research leading to these results has received funding from the BELgian federal Science Policy Office (BELSPO) through PRODEX grants Gaia and PLATO.
  
  
  
  BL 
   
  
  
  
  
  
  § EFFECT OF GAIA DR2 QUALITY FILTERS
  
  
  
  
  <cit.>, <cit.>, and <cit.>, all of whom were published together with and at the same date as the Gaia DR2 catalogue (25 April 2018), advocated using quality filters to define clean Gaia DR2 samples that are not hindered by astrometric and/or photometric artefacts. Such artefacts are known to be present in the data in particular in dense regions, and reflect the iterative and non-final nature of the data-processing strategy and status underlying Gaia DR2 and can be linked to erroneous observation-to-source matches, background subtraction errors, uncorrected source blends, etc. In this study, we employed the photometric excess factor filter as well as the astrometric quality filter, which is based on the renormalised unit weight error (RUWE) published post Gaia DR2 (in August 2018), requiring that valid sources meet the following two conditions:
  
      1.0 + 0.015 C^2 < E < 1.3 + 0.06 C^2,
  
  and
  
      RUWE = √(χ^2/(N-5))/u_0(G,C) < 1.4,
  
  where in the notation of the Gaia DR2 data model, E =  phot_bp_rp_excess_factor = ( phot_bp_mean_flux +  phot_rp_mean_flux) /  phot_g_mean_flux, C =  bp_rp =  phot_bp_mean_mag -  phot_rp_mean_mag, χ^2 =  astrometric_chi2_al, N =  astrometric_n_good_obs_al, G =  phot_g_mean_mag, and u_0(G,C) is a look-up table as function of G magnitude and BP-RP colour index that is provided on the Gaia DR2 known issues webpage[
  <https://www.cosmos.esa.int/web/gaia/dr2-known-issues>
  ]. These filters combined remove 620 842 302 entries from the Gaia DR2 catalogue (corresponding to 47% of the data). The distribution of the first significant digit of the parallaxes is affected by application of the filters, but not to the extent that overall trends change. The maximum difference occurs for the frequency of digit 1, which equals 0.28 without filtering and 0.26 with the filtering applied.
  
  Interestingly, and as a side note, the Bayesian distance estimates and associated first significant distribution of the sample of one million objects with the poorest astrometric quality (i.e. the highest RUWE values), displayed in Figure <ref>, differ substantially from those derived from a random sample of filtered stars, as displayed in Figure <ref>. With the evidence provided in the Gaia DR2 documentation and in the references quoted above that the astrometric quality filter is effective in removing genuinely bad and suspect entries, this is no surprise.
  
  
  
  § NEGATIVE PARALLAXES
  
  
  
  
  Figure <ref> shows that a significant fraction of the Gaia DR2 parallaxes is negative (26% of published data, which reduces to 18% when the filters discussed in Appendix <ref> are applied). The complication of this fact is that there is no rule of how to deal with these data in relation to Benford's law. In addition, it is known that negative parallaxes are a totally normal and expected outcome of the astrometric measurement concept of Gaia and that simply ignoring negative parallaxes can lead to severe biases in the astrophysical interpretation of the data <cit.>. Figure <ref> shows how sensitive the frequency distribution of the first significant digits is to the way in which we treat negative parallaxes: Variations in the frequency of occurrence of a few percent points appear depending on whether we include the negative parallaxes (after taking the absolute value) or not. Throughout this work, when we studied Gaia DR2 parallaxes and first-significant-digit statistics, we included all parallaxes, that is, we considered the absolute value of the measured parallax. This refers to the red symbols in Figure <ref>, which can be interpreted as a reasonable (weighted-average) compromise between the two limiting cases defined by objects with positive parallax on the one hand (green symbols) and objects with negative parallax on the other hand (blue symbols).
  
  
  
  § TESTS WITH SMALLER SAMPLE SIZES
  
  
  
  
  In view of the significant number of objects contained in Gaia DR2 and the associated non-negligible processing loads and run times, we conducted experiments to verify to what extent reduced sample sizes with randomly[
  
    We used the random_index field in Gaia DR2; see <https://gea.esac.esa.int/archive/documentation/GDR2/Gaia_archive/chap_datamodel/sec_dm_main_tables/ssec_dm_gaia_source.html>.
  
  ] selected objects return reliable results on the frequency distribution of the first significant digit of the parallaxes. Table <ref> summarises our findings. It shows that percent-level accurate data can be derived from randomly selected samples of about one million objects. When we refer to Gaia DR2 statistics here, we consistently used samples containing one million randomly selected entries without inducing loss of generality.
  
  
  
  § STATISTICS AND BENFORD'S LAW: JUSTIFICATION OF THE EUCLIDEAN DISTANCE MEASURE
  
  
  We used the Euclidean distance to quantify how well the distribution of the first significant digit of Gaia data sets is described by Benford's law,
  
  
      ED = √(Σ_d=1^9(p_d - e_d)^2),
  
  
  where p_d is the measured digit frequency and e_d is the expected digit frequency for digit d according to Benford's law. The Euclidean distance ranges between 0 (when all first significant digits exactly follow Benford's law) and 1.036 (when all first significant digits equal 9), with lower values indicating better adherence to Benford’s Law. Although the Euclidean distance is not a formal test statistic (see the discussion below), it is independent of sample size, which makes it suitable as a relative metric. The problem with sample-size dependent tests such as χ^2 (or Kolmogorov-Smirnov) is evident from their definition,
  
  
      χ^2 = ∑_d=1^9(O_d-E_d/σ)^2,
  
  
  where O_d is the observed number of occurrences of digit d, E_d is the expected number of occurrences of digit d, and σ reflects the measurement error on O_d,
  
  
      O_d   =    N p_d
      
      E_d   =    N e_d = Nlog_10(1+1/d),
  
  
  where N is the total number of data points (stars in Gaia DR2 in our case, so N ∼ 10^9). With counting (Poisson) statistics, σ∝√(N), such that χ^2 ∝ N. In practice, this means that a formal test statistic based on χ^2 would reject many cases in which the data under test come from distributions that follow Benford's law <cit.>. In other words, because χ^2 tests have large statistical power for high values of N, even quite small differences will be statistically significant, and because Gaia DR2 contains a billion parallaxes that are distributed over just nine bins (d=1,…,9), the formal error bars on the observed frequencies in each bin (resulting just from Poisson statistics) are so tiny that any peculiarity in the data (e.g. an open cluster at a specific distance or  an extragalactic objects), would affect the statistical test and might provide misleading conclusions (exclusively looking at statistical errors, compliance of Gaia DR2 parallaxes with Benford’s Law would be excluded right away with very high significance levels). A reduced-χ^2 statistic would also not alleviate this problem because the reduction would only divide χ^2 by the number of bins (nine) and not by the number of data points (N). The Euclidean distance employed in this work, on the other hand, is independent of sample size and hence provides a metric that only becomes more precise with increasing sample size, but does not run away.
  
  Clearly, a disadvantage of using the Euclidean distance is that it is not a formal test statistic with associated statistical power (although <cit.> suggested that data can be said to follow Benford's law when the Euclidean distance is shorter than ∼0.25). Many researchers have investigated and have proposed suitable metrics that can quantify statistical (dis)agreement between data and Benford's law (e.g. the Cramér-von Mises metric; ). We did not explore such metrics further for several reasons that are essentially all linked to the existing freedom and arbitrariness in the interpretation of the Gaia DR2 data, as listed below. Note here that we mean that a 5% increase of 0.4 (40%) results in 0.42 (42%), while a 5%  increase of 0.4 (40%) results in 0.45 (45%).
  
  
  
  
    * It is known that Gaia DR2 contains in addition to a small fraction of non-filtered duplicate sources (cf. Figure 2 in ) genuine sources with spurious astrometry (and/or photometry). As explained in Appendix <ref>, several filters have been recommended to obtain clean data sets (e.g. RUWE, astrometric excess noise, photometric excess factor, number of visibility periods, and the longest semi-major axis of the five-dimensional astrometric error ellipsoid; ). In all of these cases, however, the specific threshold values to be used, and also which combination of filters to be used, is specific to the science application, without an absolute truth. Depending on subjective choices, the observed distribution over the first significant digits changes by up to several percent points (see Appendix <ref>), which is orders of magnitude larger than the formal statistical errors (one billion stars divided equally over nine bins corresponds to a Poisson error of about √(10^-8) = 10^-4 per bin).
  
  
    * There is ambiguity on how negative parallaxes (comprising 26% of the published Gaia DR2 data), which are perfectly valid measurements, should be treated. Again, depending on subjective choices, the observed distribution over the first significant digits changes by up to several percent points (see Appendix <ref> and Figure <ref>).
  
  
    * In the same spirit, arbitrary changes of units (e.g. from parsec to light years [1 pc = 3.26 ly] or milliarcseconds to nanoradians [1 mas = 4.85 nrad]) change the observed distribution over the first significant digits by up to several percent points.
  
  
    * It is known that the Gaia DR2 parallaxes collectively have a global parallax zero-point offset, which to second order depends on magnitude, colour, and sky position (see Section <ref> for a detailed discussion). Again, the absolute truth is out there, and depending on the subjective choice for the value of the offset correction, the observed distribution over the first significant digits changes significantly (see Figure <ref>).
  
  
  
  In short, even with a proper statistical test or metric, we would not be able to capture the effects of the existing freedom (and systematic effects) in the (interpretation of the) data.
  
  
  
  
  
  § ADQL QUERIES
  
  
  The following ADQL queries, and slight variations thereof, were used in this research:
  
  
    * To query Gaia DR2 data from the Gaia Archive at ESA (<https://gea.esac.esa.int/archive/>):
  -0.5truecm
  -0.75truecm
  
    * To query median StarHorse distance estimates for a random subset of high-quality objects from the Gaia Archive at the Leibniz Institute for Astrophysics in Potsdam (<https://gaia.aip.de/query/>; see Section <ref>):
  -0.5truecm
  -0.75truecm
  
    * To query true GUMS distances from the Gaia Archive at the Centre de Données astronomiques de Strasbourg (<http://tapvizier.u-strasbg.fr/adql/?gaia>; ; see Section <ref>):
  -0.5truecm
  after which a random sample of one million objects was selected using the shuf command.
  -0.25truecm
  
    * To query one million random observed GUMS parallaxes from the Gaia Archive at the Observatoire de Paris-Meudon (<https://gaia.obspm.fr/tap-server/tap>; see Section <ref>):
  -0.5truecm
  after which a random sample of one million objects was selected using the shuf command.
  -0.5truecm
  
  
  
  
  § SELECTED MATHEMATICAL DERIVATIONS
  
  
  For convenience of the reader, without pretending to have derived these relations as new discoveries, this appendix presents selected derivations linked to scale invariance (Appendix <ref>), base invariance (Appendix <ref>), and inverse invariance (Appendix <ref>; see e.g.  and ). Appendix <ref> discusses the distribution of first significant digits of a Lorentzian distribution.
  
  
  
   §.§ Scale invariance
  
  
  It is possible to define the probability for the first significant digit with a probability density function as follows:
  
      P(D_1X=d) = P(⌊x⌋=d) = P(d≤ x<d+1) = ∫_d^d+1p(x)dx.
  
  If Benford's law is a universal law, it needs to be independent of the selected unit (e.g. parsec or light year). In other words, the first significant digit distribution has to be scale invariant. If the distribution of data set X̃ is scale invariant, then there exists ∀ X ∈X̃, a scale C ∈ℝ_> 0, an α∈ (0,10), and a function f such that for a significand x of X, we have
  
      P(D_1(C X)=d) = P(⌊ CX ⌋=d) = P(⌊α x⌋=d) = P(⌊ x⌋=d)/f(α),
  
  
  where
  
      α   =   c/10   if the significand of CX is smaller than the significand of X;
      α   =    c    if the significand of CX is larger than or equal to the significand of X,
  
  
  such that
  
      p(x)=f(α)· p(α x).
  
  We exclude α=C=0 because this is a special case for which Eq. (<ref>) gives d=0, when P(D_1(0· X)=d) for every X.
  
  In order to prove that Benford's law appears if and only if the data are scale invariant, we start with assuming that the data follow Benford's law. This means that the probability for the first significant digit d of significand x to appear equals
  
      P(d≤ x<d+1) = log_10(d+1/d) = 1/ln(10)∫_d^d+11/xdx.
  
  Therefore the probability density function equals
  
      p(x) = 1/ln(10)· x.
  
  This probability density function satisfies Eq. (<ref>) for f(α) = α. This proves that if a data set follows Benford's law, it is scale invariant.
  
  Next, we assume that the data are scale invariant. This implies that Eq.(<ref>) holds for every α 
  ∈ℝ_≥ 0. If p(x) is a continuous probability density function on [1,10), such that
  
      ∫_1^10 p(x)dx=1,
   
  we can derive
  
      P(1≤ x<10) = ∫_1^10 p(α x)dx = ∫_1^10p(z)dz/α = 1/α,
  
  where z≡α x. This result gives f(α) = α. Therefore
  
      p(x)/α=p(α x).
  
  By taking the derivative of both sides with respect to α, and by choosing α=1, the following relation holds:
  
      -p(x) = x∂ p(x)/∂ x.
  
  This differential equation can be solved with the separation technique and gives
  
      -ln(x)+c   =   ln(p(x));
      λ/x   =   p(x),
  
  where λ=e^c. Now, it is possible to derive
  
      ∫_1^10p(x)dx = ∫_1^10λ/xdx = λ[ln(10)-ln(1)]=1,
  
  so that
  
      λ=1/ln(10),
  
  and the probability density function p(x) becomes
  
      p(x)=1/ln(10)· x.
  
  The probability of the first significant digit can now be derived by
  
      P(D_1X=d) = P(d≤ x<d+1) = ∫_d^d+1 p(x) dx = 1/ln(10)∫_d^d+11/xdx = log_10(d+1/d).
  
  This is exactly Benford's law for the first significant digit (Eq. <ref>). This proves that if the data are scale invariant, they follow Benford's law.
  In conclusion, a necessary precondition for a data set to follow Benford's law is scale invariance.
  
  
  
   §.§ Base invariance
  
  
  If Benford's law is a universal law, it should be base invariant as well, next to being scale invariant, as these properties have a common origin.[As already mentioned in Section <ref>, <cit.> demonstrated that scale invariance implies base invariance (but base invariance does not imply scale invariance).] Consider for example the scale invariance of a uniform logarithmic distribution, which shows that base invariance is related to scale invariance. We can generalise the scale-invariance derivation in Appendix <ref> by substituting base 10 with base B such that
  
      ∫_1^Bp(x)dx = ∫_1^Bλ/xdx = λ[ln(B)-ln(1)] = 1.
  
  Therefore we find
  
      λ=1/ln(B),
  
  which gives
  
      P(D_1X=d) = ∫_d^d+1 p(x) dx = log_B(d+1/d).
  
  Base invariance was discussed in detail by <cit.>.
  
  
  
   §.§ Inverse distribution
  
  
  When parallaxes and distances are discussed, a relevant question is the relation between a data set X̃ and its inverse X̃^-1. From the scale invariance of a uniform logarithmic distribution, we might intuitively already expect that the inverse distribution is scale invariant as well. We here formally demonstrate that if X̃ is a data set that follows Benford's law, then the inverted data X̃^-1 also follow Benford's law.
  
  First, we note that the mapping of the mantissae to the inverse of the mantissae is given by
  
      {X̃→X̃^-1 : x ↦ x^-1· 10^b},
  
  where b=0 if x=10^n ∀ n∈ℤ and b=1 for any other value of x.
  
  Next, we assume that X̃ follows Benford's law, such that for ∀ X ∈X̃ in significand notation X = x · 10^m, with m ∈ℤ, we have
  
      P(D_1X^-1=d)    =    P(x^-1∈ [d,d+1)) = P(d ≤ x^-1 < d+1) = P(10^b/d+1 < x ≤10^b/d) = 1/ln(10)∫_10^b/d+1^10^b/d1/xdx = 
         =   1/ln(10)∫_1/d+1^1/d1/xdx = 1/ln(10)[-ln(d)+ln(d+1)] = log_10(d+1/d).
  
  This result, together with scale invariance (Appendix <ref>), implies that the mapping
  X ↦α X^-1
  preserves Benford's law for any value α∈ℝ_> 0.
  
  
  
   §.§ Distribution of first significant digits of a Lorentzian distribution
  
  
  The normalised Lorentzian function, centred at x=x_0 and with a half width at half maximum of γ, is given by
  
      L(x; x_0,γ)=1/π·γ(1+[x-x_0/γ]^2).
  
  The first significant digit probability distribution for a Lorentzian function can be derived analytically by using the generic first significant digit probability function:
  
      P(D_1X=d)=∑_k=-∞^∞∫_d· 10^k^(d+1)· 10^kp(x)dx,
  
  and replacing the generic probability density function p(x) with the Lorentzian from Eq. (<ref>):
  
      P(D_1X=d;x_0,γ) =
      ∑_k=-∞^∞∫_d· 10^k^(d+1)· 10^kL(x;x_0,γ)d x/∫_0^∞L(x;x_0,γ)d x =
      ∑_k=-∞^∞[atan((d+1)· 10^k-x_0/γ)-atan(d· 10^k-x_0/γ)/π/2+atan(x_0/γ)].
  
  The normalisation assumes that only positive first significant digit values are considered (x>0).
  
  With the atan addition formula, given by
  
      atan(x)+atan(y)=
      atan(x+y/1-xy)    if xy<1,
      atan(x+y/1-xy)+π   if xy>1 and x>0 and y>0,
      atan(x+y/1-xy)-π   if xy>1 and x<0 and y<0,
  
  and with the following two identities (valid for x>0):
  
      atan(-x)=-atan(x),
  
  
      atan(1/x)=acot(x),
  
  the first significant digit probability function can be written as
  
      P(D_1X=d;x_0,γ)= 
      ∑_k=-∞^∞[acot(γ· 10^-k+x_0^2· 10^-k-(2d+1)x_0+d(d+1)10^k)/π/2+atan(x_0/γ)].
  
  
  In view of Eq. (<ref>), a minor modification of the above result is required for index k=k^*, defined as
  
      d· 10^k^* < x_0 < (d+1)· 10^k^*,
  
  and
  
      ((d+1)· 10^k^*-x_0)(d· 10^k^*-x_0)+γ^2 < 0,
  
  such that the final result reads
  
      P(D_1X=d;x_0,γ)
         =   ∑_k=-∞, k≠ k^*^∞[acot(γ· 10^-k+x_0^2· 10^-k-(2d+1)x_0+d(d+1)10^k)/π/2+atan(x_0/γ)] + 
         +   ∑_k=k^*[acot(γ· 10^-k+x_0^2· 10^-k-(2d+1)x_0+d(d+1)10^k)/π/2+atan(x_0/γ)+π].
  
  
  