Skip to content
TheChatArchiveThe Chat Archive
gpt-4o-mini-search-preview· OpenAIHugging Face LMArena Search Arena 24K

使 Miller-Rabin 算法在 10^9 内不出错至少需要几个底数?

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with Perplexitysonar’s answer.
  1. User

    使 Miller-Rabin 算法在 10^9 内不出错至少需要几个底数?

  2. Assistant

    Miller-Rabin 算法是一种用于判断一个数是否为素数的概率性算法,其错误率与所选取的底数数量有关。在实际应用中,选择合适的底数可以显著降低错误率。

    对于小于 (10^9) 的数,选择前 8 个质数作为底数(即 2、3、5、7、11、13、17、37)可以确保算法在该范围内的正确性。这意味着,使用这 8 个底数进行测试时,算法的错误率为 0%,即不会出现错误。[1]

    因此,为了在 (10^9) 范围内确保 Miller-Rabin 算法不出错,至少需要选择 8 个底数。

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.

Identical first prompt