Expectation Identity of the Discrete Uniform Distribution and Its Application in the Calculations of Higher-Order Origin Moments

We provide a novel method to analytically calculate the high-order origin moments of a Discrete Uniform (DU) random variable, that is, the expectation identity method. First, the expectation identity of the DU distribution is discovered and summarized in a theorem. After that, we analytically calculate the ﬁrst four origin moments and the general k th ( k = 1 , 2 , . . . ) origin moment of the DU distribution by the expectation identity method. After comparing the corresponding coeﬃcients on both sides of an equation, we obtain a nonhomogeneous linear equations of ﬁrst degree in k +1 variables. Furthermore, we have provided two ways to solve the nonhomogeneous linear equations. The ﬁrst way is by matrix inversion, and the second way is by iterative solving. More-over, the coeﬃcients of the ﬁrst ten origin moments of the DU distribution are summarized in a table. Finally, we have a proposition for special summations.

Moreover, the DU distribution has attracted continuous interest in the literature. Sandelius (1967) discussed the variance of a DU distribution. Connor (1969) discussed sampling distribution of range from DU finite populations and a range test for homogeneity. Sundt (1988) proposed a recursive algorithm for convolutions of DU distributions. Best and Rayner (1997) carried out goodnessof-fit for the ordered categories DU distribution. Sundt (1999) revisited the recursive algorithm for convolutions of DU distributions. Wu et al. (2002) presented bit-parallel random number generation for DU distributions. Calik and Gungor (2004) derived the expected values of the sample maximum of order statistics from a DU distribution. Li and Shi (2010) presented an adaptive load balancing algorithm based on DU distribution. Belbachir (2011) determined the mode for convolution powers of DU distribution. Zhigljavsky et al. (2016) considered the problem of deconvolution of a DU distribution. Stepanauskas and Zvinyte (2017) discussed DU distribution for a sum of additive functions. Calik and Bugatekin (2018) obtained the mth raw moments of sample extremes of order statistics from DU distribution. Roychowdhury (2019) considered the center of mass and the optimal quantizers for some continuous and DU distributions. Pepelyshev and Zhigljavsky (2020) studied DU and binomial distributions with infinite support.
Exponential families include the continuous families -normal, gamma, and beta, and the discrete families -binomial, Poisson, and negative binomial. For the continuous exponential families, there is an entire class of identities that rely on integration by parts. Stein's Lemma (Lemma 3.6.5 in Casella and Berger (2002)) gives an expectation identity for the normal family. Moreover, the expectation identities of the gamma and beta families are given in Exercise 3.49 of Casella and Berger (2002). Note that these expectation identities are useful in the calculations of high-order origin moments of the corresponding families.
The discrete analogs of the expectation identities of the continuous exponential families are given in Theorem 3.6.8 of Casella and Berger (2002), which give the expectation identities for the Poisson and negative binomial families (see also Hwang (1982)). Note that the two families take countable infinite values. For the binomial family, which takes finite values, similar to the deviations of the Poisson and negative binomial expectation identities, Zhang et al. (2019) discovered an expectation identity for the binomial family. Moreover, they obtain a closed-form formula of the high-order origin moments for the binomial family by exploiting the binomial expectation identity.
The DU distribution is probably the simplest discrete distribution. However, the analytical calculations of the high-order origin moments of a DU random variable are quite challenging. There are two potential methods to calculate the high-order origin moments of a DU random variable. That is, the definition method and the moment generating function (mgf) method. But they both failed to analytically calculate the high-order origin moments of a DU random variable. The analytical calculations of the high-order origin moments by the definition method are hindered when the order is greater than or equal to 3, because it is difficult to analytically obtain the summations. Moreover, the mgf method also fails to analytically calculate the high-order origin moments, due to the calculation reduces to the definition of the high-order origin moment.
In this paper, we provide a novel method to analytically calculate the highorder origin moments of a DU random variable, that is, the expectation identity method. First, the expectation identity of the DU distribution is discovered and summarized in a theorem. After that, we analytically calculate the first four origin moments and the general kth (k = 1, 2, . . .) origin moment of the DU distribution by the expectation identity method. After comparing the corresponding coefficients on both sides of an equation, we obtain a nonhomogeneous linear equations of first degree in k + 1 variables. Furthermore, we have provided two ways to solve the nonhomogeneous linear equations. The first way is by matrix inversion, and the second way is by iterative solving.
The rest of the paper is organized as follows. In the next Section 2, we provide some preliminary. Section 3 gives an expectation identity of the DU distribution. The analytical calculations of the first four origin moments of the DU distribution by the expectation identity method are provided in Section 4.
The analytical calculations of the kth origin moment of the DU distribution by the expectation identity method are provided in Section 5. In Section 6, we provide two ways to solve the nonhomogeneous linear equations obtained in Section 5. The first way is by matrix inversion, and the second way is by iterative solving. Some conclusions and discussions are provided in Section 7.
In this paper, we will analytically calculate the kth origin moment of Y ∼ DU (n), EY k , for k = 1, 2, . . .. There are two potential methods to calculate EY k . That is, the definition method and the mgf method.
The second method to analytically calculate EY k is the mgf method. We is the mgf of Y . It is easy to obtain d k dt k e it = i k e it for k = 1, 2, . . .. Therefore, which reduces to the definition of EY k . Consequently, the mgf method fails to analytically calculate EY k .
In this paper, we provide a novel method to analytically calculate EY k , that is, the expectation identity method.

The Expectation Identity of the DU Distribution
The expectation identity of the DU distribution is discovered and summarized in the following theorem and the proof is straightforward and simple as with many important results.
Theorem 1. Let g (x) be a function with −∞ < E [g (x)] < ∞ and −∞ < g (0) < ∞. Let X ∼ DU (n − 1) and Y ∼ DU (n). Then we have the expectation identity of the DU distribution: Proof. We have The proof is complete.

The Analytical Calculations of the First Four Origin Moments of the DU Distribution by the Expectation Identity Method
In this section, we will analytically calculate the first four origin moments of the DU distribution Y ∼ DU (n) by the expectation identity method.
In the following, we will use the fact that EY k (k = 1, 2, 3, 4) can be written as a polynomial of n of order k, and the detailed and technical proof can be found in the supplement.
First, let us calculate EY . Take g (x) = x, then g (0) = 0. By the expectation identity (3), we have Rearranging, we obtain Since EY can be written as a polynomial of n of order 1, it is assumed that and EX = c 1 (n − 1) + c 0 .
Substituting (5) and (6) into (4) and simplifying, we obtain The left side of the above equation simplifies to Hence, (4) reduces to Comparing the corresponding coefficients on both sides of the above equation, we obtain a nonhomogeneous linear equations of first degree in two variables: Solving the above linear equations, we have Therefore, Second, let us calculate EY 2 . Take g (x) = x 2 , then g (0) = 0. By the expectation identity (3), we have Rearranging, we obtain Since EY 2 can be written as a polynomial of n of order 2, it is assumed that and Substituting (9), (10), and (7) into (8) and simplifying, we obtain The left side of the above equation simplifies to

Hence, (8) reduces to
Comparing the corresponding coefficients on both sides of the above equation, we obtain a nonhomogeneous linear equations of first degree in three variables: Solving the above linear equations, we have Therefore, Third, let us calculate EY 3 . Take g (x) = x 3 , then g (0) = 0. By the expectation identity (3), we have Rearranging, we obtain Since EY 3 can be written as a polynomial of n of order 3, it is assumed that and Substituting (13), (14), (7), and (11) into (12) and simplifying, we obtain The left side of the above equation simplifies to Hence, (12) reduces to Comparing the corresponding coefficients on both sides of the above equation, we obtain a nonhomogeneous linear equations of first degree in four variables: Solving the above linear equations, we have Therefore, Fourth, let us calculate EY 4 . Take g (x) = x 4 , then g (0) = 0. By the expectation identity (3), we have Rearranging, we obtain Since EY 4 can be written as a polynomial of n of order 4, it is assumed that and Substituting (17), (18), (7), (11), and (15) into (16) and simplifying, we obtain c 4 (n−1) 5 +c 3 (n−1) 4 +c 2 (n−1) 3 +c 1 (n−1) 2 +c 0 (n−1) = c 4 n 5 +(c 3 − 1) n 4 +c 2 n 3 +c 1 n 2 +c 0 n.
The left side of the above equation simplifies to Hence, (16) reduces to Comparing the corresponding coefficients on both sides of the above equation, we obtain a nonhomogeneous linear equations of first degree in five variables: Solving the above linear equations, we have Therefore,

The Analytical Calculations of the kth Origin Moment of the DU Distribution by the Expectation Identity Method
In this section, we will analytically calculate the kth origin moment of the DU distribution Y ∼ DU (n) by the expectation identity method.
Take g (x) = x k , then g (0) = 0. By the expectation identity (3), we have Rearranging, we obtain Since EY k can be written as a polynomial of n of order k, it is assumed that and where c k = 0. The detailed and technical proof that EY k (k = 1, 2, . . .) can be written as a polynomial of n of order k can be found in the supplement, where we have mainly used the mathematical induction and the expectation identity (3) of the DU distribution. By (21), the left side of (19) reduces to Now let us calculate the right side of (19). Note that Hence, Therefore, the right side of (19) becomes Because the left and right sides of the equation (19) are equal, we have Note that is the binomial coefficient for m ≥ i ≥ 0. Therefore, the left side of (22) reduces to Substituting (23) into (22) and comparing the corresponding coefficients on both sides of the equation (22), we obtain a nonhomogeneous linear equations of first degree in k + 1 variables: After simplifications, the above nonhomogeneous linear equations reduce to The unknown coefficients vector c can be obtained by solving the nonhomogeneous linear equations

Solving the Nonhomogeneous Linear Equations
We provide two ways to solve the nonhomogeneous linear equations (25).
The first way is by matrix inversion, and the second way is by iterative solving.
Taking the first column elements of the matrices on both sides of the above matrix equation, we have L 11 a 11 = 1 L 21 a 11 + L 22 a 21 = 0 L 31 a 11 + L 32 a 21 + L 33 a 31 = 0 . . . Consequently, Define L 10 a 01 = −2, then we have Note that in c (k) i , we have added the superscript (k) to indicate that c (k) i is the coefficient of EY k . When i ≤ k − 1, the expressions in (26) are clearly true.

Verifications of the first four origin moments
In this section, we will verify the first four origin moments from the iterative expressions (26) of the components of c = c (k) i i=k,k−1,k−2,...,1,0 by matrix inversion.
When k = 3, we have When k = 4, we have

Iterative solving
The second way to solve the nonhomogeneous linear equations (25)

Theoretical derivations
In this section, we will give the theoretical derivations to obtain the iterative expressions of the components of the solution vector c = c (k) j j=k,k−1,k−2,...,1,0 by iterative solving.
Rearranging the linear equations (24), we have By iterative solving, we obtain Further simplifying the above formulas, the coefficients can be expressed as Finally,

Verifications of the first four origin moments
In this section, we will verify the first four origin moments from the iterative expressions (27) of the components of c = c When k = 0, we have 0 n 0 = 1.
When k = 3, we have 3 n 3 + c 3 C 3 4 (−1) 3 + c 3 C 4 4 (−1) 4 + c 6.3. The coefficients table of the kth origin moment of the DU distribution Using the above two methods, namely, the matrix inversion method and the iterative solving method, we can use R software (R Core Team (2021)) to compute the unknown coefficients c = c where ⌊·⌋ expresses to round down the number.

k c
First, the expectation identity of the DU distribution is discovered and summarized in a theorem. After that, we analytically calculate the first four origin moments of the DU distribution Y ∼ DU (n) by the expectation identity method. Furthermore, we analytically calculate the kth (k = 1, 2, . . .) origin moment of the DU distribution Y ∼ DU (n) by the expectation identity method.
After comparing the corresponding coefficients on both sides of the equation (22), we obtain a nonhomogeneous linear equations of first degree in k + 1 variables. After simplifications, the nonhomogeneous linear equations reduce to (24) or (25).
We have provided two ways to solve the nonhomogeneous linear equations  Table 1. Finally, we have a proposition for the summations (2) for k = 1, 2, . . . , 10. For k > 10, the summations can also be obtained by more computations in R software.

Supporting Information
Additional information for this article is available.
Supplement: Some proofs of the article.
R folder: R codes used in the article. The R folder will be supplied after acceptance of the article.

Declarations Funding
The research was supported by the MOE project of Humanities and Social Sciences on the west and the border area (20XJC910001), the National Natural