<?xml version='1.0' encoding='UTF-8'?>
<?xml-stylesheet href="/rss/stylesheet/" type="text/xsl"?>
<rss xmlns:content='http://purl.org/rss/1.0/modules/content/' xmlns:taxo='http://purl.org/rss/1.0/modules/taxonomy/' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:itunes='http://www.itunes.com/dtds/podcast-1.0.dtd' xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0" xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:atom='http://www.w3.org/2005/Atom' xmlns:podbridge='http://www.podbridge.com/podbridge-ad.dtd' version='2.0'>
<channel>
  <title>苏迟但到的主页</title>
  <language>zh-cn</language>
  <generator>microfeed.org</generator>
  <itunes:type>episodic</itunes:type>
  <itunes:explicit>false</itunes:explicit>
  <atom:link rel="self" href="https://kexohproject.pages.dev/rss/" type="application/rss+xml"/>
  <link>https://kexohproject.pages.dev</link>
  <description>
    <![CDATA[<p>你好，欢迎访问个人主页！</p><p>擅长密码学，安全分析，数字水印等技术。</p><p>你可以联系我通过:findmykexin@gmail.com或者知乎私信。</p><p>我的知乎链接：<a href="https://www.zhihu.com/people/su-chi-dan-dao" rel="noopener noreferrer" target="_blank">苏迟但到 - 知乎 (zhihu.com)</a></p><p>我的github链接：<a href="https://github.com/kexinoh" rel="noopener noreferrer" target="_blank">kexinoh</a></p>]]>
  </description>
  <itunes:author>苏迟但到</itunes:author>
  <itunes:image href="https://kexohcdn.gptapi.cyou/kexohproject/production/images/channel-2e54d141ee195646ca12a9d16507a908.jpg"/>
  <image>
    <title>苏迟但到的主页</title>
    <url>https://kexohcdn.gptapi.cyou/kexohproject/production/images/channel-2e54d141ee195646ca12a9d16507a908.jpg</url>
    <link>https://kexohproject.pages.dev</link>
  </image>
  <copyright>©2024</copyright>
  <itunes:category text="Education">
    <itunes:category text="Language Learning"/>
  </itunes:category>
  <itunes:category text="Technology"/>
  <item>
    <title>判断一个大数是否为素数有哪些算法？时间复杂度最低的是哪个？</title>
    <guid>gTvKKM7682r</guid>
    <pubDate>Sun, 30 Oct 2022 01:14:21 GMT</pubDate>
    <itunes:explicit>false</itunes:explicit>
    <description>
      <![CDATA[<p data-pid="EHzsF5uX">判断素数算法有很多，但分类最主要有两类：<b>概率性算法（</b>Probabilistic PolynomialTime Algorithm<b>）</b>和<b>确定性算法</b>。</p><p data-pid="YvAR_I92">概率性算法的缺陷就是在最坏情况下的耗时是无穷。</p><p data-pid="fvrLuG0v">但是概率性算法的好处就是平均时间复杂度最低。</p><p data-pid="jnfysyWf">概率性算法有：费马检测，米勒罗宾算法，Baillie–PSW</p><p data-pid="ysbR0H-q">确定性算法有：试除法，改进后的试除法，ECPP，APR-CL（Adleman–Pomerance–Rumely-Cohen-Lenstra），以及AKS。</p><p data-pid="JQj9LLwl">而AKS我想就是题主需要的答案了</p><blockquote data-pid="UjUqNHxT">AKS最关键的重要性在于它是第一个被发表的<b>一般的</b>、<b>多项式的</b>、<b>确定性的</b>和<b>无仰赖的</b>素数判定算法。先前的算法至多达到了其中三点，但从未达到全部四个。AKS算法可以被用于检测任何<b>一般的</b>给定数字是否为素数。很多已知的高速判定算法只适用于满足特定条件的素数。例如，<a href="https://link.zhihu.com/?target=https%3A//baike.baidu.com/item/%25E5%258D%25A2%25E5%258D%25A1%25E6%2596%25AF-%25E8%258E%25B1%25E9%25BB%2598%25E6%25A3%2580%25E9%25AA%258C%25E6%25B3%2595%3FfromModule%3Dlemma_inlink" class=" wrap external" target="_blank" rel="nofollow noreferrer">卢卡斯-莱默检验法</a>仅对<a href="https://link.zhihu.com/?target=https%3A//baike.baidu.com/item/%25E6%25A2%2585%25E6%25A3%25AE%25E7%25B4%25A0%25E6%2595%25B0/816141%3FfromModule%3Dlemma_inlink" class=" wrap external" target="_blank" rel="nofollow noreferrer">梅森素数</a>适用，而Pépin测试仅对<span class="nolink">费马数</span>适用。<br/>算法的最长运行时间可以被表为一个目标数字长度的<span class="nolink">多项式</span>。ECPP和<span class="nolink">APR</span>能够判断一个给定数字是否为素数，但无法对所有输入给出多项式时间范围。<br/>算法可以<a href="https://link.zhihu.com/?target=https%3A//baike.baidu.com/item/%25E7%25A1%25AE%25E5%25AE%259A%25E6%2580%25A7%3FfromModule%3Dlemma_inlink" class=" wrap external" target="_blank" rel="nofollow noreferrer">确定性</a>地判断一个给定数字是否为素数。随机测试算法，例如<span class="nolink">米勒-拉宾检验</span>和Baillie–PSW，可以在多项式时间内对给定数字进行校验，但只能给出概率性的结果。<br/>AKS算法并未“仰赖”任何未证明<a href="https://link.zhihu.com/?target=https%3A//baike.baidu.com/item/%25E7%258C%259C%25E6%2583%25B3%3FfromModule%3Dlemma_inlink" class=" wrap external" target="_blank" rel="nofollow noreferrer">猜想</a>。一个反例是确定性米勒检验：该算法可以在多项式时间内对所有输入给出确定性结果，但其正确性却基于尚未被证明的<span class="nolink">广义黎曼猜想</span>。【引用自百度百科】</blockquote><p data-pid="Tb21qarE">AKS算法的时间复杂度是<img src="https://www.zhihu.com/equation?tex=O%28%5Clog%5E%7B12%7Dn%29" alt="O(\log^{12}n)" eeimg="1"/>，后来被改进到<img src="https://www.zhihu.com/equation?tex=O%28%5Clog%5E%7B6%7Dn%29" alt="O(\log^{6}n)" eeimg="1"/>。</p><p></p>]]>
    </description>
    <itunes:title>New Article Title for iTunes</itunes:title>
  </item>
</channel>
</rss>