1. Introduction
This paper focuses on the deep analysis of a particular type of averaging stochastic process. In the averaging process, as introduced by Aldous and Lanoue [Reference Aldous and Lanoue1], the n agents start independently from each other with an initial integer value, interact randomly by pairs, and at each interaction, keep the average of the two values as their new value. This type of process belongs to the general category of stochastic interacting particle systems [Reference Liggett9], which are applied in many fields (biology, computer science, physics, etc.) to characterize global properties emerging from local interactions. For instance, in [Reference Mocquard, Sericola and Anceaume12] we used this model to analyze the rumor spreading time, which is the number of interactions needed for all the agents of the network to learn a rumor initially known by only one agent. Haslegrave and Puljiz [Reference Haslegrave and Puljiz7] analyzed biological agents (gene or infectious disease) spreading (mean spreading time and stable gene distribution) for diverse type of networks and considering pairwise interactions. Lanoue [Reference Lanoue8] considered a voter model variant in which agents have preferences over a set of songs, and upon meeting update their own preferences incrementally towards those of the other agents they meet. This is a continuous-time model, in which a Poisson process is associated between every pair of agents and whose times correspond to their meetings. Using the spectral gap of an associated Markov chain, Lanoue gave a geometry-dependent result on the asymptotic consensus time of the model. A similar continuous model, the compulsive gambler process, was studied by Aldous et al. in [Reference Aldous, Lanoue and Salez2], where agents meet pairwise at random times according to Poisson processes and, upon meeting, play an instantaneous fair game in which one wins the other’s money. This process behaves like a reversal of our process since interactions between agents end up with their values as different as possible, rather than as equal as possible.
In our context of large-scale distributed algorithms, where interaction-based algorithms are represented by the population protocol model, agents have little computational power, limited-size memory, are indistinguishable from one another, and are unaware of the population size n of the system [Reference Angluin, Aspnes, Diamadi, Fischer and Peralta4]. It follows, in particular, that each agent can only be in a finite number of states. The key is to propose efficient algorithms that make agents cooperate to perform computational tasks such as determining the proportion of agents that started their computation with a given integer value, or computing the population size. Both problems (proportion of agents that start with some initial value A and population size) can be solved by relying on average-based population protocols. In a previous work [Reference Mocquard, Anceaume and Sericola11] we analyzed the convergence time (also called the mixing time) at which all the n agents of the distributed system are able to determine the proportion of them that started with value A. This work was used by Cordasco and Gargano [Reference Cordasco and Gargano6], who tackled a consensus problem derived from the proportion problem.
We introduce the discrete-time stochastic process
$C \,{:}\,{\raise-1.5pt{=}}\, \{C_t, \; t \geq 0\}$
, where the random vector
$C_t$
is defined by
$C_t \,{:}\,{\raise-1.5pt{=}}\, (C_t^{(1)},\ldots,C_t^{(n)})$
, to represent the evolution of the agent values. For all agents
$i = 1, \ldots, n$
,
$C^{(i)}_t$
represents its value at time
$t \geq 0$
. Since each agent uses only a finite number of states, we assume that the
$C_t^{(i)}$
are integers, for all t and all i. The average-based technique then has the result that, when two agents interact, one gets the floor of their mean value and the other the ceiling of this value, as formally defined in relation (1) below. It follows that process C does not converge to a unique absorbing state, as in [Reference Aldous and Lanoue1] or [Reference Mocquard, Anceaume, Aspnes, Busnel and Sericola10] when dealing with real numbers, but to an absorbing class of states for which each entry (or each agent value) is either equal to
$\lfloor \ell \rfloor$
or equal to
$\lceil \ell \rceil$
, where
$\ell \,:\!=\, \sum_{i = 1}^{n}C^{(i)}_0/n$
is the initial average value. This class has radius less than 1 in the infinity norm. A similar absorbing behavior was described by Broom and Cannings [Reference Broom and Cannings5], who considered a random graph representing the evolution of relationships in a fixed-size population. At each instant, a link between two individuals is either created, removed, or unchanged, at random. They showed, using Markov chains, that the population evolves to a closed class and they gave a method for finding the stationary distribution over this class.
The discrepancy of the system, that is, the difference between the maximum and minimum value among all nodes, defined by
$\max_{1\leq i\leq n} C_{t}^{(i)}-\min_{1\leq i\leq n} C_{t}^{(i)}$
, was studied by Sauerwald and Sun [Reference Sauerwald and Sun13], who showed that its expectation is in
${\mathrm{O}}(1)$
for regular graphs. Moreover, they noted that in many applications, agent values cannot be divided arbitrarily, and we need to deal with the discrete case where the values of each node can only be integers. This discretization entails a non-linear behavior due to its rounding errors, which makes this analysis much harder than in the continuous case. Alistarh, Gelashvili and Vojnovíc [Reference Alistarh, Gelashvili and Vojnovíc3] proposed a two-phase algorithm called average-and-conquer to solve the majority problem in population protocols. The first phase of their algorithm is based on the average of the agents’ values, and a second phase called conquer is needed for propagating the majority value to all the agents of the networks. It is important to be aware of the fact that, as for most of the papers on the subject (e.g. [Reference Aldous and Lanoue1], [Reference Alistarh, Gelashvili and Vojnovíc3], [Reference Cordasco and Gargano6], and [Reference Sauerwald and Sun13]), the complexities are always of the
${\mathrm{O}}(n \log n)$
type, without any study of the constants arising in these complexities. These analyses are interesting but not sufficiently precise, because if the constants occurring in an
${\mathrm{O}}(n \log n)$
complexity are large, they totally annihilate the effect of the logarithm. Indeed, in practice the number n of agents involved in large-scale systems is always bounded. For instance, in the IoT (Internet of Things) infrastructure the number of nodes never exceeds
$10^9$
nodes or agents, for which the logarithm is about
$20.72$
. That is why we focus in this work on precise values of the complexities, i.e. of the type
$n(a\ln(n)+b)$
, where a and b are constants. This is the main objective of this paper, necessitating a fairly detailed mathematical analysis of the behavior of the system.
We provide in this paper a rigorous theoretical analysis of the behavior of average-based distributed algorithms. The main contributions of this paper are as follows.
-
Theorem 2 shows that if the mean initial value,
$\ell$ , is as near as possible to a half-integer, then the process converges in linear time to a position where only the two integers closest to
$\ell$ appear.
-
Theorem 3 shows that for arbitrary
$\ell$ the process converges in linearithmic time to a position where only the three integers closest to
$\ell$ appear. More precisely, it is proved in Theorem 3 that for all
$\delta \in (0,1)$ , and for all
$t \geq (n-1)(2\ln{(K+\sqrt{n})}-\ln{\delta}-\ln{2})$ , we have
\[\mathbb{P}\{\|C_t-L\|_\infty \geq 3/2\} \leq \delta,\]
$C_0$ . The proof of this result is based on a quite novel coupling technique for which the coupling process is called the shadow process of C.
Note that this result is best possible, since, for example, if the starting configuration has one agent of value 2, two of value 0, and
$n-3$ of value 1, then it takes quadratic time to stabilize on two values (since this will only happen when the values of the selected agents are 0 and 2, which has probability
$4/(n(n-1))$ of occurring at each step). Using this result, it is shown in Corollary 1 that the discrepancy of the system is equal to 0 or 1 with arbitrarily high probability, that is,
\[\mathbb{P}\Bigl\{ \max_{1\leq i\leq n} C_{t}^{(i)}-\min_{1\leq i\leq n} C_{t}^{(i)} > 2 \Bigr\} \leq \delta.\]
-
We apply our result to the proportion problem (see Theorem 4), and show that it significantly improves that obtained in [Reference Mocquard, Anceaume and Sericola11] (see Figure 1). We also apply our result to another problem, the system size problem (see Lemma 7).
The remainder of the paper is orchestrated as follows. Section 2 presents the mathematical model, which is based on random interactions between the agents. Section 3 details the analysis of the convergence. The main contribution is the use of the shadow process, a novel stochastic coupling technique. In Section 4 we apply our results to both the proportion and the system size problems. Section 5 concludes the paper.
2. The model
We let
$X_t$
denote the random pair of distinct nodes chosen at time t to interact, and for every
$i,j = 1,\ldots,n$
, with
$i \neq j$
, we define
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU3.png?pub-status=live)
The time unit is discrete and corresponds to a single interaction. At each discrete instant t, two distinct indices i and j are chosen among
$1,\ldots,n$
with probability
$p_{i,j}(t)$
. Once chosen, the pair of agents (i, j) interacts, and both agents update their respective local value
$C_{t}^{(i)}$
and
$C_{t}^{(j)}$
by taking the mean value of their values prior to this interaction. This average-based technique leads to
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqn1.png?pub-status=live)
We suppose that the sequence
$\{X_t, \; t \geq 0\}$
is a sequence of independent and identically distributed random variables. Since
$C_t$
is entirely determined by the values of
$C_0, X_0, X_1, \ldots, X_{t-1}$
, this means in particular that the random variables
$X_t$
and
$C_t$
are independent and that the stochastic process
$C = \{C_t, \; t \geq 0\}$
is a discrete-time homogeneous Markov chain. Classically, we suppose that
$X_t$
is uniformly distributed, that is,
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU4.png?pub-status=live)
where
$1_{A}$
denotes the indicator function, which is equal to 1 if condition A is true and 0 otherwise.
3. Convergence time of average-based algorithms
We will use the Euclidean norm denoted simply by
$\|{\cdot}\|$
and the infinity norm denoted by
$\|{\cdot}\|_\infty$
and defined for all
$x=(x_1,\ldots,x_n) \in \mathbb{R}^n$
by
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU5.png?pub-status=live)
We recall the following invariant result of average-based population protocols.
Lemma 1. For every
$t \geq 0$
, we have
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU6.png?pub-status=live)
Proof. For all integers k, we have
$k = \lfloor k/2 \rfloor + \lceil k/2\rceil$
, so the transformation from
$C_t$
to
$C_{t+1}$
described in relation (1) does not change the sum of the entries of
$C_{t+1}$
.
We let
$\ell$
denote the mean value of the entries of
$C_t$
and let L denote the row vector of
$\mathbb{R}^n$
with all its entries equal to
$\ell$
, that is,
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqn2.png?pub-status=live)
Note that C has a finite value space composed of a set of transient vectors and an absorbing class of vectors whose entries are equal to
$\lfloor \ell \rfloor$
or
$\lceil \ell \rceil$
. This absorbing class is reduced to a single absorbing vector when
$\ell$
is an integer.
We first bound the decay of the expected value
$\mathbb{E}(\|C_t -L\|^2)$
.
Theorem 1. For every
$t \geq 0$
, we have
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqn3.png?pub-status=live)
Proof. In order to simplify the writing we use the notation
$Y_t \,:\!=\, \|C_t-L\|^2$
. One can deduce from relation (1) that
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU7.png?pub-status=live)
We recall that
$X_t$
and
$C_t$
are independent and that
$p_{i,j}(t) = 1/(n(n-1))$
. Conditioning first by
$C_t$
, then taking the expectations, we get
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU8.png?pub-status=live)
Using (see [Reference Mocquard, Anceaume, Aspnes, Busnel and Sericola10])
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU9.png?pub-status=live)
where integer
$q_t$
is the number of odd entries of vector
$C_t$
, we deduce that
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqn4.png?pub-status=live)
Since
$q_t \in \{0,1,\ldots,n\}$
, the function g defined, for
$x \in [0,n]$
, by
$g(x) = x(n-x)$
has its maximum at point
$x = n/2$
, so we have
$0 \leq g(x) \leq n^2/4$
. Thus
$g(q_t) = q_t(n-q_t) \leq n^2/4$
. If n is even then
$q_t$
can be equal to
$n/2$
, which means that the best upper bound of
$g(q_t)$
is
$n^2/4$
. If n is odd then
$q_t$
cannot be equal to
$n/2$
. The maximum of
$g_t(q_t)$
is then reached either at point
$q_t = (n-1)/2$
or at point
$q_t= (n+1)/2$
. For both points we have
$g(q_t) \leq (n-1)(n+1)/4 = n^2/4 - 1/4$
, so the best upper bound of
$g(q_t)$
is
$n^2/4-1/4$
. Putting the two cases together, we obtain
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU10.png?pub-status=live)
Using this inequality in relation (4), we get
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU11.png?pub-status=live)
Taking the expectation of both sides, we obtain
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU12.png?pub-status=live)
Solving this recurrence leads to relation (3).
3.1. A first bound on the convergence time
We introduce
$\lambda$
, the distance between
$\ell$
and its nearest integer, that is,
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU13.png?pub-status=live)
It is easily checked that we have
$0 \leq \lambda \leq 1/2$
. In Theorem 4 of [Reference Mocquard, Anceaume and Sericola11] we dealt with the case where
$\lambda$
is equal to
$1/2$
. In the following we extend that analysis first to the case where
$\lambda = (n- 1_{\{n\,\mathrm{odd}\} })/(2n)$
(see Theorem 2) and then to all
$\lambda \in [0,1/2]$
(see Section 3.2). We start with the following two lemmas.
Lemma 2. Let
$h = \lfloor \ell \rfloor + 1/2$
and
$H = (h,h,\ldots,h) \in \mathbb{R}^n$
. If
$\lambda = (n- 1_{\{n\,\mathrm{odd}\} })/(2n)$
, then
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqn5.png?pub-status=live)
Proof. Vector
$C_t-L$
is orthogonal to vector e, with all entries equal to 1. Indeed,
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU14.png?pub-status=live)
Hence, since
$L - H = (\ell - h) e$
, we deduce that
$C_t-L$
and
$L-H$
are orthogonal too. Applying Pythagoras’ theorem, we obtain
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqn6.png?pub-status=live)
Moreover, we have
$\|L-H\|^2 = n(\ell -h)^2 =n (1/2 - (\ell -\lfloor \ell \rfloor))^2$
. By definition of
$\lambda$
and since
$\lambda = (n-1_{\{n\,\mathrm{odd}\}})/(2n)$
, we have either
$\ell -\lfloor \ell \rfloor=(n-1_{\{n\,\mathrm{odd}\}})/2n$
or
$\ell -\lfloor \ell \rfloor=(n+1_{\{n\,\mathrm{odd}\}})/2n$
. In both cases we get
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqn7.png?pub-status=live)
Observe that
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqn8.png?pub-status=live)
Substituting (7) in relation (6), and applying inequality (8), we get inequality (5).
Lemma 3. If
$\lambda = (n- 1_{\{n\,\mathrm{odd}\} })/(2n)$
, then we have
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU15.png?pub-status=live)
Proof. Since
$\lambda > 0$
,
$\ell$
is not an integer, so
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU16.png?pub-status=live)
which implies that
$\|C_t-L\|_{\infty} \geq 1-\lambda$
. Thus
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU17.png?pub-status=live)
implies that
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU18.png?pub-status=live)
which means that
$\|C_t-L\|_{\infty} = 1-\lambda$
.
Conversely, if
$\|C_t-L\|_{\infty} = 1-\lambda$
, then we have
$\ell-1 < C_t^{(i)}< \ell+1$
, which means that
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU19.png?pub-status=live)
that is,
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU20.png?pub-status=live)
This completes the proof.
We can now prove the following theorem.
Theorem 2. For all
$\delta \in (0,1)$
, if
$\lambda = (n- 1_{\{n\,\mathrm{odd}\} })/(2n)$
and if there exists a constant K such that
$\|C_{0}-L\| \leq K$
, then, for every
$t \geq (n-1) (2\ln{K}-\ln{\delta}-\ln{2})$
, we have
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU21.png?pub-status=live)
or equivalently
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqn9.png?pub-status=live)
Proof. We first show that
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqn10.png?pub-status=live)
Let
$h = \lfloor \ell \rfloor + 1/2$
and
$H = (h,h,\ldots,h) \in \mathbb{R}^n$
. In the same way, if
$\max_{1\leq i\leq n} C_{t}^{(i)}-\min_{1\leq i\leq n} C_{t}^{(i)} > 1$
, then there exists an agent i such that
$|C_t^{(i)}-h| \geq 3/2$
, and for all
$j \in \{1,2,\ldots,n\} \setminus \{i\}$
,
$|C_t^{(j)}-h| \geq 1/2$
. We can thus write
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU22.png?pub-status=live)
Applying Lemma 2, we thus obtain relation (10), and deduce that
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqn11.png?pub-status=live)
Then, from relation (3) of Theorem 1, we obtain
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU23.png?pub-status=live)
Let
$\tau = (n-1) (2\ln{K}-\ln{\delta}-\ln{2})$
. For
$t \geq \tau$
, we have
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU24.png?pub-status=live)
Moreover, since
$\|C_0-L\| \leq K$
, we get
$\mathbb{E}(\|C_0-L\|^2) \leq K^2$
and thus
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU25.png?pub-status=live)
Using the Markov inequality (Lemma 2 ensures that we take the expectation of a non-negative random variable), we obtain for
$t \geq \tau$
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU26.png?pub-status=live)
Hence we deduce from relation (11) that, for
$t \geq \tau$
,
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU27.png?pub-status=live)
Note that
$\max_{1\leq i\leq n} C_{t}^{(i)}$
cannot be equal to
$\min_{1\leq i\leq n} C_{t}^{(i)}$
here. Indeed, if so, then vector
$C_t$
is equal to vector L, implying that
$\ell$
is an integer. In such a case we have
$\lambda = 0$
, which is impossible since
$n \geq 2$
. Hence
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU28.png?pub-status=live)
and we directly obtain relation (9). Finally, applying Lemma 3, we deduce that
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU29.png?pub-status=live)
which ends the proof.
Note that
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU30.png?pub-status=live)
implies that
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU31.png?pub-status=live)
Hence Theorem 2 assures us that if
$\lambda= (n- 1_{\{n\,\mathrm{odd}\} })/(2n)$
, then the protocol converges after at least
$ (n-1) (2\ln{K}-\ln{\delta}-\ln{2})$
interactions, with arbitrarily high probability
$1-\delta$
, towards a class of absorbing states which are vectors with entries equal to either
$ \lfloor \ell \rfloor $
or
$ \lceil \ell \rceil $
.
3.2. The shadow process and the main result
The goal of this section is to obtain a result identical to that of Theorem 2, but without any assumption on
$\lambda$
. This is done by using a stochastic coupling technique in which the process coupled with process C is called the shadow process of C.
The shadow process associated with process C is denoted by
$D\,:\!=\,\{D_t, \; t \geq 0\}$
and defined at time
$t=0$
by
$D_0^{(i)} = C_0^{(i)} +1_{\{i \in B_0\}}$
, where
$B_0$
is any fixed non-empty subset of b agents with
$b \leq n-1$
, i.e.
$B_0 \subset \{1,\ldots,n\}$
and
$|B_0|=b$
.
For every
$t \geq 1$
, the random vector
$D_t$
is defined as
$C_t$
, that is, when the couple (i, j) is chosen to interact at time t, i.e. when
$X_t=(i,j)$
, the vector
$D_{t+1}$
is given by
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU32.png?pub-status=live)
In other words, processes
$C_t$
and
$D_t$
are coupled by process
$X_t$
: they behave identically in the sense that at each time, the same two agents are chosen for the interaction. The only difference lies in their initial values. Lemma 4 shows that if at time
$t=0$
,
$D_0$
is initially in the shadow of
$C_0$
, then at any time
$t\geq 0$
,
$D_{t}$
remains in the shadow of
$C_{t}$
.
Lemma 4. For all
$t\geq 0$
, there exists a non-empty set
$B_t$
of b agents, i.e.
$B_t \subset \{ 1,\ldots,n\}$
and
$|B_t|=b$
, such that, for all
$i \in \{ 1, 2, \ldots, n\}$
, we have
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqn12.png?pub-status=live)
Proof. The proof is made by induction. Relation (12) is clearly true for
$t=0$
by definition of
$D_0$
. Suppose that at time
$t \geq 0$
there exists a set
$B_{t} \subset \{1,2,\ldots,n\}$
with
$|B_{t}|=b$
, satisfying relation (12). Let i and j be the two agents interacting at time t, that is, let
$X_t = (i, j)$
, for both processes
$C_t$
and
$D_t$
. We distinguish the following cases.
-
Case 1:
$i,j \in B_t$ . In this case we have
\[D_{t+1}^{(i)} =\biggl\lfloor\dfrac{D_{t}^{(i)} + D_{t}^{(j)}}{2}\biggr\rfloor= \biggl\lfloor\dfrac{C_{t}^{(i)} + C_{t}^{(j)}+2}{2}\biggr\rfloor=C_{t+1}^{(i)}+1.\]
$D_{t+1}^{(j)} = C_{t+1}^{(j)}+1$ , which means that
$i,j \in B_{t+1}$ . The other entries being invariant, we have
$B_{t+1} = B_t$ .
-
Case 2:
$i,j \notin B_t$ . In this case we have
$D_{t+1}^{(i)}=C_{t+1}^{(i)}$ and
$D_{t+1}^{(j)}=C_{t+1}^{(j)}$ which means that
$i,j \notin B_{t+1}$ . The other entries being invariant, we have
$B_{t+1} = B_t$ .
-
Case 3.1:
$i \in B_t$ and
$j \notin B_t$ and
$C_t^{(i)} + C_t^{(j)}$ is even. In this case we have
\[D_{t+1}^{(i)} =\biggl\lfloor\dfrac{D_{t}^{(i)} + D_{t}^{(j)}}{2}\biggr\rfloor= \biggl\lfloor\dfrac{C_{t}^{(i)} + 1 + C_{t}^{(j)}}{2}\biggr\rfloor= \biggl\lfloor\dfrac{C_{t}^{(i)} + C_{t}^{(j)}}{2}\biggr\rfloor = C_{t+1}^{(i)}.\]
$D_{t+1}^{(j)}=C_{t+1}^{(j)}+1$ , which means that
$i \notin B_{t+1}$ and
$j \in B_{t+1}$ . We thus have
$B_{t+1} = (B_t \setminus \{i\}) \cup \{j\}$ and so
$|B_{t+1}| = |B_t|=b$ .
-
Case 3.2:
$i \in B_t$ and
$j \notin B_t$ and
$C_t^{(i)} + C_t^{(j)}$ is odd. In a similar way to Case 3.1, we have
$D_{t+1}^{(i)}=C_{t+1}^{(i)}+1$ and
$D_{t+1}^{(j)}=C_{t+1}^{(j)}$ , which means that
$i \in B_{t+1}$ and
$j \notin B_{t+1}$ and so
$B_{t+1} = B_t$ .
-
Case 4.1:
$i \notin B_t$ and
$j \in B_t$ and
$C_t^{(i)} + C_t^{(j)}$ is even. In a similar way to Case 3.2, we have
$D_{t+1}^{(i)}=C_{t+1}^{(i)}$ and
$D_{t+1}^{(j)}=C_{t+1}^{(j)}+1$ , which means that
$i \notin B_{t+1}$ and
$j \in B_{t+1}$ and so
$B_{t+1} = B_t$ .
-
Case 4.2:
$i \notin B_t$ and
$j \in B_t$ and
$C_t^{(i)} + C_t^{(j)}$ is odd. In a similar way to Case 3.1, we have
$D_{t+1}^{(i)}=C_{t+1}^{(i)}+1$ and
$D_{t+1}^{(j)}=C_{t+1}^{(j)}$ , which means that
$i \in B_{t+1}$ and
$j \notin B_{t+1}$ . We thus have
$B_{t+1} = (B_t \setminus \{j\}) \cup \{i\}$ and so
$|B_{t+1}| = |B_t|=b$ .
In all cases we have shown that
$B_{t+1} \subset \{1,2,\ldots,n\}$
, that
$|B_{t+1}|=|B_{t}|=b$
, and that (12) is true at time
$t+1$
, which completes the proof.
Just as for process C, we let
$\ell_D$
denote the mean value of the entries of
$D_t$
and let
$L_D$
denote the row vector of
$\mathbb{R}^n$
with all its entries equal to
$\ell_D$
, that is,
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU35.png?pub-status=live)
We use the shadow process D to extend the results of Theorem 2 for any value of
$\lambda$
. We first show that for any process C we can construct a shadow process D verifying the condition of Theorem 2, that is, a shadow process D such that the fractional part
$\lambda_D$
of
$\ell_D$
, defined by
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU36.png?pub-status=live)
verifies
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU37.png?pub-status=live)
Recall from relation (2) and Lemma 1 that
$n\ell = \sum_{i = 1}^nC^{(i)}_0 $
is an integer.
Lemma 5. For any process C there exists a shadow process D with parameter b such that
$\ell_D - \lfloor \ell_D\rfloor = (n-1_{\{n \,\mathrm{odd}\}})/(2n)$
. More precisely, let
$d\geq 0$
be the smallest integer such that n divides
$n\ell + d$
. Then we have the following.
-
If
$ 0 \leq d \leq n/2 $ , then
$b = d + (n - 1_{\{n \,\mathrm{odd}\}})/2$ .
-
If
$n/2 < d < n$ , then
$b = d - (n + 1_{\{n \,\mathrm{odd}\}})/2.$
Proof. Let
$B_0$
be a set of b agents with
$b \in \{1,\ldots, n-1\}$
and let
$D_t$
be the corresponding shadow process, associated with process
$C_t$
, defined in Section 3.2. By definition of
$\ell_D$
, we have, from (12),
$\ell_D = \ell + b/n$
, which gives
$\ell_D - \lfloor \ell_D\rfloor = \ell + b/n -\lfloor \ell + b/n \rfloor$
. Let d be the smallest integer such that n divides
$n \ell + d$
. Integer d thus belongs to
$\{0,\ldots,n-1\}$
, and we have
$\ell_D - \lfloor \ell_D\rfloor = (b - d)/n -\lfloor (b - d)/n \rfloor$
.
-
Case 1: if
$0 \leq d \leq n/2$ then, by taking
$b = d + (n - 1_{\{n \,\mathrm{odd}\}})/2$ , we check that
$b \in \{1,\ldots, n-1\}$ . Since
$0 < (n-1_{\{n \,\mathrm{odd}\}})/(2n) < 1$ , we have
\begin{equation*}\ell_D - \lfloor \ell_D\rfloor = \dfrac{n - 1_{\{n \,\mathrm{odd}\}}}{2n} -\biggl\lfloor \dfrac{n - 1_{\{n \,\mathrm{odd}\}}}{2n} \biggr\rfloor = \dfrac{n - 1_{\{n \,\mathrm{odd}\}}}{2n}.\end{equation*}
-
Case 2: if
$n/2 < d < n$ then, by taking
$b = d - (n + 1_{\{n \,\mathrm{odd}\}})/2$ , we also check that
$b \in \{1,\ldots, n-1\}$ . Since
$-1 < -(n + 1_{\{n \,\mathrm{odd}\}})/(2n) < 0$ , we have
\begin{equation*}\ell_D - \lfloor \ell_D\rfloor = -\dfrac{n + 1_{\{n \,\mathrm{odd}\}}}{2n} -\biggl\lfloor -\dfrac{n + 1_{\{n \,\mathrm{odd}\}}}{2n} \biggr\rfloor = \dfrac{n - 1_{\{n \,\mathrm{odd}\}}}{2n}.\end{equation*}
Hence
$\ell_D - \lfloor \ell_D\rfloor = (n-1_{\{n \,\mathrm{odd}\}} )/(2n)$
, which ends the proof.
The shadow process D, associated with process C, is thus constructed from the remainder of the Euclidean division of
$n \ell$
by n. Taking the complement of this remainder to n, we deduce the value of parameter b of the shadow process D. In order to prove the main theorem of this paper, we still need the following technical result.
Lemma 6. For all
$t\geq 0$
, we have
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU40.png?pub-status=live)
Proof. From Lemma 4 we easily get
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU41.png?pub-status=live)
Observing that
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU42.png?pub-status=live)
we first deduce that
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqn13.png?pub-status=live)
We distinguish the following two cases. If
$\|C_t-L\|_\infty = \ell - \min_{1 \leq i \leq n }{C_t^{(i)}}$
, then, applying relation (13), we obtain
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU43.png?pub-status=live)
and since, from Lemma 4, we have
$\min_{1 \leq i \leq n }{D_t^{(i)}} \leq \min_{1 \leq i \leq n }{C_t^{(i)}} + 1$
, we deduce
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU44.png?pub-status=live)
If
$\|C_t-L\|_\infty = \max_{1\leq i \leq n}C_t^{(i)}-\ell$
, then, applying relation (13), we obtain
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU45.png?pub-status=live)
and since, from Lemma 4, we have
$\max_{1 \leq i \leq n }{C_t^{(i)}} \leq \max_{1 \leq i \leq n }{D_t^{(i)}}$
, we again deduce
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU46.png?pub-status=live)
which completes the proof of the first inequality.
To prove the second one, note that
$D_t-L_D$
is orthogonal to unit vector e. Indeed
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU47.png?pub-status=live)
Hence, since
$L_D-L = (\ell_D - \ell) e$
, we deduce that
$D_t-L_D$
and
$L_D-L$
are orthogonal too. Pythagoras’ theorem then gives
$\|D_t-L\|^2=\|D_t-L_D\|^2 +\|L_D-L\|^2$
, which implies that
$\|D_t-L_D\| \leq \|D_t-L\|$
.
From relation (12), we have
$D_t^{(i)}-C_t^{(i)} = 1_{\{i \in B_t\}}$
for every
$i=1,\ldots,n$
. Since
$|B_t|=b$
, this leads to
$\|D_t-C_t\|=\sqrt{b}$
. From the triangle inequality and since
$b < n$
, we get
$\|D_t-L\| \leq \|D_t-C_t\| + \|C_t-L\| = \|C_t-L\|+\sqrt{b} \leq \|C_t-L\|+\sqrt{n}$
.
The following theorem is the main result of this paper.
Theorem 3. For all
$\delta \in (0,1)$
, if there exists a constant K such that
$\|C_{0}-L\| \leq K$
, then, for all
$t \geq (n-1) (2\ln{(K+\sqrt{n})}-\ln{\delta}-\ln{2})$
, we have
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqn14.png?pub-status=live)
Proof. Let d be the smallest integer such that n divides
$n \ell + d$
. From Lemma 5 there exists a shadow process D associated with a set
$B_0$
of b agents, such that
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU48.png?pub-status=live)
Hence
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU49.png?pub-status=live)
Moreover, combining the hypothesis
$\|C_{0}-L\| \leq K$
and Lemma 6, we get
$\|D_{0}-L_D\| \leq \|C_{0}-L\| + \sqrt{n} \leq K + \sqrt{n}$
. We can thus apply Theorem 2 to process D with
$\lambda_D$
,
$L_D$
, and
$K+\sqrt{n}$
in place of
$\lambda$
, L, and K respectively. We thus obtain, for all
$\delta \in (0,1)$
and for every
$t\geq (n-1) (2\ln(K+\sqrt{n}) -\ln\delta -\ln 2)$
,
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU50.png?pub-status=live)
From Lemma 6, we get
$\|C_t-L\|_\infty \leq \|D_t-L_D\|_\infty +{{(n-1)}/{n}}.$
This inequality allows us to write
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU51.png?pub-status=live)
and thus
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU52.png?pub-status=live)
or equivalently
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU53.png?pub-status=live)
which completes the proof.
Theorem 3 thus extends the results of Theorem 6 of [Reference Mocquard, Anceaume and Sericola11] to any
$\lambda $
. For any
$\lambda $
, process
$C_t$
belongs to the open ball of radius
$3/2$
and center L, with arbitrarily high probability in the infinity norm, after no more than
${\mathrm{O}}(n \ln( K + \sqrt{n}))$
time or
${\mathrm{O}}(\ln(K + \sqrt{n}))$
parallel time, as shown in relation (14). Note that in relation (14) we explicitly give the constant arising in this complexity. This constant depends on the upper bound K of
$\|C_{0}-L\|$
and the initial vector
$C_0$
is given by the application the user wants to deal with. In the next section we calculate the upper bound K for two different types of application: the proportion problem and the system size problem. We conclude this section with the following corollary, which shows that under the condition of Theorem 3, the greatest difference among the entries of vector
$C_t$
, which represents the values of the agents at time t, is less than or equal to 2 with arbitrarily high probability.
Corollary 1. For all
$\delta \in (0,1)$
, if there exists a constant K such that
$\|C_{0}-L\| \leq K$
, then for all
$t \geq (n-1) (2\ln{(K+\sqrt{n})}-\ln{\delta}-\ln{2})$
, we have
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU54.png?pub-status=live)
Proof. Observe that
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU55.png?pub-status=live)
This leads to
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU56.png?pub-status=live)
since the
$C^{(i)}_t$
are integers, and we conclude by applying Theorem 3.
4. Applications
In this section we apply the average-based distributed algorithm studied above to derive, from local average-based interactions, two global properties of our system: first the proportion of agents whose initial value is equal to A and second the number of agents n of the system.
We suppose that agents initially start their execution with either the initial value A or B. Let
$n_A$
be the number of agents starting with value A. If agent i starts with value A, we set
$C_0^{(i)}=m$
and if he starts with value B, we set
$C_0^{(i)}=0$
, where m is an integer, known by all the agents, which will be determined later. We thus have
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqn15.png?pub-status=live)
4.1. Solving the proportion problem
The proportion problem requires each agent to compute the proportion
$\gamma_A$
of agents that initially started the average-based algorithm with initial value A. We have
$\gamma_A=n_A/n$
. Recall that the number n of agents in the system is not known to the agents. Relation (15) gives a function of
$n_A$
, which reaches its maximum for
$n_A = n/2$
. At that value we obtain
$\|C_0-L\|^2 \leq m^2 n /4$
, that is,
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqn16.png?pub-status=live)
Recall that
$C_t^{(i)}$
represents the local value of agent i at discrete time t. We show that the local estimation of the proportion
$\gamma_A$
is given by the quantity
$C_t^{(i)}/m$
. More precisely, the following theorem gives an evaluation of the first instant t from which the distance between
$C_t^{(i)}/m$
and
$\gamma_A$
, for all the agents, is less than a fixed
$\varepsilon$
with arbitrarily high probability
$1-\delta$
, the integer value m being determined by the threshold
$\varepsilon$
.
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_fig1.png?pub-status=live)
Figure 1: Bound comparison of the parallel convergence time for the proportion problem. For each n, we simulate the parallel convergence time (crosses) using
$10^5$
experiments. We also compute the two upper bounds on the parallel convergence time obtained in [Reference Mocquard, Anceaume and Sericola11] (dashed line) and in Theorem 4 (solid line). For each experiment the initial proportion of agents starting with A is a uniform random number in [0, 1] and we have taken
$\delta = 10^{-4}$
and
$\varepsilon = 10^{-2}$
, which gives
$m = 150$
. Note the logarithmic scale of the x-axis.
Theorem 4. For all
$\delta \in (0,1)$
and for all
$\varepsilon \in (0,1)$
, by taking
$m = \lceil 3/(2\varepsilon) \rceil$
, for all
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU57.png?pub-status=live)
we have
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU58.png?pub-status=live)
Proof. Since
$m=\lceil 3/(2\varepsilon) \rceil$
, we have, from relation (16),
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU59.png?pub-status=live)
By choosing
$K=(3+2\varepsilon)\sqrt{n}/(2\varepsilon)$
, we obtain
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU60.png?pub-status=live)
We are now able to apply Theorem 3, which, for all
$\delta \in (0, 1)$
and for all
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU61.png?pub-status=live)
leads to
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU62.png?pub-status=live)
or equivalently, since
$\ell = \gamma_Am$
, to
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU63.png?pub-status=live)
The fact that
$m \geq 3/(2\varepsilon)$
completes the proof.
In Figure 1 we compare our new bound on the convergence time obtained in Theorem 4 for the proportion problem with that obtained in [Reference Mocquard, Anceaume and Sericola11]. One can observe that we have considerably improved it. As usual, the parallel convergence time is the convergence time divided by the number n of agents.
4.2. Solving the system size problem
We now address the system size problem and suppose that each agent knows
$n_A$
. We prove that each agent is able to determine either the exact value of the number n of agents or an approximation of this number, depending on the initial input value m with arbitrarily high probability.
We introduce the following two functions,
$\omega_{\min}$
and
$\omega_{\max}$
, which will be used by each node to get the lower and the upper bound of n, respectively. They are defined, for all integers k, by
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU64.png?pub-status=live)
We start with a general result on the convergence time for the system size problem.
Lemma 7. For all
$\delta \in (0,1)$
, for all positive integers m and
$n_A$
, and for all
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU65.png?pub-status=live)
we have
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU66.png?pub-status=live)
Proof. From (15), we obtain
$\|C_0-L\|\leq m\sqrt{n_A(1-n_A/n)} $
. Applying Theorem 3 with
$K= m\sqrt{n_A(1-n_A/n)}$
, we get
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqn17.png?pub-status=live)
for all
$t \geq (n-1)\bigl(\ln(m\sqrt{n_A(1-n_A/n)}+\sqrt{n})-\ln \delta -\ln 2 \bigr)$
. Then, recalling that
$\ell = n_A m/n$
and using the fact that
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqn18.png?pub-status=live)
we deduce first that, for all
$i=1,\ldots,n$
,
$n_A m/(C_t^{(i)} + 3/2) < n $
, which implies that
$\omega_{\min}\bigl(C_t^{(i)}\bigr) = \lceil n_A m/(C_t^{(i)} + 3/2) \rceil \leq n $
.
By definition of
$\omega_{\max}$
, if
$C^{(i)}_t \leq 1$
, then obviously in that case
$n \leq \omega_{\max}(C_t^{(i)}) $
. If
$C^{(i)}_t \geq 2$
, we deduce from relation (18) that
$n < n_A m/ C_t^{(i)} - 3/2 $
, which means that
$ n \leq \lfloor n_A m/(C_t^{(i)} - 3/2) \rfloor = \omega_{\max}(C_t^{(i)})$
. We have thus shown that, for all
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU67.png?pub-status=live)
we have
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqn19.png?pub-status=live)
The use of relation (17) completes the proof.
Suppose that an upper bound N of n is known. Then we prove that with arbitrarily high probability, after a given number of interactions (computed below), any agent i can locally compute the exact system size n, i.e.
$\omega_{\min}(C_t^{(i)})= \omega_{\max}(C_t^{(i)}) = n$
.
Theorem 5. For all
$\delta \in (0,1)$
, for all positive integers
$n_A$
and N with
$n \leq N$
, by taking
$m \geq 3N(N+1)/n_A$
, we have, for all
$t \geq (n-1) (\ln{n_A}+2\ln m -\ln{\delta})$
,
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU68.png?pub-status=live)
Proof. Since
$n \leq N$
, the condition on m gives
$3n(n+1) \leq n_A m$
or equivalently to
$3n^2 \leq n_A m -3 n.$
Multiplying each side of this inequality by
$4 n_A m /n^2$
, we obtain
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqn20.png?pub-status=live)
On the other hand, from (15), we have
$\|C_0-L\|\leq m\sqrt{n_A(1-n_A/n)}$
. Using the fact that
$\sqrt{1-x} \leq 1- x/2$
, for all
$x \leq 1$
, we get
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU69.png?pub-status=live)
Letting K denote this upper bound of
$\|C_0-L\|$
and using successively the condition
$mn_A \geq 3n(n+1)$
and the fact that
$n_A \geq 1$
, we obtain
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU70.png?pub-status=live)
Using this inequality in Theorem 3, we get, for all
$t \geq (n-1) (\ln n_A +2\ln m -\ln \delta -\ln 2 )$
,
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU71.png?pub-status=live)
Observe now that
$\|C_t - L \|_{\infty} < 3/2$
implies that
$n_Am/n - 3/2 < C_t^{(i)}$
, for all i, which in turn implies, from (20), that
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU72.png?pub-status=live)
in which we used the condition
$m \geq 3n(n+1)/n_A$
to ensure that
$n_A m / n - 3/2 > 0$
. Combining these two results and using the definitions of the integer functions
$\omega_{\min}$
and
$\omega_{\max}$
, we obtain
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU73.png?pub-status=live)
From (19) in Lemma 7, we also have
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU74.png?pub-status=live)
Thus
![](https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20210622133118498-0423:S0021900220000972:S0021900220000972_eqnU75.png?pub-status=live)
This completes the proof.
5. Conclusion
In this paper we have presented a thorough analysis of the bound on the convergence time of average-based population protocols, and applied it to both the proportion problem and the system size problem. Thanks to a well-chosen stochastic coupling, we have considerably improved existing results by providing explicit and tight bounds on the time required to converge to the solution of these problems. Numerical simulations illustrate the tightness of our bounds on convergence times.
A possible extension of this work would be to consider more general graphs for the interactions between agents, instead of the complete graph used in this paper. Another future direction would be to deal with a continuous-time model in which interactions occur at the transition times of a Poisson process, or more generally at the transition times of a phase-type renewal process which preserves the Markov property.