小孩吐奶是什么原因| 镇静是什么意思| 龙蛇混杂是什么意思| 肌酐低什么原因| 郑州有什么好玩的| champion是什么牌子| 月桂酸是什么| 氯仿是什么| 瑞五行属性是什么| 中耳炎不能吃什么食物| 益母草煮鸡蛋有什么功效| 发改委是干什么的| 95年是什么年| 眩晕是什么症状| 三体讲的是什么| 什么是破窗效应| 插入是什么感觉| 朱元璋为什么不杀汤和| 耀字五行属什么| fossil是什么意思| 消肿用什么药| 古曼童是什么| 6合是什么生肖| 发难是什么意思| 梦见吃酒席是什么预兆| 黄水晶五行属什么| 看阴茎挂什么科| 唐筛临界风险是什么意思| 对视是什么意思| 血瘀是什么意思| 茄子有什么营养| 甘油三酯吃什么药| 什么锅好| 在水一方是什么意思| 五月三十一号是什么星座| 汆水是什么意思| 女性漏尿是什么原因| 眼睛突然红了是什么原因| 什么人适合学玄学| 今年春节是什么时候| 子虚乌有是什么意思| 脑血流图能检查出什么| 政绩是什么意思| 皮肤瘙痒症用什么药| 为什么拉屎有血| 调戏是什么意思| alyx是什么牌子| 小腿肿看什么科| 拔火罐有什么好处| 上午9点是什么时辰| 龄字五行属什么| 社保基金是什么| 吃避孕药有什么副作用| 土地确权是什么意思| 烧仙草是什么| 忖量是什么意思| 什么地喝| 人参片泡水喝有什么功效和作用| 吆西是什么意思| 什么样的人容易中暑| 怡五行属性是什么| 小孩坐飞机需要什么证件| 诺是什么意思| 卡针是什么| 补肾益精是什么意思| 李开复是什么人| 慢保申请有什么条件| 法国铁塔叫什么| 野趣是什么意思| 什么是翻新机| 50至60岁吃什么钙片好| 时柱比肩是什么意思| 女人是什么动物| 苯甲酸钠是什么东西| 2月29日是什么星座| www是什么网| 先兆临产是什么意思| 红烧肉可以放什么配菜| 地藏菩萨是管什么的| 太平果是什么水果| 红果是什么| 猕猴桃和什么榨汁好喝| 吉兰巴雷综合征是什么病| 女强人是什么意思| 肺热咳嗽吃什么药| 镭射有什么危害| 生抽是什么| 什么叫大数据| 睡觉经常流口水是什么原因| 补办港澳通行证需要什么材料| 脚为什么会臭| 曹真和曹操什么关系| 头孢治疗什么| 吃什么长得高| 刮痧的痧是什么东西| 乳头痛是什么原因| 什么的奇观| 什么叫咳嗽变异性哮喘| 什么是复句| 角加斗念什么| 五七是什么意思| 播客是什么意思| 三文鱼又叫什么鱼| 吃什么可以让阴茎变硬| 胃酸过多是什么原因造成的| 大暑是什么时间| 老婆饼是什么馅| 血氧低有什么症状| 色即是空是什么意思| 亥五行属什么| 大脚骨疼是什么原因| 小米粥和什么搭配最好| 梦见儿子拉屎是什么意思| 1959属什么生肖| 黑白双煞是什么意思| 蒙氏结节是什么| 各什么己| 吃灵芝孢子粉有什么好处| 头出汗多是什么原因| 看脑袋挂什么科| 山楂和什么不能一起吃| 男人左眼下有痣代表什么| 舌自心念什么| 蝗虫的呼吸器官是什么| 2004属什么| 牡丹什么时候开放| 羊水破了是什么症状| 什么情况下需要割包皮| 倒打一耙的前一句是什么| 广西属于什么地区| 卵巢囊性占位是什么意思| 阳萎早谢吃什么药最好| 邮戳是什么意思| 孤寡老人是什么意思| 小孩个子矮小吃什么促进生长发育| 跳蚤吃什么| 脑供血不足做什么检查能查出来| 凉席什么材质好| 单纯性肥胖是什么意思| 白带正常是什么颜色| 咸鱼翻身是什么意思| 抓龙筋什么意思| 解表化湿是什么意思| 意大利全称是什么| 情非得已是什么生肖| 京剧脸谱黑色代表什么| 压床娃娃有什么讲究吗| 1972年属鼠五行属什么| 凝胶是什么东西| 第一次是什么意思| 角瓜念什么| 女性白细胞高是什么原因| 长春都有什么大学| 阴历三月是什么星座| 私生饭是什么意思| 粘液丝高是什么原因| 养什么鱼招财转运| 杀虫剂中毒有什么症状| 血糖的单位是什么| 万事顺意是什么意思| 窦性心律逆钟向转位是什么意思| 公务员是什么编制| 腿肿是什么病的前兆| 牙龈炎吃什么药最有效| 什么动物可以贴在墙上| 冠脉硬化什么意思| 交替是什么意思| 迦字五行属什么| 哪吒他妈叫什么名字| 站街女是什么意思| 女性经常手淫有什么危害| 胃粘膜损伤吃什么药| 腹主动脉钙化是什么意思| 嗜的意思是什么| 高什么亮什么| 儿童贫血有什么症状表现| 吃榴莲有什么好处和坏处| 水五行属什么| 吃什么解毒| svip和vip有什么区别| 五色土有什么风水作用| 眼皮发黑是什么原因| 糖稀是什么| 什么叫网红| 什么头什么节| 心肌炎是什么病严重吗| 慢心律又叫什么药| 什么是气压| 静脉曲张挂号挂什么科| 利空是什么意思| 女性检查甲功是什么病| 鼻子下面长痘痘是什么原因引起的| 为什么会长闭口| 自然什么意思| 荔枝吃了有什么好处| singing是什么意思| 什么情况下会感染hpv病毒| 女右眉毛跳是什么预兆| 婴儿湿疹用什么药膏最有效| 芹菜炒什么配菜好吃| 抗体弱阳性是什么意思| 鸭胗是鸭的什么部位| 医生说宝宝趴着在暗示着什么| 蚂蚁爱吃什么东西| 血糖高适合吃什么主食| 牙齿抛光是什么意思| 凭什么是什么意思| 小肚子疼是什么原因引起的| 什么体质的人才有季经| 灿烂的近义词是什么| 左眼跳什么右眼跳什么| 胸痛吃什么药| b型血阳性是什么意思| 东吴在现在什么地方| 德不配位是什么意思| 清道夫鱼有什么作用| 里字五行属什么| 胃为什么会疼| 什么叫裸眼视力| 牛头马面是什么生肖| 清白是什么意思| 排山倒海是什么意思| 吃菠萝蜜有什么好处| 迁移宫代表什么| 什么是老公| 口力念什么| 长江后浪推前浪是什么意思| 关节由什么组成| 孔明属什么生肖| 肝有钙化灶是什么意思| ct与核磁共振有什么区别| 什么是直男| 烙馍卷菜搭配什么菜| 血淀粉酶是查什么的| 什么是阴吹| 护士是干什么的| 高压和低压差值在什么范围正常| 叼是什么意思| 弥勒佛为什么是未来佛| 肚脐右边按压疼是什么原因| 眼发花是什么病的征兆| 老年人吃什么钙片好| 身上有异味是什么原因| 为什么牙龈老是出血| 枸橼酸是什么| wba是什么意思| 蜗牛吃什么| 一什么| 发烧有什么症状| 肝功能异常是什么意思| 贡高我慢是什么意思| 耳仓为什么是臭的| 胆小如鼠是什么生肖| 脚气用什么药膏效果好| 小便尿起泡是什么原因| 一切唯心造是什么意思| 感冒吃什么菜比较好| 开会是什么意思| 阴山是今天的什么地方| chd医学上是什么意思| 披什么散什么| 切洋葱为什么会流泪| 为什么会被限制高消费| 人的反义词是什么| 百度Jump to content

重庆:便民一张网 群众好办事

From Wikipedia, the free encyclopedia
百度 科学技术部对外保留国家外国专家局牌子。

The AKS primality test (also known as Agrawal–Kayal–Saxena primality test and cyclotomic AKS test) is a deterministic primality-proving algorithm created and published by Manindra Agrawal, Neeraj Kayal, and Nitin Saxena, computer scientists at the Indian Institute of Technology Kanpur, on August 6, 2002, in an article titled "PRIMES is in P".[1] The algorithm was the first one which is able to determine in polynomial time, whether a given number is prime or composite without relying on mathematical conjectures such as the generalized Riemann hypothesis. The proof is also notable for not relying on the field of analysis.[2] In 2006 the authors received both the G?del Prize and Fulkerson Prize for their work.

Importance

[edit]

AKS is the first primality-proving algorithm to be simultaneously general, polynomial-time, deterministic, and unconditionally correct. Previous algorithms had been developed for centuries and achieved three of these properties at most, but not all four.

  • The AKS algorithm can be used to verify the primality of any general number given. Many fast primality tests are known that work only for numbers with certain properties. For example, the Lucas–Lehmer test works only for Mersenne numbers, while Pépin's test can be applied to Fermat numbers only.
  • The maximum running time of the algorithm can be bounded by a polynomial over the number of digits in the target number. ECPP and APR conclusively prove or disprove that a given number is prime, but are not known to have polynomial time bounds for all inputs.
  • The algorithm is guaranteed to distinguish deterministically whether the target number is prime or composite. Randomized tests, such as Miller–Rabin and Baillie–PSW, can test any given number for primality in polynomial time, but are known to produce only a probabilistic result.
  • The correctness of AKS is not conditional on any subsidiary unproven hypothesis. In contrast, Miller's version of the Miller–Rabin test is fully deterministic and runs in polynomial time over all inputs, but its correctness depends on the truth of the yet-unproven generalized Riemann hypothesis.

While the algorithm is of immense theoretical importance, it is not used in practice, rendering it a galactic algorithm. For 64-bit inputs, the Baillie–PSW test is deterministic and runs many orders of magnitude faster. For larger inputs, the performance of the (also unconditionally correct) ECPP and APR tests is far superior to AKS. Additionally, ECPP can output a primality certificate that allows independent and rapid verification of the results, which is not possible with the AKS algorithm.

Concepts

[edit]

The AKS primality test is based upon the following theorem: Given an integer and integer coprime to , is prime if and only if the polynomial congruence relation

holds within the polynomial ring .[1] Note that denotes the indeterminate which generates this polynomial ring.

This theorem is a generalization to polynomials of Fermat's little theorem. In one direction it can easily be proven using the binomial theorem together with the following property of the binomial coefficient:

for all if is prime.

While the relation (1) constitutes a primality test in itself, verifying it takes exponential time: the brute force approach would require the expansion of the polynomial and a reduction of the resulting coefficients.

The congruence is an equality in the polynomial ring . Evaluating in a quotient ring of creates an upper bound for the degree of the polynomials involved. The AKS evaluates the equality in , making the computational complexity dependent on the size of . For clarity,[1] this is expressed as the congruence

which is the same as:

for some polynomials and .

Note that all primes satisfy this relation (choosing in (3) gives (1), which holds for prime). This congruence can be checked in polynomial time when is polynomial to the digits of . The AKS algorithm evaluates this congruence for a large set of values, whose size is polynomial to the digits of . The proof of validity of the AKS algorithm shows that one can find an and a set of values with the above properties such that if the congruences hold then is a power of a prime.[1]

History and running time

[edit]

In the first version of the above-cited paper, the authors proved the asymptotic time complexity of the algorithm to be (using ? from big O notation)—the twelfth power of the number of digits in n times a factor that is polylogarithmic in the number of digits. However, this upper bound was rather loose; a widely-held conjecture about the distribution of the Sophie Germain primes would, if true, immediately cut the worst case down to .

In the months following the discovery, new variants appeared (Lenstra 2002, Pomerance 2002, Berrizbeitia 2002, Cheng 2003, Bernstein 2003a/b, Lenstra and Pomerance 2003), which improved the speed of computation greatly. Owing to the existence of the many variants, Crandall and Papadopoulos refer to the "AKS-class" of algorithms in their scientific paper "On the implementation of AKS-class primality tests", published in March 2003.

In response to some of these variants, and to other feedback, the paper "PRIMES is in P" was updated with a new formulation of the AKS algorithm and of its proof of correctness. (This version was eventually published in Annals of Mathematics.) While the basic idea remained the same, r was chosen in a new manner, and the proof of correctness was more coherently organized. The new proof relied almost exclusively on the behavior of cyclotomic polynomials over finite fields. The new upper bound on time complexity was , later reduced using additional results from sieve theory to .

In 2005, Pomerance and Lenstra demonstrated a variant of AKS that runs in operations,[3] leading to another updated version of the paper.[4] Agrawal, Kayal and Saxena proposed a variant which would run in if Agrawal's conjecture were true; however, a heuristic argument by Pomerance and Lenstra suggested that it is probably false.

The algorithm

[edit]

The algorithm is as follows:[1]

Input: integer n > 1.
  1. Check if n is a perfect power: if n = ab for integers a > 1 and b > 1, then output composite.
  2. Find the smallest r such that ordr(n) > (log2 n)2. If r and n are not coprime, then output composite.
  3. For all 2 ≤ a ≤ min (r, n?1), check that a does not divide n: If a|n for some 2 ≤ a ≤ min (r, n?1), then output composite.
  4. If nr, then output prime.
  5. For a = 1 to do
    if (X+a)nXn+a (mod Xr ? 1,n), then output composite;
  6. Output prime.

Here ordr(n) is the multiplicative order of n modulo r, log2 is the binary logarithm, and is Euler's totient function of r.

Step 3 is shown in the paper as checking 1 < gcd(a,n) < n for all ar. It can be seen this is equivalent to trial division up to r, which can be done very efficiently without using gcd. Similarly the comparison in step 4 can be replaced by having the trial division return prime once it has checked all values up to and including

Once beyond very small inputs, step 5 dominates the time taken. The essential reduction in complexity (from exponential to polynomial) is achieved by performing all calculations in the finite ring

consisting of elements. This ring contains only the monomials , and the coefficients are in which has elements, all of them codable within bits.

Most later improvements made to the algorithm have concentrated on reducing the size of r, which makes the core operation in step 5 faster, and in reducing the size of s, the number of loops performed in step 5.[5] Typically these changes do not change the computational complexity, but can lead to many orders of magnitude less time taken; for example, Bernstein's final version has a theoretical speedup by a factor of over 2 million.

Proof of validity outline

[edit]

For the algorithm to be correct, all steps that identify n must be correct. Steps 1, 3, and 4 are trivially correct, since they are based on direct tests of the divisibility of n. Step 5 is also correct: since (2) is true for any choice of a coprime to n and r if n is prime, an inequality means that n must be composite.

The difficult part of the proof is showing that step 6 is true. Its proof of correctness is based on the upper and lower bounds of a multiplicative group in constructed from the (X + a) binomials that are tested in step 5. Step 4 guarantees that these binomials are distinct elements of . For the particular choice of r, the bounds produce a contradiction unless n is prime or a power of a prime. Together with the test of step 1, this implies that n is always prime at step 6.[1]

Example 1: n = 31 is prime

[edit]
   Input: integer n = 31 > 1.

   (* Step 1 *)
   If (n = ab for integers a > 1 and b > 1), 
     output composite.
     For ( b = 2; b <= log2(n); b++) {
       a = n1/b;
       If (a is integer), 
         Return[Composite]
     }
     a = n1/2...n1/4 = {5.568, 3.141, 2.360}

   (* Step 2 *)
   Find the smallest r such that Or(n) > (log2 n)2.
     maxk = ?(log2 n)2?;
     maxr = Max[3, ?(Log2 n)5?]; (* maxr really isn't needed *)
     nextR = True;
     For (r = 2; nextR && r < maxr; r++) {
       nextR = False;
       For (k = 1; (!nextR) && k ≤ maxk; k++) {
         nextR = (Mod[nk, r] == 1 || Mod[nk, r]==0)
       }
     }
     r--; (*the loop over increments by one*)
      
     r = 29

   (* Step 3 *)
   If (1 < gcd(a,n) < n for some ar), 
     output composite.
     For (a = r; a > 1; a--) {
       If ((gcd = GCD[a,n]) > 1 && gcd < n), 
         Return[Composite]
     }
      
     gcd = {GCD(29,31)=1, GCD(28,31)=1, ..., GCD(2,31)=1} ≯ 1

   (* Step 4 *)
   If (nr), 
     output prime.
     If (n ≤ r), 
       Return[Prime] (* this step may be omitted if n > 5690034 *)
      
     31 > 29
   
   (* Step 5 *)
   For a = 1 to  do
     If ((X+a)nXn + a (mod Xr ? 1,n)), 
       output composite;
      
     φ[x_] := EulerPhi[x];
     PolyModulo[f_] := PolynomialMod[PolynomialRemainder[f, xr-1, x], n];
     max = Floor[Log[2, n]φ[r]];
     For (a = 1; a ≤ max; a++) {
       If (PolyModulo[(x+a)n - PolynomialRemainder[xn+a, xr-1], x] ≠ 0) {
         Return[Composite]
       {
     }
      
     (x+a)31 =
       a31 +31a30x +465a29x2 +4495a28x3 +31465a27x4 +169911a26x5 +736281a25x6 +2629575a24x7 +7888725a23x8 +20160075a22x9 +44352165a21x10 +84672315a20x11 +141120525a19x12 +206253075a18x13 +265182525a17x14 +300540195a16x15 +300540195a15x16 +265182525a14x17 +206253075a13x18 +141120525a12x19 +84672315a11x20 +44352165a10x21 +20160075a9x22 +7888725a8x23 +2629575a7x24 +736281a6x25 +169911a5x26 +31465a4x27 +4495a3x28 +465a2x29 +31ax30 +x31
      
     PolynomialRemainder [(x+a)31, x29-1] =
       465a2 +a31 +(31a+31a30)x +(1+465a29)x2 +4495a28x3 +31465a27x4 +169911a26x5 +736281a25x6 +2629575a24x7 +7888725a23x8 +20160075a22x9 +44352165a21x10 +84672315a20x11 +141120525a19x12 +206253075a18x13 +265182525a17x14 +300540195a16x15 +300540195a15x16 +265182525a14x17 +206253075a13x18 +141120525a12x19 +84672315a11x20 +44352165a10x21 +20160075a9x22 +7888725a8x23 +2629575a7x24 +736281a6x25 +169911a5x26 +31465a4x27 +4495a3x28
      
     (A) PolynomialMod [PolynomialRemainder [(x+a)31, x29-1], 31] = a31+x2
      
     (B) PolynomialRemainder [x31+a, x29-1] = a+x2
      
     (A) - (B) = a31+x2 - (a+x2) = a31-a
      
     
      
     {131-1 = 0 (mod 31), 231-2 = 0 (mod 31), 331-3 = 0 (mod 31), ..., 2631-26 = 0 (mod 31)}
   
   (* Step 6 *)
   Output prime.
     31 Must be Prime

Where PolynomialMod is a term-wise modulo reduction of the polynomial. e.g. PolynomialMod[x+2x2+3x3, 3] = x+2x2+0x3

[6]

References

[edit]
  1. ^ a b c d e f Agrawal, Manindra; Kayal, Neeraj; Saxena, Nitin (2004). "PRIMES is in P" (PDF). Annals of Mathematics. 160 (2): 781–793. doi:10.4007/annals.2004.160.781. JSTOR 3597229.
  2. ^ Granville, Andrew (2005). "It is easy to determine whether a given integer is prime". Bull. Amer. Math. Soc. 42: 3–38. doi:10.1090/S0273-2025-08-05037-7.
  3. ^ H. W. Lenstra Jr. and Carl Pomerance, "Primality testing with Gaussian periods", preliminary version July 20, 2005.
  4. ^ H. W. Lenstra Jr. and Carl Pomerance, "Primality testing with Gaussian periods Archived 2025-08-05 at the Wayback Machine", version of April 12, 2011.
  5. ^ Daniel J. Bernstein, "Proving Primality After Agrawal-Kayal-Saxena", version of January 25, 2003.
  6. ^ See AKS Talk page for a discussion on why 'Example 2: n is not Prime past Step 4' is missing.

Further reading

[edit]
[edit]
肺结节吃什么食物好 无创是检查什么 为什么吃荔枝会上火 兰姓是什么民族 血常规白细胞偏高是什么原因
家里有壁虎是什么原因 整装待发是什么意思 偷窥是什么意思 手麻挂什么科室 世界的尽头是什么
我的星座是什么 血糖高吃什么药 两票制指的是什么 看演唱会需要准备什么 不自爱是什么意思
眼睛有红血丝是什么原因 僧侣是什么意思 15一16岁青少年腰疼是什么病 为什么下雨后会出现彩虹 疼痛科主要看什么病
狮子住在什么地方hcv7jop9ns3r.cn 凉皮用什么做的hcv7jop6ns8r.cn 看见壁虎是什么兆头hcv9jop7ns0r.cn wbc白细胞高是什么原因hcv9jop0ns0r.cn 雌二醇凝胶有什么作用inbungee.com
怀孕感冒了有什么好办法解决hcv8jop1ns6r.cn 屎特别臭是什么原因hcv9jop3ns9r.cn 泄气的意思是什么hcv7jop7ns1r.cn 甲苯是什么东西hcv7jop5ns4r.cn 背疼挂什么科室最好hcv9jop3ns4r.cn
小舅子是什么意思hcv9jop1ns8r.cn 临界是什么意思hcv8jop3ns9r.cn 浅色是什么颜色yanzhenzixun.com 爱说梦话是什么原因hcv9jop0ns8r.cn 狗狗体内驱虫用什么药最好hcv8jop8ns4r.cn
一个黑一个出读什么hcv9jop0ns9r.cn 什么情况下需要做活检hcv9jop3ns3r.cn 永加日念什么hcv9jop7ns1r.cn 热裤是什么裤子bysq.com 喝茶什么意思hcv8jop1ns0r.cn
百度