^{1}

^{*}

^{1}

Factoring quadratics over Z is a staple of introductory algebra and textbooks tend to create the impression that doable factorizations are fairly common. To the contrary, if coefficients of a general quadratic are selected randomly without restriction, the probability that a factorization exists is zero. We achieve a specific quantification of the probability of factoring quadratics by taking a new approach that considers the absolute size of coefficients to be a parameter
n. This restriction allows us to make relative likelihood estimates based on finite sample spaces. Our probability estimates are then conditioned on the size parameter
n and the behavior of the conditional estimates may be studied as the parameter is varied. Specifically, we enumerate how many formal factored expressions could possibly correspond to a quadratic for a given size parameter. The conditional probability of factorization as a function of
n is just the ratio of this enumeration to the total number of possible quadratics consistent with
n. This approach is patterned after the well-known case where factorizations are carried out over a finite field. We review the finite field method as background for our method of dealing with Z [
*x*]. The monic case is developed independently of the general case because it is simpler and the resulting probability estimating formula is more accurate. We conclude with a comparison of our theoretical probability estimates with exact data generated by a computer search for factorable quadratics corresponding to various parameter values.

This paper presents the preliminary results of a broader program to estimate the probabilities of factoring more general polynomials over ℤ . We anticipate that subsequent research will develop along the lines suggested by the quadratic case investigated here, specifically by using the method of parameterizing the maximum absolute value of coefficients and correlating the conditional probabilities of factorization with the size of the parameter.

The probability that a given general quadratic α x 2 + β x + γ ∈ ℤ [ x ] can be factored depends heavily on the commensurability of the coefficients [

We consider three cases, the first of which, factoring quadratics over finite fields, is well-known [

If a , b , c ∈ ℤ are selected randomly without restriction, then the probability of factoring a x 2 + b x + c over ℤ is zero.

Proof. Suppose we are given a x 2 + b x + c with a , b , c ∈ ℤ selected at random. This quadratic factors over ℚ , hence ℤ by Gauss’ Lemma, if the discriminant Δ = b 2 − 4 a c is a perfect square. We ask what is the probability that Δ is a perfect square if a and b have been selected and c is provisionally allowed to range over [ − n , n ] for some n ∈ ℕ . Then there are 2 n + 1 possible values of Δ spread over an interval of length | 8 a n | . The largest possible number of perfect squares in such an interval would occur when none of the interval intersected the open left half line and where the arithmetic density of squares was the greatest. This would occur if the interval were exactly [ 0, | 8 a n | ] . The number of squares in this interval does not exceed | 8 a n | . The classical probability that

one of these squares coincides with a value of Δ is therefore no more than | 8 a n | 2 n + 1 < 2 | a | 1 n . As the provisional restriction that c ∈ [ − n , n ] is relaxed by allowing n → ∞ , we see 2 | a | 1 n → 0 . It follows that the probability that Δ is a perfect square, and therefore a x 2 + b x + c is factorable over ℤ , is zero in the limit, which corresponds to no restrictions at all on c. Since this is true for any triple ( a , b , c ) , the proposition is established.

We wish to have a more granular understanding of the way in which factorability depends on commensurability of coefficients. Our approach to this question is motivated by solving the factorization probability problem in the context of finite fields, which we review below.

Suppose we are given a random monic quadratic over the finite field G F ( p ) . What is the likelihood that it factors [

If f ( x ) = x 2 + α x + β and α , β ∈ G F ( p ) , then the probability P p of factoring f ( x ) over G F ( p ) is 1 2 + 1 2 p .

Proof. There are p 2 possible pairs of coefficients, hence p 2 distinct quadratics. On the other hand, if f factors as ( x − r 1 ) ( x − r 2 ) , then there are p factorizations where r 1 = r 2 and ( p 2 ) distinct factorizations where r 1 ≠ r 2 , allowing for interchanging the factors. P p is the ratio of possible factorizations to possible quadratics, so P p = p + p ( p − 1 ) 2 p 2 = 1 2 + 1 2 p .

Now let us generalize to an arbitrary quadratic.

If f ( x ) = λ x 2 + α x + β and λ ( ≠ 0 ) , α , β ∈ G F ( p ) , then the probability P p of factoring f ( x ) over G F ( p ) is 1 2 + 1 2 p .

Proof. Evidently there are ( p − 1 ) p 2 possible triples of coefficients, but we can mimic the above proof by rewriting f ( x ) = λ ( x 2 + λ − 1 α x + λ − 1 β ) = λ ( x 2 + α ′ x + β ′ ) . Now the possible factorizations would look like λ ( x − r 1 ) ( x − r 2 ) . Once again, the probability of factoring a random quadratic, not necessarily monic, would be P p = ( p − 1 ) ( p 2 + p 2 ) ( p − 1 ) p 2 = 1 2 + 1 2 p .

If f ( x ) = λ x 2 + α x + β and λ ( ≠ 0 ) , α , β ∈ G F ( p n ) , then the probability P p n of factoring f ( x ) over G F ( p n ) is 1 2 + 1 2 p n .

Proof. Following the proof for the preceding, we have ( p n − 1 ) p 2 n possible triples of coefficients, and ( p n − 1 ) [ p n + p n ( p n − 1 ) 2 ] = ( p n − 1 ) ( p 2 n + p n 2 ) possible factorizations. Hence P p n = ( p n − 1 ) ( p 2 n + p n 2 ) ( p n − 1 ) p 2 n = 1 2 + 1 2 p n .

The limit as p → ∞ of the probability P p n of factoring a quadratic over G F ( p n ) is 1 2 .

Proof. This follows immediately from the fact that the limit as p → ∞ of the expression in Corollary 1-2 is independent of n.

The situation we see embodied in Proposition 1 and its corollaries is somewhat unexpected (at least the first time it is considered) and in any case very different from factoring over ℤ . It is a mildly entertaining exercise in experimental mathematics to choose a large prime p and ask a computer algebra system to factor several random quadratics with large coefficients modulo p. Superficially, since p is large, it seems that the chances for a factorization would be about the same as if the factorization were to be done over ℤ , namely poor. But in the long run, about half of the test examples result in factorizations. Although it would defeat the whole purpose of our discussion of the enumeration method for factorization probabilities in the finite field case, a short proof of Proposition 1 can be gotten directly from number theory. The quadratic equation x 2 + α x + β = 0 can be simplified by completing the square, leaving a constant on the right hand side. Among the p − 1 non-zero least residues modulo p,exactly p − 1 2 are quadratic residues. The constant needs to be a quadratic residue so that roots can be found to construct a factorization. Zero is always a quadratic residue, so there are p − 1 2 + 1 = p + 1 2 quadratic residues in all. On the other hand, there are p least residues modulo p, hence the probability that a randomly chosen least residue is in fact a quadratic residue is p + 1 2 p = 1 2 + 1 2 p as above.

We would like to adapt the same argument for factoring over ℤ as we used for finite fields, namely counting up the number of possible distinct factorizations and dividing by the number of distinct quadratic expressions to get a probability of being able to factor. Since ℤ is infinite this plan is immediately hobbled [

Let us define a “window of feasibility” W ( n ) in the plane as the rectangle of grid points [ 0, n + 1 ] × [ 0, n ] ⊂ ℤ 2 . Suppose we are given a random p ( x ) ∈ ℤ [ x ] of the form x 2 − α x + β with α , β ≥ 0 and β ≤ n . If p ( x ) factors as ( x − r 1 ) ( x − r 2 ) both roots are nonnegative and α = r 1 + r 2 and β = r 1 r 2 . If β > 0 these conditions imply that α ≤ n + 1 , and in the event β = 0 we impose this condition arbitrarily to ensure that all p ( x ) satisfying these conditions can be mapped in the obvious way to ( α , β ) ∈ W ( n ) . At the moment we have every point in W ( n ) as the image of some p ( x ) with α , β ≥ 0 . Clearly this is a bijective mapping. We call W ( n ) a window of feasibility since any p ( x ) with 0 < β ≤ n and α > n + 1 is necessarily impossible to factor. The motivation for constructing the window is to exclude those cases which overwhelm ordinary probability calculations. A quadratic inside the window may or may not be factorable, but if not, the reason will not be due to incommensurability of coefficients.

Note that a grid point of the form ( α ,0 ) corresponds to the quadratic x 2 − α x = x ( x − α ) , so factorization is always possible. A grid point of the form ( 0, β ) , provided β > 0 corresponds to the quadratic x 2 + β , which never factors.

Now denote by F ( n ) the grid points in W ( n ) corresponding to factorable polynomials. A factorable quadratic mapped to ( α , β ) must have α = r 1 + r 2 and β = r 1 r 2 for some r 1 , r 2 . Let us then plot pairs of roots on the W ( n ) grid and define ϕ ( r 1 , r 2 ) = ( α , β ) as the mapping that associates a root pair to the quadratic which factors with those roots. We will see shortly that there are substantial limitations on which points in W ( n ) can be root pairs. In other words,

the domain of ϕ will be relatively small, so surjectivity will clearly be out of the question. We would like ϕ to be injective, and since ϕ ( r 1 , r 2 ) = ϕ ( r 2 , r 1 ) we impose the condition r 2 ≤ r 1 without loss of generality. Graphically, this amounts to eliminating all root pairs strictly above the line r 2 = r 1 . Now W ( n ) \ { ( r 1 , r 2 ) : r 2 ≤ r 1 } is still not F ( n ) since there is another important condition on the root pairs, namely r 1 r 2 ≤ n . The only admissible root pair grid points whenever r 2 > 0 are also below the hyperbola r 2 = n r 1 . This is also true trivially if r 2 = 0 so the hyperbola is an upper bound for all root pairs corresponding to factorable quadratics. Now we estimate the number of points in F ( n ) by calculating the area inside the region of the plane defined by the line r 2 = 0 , the line r 2 = r 1 , and the hyperbola r 2 = n r 1 . The area of this region is A = ∫ 0 n ( r 1 ) d r 1 + ∫ n n + 1 ( n r 1 ) d r 1 = n l n n + 3 n 2 . We estimate the number of grid points in F ( n ) by assuming one grid point per unit of area. This estimate is asymptotically exact. Now W ( n ) has ( n + 1 ) ( n + 2 ) total grid points. Finally, our conditional probability estimate is n l n n + 3 n 2 ( n + 1 ) ( n + 2 ) . We have proved:

Given a random quadratic in ℤ [ x ] of the form x 2 − α x + β , where α , β ≥ 0 , the approximate probability P ( n ) of factorization, subject to the conditions

α ≤ n + 1 and β ≤ n for fixed n ∈ ℕ , is given by P ( n ) = n l n n + 3 n 2 ( n + 1 ) ( n + 2 ) .

With the notation of Proposition 2, P ( n ) is asymptotically l n n 2 n .

Proof. Divide numerator and denominator of n l n n + 3 n 2 ( n + 1 ) ( n + 2 ) by n to get l n n + 3 2 ( n + 3 + 2 n ) . Note that for large n we have l n n ≫ 3 and n ≫ 3 + 2 n . Hence n ≫ 1 implies P ( n ) ≈ l n n 2 n .

Unsurprisingly, letting n → ∞ corresponds to α and β being chosen completely arbitrarily and we confirm that l i m n → ∞ P ( n ) = 0 by L’Hôpital’s rule. The rate at which the likelihood of factorization declines is P ′ ( n ) ≈ − l n n 2 n 2 for large n, as would be expected.

For perspective, if n = 440 , the corresponding likelihood of factorability P ( 440 ) ≈ 1 % .

Consider the lattice cube L ( n ) = [ 0, n ] 3 ⊂ ℤ 3 as the three-dimensional analog of the preceding window of feasibility. The general quadratic [

would satisfy c ≤ n a . As in the monic case, we embed ℤ 2 in ℝ 2 , calculate the appropriate area under the given hyperbola, and then assume one grid point (admissible pair) per unit of area with the understanding that this is asymptotically correct. The area in the first quadrant of the ac plane is ∫ 1 n n ( δ a ) a − n = n l n n − n = n ( l n n − 1 ) . Since the maximum γ is n, but either b or d (or both) could be zero, the appropriate area in the first quadrant of the bd plane would be ∫ 1 n n ( δ b ) b + n = n l n n + n = n ( l n n + 1 ) . Evidently there are [ n ( l n n − 1 ) ] ⋅ [ n ( l n n + 1 ) ] = n 2 ( ( l n n ) 2 − 1 ) = F ( n ) expressions of the form ( a x − b ) ( c x − d ) which could factor the quadratic α x 2 − β x + γ subject to the constraints imposed on those coefficients. Certainly not every point in L ( n ) corresponds to a factorable quadratic, but we can be assured that any points which are associated with a factorable quadratic have a factorization counted by F ( n ) . Since the factor pairs commute, we divide F ( n ) by two and it follows that the conditional probability of factorization is estimated by P ( n ) = F ( n ) 2 n 3 = n 2 ( ( l n n ) 2 − 1 ) 2 n 3 = ( l n n ) 2 − 1 2 n .

We have proved:

Given a random quadratic in ℤ [ x ] of the form α x 2 − β x + γ , where α > 0 , β , γ ≥ 0 and m a x { α , β , γ } ≤ n , an estimate for the probability P ( n ) of factorization is given by P ( n ) = ( l n n ) 2 − 1 2 n .

With the notation of Proposition 3, P ( n ) is asymptotically ( l n n ) 2 n .

n | Calc | Actual |
---|---|---|

10 | 0.200 | 0.197 |

20 | 0.128 | 0.121 |

30 | 0.097 | 0.089 |

40 | 0.078 | 0.070 |

50 | 0.065 | 0.058 |

1000 | 0.005 | * |

∞ | 0 | * |

n = coefficient bound; Calc = calculated P(n); Actual = actual P(n) by computer check.

n | Calc | Actual |
---|---|---|

10 | 0.215 | 0.149 |

20 | 0.199 | 0.190 |

30 | 0.176 | 0.067 |

40 | 0.158 | 0.054 |

50 | 0.143 | 0.045 |

1000 | 0.023 | * |

∞ | 0 | * |

n = coefficient bound; Calc = calculated P(n); Actual = actual P(n) by computer check.

Proof. For n ≫ e , ( l n n ) 2 − 1 2 n ≈ ( l n n ) 2 2 n .

As expected, l i m n → ∞ P ( n ) = 0 again by L’Hôpital’s rule.

We have described two methods for estimating the conditional probability that a random quadratic in ℤ [ x ] with non-negative bounded coefficients can be factored as a function of the bounding parameter. The simpler case is based on mapping monic quadratics injectively to a two-dimensional lattice in ℤ 2 and enumerating the formal expressions that could possibly represent factorizations of them. The ratio of the number of admissible formal factorizations to the total number of points in the lattice defines the conditional probability of factorization for the given coefficient bound. The more complicated case involves mapping general quadratics to a three-dimensional lattice in ℤ 3 and reprising the calculation for the two-dimensional case. Both methods have their provenance in the problem of calculating the likelihood that a quadratic over a finite field may be factored. In the case of finite fields, only a finite number of polynomials are possible and only a finite number of factorizations can be written, making the calculation a simple ratio. This fails, of course, for ℤ , but the point of our method is to resurrect the utility of finiteness by imposing a size limitation on coefficients [

Below in

To close on a philosophical note, although factorization of random quadratics over ℤ has been shown to be a progressively futile exercise, practicing pattern recognition with doable examples for small n is a worthwhile exercise that no doubt pays dividends elsewhere in mathematics.

The authors declare no conflicts of interest regarding the publication of this paper.

Beatty, T. and von Linden, G. (2020) On Conditional Probabilities of Factoring Quadratics. Advances in Pure Mathematics, 10, 114-124. https://doi.org/10.4236/apm.2020.103008