# How many roots of polynomial in $\mathbb Z[x]$ and $\mathbb Q[x]$ are integers on average?

Given $$d,B>0$$ the number of polynomials in $$\mathbb Z[x]$$ of degree $$d$$ and coefficient size at most $$B$$ have at least one integer roots should be $$B^{O(d)}f(d)$$ at some function $$f$$ (from Random Diophantine polynomials: Percent solvable?). So the probability that a uniformly random polynomial in $$\mathbb Z[x]$$ of degree $$d$$ and coefficient size at most $$B$$ has at least one integer root is $$\frac{B^{O(d)}f(d)}{(2B+1)^{d+1}}\asymp\frac{f(d)}{2B+1}$$ which is close to $$0$$.

1. Then what is the average number of integer roots for polynomials in $$\mathbb Z[x]$$ of degree $$d$$ and coefficient size at most $$B$$?

I think it should be $$<1$$.

However I am not sure of the exact parameterizations.

It might be $$\frac1{B^{O(d)}}$$ on average.

1. What is the average number of integer roots for polynomials in $$\mathbb Q[x]$$ of degree $$d$$ and coefficients with numerator of size at most $$B$$ and denominator of size at most $$C$$?
• When you say "$f(B)^{d - 1}$", do you mean that it should grow with $O(B^{d - 1})$? Because neither is true, for example, in the $d = 1$ case, where the growth is logarithmic (an integer root means the coefficient of $x$ divides the coefficient of $1$, so you get approximately the harmonic series sum). – user44191 Jan 22 at 10:26
• @user44191 $bx-a$ has integer root if $b|a$ and $b=1$ itself implies $a$ has $O(B)$ possibilities and so we have at least $B$ degree $1$ polynomials. – T.... Jan 22 at 10:28
• Apologies; I should have said there are $B \text{ln} (B)$ possibilities (approximately). – user44191 Jan 22 at 10:36
• Maybe go at it from the other direction – how many polynomials of degree $d$ and coefficients bounded by $B$ have, say, 17 as a root? Then take a sum, as 17 varies, to get the total number of integer roots, and then the average number. – Gerry Myerson Jan 22 at 11:01
• Over $\mathbb R$, the answer is zero with any reasonable notion of "average". With probability 1 the coefficients will be algebraically independent, so they won't have a single integer, rational nor even algebraic root. – Wojowu Jan 22 at 12:24

$$\mathbb{E}[\text{#|roots of P|}]=\mathbb{E}(\sum_{k\in \mathbb{Z}}1_{k \text{ is a root of P}})=\sum_{k\in\mathbb{Z}}\mathbb{P}(P(k)=0)$$ For $$k=0$$, $$\mathbb{P}(P(0)=0)=\frac{1}{(2B+1)}$$.
For $$k\neq 0$$, because the coefficients are independent (if $$B$$ and $$d$$ large) $$P(k)$$ should behave like a Gaussian if $$d$$ is large of variance $$\sigma^2=\sum_{j=0}^d \big(k^{2j}\times\frac{1}{(2B+1)}\sum_{i=-B}^Bi^2\big)\approx (d+1)\times \frac{B^2}{3}$$ if $$|k|=1$$ and $$\frac{k^{2d+2} -1}{k^2-1} \times \frac{B^2}{3}$$ for $$|k|>1$$. So $$\mathbb{P}(P(k)=0)\approx \begin{cases} \frac{1}{B\sqrt{2\pi(d+1)/3}} \text{ for }k=1 \\ \frac{1}{B\sqrt{2 \pi\frac{k^{2d+2} -1}{k^2-1}/3}} \text{for |k|>1}\end{cases}$$ Note that for large $$d$$, the probability for $$|k|>1$$ is very small and then $$\mathbb{E}[\text{#|roots of P|}]\approx \mathbb{P}(P(0)=0)+\mathbb{P}(P(1)=0)+\mathbb{P}(P(-1)=0)\approx\frac{1}{(2B+1)}(1+2\times \frac{\sqrt{6}}{\pi d})$$(same result as in Random Diophantine polynomials: Percent solvable?)
• Would similar result hold in $\mathbb R[x]$? – T.... Jan 22 at 12:12