On the Degree of the GCD of Random Polynomials over a Finite Field

In this paper, we focus on the degree of the greatest common divisor (gcd) of random polynomials over Fq. Here, Fq is the finite field with q elements. Firstly, we compute the probability distribution of the degree of the gcd of random and monic polynomials with fixed degree over Fq. )en, we consider the waiting time of the sequence of the degree of gcd functions. We compute its probability distribution, expectation, and variance. Finally, by considering the degree of a certain type gcd, we investigate the probability distribution of the number of rational (i.e., in Fq) roots (counted with multiplicity) of random and monic polynomials with fixed degree over Fq.


Background.
e greatest common divisor (gcd) function is very basic in number theory. It has also been considered in the view of probability theory. For an integer n ≥ 2, suppose the random variables X 1 , . . . , X m , . . . are independent and uniformly distributed on 1, 2, . . . , n { }. In 1880s, Cesàro [1,2] first considered the probability distribution of the gcd of random integers and showed that lim n⟶∞ P gcd X 1 , . . . , X r � l � 1 ζ(r) for r ≥ 2 and 1 ≤ l ≤ n, where ζ is the Riemann zeta function. Diaconis and Erdös [3] gave a more precise asymptotic formula for the case r � 2, which is for 1 ≤ l ≤ n as n ⟶ ∞. One may refer to [4][5][6][7], for more related works. In 2013, Fernández and Fernández [8] considered the waiting time for the gcd sequence: . . , G m � gcd X 1 , . . . , X m , . . . .
Let T (n) be the subscript at which the sequence G m m∈N reaches the value 1 for the first time. ey computed the expectation of T (n) and showed that Besides random integers, it is also natural to study random polynomials. One interesting topic in this area is to understand the behavior of the number of certain type of roots of random polynomials. For example, Kac [9] considered the number of real roots of random polynomials over the real number field R. One may refer to [10] for a recent progress.
In this paper, we focus on the degree of the gcd of random polynomials over the finite field F q , where q ≥ 2 is a prime power.

Our Results.
In the polynomial ring F q [T], we use M and M n to denote the sets of all monic polynomials and monic polynomials with degree n ≥ 0, respectively. We also use deg(f) to denote the degree of a polynomial f.
For integers n ≥ 1 and r ≥ 2, we define where f i , 1 ≤ i ≤ r, are independent and uniformly distributed on M n . We derive the following probability distribution of X(n, q, r).

Theorem 1.
For any integers n ≥ 1 and r ≥ 2, the mass function of X � X(n, q, r) is where With the help of eorem 1, we investigate the waiting time of the sequence: where f 1 , f 2 , . . . are independent and uniformly distributed on M n , n ≥ 1. Observe that this sequence is decreasing.
For an integer 0 ≤ s < n, define the random variable T Theorem 2. Suppose integer n ≥ 1; then, for integers 0 ≤ s < n and m ≥ 2, the mass function of T and furthermore, we have It is a little bit surprising that the expectation and variance of T (n,q) s are independent of the degree n. Using SageMath, we verify this for s � 0, 1 and some (n, q) by doing numerical experiments with 10 6 times. e results are listed in Table 1 (expectation) and Table 2 (variance).
Enlightened by the proof of eorem 1, we use the degree of gcd to study the number of rational roots (counted with multiplicity) of a random polynomial f ∈ F q [T], where f is uniformly distributed on M n , n ≥ 1. Denote this number by N(n, q); then, we have the following result.

Theorem 3. For an integer n ≥ 1, the mass function of N � N(n, q) is
for 0 ≤ l ≤ n.
e method for proving eorem 3 is also valid if we consider the number of distinct rational roots of a random polynomial f ∈ M n . is number is investigated by Leont'ev in [11], where combinational methods are used. Comparatively, our method has more flavor of number theory, and we hope it can be used for other roots' counting problems.
Notations: we use P(A) to denote the probability of an event A and use E(X) and V(X) to denote the expectation and variance of a random variable X. We also use F q to denote the finite field with q elements and use F q [T] to denote the polynomial ring over F q .

Preliminaries e Mo
.. bius function for monic polynomials is defined by For the mean value of μ(f) over M n , it is well known that For a polynomial f in F q [T], we defined its norm by ‖f‖ :� q deg(f) . We derive the following two results, which are needed in proving Proposition 1. 2 Journal of Mathematics (15) en, the first statement follows by noting For the second statement, we have (17) is together with (13) gives our desired result. □ e following lemma is used in the proof of Proposition 2.
Proof. Note that (19) Let deg(d) � i; then, by the definition of μ(d) and Q, we have that d is of the form for some distinct α j ∈ F q , 1 ≤ j ≤ i. From this, we derive that

Proof of Theorem 1
We first compute the kth power moments of X � X(n, q, r).

Proposition 1.
For any integers n, k ≥ 1 and r ≥ 2, we have where A n,q,r (l) is given by (7).
Proof. By the definition of the kth moment, we have It follows that en, for the inner sum on the right-hand side of (25), we can write where we have used (12). Changing the order of the summations, we obtain It follows that Inserting (28) to (25) gives e contribution of those h with deg(h) � n is equal to By Lemma 1, the contribution of those h with 0 ≤ deg(h) ≤ n − 1 is equal to Hence, we have which is our desired result.
□ Now, we are ready to prove eorem 1. Suppose M X (t): � E(e tX ) is the moment generating function of X; then, we have It follows from Proposition 1 that en, our desired result follows from the relationship between the moment generating function and the generating function of X.

Proof of Theorem 2
For an integer 0 ≤ s < n, note that the event G (n,q) m ≤ s � X(n, q, m) ≤ s coincides with the event T (n,q) s ≤ m for each m ≥ 2. Hence, by eorem 1, we have is gives the mass function in eorem 2. By the definition of the expectation of T (n,q) s , we have It follows from (35) that To deal with V(T (n,q) s ), we write It follows from (35) again that where we have used Inserting (37) and (40) into (38) yields our desired result.

Proof of Theorem 3
We first compute the kth power moments of N � N(n, q).

Proposition 2.
For any integers n, k ≥ 1, we have where f is random and uniformly distributed on M n . en, by the definition of the kth moment, we have It follows that For the inner sum on the right-hand side of (45), we have where we have used (12). Changing the order of the summations, we derive f∈M n gcd(f,Q)�h By (45) and (47), we obtain Breaking the above sum into two sums according to deg(h) � n or not, we have

Journal of Mathematics
To deal with 1 , note that h|Q and deg(h) � n; then, h is of the form for distinct α j ∈ F q , 1 ≤ j ≤ q, where 0 ≤ r j ≤ n and r 1 + · · · + r q � n. us, we have For 2 , using Lemma 2, we derive By Proposition 2, we derive en, our desired result follows from the relationship between the moment generating function and the generating function of N.
Data Availability e date in the chart in our paper can be verifies by using SageMath.

Conflicts of Interest
e authors declare that they have no conflicts of interest.