On the Number of Witnesses in the Miller–Rabin Primality Test

In this paper, we investigate the popular Miller–Rabin primality test and study its effectiveness. The ability of the test to determine prime integers is based on the difference of the number of primality witnesses for composite and prime integers. Let <inline-formula> <math display="i...

Full description

Bibliographic Details
Main Authors: Shamil Talgatovich Ishmukhametov, Bulat Gazinurovich Mubarakov, Ramilya Gakilevna Rubtsova
Format: Article
Language:English
Published: MDPI AG 2020-06-01
Series:Symmetry
Subjects:
Online Access:https://www.mdpi.com/2073-8994/12/6/890
Description
Summary:In this paper, we investigate the popular Miller–Rabin primality test and study its effectiveness. The ability of the test to determine prime integers is based on the difference of the number of primality witnesses for composite and prime integers. Let <inline-formula> <math display="inline"> <semantics> <mrow> <mi>W</mi> <mo>(</mo> <mi>n</mi> <mo>)</mo> </mrow> </semantics> </math> </inline-formula> denote the set of all primality witnesses for odd <i>n</i>. By Rabin’s theorem, if <i>n</i> is prime, then each positive integer <inline-formula> <math display="inline"> <semantics> <mrow> <mi>a</mi> <mo><</mo> <mi>n</mi> </mrow> </semantics> </math> </inline-formula> is a primality witness for <i>n</i>. For composite <i>n</i>, the power of <inline-formula> <math display="inline"> <semantics> <mrow> <mi>W</mi> <mo>(</mo> <mi>n</mi> <mo>)</mo> </mrow> </semantics> </math> </inline-formula> is less than or equal to <inline-formula> <math display="inline"> <semantics> <mrow> <mi>φ</mi> <mo>(</mo> <mi>n</mi> <mo>)</mo> <mo>/</mo> <mn>4</mn> </mrow> </semantics> </math> </inline-formula> where <inline-formula> <math display="inline"> <semantics> <mrow> <mi>φ</mi> <mo>(</mo> <mi>n</mi> <mo>)</mo> </mrow> </semantics> </math> </inline-formula> is Euler’s Totient function. We derive new exact formulas for the power of <inline-formula> <math display="inline"> <semantics> <mrow> <mi>W</mi> <mo>(</mo> <mi>n</mi> <mo>)</mo> </mrow> </semantics> </math> </inline-formula> depending on the number of factors of tested integers. In addition, we study the average probability of errors in the Miller–Rabin test and show that it decreases when the length of tested integers increases. This allows us to reduce estimations for the probability of the Miller–Rabin test errors and increase its efficiency.
ISSN:2073-8994