<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://michaelnielsen.org/polymath/index.php?action=history&amp;feed=atom&amp;title=Finding_primes_with_O%28k%29_random_bits</id>
	<title>Finding primes with O(k) random bits - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://michaelnielsen.org/polymath/index.php?action=history&amp;feed=atom&amp;title=Finding_primes_with_O%28k%29_random_bits"/>
	<link rel="alternate" type="text/html" href="https://michaelnielsen.org/polymath/index.php?title=Finding_primes_with_O(k)_random_bits&amp;action=history"/>
	<updated>2026-04-13T13:30:04Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.3</generator>
	<entry>
		<id>https://michaelnielsen.org/polymath/index.php?title=Finding_primes_with_O(k)_random_bits&amp;diff=2176&amp;oldid=prev</id>
		<title>Teorth: New page: We have at least two ways to find k-digit primes with probability &gt; 1/2 (say) in polynomial time using O(k) random bits. (Note that the trivial algorithm of randomly generating k-digit num...</title>
		<link rel="alternate" type="text/html" href="https://michaelnielsen.org/polymath/index.php?title=Finding_primes_with_O(k)_random_bits&amp;diff=2176&amp;oldid=prev"/>
		<updated>2009-08-03T12:07:58Z</updated>

		<summary type="html">&lt;p&gt;New page: We have at least two ways to find k-digit primes with probability &amp;gt; 1/2 (say) in polynomial time using O(k) random bits. (Note that the trivial algorithm of randomly generating k-digit num...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;We have at least two ways to find k-digit primes with probability &amp;gt; 1/2 (say) in polynomial time using O(k) random bits.&lt;br /&gt;
(Note that the trivial algorithm of randomly generating k-digit numbers and testing them for primality would require &amp;lt;math&amp;gt;O(k^2)&amp;lt;/math&amp;gt; random bits, since one expects to need about k trials to get a hit.)&lt;br /&gt;
&lt;br /&gt;
== First method ==&lt;br /&gt;
&lt;br /&gt;
There is a general-purpose method that would find any element of a dense, testable set of k-digit numbers using O(k) random bits.&lt;br /&gt;
&lt;br /&gt;
This is a corollary of the unconditional pseudorandom generator of Nisan and Zuckermann, because the algorithm to choose a random n-bit prime uses space O(n). This PRG uses a random O(S) bit seed and outputs poly(S) bits which appear random to any space(S) machine (S&amp;gt;log n).&lt;br /&gt;
&lt;br /&gt;
http://www.cs.utexas.edu/~diz/pubs/space.ps&lt;br /&gt;
&lt;br /&gt;
(More explanation needed here!)&lt;br /&gt;
&lt;br /&gt;
== Second method ==&lt;br /&gt;
&lt;br /&gt;
Let x be a random k-bit integer.  We can search all the elements of [x,x+k] for primes in polynomial time, and this uses O(k) random bits.  If we let X be the number of primes in [x,x+k], then this algorithm works as long as X is positive.  So it suffices to show that X is positive with probability bounded away from zero (if it is less than 1/2, we can bring it to exceed 1/2 by iteration).&lt;br /&gt;
&lt;br /&gt;
The expectation of X is comparable to 1 (prime number theorem) and the second moment of X is O(1) (this can be seen from a bit of sieve theory, in fact all moments are bounded). This establishes the claim.&lt;/div&gt;</summary>
		<author><name>Teorth</name></author>
	</entry>
</feed>