Numerous algorithms call for computation over the integers modulo a randomly-chosen large prime. In some cases, the quasi-cubic complexity of selecting a random prime can dominate the total running time. We propose a new variant of the classic D5 algorithm for "dynamic evaluation", applied to a randomly-chosen (composite) integer. Unlike the D5 principle which has been used in the past to compute over a direct product of fields, our method is simpler as it only requires following a single path after any modulus splits. The transformation we propose can apply to any algorithm in the algebraic RAM model, even allowing randomization. The resulting transformed algorithm avoids any primality tests and will, with constant positive probability, have the same result as the original computation modulo a randomly-chosen prime. As an application, we demonstrate how to compute the exact number of nonzero terms in an unknown integer polynomial in quasi-linear time. We also show how the same algorithmic transformation technique can be used for computing modulo random irreducible polynomials over a finite field.
翻译:许多算法要求计算整数 modulo 是一个随机选择的大质。 在某些情况下, 选择随机质数的准立体复杂度可以支配总运行时间。 我们提出一个用于随机选取( complosite) 整数的经典 D5 算法的新的变种。 与过去用来计算字段直接产值的 D5 原则不同, 我们的方法比较简单, 因为它只在任何模数分离后需要遵循单一路径。 我们提议的变种可以适用于代数 RAM 模型中的任何算法, 甚至允许随机化。 由此产生的变种算法将避免任何原始性测试, 并且以恒定的正概率, 其结果与原计算摩杜拉( modlo) 随机化质数相同。 作为应用程序, 我们演示如何计算非零术语的准确数, 在准线时间上未知的整数的多元度多数值。 我们还演示如何使用相同的算法转换技术来计算莫杜洛 随机不可复制的多质化场数 。