Prime probability remainder error, fixed



 Science > Physics > Prime probability remainder error, fixed

LINK TO THIS PAGE  


rating :  0   |  0


  Page 1 of 1

1

 
Topic: Science > Physics
User: ""
Date: 18 Aug 2006 07:45:24 PM
Object: Prime probability remainder error, fixed
I talked for a while about using the lack of a prime preference for a
particular residue modulo another prime i.e. given primes p_1 and p_2
p_1 mod p_2
shows no preference for a particular non-zero residue of p_2 to get
prime probability, and this approach was considered to be heuristic,
but a couple of days ago I stepped through how it is equivalent to
using Legendre's Formula without the use of the floor() function, so
errors crop up, which are remainder errors.
But with that explanation in hand, it turns out there is an easy way to
correct for the remainder errors which I'll describe in this post.
What's remarkable though is that the research I've been doing does not
show that mathematicians figured out the reason for the failure of what
they seem to have thought was an intuitive idea--not rigorous--that was
to be dropped because it failed, versus seeing the puzzling failure as
an opportunity.
Now then consider this approach for the count of primes up to 100:
100*(6/7)*(4/5)*(2/3)*(1/2) = 22.857 to five significant figures
which is using the straightforward but flawed approach of just
multiplying and dividing without any use of the floor() function, which
adds remainder error.
But here's a simple trick for removing that problem, which is to divide
off factors in common between x and p_j*...*2, and then divide by what
remains, discarding the remainder as long the result is greater than
1--if it's not then you drop probabilities for the largest prime until
it is, and then divide dropping off the remainder--and then multiply
that result times (p_k - 1)*...*2, where k is the kth prime remaining
and k=j if no primes were dropped, to get the expected.
For example with x=100, first you divide off 10, so what's left is
10*(6/7)*(4)*(2/3)
and since 21 is greater than 10, next you'd drop (6/7), so you have
10*4*(2/3) where now you use floor(), so you have
4*2*floor(10/3)= 4*2*3 = 24
which is only off by 1.
And notice that the the probability given by now dividing by 100, is
24% closer to the exact 25%, as there are 25 primes up to 100.
So there is a simple way to solve that problem.
The reason this idea works is that the actual count of naturals up to
and including a natural number x that have a prime p as a factor is
given by
floor(x/p)
so absolutely the probability can be said to be floor(x/p)/x. The idea
I've outlined is more along the lines of that usage, so it's a simple
idea that removes the remainder error.
Intriguingly then, this way of calculating x*(p_j - 1)*...*(1/2) cannot
be approximated by using Merten's theorem, as the approximately 12%
error that arise from the lack of use of the floor() function is
removed.
Here is a recap of the technique written more rigorously:
probPrime(x) = ((p_k - 1)*...*2)*floor(x/(p_k*...*2))/x
such that x>(p_k*...*2), where k is the largest prime less than or
equal to j that will fit, where j is the count of primes up to and
including sqrt(x).
So shifting things about in a simple way changes everything, and
explains the prime distribution without much fuss, while using what
people thought was a flawed intuitive approach, when the approach
wasn't the problem--the problem was error introduced by not using the
floor() function.
This solution is a nice one on a scale that my fellow physics people
should be able to appreciate, showing the power of simplicity in
thinking, and is I think, an expression of Occam's Razor at work.
Short of it is, simple is good.
James Harris
.

User: "Dr. Tibbs"

Title: Re: Prime probability remainder error, fixed 18 Aug 2006 10:30:48 PM
<jstevh@msn.com> wrote in message
news:1155948324.816130.72080@m79g2000cwm.googlegroups.com...
<snip>

100*(6/7)*(4/5)*(2/3)*(1/2) = 22.857 to five significant figures

which is using the straightforward but flawed approach of just
multiplying and dividing without any use of the floor() function, which
adds remainder error.

Un-noteable pee wee JSH discovers <"truncation"> !
"What would we do without a floor ? "
.
User: ""

Title: Re: Prime probability remainder error, fixed 19 Aug 2006 10:48:50 AM
Dr. Tibbs wrote:

<jstevh@msn.com> wrote in message
news:1155948324.816130.72080@m79g2000cwm.googlegroups.com...

<snip>

100*(6/7)*(4/5)*(2/3)*(1/2) = 22.857 to five significant figures

which is using the straightforward but flawed approach of just
multiplying and dividing without any use of the floor() function, which
adds remainder error.


Un-noteable pee wee JSH discovers <"truncation"> !

"What would we do without a floor ? "

Go in and out the window.
Go in and out the window.
Go in and out the window.
If you don't want to use the door.
Just walk around the ceiling.
Just walk around the ceiling.
Just walk around the ceiling.
If you don't want to use the floor.
.
User: "Odysseus"

Title: Re: Prime probability remainder error, fixed 21 Aug 2006 03:59:02 AM
In article <1156002530.546371.120670@m79g2000cwm.googlegroups.com>,
"mensanator@aol.com" <mensanator@aol.com> wrote:

Dr. Tibbs wrote:

<jstevh@msn.com> wrote in message
news:1155948324.816130.72080@m79g2000cwm.googlegroups.com...

<snip>

100*(6/7)*(4/5)*(2/3)*(1/2) = 22.857 to five significant figures

which is using the straightforward but flawed approach of just
multiplying and dividing without any use of the floor() function, which
adds remainder error.


Un-noteable pee wee JSH discovers <"truncation"> !

"What would we do without a floor ? "


Go in and out the window.
Go in and out the window.
Go in and out the window.
If you don't want to use the door.

Just walk around the ceiling.
Just walk around the ceiling.
Just walk around the ceiling.
If you don't want to use the floor.

"I wish that my room had a floor--
I don't care so much for a door--
But this walking around
Without touching the ground
Is getting to be quite a bore!"
--
Odysseus
.



User: "Gib Bogle"

Title: Re: Prime probability remainder error, fixed 18 Aug 2006 09:40:10 PM
wrote:

Short of it is, simple is good.

As simple as possible, no simpler.
.

User: "Tim Peters"

Title: Re: JSH: Prime probability remainder error, fixed 18 Aug 2006 10:46:44 PM
[added "JSH:" to subject]
[jstevh@msn.com]

...
Here is a recap of the technique written more rigorously:

probPrime(x) = ((p_k - 1)*...*2)*floor(x/(p_k*...*2))/x

such that x>(p_k*...*2), where k is the largest prime less than or
equal to j that will fit, where j is the count of primes up to and
including sqrt(x).

You mean p_k is the largest prime (etc), not k.
So at x=100 k is 3, because the product of the first 3 primes is 30 (<= 100)
but the product of the first 4 primes is 210 (> 100). Then you estimate the
number of primes <= 100 as 100 * probPrime(100) =
(p_3 - 1)*(p_2 - 1)*(p_1 - 1) * floor(100/(p_3 * p_2 * p_1)) =
4 * 2 * 1 * floor(100/( 5 * 3 * 2) =
8 * 3 =
24
? Fine so far as it goes.
What happens at, say, x=10^6? The product of the first 7 primes is 510510,
so k=7. You expect to compute a sensible approximation by using /only/ the
first 7 primes, when there are 168 primes <= sqrt(10^6)?
If that doesn't strike you as exceedingly unlikely to work at first glance,
complete the computation for 10^6 and explain why 92160 should be accepted
as a good approximation to pi(10^6) = 78498 (and note that the dirt-cheap
x/(ln(x)-1) estimates 78030 in this case).
Looks like you don't know how very fast the product of the first k primes
grows. For example, at x=10^12, k=11, and then you're using only 11 primes
despite that pi(sqrt(10^12)) = 78498. Here's a hint:
http://primes.utm.edu/glossary/page.php?sort=Primorial

So shifting things about in a simple way changes everything, and
explains the prime distribution without much fuss, while using what
people thought was a flawed intuitive approach, when the approach
wasn't the problem--the problem was error introduced by not using the
floor() function.

That's not the primary problem with the previous simpler approach (although
it may be the only problem with it you understand so far).

This solution is a nice one on a scale that my fellow physics people
should be able to appreciate, showing the power of simplicity in
thinking, and is I think, an expression of Occam's Razor at work.

Short of it is, simple is good.

Established theory supplies much easier (to compute) approximations that are
far better, and which were proved asymptotically equal to pi(x) over a
century ago. So if you're serious about Occam's razor, consider that old
theory is both simpler and actually works.
.
User: ""

Title: Re: JSH: Prime probability remainder error, fixed 18 Aug 2006 11:16:41 PM
Tim Peters wrote:

[added "JSH:" to subject]

[jstevh@msn.com]

...
Here is a recap of the technique written more rigorously:

probPrime(x) = ((p_k - 1)*...*2)*floor(x/(p_k*...*2))/x

such that x>(p_k*...*2), where k is the largest prime less than or
equal to j that will fit, where j is the count of primes up to and
including sqrt(x).


You mean p_k is the largest prime (etc), not k.

So at x=100 k is 3, because the product of the first 3 primes is 30 (<= 100)
but the product of the first 4 primes is 210 (> 100). Then you estimate the
number of primes <= 100 as 100 * probPrime(100) =

(p_3 - 1)*(p_2 - 1)*(p_1 - 1) * floor(100/(p_3 * p_2 * p_1)) =
4 * 2 * 1 * floor(100/( 5 * 3 * 2) =
8 * 3 =
24

? Fine so far as it goes.

What happens at, say, x=10^6? The product of the first 7 primes is 510510,
so k=7. You expect to compute a sensible approximation by using /only/ the
first 7 primes, when there are 168 primes <= sqrt(10^6)?

If that doesn't strike you as exceedingly unlikely to work at first glance,
complete the computation for 10^6 and explain why 92160 should be accepted
as a good approximation to pi(10^6) = 78498 (and note that the dirt-cheap
x/(ln(x)-1) estimates 78030 in this case).

Looks like you don't know how very fast the product of the first k primes
grows. For example, at x=10^12, k=11, and then you're using only 11 primes
despite that pi(sqrt(10^12)) = 78498. Here's a hint:

Link removed. So you still didn't take the next obvious step? I
wonder why.
I said that the probability that x is not divisible by p for a
particular prime p less than or equal to the sqrt(x) is given by
((p-1)*floor(x/p))/x
So, of course, the easy correction is to use:
probPrime(x) = ((p_j-1)*floor(x/p_j))...*floor(x/2))/x^j
where p_j is the jth prime, where j is the number of primes up to and
including x.
So, why didn't you make the obvious leap? I wonder.
If you had, you might have become world-famous, put your name in the
history books as more than just my foil, and stepped forward as a
positive contributor in this entire thing, despite what you did before,
so there was a tremendous amount of positive pressure to get the right
answer, and a world of pain to miss it.
But you missed it.
The puzzle remains and I wonder what else I can do that is that easy.
I have not found a bottom, and that is the puzzle. There should have
been a bottom.
___JSH
.
User: "Tim Peters"

Title: Re: JSH: Prime probability remainder error, fixed 19 Aug 2006 03:20:10 AM
[jstevh@msn.com]

...
Here is a recap of the technique written more rigorously:

probPrime(x) = ((p_k - 1)*...*2)*floor(x/(p_k*...*2))/x

such that x>(p_k*...*2), where k is the largest prime less than or
equal to j that will fit, where j is the count of primes up to and
including sqrt(x).

[Tim Peters]

You mean p_k is the largest prime (etc), not k.

So at x=100 k is 3, because the product of the first 3 primes is 30
(<= 100) but the product of the first 4 primes is 210 (> 100). Then

you estimate the number of primes <= 100 as 100 * probPrime(100) =


(p_3 - 1)*(p_2 - 1)*(p_1 - 1) * floor(100/(p_3 * p_2 * p_1)) =
4 * 2 * 1 * floor(100/( 5 * 3 * 2) =
8 * 3 =
24

? Fine so far as it goes.

What happens at, say, x=10^6? The product of the first 7 primes is
510510, so k=7. You expect to compute a sensible approximation by
using /only/ the first 7 primes, when there are 168 primes <= sqrt(10^6)?

If that doesn't strike you as exceedingly unlikely to work at first
glance, complete the computation for 10^6 and explain why 92160 should be
accepted as a good approximation to pi(10^6) = 78498 (and note that the
dirt-cheap x/(ln(x)-1) estimates 78030 in this case).

Looks like you don't know how very fast the product of the first k primes
grows. For example, at x=10^12, k=11, and then you're using only 11
primes despite that pi(sqrt(10^12)) = 78498.
...

[jstevh@msn.com]

Link removed. So you still didn't take the next obvious step? I
wonder why.

Same general deal as with your factoring attempts: I actually know
something non-trivial about the topic, so often know how one of your
attempts is going to turn out shortly after first seeing it. The use of the
primorial above (see the link you deleted -- the product of the first k
primes) made it obvious at first glance (note the use of that phrase above)
it wasn't going to work well at all.
Now a question for you: if the next step is obvious, why didn't you use it
the first time instead of posting the above?

I said that the probability that x is not divisible by p for a
particular prime p less than or equal to the sqrt(x) is given by

((p-1)*floor(x/p))/x

You didn't say that in the post I was replying to, and it's clear as mud why
you think it. The probability that x is divisible by p is 1 or 0, but we
can't say which without knowing x and p first. The probability that an
integer chosen uniformly at random from 1 to x is divisible by p is exactly:
floor(x/p) / x
Therefore the probability that an integer chosen uniformly at random from 1
to x is not divisible by p is exactly 1 minus that, or:
1 - floor(x/p)/x [1]
For example, floor(30/7) = 4 integers in 1..30 are divisible by 7, so the
probability that an integer in 1..30 is not divisible by 7 is
1 - 4/30 = 26/30 = 13/15
What's the reasoning for your:
((p-1)*floor(x/p))/x [2]
above? Do you /really/ want to say that "the probability" of not being
divisible by 7 is the smaller 6*floor(30/7)/30 = 24/30 = 12/15 instead?
This smells like an error to me.
In the end it won't matter much (both ways are still asymptotically wrong).
However, note that because the /underlying/ model is inherently biased
toward overestimating the prime count, an error that makes your
"probabilities" smaller than you intend may actually help you. (Exercise:
prove that your expression [2] is always <= my expression [1], for all
positive x and p.)

So, of course, the easy correction is to use:

probPrime(x) = ((p_j-1)*floor(x/p_j))...*floor(x/2))/x^j

where p_j is the jth prime, where j is the number of primes up to and
including x.

So, why didn't you make the obvious leap? I wonder.

You haven't been paying attention: it's not the rounding artifacts that
were the /primary/ problem in your original model. That's only the problem
you saw. The primary problem remains that the individual probabilities here
are not independent in the vicinity of x, so multiplying them together to
compute the joint probability is /inherently/ incorrect.
Because I know that (you still don't in part because you didn't follow the
references previously given), I /know/ this approach is also doomed. I
don't have to try it to know that, same way I didn't have to try your
previous attempts to know how they'd turn out. Write a program yourself
this time, and you'll see that even the simple x/(ln(x)-1) is a much better
approximation to pi(x) as x increases, and that the ratio of pi(x) to yours
still drifts away from 1. It's probably a better approximation than you
started with (especially if you make errors that underestimate the
"probabilities" you intended to compute), and enormously better than the one
you posted at the top, but it still misses the mark.

If you had, you might have become world-famous, put your name in the
history books as more than just my foil, and stepped forward as a
positive contributor in this entire thing, despite what you did before,
so there was a tremendous amount of positive pressure to get the right
answer, and a world of pain to miss it.

But you missed it.

The puzzle remains and I wonder what else I can do that is that easy.
I have not found a bottom, and that is the puzzle. There should have
been a bottom.

Sorry, but in truth you don't yet have anything in this area worth having.
How about going to a library tomorrow and looking up one of the books I
referenced?
.
User: ""

Title: Re: JSH: Prime probability remainder error, fixed 19 Aug 2006 11:26:28 AM
Tim Peters wrote:

[jstevh@msn.com]

...
Here is a recap of the technique written more rigorously:

probPrime(x) = ((p_k - 1)*...*2)*floor(x/(p_k*...*2))/x

such that x>(p_k*...*2), where k is the largest prime less than or
equal to j that will fit, where j is the count of primes up to and
including sqrt(x).


[Tim Peters]

You mean p_k is the largest prime (etc), not k.

So at x=100 k is 3, because the product of the first 3 primes is 30
(<= 100) but the product of the first 4 primes is 210 (> 100). Then

you estimate the number of primes <= 100 as 100 * probPrime(100) =


(p_3 - 1)*(p_2 - 1)*(p_1 - 1) * floor(100/(p_3 * p_2 * p_1)) =
4 * 2 * 1 * floor(100/( 5 * 3 * 2) =
8 * 3 =
24

? Fine so far as it goes.

What happens at, say, x=10^6? The product of the first 7 primes is
510510, so k=7. You expect to compute a sensible approximation by
using /only/ the first 7 primes, when there are 168 primes <= sqrt(10^6)?

If that doesn't strike you as exceedingly unlikely to work at first
glance, complete the computation for 10^6 and explain why 92160 should be
accepted as a good approximation to pi(10^6) = 78498 (and note that the
dirt-cheap x/(ln(x)-1) estimates 78030 in this case).

Looks like you don't know how very fast the product of the first k primes
grows. For example, at x=10^12, k=11, and then you're using only 11
primes despite that pi(sqrt(10^12)) = 78498.
...


[jstevh@msn.com]

Link removed. So you still didn't take the next obvious step? I
wonder why.


Same general deal as with your factoring attempts: I actually know
something non-trivial about the topic, so often know how one of your
attempts is going to turn out shortly after first seeing it. The use of the
primorial above (see the link you deleted -- the product of the first k
primes) made it obvious at first glance (note the use of that phrase above)
it wasn't going to work well at all.

Now a question for you: if the next step is obvious, why didn't you use it
the first time instead of posting the above?

I said that the probability that x is not divisible by p for a
particular prime p less than or equal to the sqrt(x) is given by

((p-1)*floor(x/p))/x

A mistake on my part.


You didn't say that in the post I was replying to, and it's clear as mud why
you think it. The probability that x is divisible by p is 1 or 0, but we
can't say which without knowing x and p first. The probability that an
integer chosen uniformly at random from 1 to x is divisible by p is exactly:

floor(x/p) / x

Therefore the probability that an integer chosen uniformly at random from 1
to x is not divisible by p is exactly 1 minus that, or:

1 - floor(x/p)/x [1]

For example, floor(30/7) = 4 integers in 1..30 are divisible by 7, so the
probability that an integer in 1..30 is not divisible by 7 is

1 - 4/30 = 26/30 = 13/15

What's the reasoning for your:

((p-1)*floor(x/p))/x [2]

above? Do you /really/ want to say that "the probability" of not being
divisible by 7 is the smaller 6*floor(30/7)/30 = 24/30 = 12/15 instead?
This smells like an error to me.

Yup. It was a mistake which I realized a little later. The correct
answer is
1 - floor(x/p)/x.

In the end it won't matter much (both ways are still asymptotically wrong).

There is the possibility of clipping from combinations that are not
possible, which still just follows from using Legendre's Formula.
Like up to 100, the primes are 2, 3, 5 and 7, so you loop through
possibilities using 2, 3, 5 and 7, and then 2(3), 2(5), 2(6), and 3(5),
3(7) and so on until you get to 2(3)(5)(7), which drops off with the
use of floor() because it is greater than 100.
So it's still all about the floor() function.
As you get bigger and bigger x, more combinations of primes fall off
the edge you might say, and are cleared with the exact approach using
Legendre's.

However, note that because the /underlying/ model is inherently biased
toward overestimating the prime count, an error that makes your
"probabilities" smaller than you intend may actually help you. (Exercise:
prove that your expression [2] is always <= my expression [1], for all
positive x and p.)

So, of course, the easy correction is to use:

probPrime(x) = ((p_j-1)*floor(x/p_j))...*floor(x/2))/x^j

where p_j is the jth prime, where j is the number of primes up to and
including x.

Fixing my error that should be
ProbPrime(x) = ((1 - floor(x/p_j)/x)*...*(1 - floor(x/2)/x).

So, why didn't you make the obvious leap? I wonder.


You haven't been paying attention: it's not the rounding artifacts that
were the /primary/ problem in your original model. That's only the problem
you saw. The primary problem remains that the individual probabilities here
are not independent in the vicinity of x, so multiplying them together to
compute the joint probability is /inherently/ incorrect.

Nope. I proved that it is mostly remainder error by stepping through
what follows from Legendre's Formula, as the argument is trivial.
Possibly mathematicians looking for an explanation in this area thought
that the individual progabilities were entangled, but that can't be
true for many reasons where a simple explanation is that given primes
p_1 and p_2, p_1 mod p_2 can't show a preference, as if it did, the
naturals would show a preference, but for each prime they go in
lock-step, for example:
1, 2, 3 followed by 4, 5, 6 and so on
where you have 1, 2, 0 modulo 3, followed by 1, 2, 0 modulo 3, out to
infinity.
So no, there no entanglement of probabilities. That idea is just
wrong.
The correct answer can easily be found using Legendre's and noticing
that some combinations are excluded for size reasons.

Because I know that (you still don't in part because you didn't follow the
references previously given), I /know/ this approach is also doomed. I
don't have to try it to know that, same way I didn't have to try your
previous attempts to know how they'd turn out. Write a program yourself
this time, and you'll see that even the simple x/(ln(x)-1) is a much better
approximation to pi(x) as x increases, and that the ratio of pi(x) to yours
still drifts away from 1. It's probably a better approximation than you
started with (especially if you make errors that underestimate the
"probabilities" you intended to compute), and enormously better than the one
you posted at the top, but it still misses the mark.

But unlike you I want to know the correct answer--while you want what
you've been told to be true.
You are following some books.
I am figuring out what is actually happening.

If you had, you might have become world-famous, put your name in the
history books as more than just my foil, and stepped forward as a
positive contributor in this entire thing, despite what you did before,
so there was a tremendous amount of positive pressure to get the right
answer, and a world of pain to miss it.

But you missed it.

The puzzle remains and I wonder what else I can do that is that easy.
I have not found a bottom, and that is the puzzle. There should have
been a bottom.


Sorry, but in truth you don't yet have anything in this area worth having.
How about going to a library tomorrow and looking up one of the books I
referenced?

Waste of time.
After reading all those books you thought that probabilities could be
entangled, when the simple answer followed from what I already
discussed when I talked about stepping through what had to be going on
using Legendre's.
Yet that directly contradicts with the obvious behavior of the naturals
themselves, yet your mind seized on something wrong, versus just
carefully thinking through the problem to what has to be the correct
answer.
Now I'm going to consider the impact of combinations that go off the
edge, and consider if this latest idea gets caught by them or not, as
I'm still not sure.
But at least I question. You have your references and a hundred plus
years of people thinking one way.
I have the desire to get the answer versus confidence in what some
people said.
James Harris
.
User: ""

Title: Re: JSH: Prime probability remainder error, fixed 20 Aug 2006 12:50:43 PM
wrote:

Tim Peters wrote:

[

]

...
Here is a recap of the technique written more rigorously:

probPrime(x) = ((p_k - 1)*...*2)*floor(x/(p_k*...*2))/x

such that x>(p_k*...*2), where k is the largest prime less than or
equal to j that will fit, where j is the count of primes up to and
including sqrt(x).


[Tim Peters]

You mean p_k is the largest prime (etc), not k.

So at x=100 k is 3, because the product of the first 3 primes is 30
(<= 100) but the product of the first 4 primes is 210 (> 100). Then

you estimate the number of primes <= 100 as 100 * probPrime(100) =


(p_3 - 1)*(p_2 - 1)*(p_1 - 1) * floor(100/(p_3 * p_2 * p_1)) =
4 * 2 * 1 * floor(100/( 5 * 3 * 2) =
8 * 3 =
24

? Fine so far as it goes.

What happens at, say, x=10^6? The product of the first 7 primes is
510510, so k=7. You expect to compute a sensible approximation by
using /only/ the first 7 primes, when there are 168 primes <= sqrt(10^6)?

If that doesn't strike you as exceedingly unlikely to work at first
glance, complete the computation for 10^6 and explain why 92160 should be
accepted as a good approximation to pi(10^6) = 78498 (and note that the
dirt-cheap x/(ln(x)-1) estimates 78030 in this case).

Looks like you don't know how very fast the product of the first k primes
grows. For example, at x=10^12, k=11, and then you're using only 11
primes despite that pi(sqrt(10^12)) = 78498.
...


[

]

Link removed. So you still didn't take the next obvious step? I
wonder why.


Same general deal as with your factoring attempts: I actually know
something non-trivial about the topic, so often know how one of your
attempts is going to turn out shortly after first seeing it. The use of the
primorial above (see the link you deleted -- the product of the first k
primes) made it obvious at first glance (note the use of that phrase above)
it wasn't going to work well at all.

Now a question for you: if the next step is obvious, why didn't you use it
the first time instead of posting the above?

I said that the probability that x is not divisible by p for a
particular prime p less than or equal to the sqrt(x) is given by

((p-1)*floor(x/p))/x


A mistake on my part.


You didn't say that in the post I was replying to, and it's clear as mud why
you think it. The probability that x is divisible by p is 1 or 0, but we
can't say which without knowing x and p first. The probability that an
integer chosen uniformly at random from 1 to x is divisible by p is exactly:

floor(x/p) / x

Therefore the probability that an integer chosen uniformly at random from 1
to x is not divisible by p is exactly 1 minus that, or:

1 - floor(x/p)/x [1]

For example, floor(30/7) = 4 integers in 1..30 are divisible by 7, so the
probability that an integer in 1..30 is not divisible by 7 is

1 - 4/30 = 26/30 = 13/15

What's the reasoning for your:

((p-1)*floor(x/p))/x [2]

above? Do you /really/ want to say that "the probability" of not being
divisible by 7 is the smaller 6*floor(30/7)/30 = 24/30 = 12/15 instead?
This smells like an error to me.


Yup. It was a mistake which I realized a little later. The correct
answer is

1 - floor(x/p)/x.

In the end it won't matter much (both ways are still asymptotically wrong).


There is the possibility of clipping from combinations that are not
possible, which still just follows from using Legendre's Formula.

Yup. And it turns out that is the answer that resolves everything, as
I explained in other threads.
It can be said to be like a coincidence that probabilistic methods LOOK
like the exact method that can be used for the prime distribution
itself, when of course, it's not really a coincidence as it is because
of the order that is in the counting numbers themselves.
And it is definitely an area of confusion.
In looking over the literature in this area it's almost as if the
mathematicians who did much of the research didn't understand how the
naturals weren't a probabilistic system, versus prime residues modulo
other primes, which ARE random.

Like up to 100, the primes are 2, 3, 5 and 7, so you loop through
possibilities using 2, 3, 5 and 7, and then 2(3), 2(5), 2(6), and 3(5),
3(7) and so on until you get to 2(3)(5)(7), which drops off with the
use of floor() because it is greater than 100.

So it's still all about the floor() function.

Yup. I thought I could find a way around that and still use
probabilistic approaches but then realized--hey, the naturals are NOT
random!
And you can figure it out by doing the exact counts, which you can do
easily enough with naturals once you know that floor(x/p) is the count
of naturals up to and including x that have p as a factor, but you
cannot do that with the primes, considering questions like if x is
prime, is x+2 prime as well?
That is the answer that I myself missed for a while because you can get
answers that look close by acting as if the naturals are random, so it
can mislead you for a while until you think it through.
Then the closeness is seen to just be the reality that treating the
naturals as if they are random can get you close to the correct answer
because the equations are similar between the exact answer and the
wrong probabilistic approach.
That settles all the major issues in this area.
James Harris
.
User: "Tito Mangiuea"

Title: Re: JSH: Prime probability remainder error, fixed 20 Aug 2006 03:13:37 PM
<jstevh@msn.com> wrote in message
news:1156096243.259250.271420@m73g2000cwd.googlegroups.com...

jstevh@msn.com wrote:

<snip>

Then the closeness is seen to just be the reality that treating the
naturals as if they are random can get you close to the correct answer
because the equations are similar between the exact answer and the
wrong probabilistic approach.

So you can't tell if you are more wrong than right. So what good is it?
Why don't you publish it in a peer reviewed journal?


That settles all the major issues in this area.

Except one, it only works part of the time, and then when it does you cant
tell if it is wrong or right?
Is that the problem?



James Harris

.

User: ""

Title: Re: JSH: Prime probability remainder error, fixed 20 Aug 2006 01:15:46 PM
wrote:

That settles all the major issues in this area.


James Harris

So sayeth the man without a clue.
.

User: ""

Title: Re: JSH: Prime probability remainder error, fixed 20 Aug 2006 12:56:34 PM
Harris Integral , Harris Spaces, introduction and development >>>>>
http://sciphysicsopenmanuscript.blogspot.com/
.


User: "David Moran"

Title: Re: JSH: Prime probability remainder error, fixed 19 Aug 2006 11:47:16 AM
wrote:

Tim Peters wrote:

[

]

...
Here is a recap of the technique written more rigorously:

probPrime(x) = ((p_k - 1)*...*2)*floor(x/(p_k*...*2))/x

such that x>(p_k*...*2), where k is the largest prime less than or
equal to j that will fit, where j is the count of primes up to and
including sqrt(x).

[Tim Peters]

You mean p_k is the largest prime (etc), not k.

So at x=100 k is 3, because the product of the first 3 primes is 30
(<= 100) but the product of the first 4 primes is 210 (> 100). Then

you estimate the number of primes <= 100 as 100 * probPrime(100) =

(p_3 - 1)*(p_2 - 1)*(p_1 - 1) * floor(100/(p_3 * p_2 * p_1)) =
4 * 2 * 1 * floor(100/( 5 * 3 * 2) =
8 * 3 =
24

? Fine so far as it goes.

What happens at, say, x=10^6? The product of the first 7 primes is
510510, so k=7. You expect to compute a sensible approximation by
using /only/ the first 7 primes, when there are 168 primes <= sqrt(10^6)?

If that doesn't strike you as exceedingly unlikely to work at first
glance, complete the computation for 10^6 and explain why 92160 should be
accepted as a good approximation to pi(10^6) = 78498 (and note that the
dirt-cheap x/(ln(x)-1) estimates 78030 in this case).

Looks like you don't know how very fast the product of the first k primes
grows. For example, at x=10^12, k=11, and then you're using only 11
primes despite that pi(sqrt(10^12)) = 78498.
...

[

]

Link removed. So you still didn't take the next obvious step? I
wonder why.

Same general deal as with your factoring attempts: I actually know
something non-trivial about the topic, so often know how one of your
attempts is going to turn out shortly after first seeing it. The use of the
primorial above (see the link you deleted -- the product of the first k
primes) made it obvious at first glance (note the use of that phrase above)
it wasn't going to work well at all.

Now a question for you: if the next step is obvious, why didn't you use it
the first time instead of posting the above?

I said that the probability that x is not divisible by p for a
particular prime p less than or equal to the sqrt(x) is given by

((p-1)*floor(x/p))/x


A mistake on my part.

You didn't say that in the post I was replying to, and it's clear as mud why
you think it. The probability that x is divisible by p is 1 or 0, but we
can't say which without knowing x and p first. The probability that an
integer chosen uniformly at random from 1 to x is divisible by p is exactly:

floor(x/p) / x

Therefore the probability that an integer chosen uniformly at random from 1
to x is not divisible by p is exactly 1 minus that, or:

1 - floor(x/p)/x [1]

For example, floor(30/7) = 4 integers in 1..30 are divisible by 7, so the
probability that an integer in 1..30 is not divisible by 7 is

1 - 4/30 = 26/30 = 13/15

What's the reasoning for your:

((p-1)*floor(x/p))/x [2]

above? Do you /really/ want to say that "the probability" of not being
divisible by 7 is the smaller 6*floor(30/7)/30 = 24/30 = 12/15 instead?
This smells like an error to me.


Yup. It was a mistake which I realized a little later. The correct
answer is

1 - floor(x/p)/x.

In the end it won't matter much (both ways are still asymptotically wrong).


There is the possibility of clipping from combinations that are not
possible, which still just follows from using Legendre's Formula.

Like up to 100, the primes are 2, 3, 5 and 7, so you loop through
possibilities using 2, 3, 5 and 7, and then 2(3), 2(5), 2(6), and 3(5),
3(7) and so on until you get to 2(3)(5)(7), which drops off with the
use of floor() because it is greater than 100.

So it's still all about the floor() function.

As you get bigger and bigger x, more combinations of primes fall off
the edge you might say, and are cleared with the exact approach using
Legendre's.

However, note that because the /underlying/ model is inherently biased
toward overestimating the prime count, an error that makes your
"probabilities" smaller than you intend may actually help you. (Exercise:
prove that your expression [2] is always <= my expression [1], for all
positive x and p.)

So, of course, the easy correction is to use:

probPrime(x) = ((p_j-1)*floor(x/p_j))...*floor(x/2))/x^j

where p_j is the jth prime, where j is the number of primes up to and
including x.


Fixing my error that should be

ProbPrime(x) = ((1 - floor(x/p_j)/x)*...*(1 - floor(x/2)/x).

So, why didn't you make the obvious leap? I wonder.

You haven't been paying attention: it's not the rounding artifacts that
were the /primary/ problem in your original model. That's only the problem
you saw. The primary problem remains that the individual probabilities here
are not independent in the vicinity of x, so multiplying them together to
compute the joint probability is /inherently/ incorrect.


Nope. I proved that it is mostly remainder error by stepping through
what follows from Legendre's Formula, as the argument is trivial.

Possibly mathematicians looking for an explanation in this area thought
that the individual progabilities were entangled, but that can't be
true for many reasons where a simple explanation is that given primes
p_1 and p_2, p_1 mod p_2 can't show a preference, as if it did, the
naturals would show a preference, but for each prime they go in
lock-step, for example:

1, 2, 3 followed by 4, 5, 6 and so on

where you have 1, 2, 0 modulo 3, followed by 1, 2, 0 modulo 3, out to
infinity.

So no, there no entanglement of probabilities. That idea is just
wrong.

The correct answer can easily be found using Legendre's and noticing
that some combinations are excluded for size reasons.

Because I know that (you still don't in part because you didn't follow the
references previously given), I /know/ this approach is also doomed. I
don't have to try it to know that, same way I didn't have to try your
previous attempts to know how they'd turn out. Write a program yourself
this time, and you'll see that even the simple x/(ln(x)-1) is a much better
approximation to pi(x) as x increases, and that the ratio of pi(x) to yours
still drifts away from 1. It's probably a better approximation than you
started with (especially if you make errors that underestimate the
"probabilities" you intended to compute), and enormously better than the one
you posted at the top, but it still misses the mark.


But unlike you I want to know the correct answer--while you want what
you've been told to be true.

You are following some books.

I am figuring out what is actually happening.

If you had, you might have become world-famous, put your name in the
history books as more than just my foil, and stepped forward as a
positive contributor in this entire thing, despite what you did before,
so there was a tremendous amount of positive pressure to get the right
answer, and a world of pain to miss it.

But you missed it.

The puzzle remains and I wonder what else I can do that is that easy.
I have not found a bottom, and that is the puzzle. There should have
been a bottom.

Sorry, but in truth you don't yet have anything in this area worth having.
How about going to a library tomorrow and looking up one of the books I
referenced?


Waste of time.

Why? We had to read books to learn. Why can't you? An attempt to learn
might show that you're actually trying to understand what people with
more experience are telling you.
Dave
.
User: ""

Title: Re: JSH: Prime probability remainder error, fixed 21 Aug 2006 07:36:55 PM
David Moran wrote:

jstevh@msn.com wrote:

Tim Peters wrote:

[jstevh@msn.com]

...
Here is a recap of the technique written more rigorously:

probPrime(x) = ((p_k - 1)*...*2)*floor(x/(p_k*...*2))/x

such that x>(p_k*...*2), where k is the largest prime less than or
equal to j that will fit, where j is the count of primes up to and
including sqrt(x).

[Tim Peters]

You mean p_k is the largest prime (etc), not k.

So at x=100 k is 3, because the product of the first 3 primes is 30
(<= 100) but the product of the first 4 primes is 210 (> 100). Then

you estimate the number of primes <= 100 as 100 * probPrime(100) =

(p_3 - 1)*(p_2 - 1)*(p_1 - 1) * floor(100/(p_3 * p_2 * p_1)) =
4 * 2 * 1 * floor(100/( 5 * 3 * 2) =
8 * 3 =
24

? Fine so far as it goes.

What happens at, say, x=10^6? The product of the first 7 primes is
510510, so k=7. You expect to compute a sensible approximation by
using /only/ the first 7 primes, when there are 168 primes <= sqrt(10^6)?

If that doesn't strike you as exceedingly unlikely to work at first
glance, complete the computation for 10^6 and explain why 92160 should be
accepted as a good approximation to pi(10^6) = 78498 (and note that the
dirt-cheap x/(ln(x)-1) estimates 78030 in this case).

Looks like you don't know how very fast the product of the first k primes
grows. For example, at x=10^12, k=11, and then you're using only 11
primes despite that pi(sqrt(10^12)) = 78498.
...

[jstevh@msn.com]

Link removed. So you still didn't take the next obvious step? I
wonder why.

Same general deal as with your factoring attempts: I actually know
something non-trivial about the topic, so often know how one of your
attempts is going to turn out shortly after first seeing it. The use of the
primorial above (see the link you deleted -- the product of the first k
primes) made it obvious at first glance (note the use of that phrase above)
it wasn't going to work well at all.

Now a question for you: if the next step is obvious, why didn't you use it
the first time instead of posting the above?

I said that the probability that x is not divisible by p for a
particular prime p less than or equal to the sqrt(x) is given by

((p-1)*floor(x/p))/x


A mistake on my part.

You didn't say that in the post I was replying to, and it's clear as mud why
you think it. The probability that x is divisible by p is 1 or 0, but we
can't say which without knowing x and p first. The probability that an
integer chosen uniformly at random from 1 to x is divisible by p is exactly:

floor(x/p) / x

Therefore the probability that an integer chosen uniformly at random from 1
to x is not divisible by p is exactly 1 minus that, or:

1 - floor(x/p)/x [1]

For example, floor(30/7) = 4 integers in 1..30 are divisible by 7, so the
probability that an integer in 1..30 is not divisible by 7 is

1 - 4/30 = 26/30 = 13/15

What's the reasoning for your:

((p-1)*floor(x/p))/x [2]

above? Do you /really/ want to say that "the probability" of not being
divisible by 7 is the smaller 6*floor(30/7)/30 = 24/30 = 12/15 instead?
This smells like an error to me.


Yup. It was a mistake which I realized a little later. The correct
answer is

1 - floor(x/p)/x.

In the end it won't matter much (both ways are still asymptotically wrong).


There is the possibility of clipping from combinations that are not
possible, which still just follows from using Legendre's Formula.

Like up to 100, the primes are 2, 3, 5 and 7, so you loop through
possibilities using 2, 3, 5 and 7, and then 2(3), 2(5), 2(6), and 3(5),
3(7) and so on until you get to 2(3)(5)(7), which drops off with the
use of floor() because it is greater than 100.

So it's still all about the floor() function.

As you get bigger and bigger x, more combinations of primes fall off
the edge you might say, and are cleared with the exact approach using
Legendre's.

However, note that because the /underlying/ model is inherently biased
toward overestimating the prime count, an error that makes your
"probabilities" smaller than you intend may actually help you. (Exercise:
prove that your expression [2] is always <= my expression [1], for all
positive x and p.)

So, of course, the easy correction is to use:

probPrime(x) = ((p_j-1)*floor(x/p_j))...*floor(x/2))/x^j

where p_j is the jth prime, where j is the number of primes up to and
including x.


Fixing my error that should be

ProbPrime(x) = ((1 - floor(x/p_j)/x)*...*(1 - floor(x/2)/x).

So, why didn't you make the obvious leap? I wonder.

You haven't been paying attention: it's not the rounding artifacts that
were the /primary/ problem in your original model. That's only the problem
you saw. The primary problem remains that the individual probabilities here
are not independent in the vicinity of x, so multiplying them together to
compute the joint probability is /inherently/ incorrect.


Nope. I proved that it is mostly remainder error by stepping through
what follows from Legendre's Formula, as the argument is trivial.

Possibly mathematicians looking for an explanation in this area thought
that the individual progabilities were entangled, but that can't be
true for many reasons where a simple explanation is that given primes
p_1 and p_2, p_1 mod p_2 can't show a preference, as if it did, the
naturals would show a preference, but for each prime they go in
lock-step, for example:

1, 2, 3 followed by 4, 5, 6 and so on

where you have 1, 2, 0 modulo 3, followed by 1, 2, 0 modulo 3, out to
infinity.

So no, there no entanglement of probabilities. That idea is just
wrong.

The correct answer can easily be found using Legendre's and noticing
that some combinations are excluded for size reasons.

Because I know that (you still don't in part because you didn't follow the
references previously given), I /know/ this approach is also doomed. I
don't have to try it to know that, same way I didn't have to try your
previous attempts to know how they'd turn out. Write a program yourself
this time, and you'll see that even the simple x/(ln(x)-1) is a much better
approximation to pi(x) as x increases, and that the ratio of pi(x) to yours
still drifts away from 1. It's probably a better approximation than you
started with (especially if you make errors that underestimate the
"probabilities" you intended to compute), and enormously better than the one
you posted at the top, but it still misses the mark.


But unlike you I want to know the correct answer--while you want what
you've been told to be true.

You are following some books.

I am figuring out what is actually happening.

If you had, you might have become world-famous, put your name in the
history books as more than just my foil, and stepped forward as a
positive contributor in this entire thing, despite what you did before,
so there was a tremendous amount of positive pressure to get the right
answer, and a world of pain to miss it.

But you missed it.

The puzzle remains and I wonder what else I can do that is that easy.
I have not found a bottom, and that is the puzzle. There should have
been a bottom.

Sorry, but in truth you don't yet have anything in this area worth having.
How about going to a library tomorrow and looking up one of the books I
referenced?


Waste of time.


Why? We had to read books to learn. Why can't you? An attempt to learn
might show that you're actually trying to understand what people with
more experience are telling you.

Dave

I've read lots of books. I prize books and learning. I've also read
books in this area.
The problem here though is that for reasons that escape me, as it
boggles my mind, mathematicians have smudged the line with primes when
it comes to question about how many primes there are in an
interval--the prime distribution--versus questions like how many twin
primes there are in an interval.
So the books are lying. Since it is so easy to explain, any objective
reader can know that the books are lying, and wonder, like me, why.
Now then, how is it obvious?
Well, the count of primes up to a given x is exactly determined by a
simple calculation using the primes up to and including the square root
of x.
For instance, to count the primes up to 24, you need only use
24 - floor(24/2) - floor(24/3) + floor(24/6) + 2 - 1
which is, you subtract the evens, from 24 and then the count of those
divisible by 3, and then you add in those divisible by 6--as they've
been subtracted twice--and then add in 2 for the primes as 2 got
subtracted with the evens and 3 got subtracted with those divisible by
3, and then you subtract one for 1, as one is not prime.
That gives you the EXACT count, and the method is perfect, for any
natural x.
In contrast, how many twin primes are there up to 24?
To be a twin prime, given an odd prime x, it must be true in that
interval that
x+2
is coprime to 3, as, of course, it will be coprime to 2, but notice,
you cannot calculate the count in the same way you could calculate the
count of primes!!!
There are TWO SYSTEMS, where one is exact and determined, not at all
random, with simple equations for counting primes, and the other is
random, so you can't calculate the number of twin primes, you have to
go check each prime, add 2 to it, and see if the result is divisible by
3.
As I've pointed out repeatedly, given primes p_1 mod p_2 it is
IMPOSSIBLE for that to show a preference for a particuar non-zero
residue!!!
If it could, then the composites--the products of the primes--would
show the SAME PREFERENCE, but in fact, the natural follow the simple
pattern:
1, 2, 3, 4, 5, and so on out to infinity.
I just explained in a couple of paragraphs how and why questions about
the prime distribution differ from areas that have to do with prime
residues modulo other primes, like with the twin primes conjecture, or
Goldbach's Conjecture.
But I doubt you'd find that explanation in ANY of the references you
mention.
My conclusion is that since this is simple, mathematicians lied. By
smearing the line, they can do research indefinitely, supporting any
number of people who are doing nothing at all positive.
They are doing nothing. They are just doing nothing at all.
James Harris
.
User: "David Moran"

Title: Re: JSH: Prime probability remainder error, fixed 21 Aug 2006 07:51:14 PM
wrote:

David Moran wrote:

wrote:

Tim Peters wrote:

[

]

...
Here is a recap of the technique written more rigorously:

probPrime(x) = ((p_k - 1)*...*2)*floor(x/(p_k*...*2))/x

such that x>(p_k*...*2), where k is the largest prime less than or
equal to j that will fit, where j is the count of primes up to and
including sqrt(x).

[Tim Peters]

You mean p_k is the largest prime (etc), not k.

So at x=100 k is 3, because the product of the first 3 primes is 30
(<= 100) but the product of the first 4 primes is 210 (> 100). Then

you estimate the number of primes <= 100 as 100 * probPrime(100) =

(p_3 - 1)*(p_2 - 1)*(p_1 - 1) * floor(100/(p_3 * p_2 * p_1)) =
4 * 2 * 1 * floor(100/( 5 * 3 * 2) =
8 * 3 =
24

? Fine so far as it goes.

What happens at, say, x=10^6? The product of the first 7 primes is
510510, so k=7. You expect to compute a sensible approximation by
using /only/ the first 7 primes, when there are 168 primes <= sqrt(10^6)?

If that doesn't strike you as exceedingly unlikely to work at first
glance, complete the computation for 10^6 and explain why 92160 should be
accepted as a good approximation to pi(10^6) = 78498 (and note that the
dirt-cheap x/(ln(x)-1) estimates 78030 in this case).

Looks like you don't know how very fast the product of the first k primes
grows. For example, at x=10^12, k=11, and then you're using only 11
primes despite that pi(sqrt(10^12)) = 78498.
...

[

]

Link removed. So you still didn't take the next obvious step? I
wonder why.

Same general deal as with your factoring attempts: I actually know
something non-trivial about the topic, so often know how one of your
attempts is going to turn out shortly after first seeing it. The use of the
primorial above (see the link you deleted -- the product of the first k
primes) made it obvious at first glance (note the use of that phrase above)
it wasn't going to work well at all.

Now a question for you: if the next step is obvious, why didn't you use it
the first time instead of posting the above?

I said that the probability that x is not divisible by p for a
particular prime p less than or equal to the sqrt(x) is given by

((p-1)*floor(x/p))/x

A mistake on my part.

You didn't say that in the post I was replying to, and it's clear as mud why
you think it. The probability that x is divisible by p is 1 or 0, but we
can't say which without knowing x and p first. The probability that an
integer chosen uniformly at random from 1 to x is divisible by p is exactly:

floor(x/p) / x

Therefore the probability that an integer chosen uniformly at random from 1
to x is not divisible by p is exactly 1 minus that, or:

1 - floor(x/p)/x [1]

For example, floor(30/7) = 4 integers in 1..30 are divisible by 7, so the
probability that an integer in 1..30 is not divisible by 7 is

1 - 4/30 = 26/30 = 13/15

What's the reasoning for your:

((p-1)*floor(x/p))/x [2]

above? Do you /really/ want to say that "the probability" of not being
divisible by 7 is the smaller 6*floor(30/7)/30 = 24/30 = 12/15 instead?
This smells like an error to me.

Yup. It was a mistake which I realized a little later. The correct
answer is

1 - floor(x/p)/x.

In the end it won't matter much (both ways are still asymptotically wrong).

There is the possibility of clipping from combinations that are not
possible, which still just follows from using Legendre's Formula.

Like up to 100, the primes are 2, 3, 5 and 7, so you loop through
possibilities using 2, 3, 5 and 7, and then 2(3), 2(5), 2(6), and 3(5),
3(7) and so on until you get to 2(3)(5)(7), which drops off with the
use of floor() because it is greater than 100.

So it's still all about the floor() function.

As you get bigger and bigger x, more combinations of primes fall off
the edge you might say, and are cleared with the exact approach using
Legendre's.

However, note that because the /underlying/ model is inherently biased
toward overestimating the prime count, an error that makes your
"probabilities" smaller than you intend may actually help you. (Exercise:
prove that your expression [2] is always <= my expression [1], for all
positive x and p.)

So, of course, the easy correction is to use:

probPrime(x) = ((p_j-1)*floor(x/p_j))...*floor(x/2))/x^j

where p_j is the jth prime, where j is the number of primes up to and
including x.

Fixing my error that should be

ProbPrime(x) = ((1 - floor(x/p_j)/x)*...*(1 - floor(x/2)/x).

So, why didn't you make the obvious leap? I wonder.

You haven't been paying attention: it's not the rounding artifacts that
were the /primary/ problem in your original model. That's only the problem
you saw. The primary problem remains that the individual probabilities here
are not independent in the vicinity of x, so multiplying them together to
compute the joint probability is /inherently/ incorrect.

Nope. I proved that it is mostly remainder error by stepping through
what follows from Legendre's Formula, as the argument is trivial.

Possibly mathematicians looking for an explanation in this area thought
that the individual progabilities were entangled, but that can't be
true for many reasons where a simple explanation is that given primes
p_1 and p_2, p_1 mod p_2 can't show a preference, as if it did, the
naturals would show a preference, but for each prime they go in
lock-step, for example:

1, 2, 3 followed by 4, 5, 6 and so on

where you have 1, 2, 0 modulo 3, followed by 1, 2, 0 modulo 3, out to
infinity.

So no, there no entanglement of probabilities. That idea is just
wrong.

The correct answer can easily be found using Legendre's and noticing
that some combinations are excluded for size reasons.

Because I know that (you still don't in part because you didn't follow the
references previously given), I /know/ this approach is also doomed. I
don't have to try it to know that, same way I didn't have to try your
previous attempts to know how they'd turn out. Write a program yourself
this time, and you'll see that even the simple x/(ln(x)-1) is a much better
approximation to pi(x) as x increases, and that the ratio of pi(x) to yours
still drifts away from 1. It's probably a better approximation than you
started with (especially if you make errors that underestimate the
"probabilities" you intended to compute), and enormously better than the one
you posted at the top, but it still misses the mark.

But unlike you I want to know the correct answer--while you want what
you've been told to be true.

You are following some books.

I am figuring out what is actually happening.

If you had, you might have become world-famous, put your name in the
history books as more than just my foil, and stepped forward as a
positive contributor in this entire thing, despite what you did before,
so there was a tremendous amount of positive pressure to get the right
answer, and a world of pain to miss it.

But you missed it.

The puzzle remains and I wonder what else I can do that is that easy.
I have not found a bottom, and that is the puzzle. There should have
been a bottom.

Sorry, but in truth you don't yet have anything in this area worth having.
How about going to a library tomorrow and looking up one of the books I
referenced?

Waste of time.

Why? We had to read books to learn. Why can't you? An attempt to learn
might show that you're actually trying to understand what people with
more experience are telling you.

Dave


I've read lots of books. I prize books and learning. I've also read
books in this area.

The problem here though is that for reasons that escape me, as it
boggles my mind, mathematicians have smudged the line with primes when
it comes to question about how many primes there are in an
interval--the prime distribution--versus questions like how many twin
primes there are in an interval.

So the books are lying. Since it is so easy to explain, any objective
reader can know that the books are lying, and wonder, like me, why.

Now then, how is it obvious?

Well, the count of primes up to a given x is exactly determined by a
simple calculation using the primes up to and including the square root
of x.

For instance, to count the primes up to 24, you need only use

24 - floor(24/2) - floor(24/3) + floor(24/6) + 2 - 1

which is, you subtract the evens, from 24 and then the count of those
divisible by 3, and then you add in those divisible by 6--as they've
been subtracted twice--and then add in 2 for the primes as 2 got
subtracted with the evens and 3 got subtracted with those divisible by
3, and then you subtract one for 1, as one is not prime.

That gives you the EXACT count, and the method is perfect, for any
natural x.

In contrast, how many twin primes are there up to 24?

To be a twin prime, given an odd prime x, it must be true in that
interval that

x+2

is coprime to 3, as, of course, it will be coprime to 2, but notice,
you cannot calculate the count in the same way you could calculate the
count of primes!!!

There are TWO SYSTEMS, where one is exact and determined, not at all
random, with simple equations for counting primes, and the other is
random, so you can't calculate the number of twin primes, you have to
go check each prime, add 2 to it, and see if the result is divisible by
3.

As I've pointed out repeatedly, given primes p_1 mod p_2 it is
IMPOSSIBLE for that to show a preference for a particuar non-zero
residue!!!

If it could, then the composites--the products of the primes--would
show the SAME PREFERENCE, but in fact, the natural follow the simple
pattern:

1, 2, 3, 4, 5, and so on out to infinity.

I just explained in a couple of paragraphs how and why questions about
the prime distribution differ from areas that have to do with prime
residues modulo other primes, like with the twin primes conjecture, or
Goldbach's Conjecture.

But I doubt you'd find that explanation in ANY of the references you
mention.

My conclusion is that since this is simple, mathematicians lied. By
smearing the line, they can do research indefinitely, supporting any
number of people who are doing nothing at all positive.

They are doing nothing. They are just doing nothing at all.


James Harris

I highly doubt that so many books are wrong. I would think if so many
people say you're wrong (and may I add people more educated in
mathematics than you), you might find you are indeed wrong. How do I
know calculus or some other field of mathematics isn't flawed? I think
I'm educated enough to determine that. So far, I can't see any reason to
think anything I've been taught as a mathematician is wrong. And I'm
sure I've taken a bit more math than you have.
Dave
.

User: "Ben Newsam"

Title: Re: JSH: Prime probability remainder error, fixed 22 Aug 2006 03:05:54 AM
On 21 Aug 2006 17:36:55 -0700,
wrote:

For instance, to count the primes up to 24, you need only use

24 - floor(24/2) - floor(24/3) + floor(24/6) + 2 - 1

which is, you subtract the evens, from 24 and then the count of those
divisible by 3, and then you add in those divisible by 6--as they've
been subtracted twice--and then add in 2 for the primes as 2 got
subtracted with the evens and 3 got subtracted with those divisible by
3, and then you subtract one for 1, as one is not prime.

That gives you the EXACT count, and the method is perfect, for any
natural x.

How many primes are there up to 60, then, and how do you work that one
out?
--
Posted via a free Usenet account from http://www.teranews.com
.

User: "Tim Peters"

Title: Re: JSH: Prime probability remainder error, fixed 21 Aug 2006 08:28:51 PM
[jstevh@msn.com]

I've read lots of books. I prize books and learning. I've also read
books in this area.

That's in curious contrast to your earlier statements that you once bought
/a/ reference on prime numbers (which you also say you can't get at now).
It's also curious that you never reference any results from books or papers.
Perhaps you're exaggerating?
Whatever, since Mertens's Theorem came as a complete surprise to you, you
couldn't have done more than skim whatever books you did acquire. It's not
like you just temporarily forgot that theorem either, since it was
explicitly pointed out to you after your first post speculating about prime
probabilities, and it didn't ring a bell for you.

The problem here though is that for reasons that escape me, as it
boggles my mind, mathematicians have smudged the line with primes when
it comes to question about how many primes there are in an
interval--the prime distribution--versus questions like how many twin
primes there are in an interval.

I've given you this reference before: Brent's "The Distribution of Small
Gaps Between Successive Primes", available for the taking from:
http://wwwmaths.anu.edu.au/~brent/pd/rpb021.pdf
The theory he develops there is thoroughly conventional, and the predictions
made by the theory are in excellent agreement with observed counts of
various prime gaps in large-scale computational experiments. As I said
before:
Note that, unlike yours, these methods do /not/ require knowing
all the primes up to the square root of x first (in fact, they
don't require knowing any primes at all). Note that, as his Table 2
shows, for the case of r=6 (counting pairs s.t. p+2*r = p+12 is the
smallest prime greater than prime p), the theory he develops predicts
4460654.7 such pairs between 10^6 and 10^9, while the actual count
is 4460952.
Here's a "simple question" for you, then: what do /you/ estimate the
number of gap=12 consecutive-prime pairs to be between 10^6 and 10^9?
Can you do that at all with your approach in reasonable time? If so,
do you also get it right to 4 significant digits?
If you can find accurate methods simpler and as fast as Brent's, then
someone might care. Note that to show "accurate" you must do extensive
computational verification; hand-waving probability arguments won't
convince anyone.
So I ask again: can you do as well as Brent did? Then demonstrate it.
Your claims insult people like Brent, who did serious work and delivered
serious results.

So the books are lying.

Another possibility is that you're wrong.

... [repetition] ...
I just explained in a couple of paragraphs how and why questions about
the prime distribution differ from areas that have to do with prime
residues modulo other primes, like with the twin primes conjecture, or
Goldbach's Conjecture.

But I doubt you'd find that explanation in ANY of the references you
mention.

True. What you will find is explanations and theorems that have stood the
tests of time and extensive computational verification. You'll also find
lucid explanations for why although the Prime Number Theorem was proved more
than a century ago, Hardy & Littlewood's empirically excellent estimates
relating to patterns of primes (starting with twin primes, and of which
Brent's work above is an extension) remain unproven. It's ancient news to
mathematicians that the cases raise different issues -- which you would know
if you had actually read books in the area.
Since you clearly haven't (by any reasonable meaning of "read"), how do you
know they're "lying"? You don't. That claim is just disingenuous
"promotion" of your own ideas. Prove your ideas are actually worth
something instead, and you won't have to employ sleazy "social tactics".

... [repetition] ...

.
User: ""

Title: Re: JSH: Prime probability remainder error, fixed 21 Aug 2006 09:00:31 PM
Tim Peters wrote:

[jstevh@msn.com]

I've read lots of books. I prize books and learning. I've also read
books in this area.


That's in curious contrast to your earlier statements that you once bought
/a/ reference on prime numbers (which you also say you can't get at now).
It's also curious that you never reference any results from books or papers.
Perhaps you're exaggerating?

I have bought a reference on primes, which I bought when I was arguing
with people about my prime counting function.
I have read more books than I have bought.

Whatever, since Mertens's Theorem came as a complete surprise to you, you
couldn't have done more than skim whatever books you did acquire. It's not
like you just temporarily forgot that theorem either, since it was
explicitly pointed out to you after your first post speculating about prime
probabilities, and it didn't ring a bell for you.

That's not something that would have interested me much as I was
focusing on information related to the uniqueness of my prime counting
function.
Besides, my earlier thoughts in this area were just wrong, as I thought
of using probabilistic methods, when there is a way to get the EXACT
count, no probability required.
So it turns out that the prime distribution is not probabilistic at
all, but rigidly determined, which makes sense.

The problem here though is that for reasons that escape me, as it
boggles my mind, mathematicians have smudged the line with primes when
it comes to question about how many primes there are in an
interval--the prime distribution--versus questions like how many twin
primes there are in an interval.


I've given you this reference before: Brent's "The Distribution of Small
Gaps Between Successive Primes", available for the taking from:

http://wwwmaths.anu.edu.au/~brent/pd/rpb021.pdf

The theory he develops there is thoroughly conventional, and the predictions
made by the theory are in excellent agreement with observed counts of
various prime gaps in large-scale computational experiments. As I said
before:

I looked at the link and saw the tell-tale (p-2)/(p-1), which is the
probability given a prime x that a different prime p is NOT a factor of
x.
Besides, once you know that prime residues modulo other primes are
random, you know you have to use probability and statistics.
So that's it.
You claim to be studying meterology, so you should know something about
probability and statistics.
Systems that have random behavior, require probabilistic methods.

Note that, unlike yours, these methods do /not/ require knowing
all the primes up to the square root of x first (in fact, they
don't require knowing any primes at all). Note that, as his Table 2
shows, for the case of r=6 (counting pairs s.t. p+2*r = p+12 is the
smallest prime greater than prime p), the theory he develops predicts
4460654.7 such pairs between 10^6 and 10^9, while the actual count
is 4460952.

Here's a "simple question" for you, then: what do /you/ estimate the
number of gap=12 consecutive-prime pairs to be between 10^6 and 10^9?
Can you do that at all with your approach in reasonable time? If so,
do you also get it right to 4 significant digits?

I'll defer on doing the calculation as once you figure out that the
prime count itself can be calculated with simple equations, but the
count of twin primes cannot be, and realize that primes have no
preference for a particular residue modulo another prime, then you know
you have a probabilistic system.

If you can find accurate methods simpler and as fast as Brent's, then
someone might care. Note that to show "accurate" you must do extensive
computational verification; hand-waving probability arguments won't
convince anyone.

It's not about convincing people, it's about what's true.
Now the physics people should be wondering how there is a debate here,
as if primes have this random behavior, then of course, they are part
of a random system and you have to use probability and statistics.
The problem though is that either mathematicians are in denial, or they
can't quite figure that out!
I like
p_1 mod p_2
as an example of the point that the residue of p_1 modulo p_2 can't
show a preference, like it can't tend towards 1, as if it did the
naturals would show that preference, but for any prime p, 1/p of the
naturals will have that prime as a factor.
Like saying that half of the naturals are even, where if infinity bugs
you there, say that half within 1 of naturals up to any natural x will
be even.
The count of primes can be calculated with some simple equations.
The gap between primes is random.

So I ask again: can you do as well as Brent did? Then demonstrate it.
Your claims insult people like Brent, who did serious work and delivered
serious results.

It's not about feelings here.
This information is basic.
If primes are random in this particular way then their behavior can
ONLY be described by probability.
Astute readers who check will keep finding (p-2)/(p-1) showing up in
literature on prime gaps because that's the probability given a prime x
that x does NOT have a prime p as a factor.
It's not even hard when you are objective about it.

So the books are lying.


Another possibility is that you're wrong.

Then point to an error.
I want to emphasize to any people who might be listening in on
sci.physics that this recalcitrant behavior in the face of simplicity
is common with math people.
It's like, they have these approaches they love that don't work, and
they will argue and argue around the reasons, and then just go back to
whatever they were doing.
But anyone who knows even the basics of probability and statistics,
once they accept that argument that prime gaps have to be random,
understand that probabilistic methods govern.
Prime gaps are perfectly random.

... [repetition] ...


I just explained in a couple of paragraphs how and why questions about
the prime distribution differ from areas that have to do with prime
residues modulo other primes, like with the twin primes conjecture, or
Goldbach's Conjecture.

But I doubt you'd find that explanation in ANY of the references you
mention.


True. What you will find is explanations and theorems that have stood the
tests of time and extensive computational verification. You'll also find
lucid explanations for why although the Prime Number Theorem was proved more
than a century ago, Hardy & Littlewood's empirically excellent estimates
relating to patterns of primes (starting with twin primes, and of which
Brent's work above is an extension) remain unproven. It's ancient news to
mathematicians that the cases raise different issues -- which you would know
if you had actually read books in the area.

Yet if you are objective you will see (p-2)/(p-1) in those texts,
showing the connection to the probability.
And if you are objective the simple argument that primes are random in
this particular area, is obvious.
Now the prime distribution is NOT random, as you can get a count of
prime up to some natural x by some simple equations, so you have two
systems, where two approaches must be used.
What works with the prime distribution cannot work with questions in
areas where randomness rules.

Since you clearly haven't (by any reasonable meaning of "read"), how do you
know they're "lying"? You don't. That claim is just disingenuous
"promotion" of your own ideas. Prove your ideas are actually worth
something instead, and you won't have to employ sleazy "social tactics".

... [repetition] ...

My position relies on just a few logical points.
Worse, objective looking shows probabilistic methods jumping out at you
in the mathematical literature on twin primes as you can just see
(p-2)/(p-1) all over the place.
Denial doesn't change the reality, but the political consequences are
HUGE.
The twin primes conjecture can only be proven using probability theory.
Goldbach's conjecture must be false by those same methods.
No research not relying on probabilistic methods is worth a damn in
this area.
James Harris
.
User: "David Moran"

Title: Re: JSH: Prime probability remainder error, fixed 21 Aug 2006 09:07:09 PM


You claim to be studying meterology, so you should know something about
probability and statistics.

I do. It was required for both my degree in math and my degree in
meteorology.
Dave
.
User: ""

Title: Re: JSH: Prime probability remainder error, fixed 21 Aug 2006 09:10:06 PM
David Moran wrote:


You claim to be studying meterology, so you should know something about
probability and statistics.


I do. It was required for both my degree in math and my degree in
meteorology.

Dave

Harris Integral introduced and developed, Harris H1 space, Harris
Hypothesis, etc >>
http://sciphysicsopenmanuscript.blogspot.com/
http://sciphysicsopenmanuscript.blogspot.com/
http://sciphysicsopenmanuscript.blogspot.com/
.


User: "Tim Peters"

Title: Re: JSH: Prime probability remainder error, fixed 22 Aug 2006 12:34:01 AM
[jstevh@msn.com]

I've read lots of books. I prize books and learning. I've also read
books in this area.

[Tim Peters]

That's in curious contrast to your earlier statements that you once
bought
/a/ reference on prime numbers (which you also say you can't get at now).
It's also curious that you never reference any results from books or
papers. Perhaps you're exaggerating?

[jstevh@msn.com]

I have bought a reference on primes, which I bought when I was arguing
with people about my prime counting function.

I have read more books than I have bought.

See below.

Whatever, since Mertens's Theorem came as a complete surprise to you, you
couldn't have done more than skim whatever books you did acquire. It's
not like you just temporarily forgot that theorem either, since it was
explicitly pointed out to you after your first post speculating about
prime probabilities, and it didn't ring a bell for you.

That's not something that would have interested me much as I was
focusing on information related to the uniqueness of my prime counting
function.

So you perhaps skimmed the book searching for "debating points" wrt a
specific issue, but didn't study the topic as a whole -- and you haven't
looked at the book since then, so haven't studied anything about the claims
you're /currently/ making.

Besides, my earlier thoughts in this area were just wrong,

Which you would have known before starting (as several on sci.math told you)
had you studied before pontificating.

as I thought of using probabilistic methods, when there is a way to get
the EXACT count, no probability required.

Except there's no efficient way known to get the exact count, so that the
exact formulas are useless for many purposes. Serious researchers want
something more than a theoretical answer that can't be computed (and serious
researchers have discovered much more than that too).

So it turns out that the prime distribution is not probabilistic at
all, but rigidly determined, which makes sense.

The truth isn't that simple. /Correct/ probabilistic methods are used with
great success in number theory, despite the obvious truth that the primes
are wholly determined. For more on that, read a book.

The problem here though is that for reasons that escape me, as it
boggles my mind, mathematicians have smudged the line with primes when
it comes to question about how many primes there are in an
interval--the prime distribution--versus questions like how many twin
primes there are in an interval.

I've given you this reference before: Brent's "The Distribution of Small
Gaps Between Successive Primes", available for the taking from:

http://wwwmaths.anu.edu.au/~brent/pd/rpb021.pdf

The theory he develops there is thoroughly conventional, and the
predictions made by the theory are in excellent agreement with observed
counts of various prime gaps in large-scale computational experiments.
As I said before:

I looked at the link and saw the tell-tale (p-2)/(p-1),

What of it?

which is the probability given a prime x that a different prime p is
NOT a factor of x.

Given a prime x it's certain that no other prime divides x, by the
definition of "prime" (a prime has no positive integer divisors other than 1
and x): the probability that a different prime p divides prime x is 0, not
(p-2)/(p-1).

Besides, once you know that prime residues modulo other primes are
random,

You're potentially making the same mistake you made last time: while the
primes are /asymptotically/ equidistributed among the non-zero residue
classes of any given prime p, it doesn't follow that the probabilities are
also independent across /relatively small finite ranges you care about/. If
you want to rely on that, you need to prove it first. You can prove it
easily for p=2. You'll almost certainly fail if you try to prove it for
p=3.

you know you have to use probability and statistics.

So that's it.

You claim to be studying meterology,

Not me, no. Do you?

so you should know something about probability and statistics.

It so happens that I do anyway. Do you?

Systems that have random behavior, require probabilistic methods.

Pretty vague there, James ;-)

Note that, unlike yours, these methods do /not/ require knowing
all the primes up to the square root of x first (in fact, they
don't require knowing any primes at all). Note that, as his Table 2
shows, for the case of r=6 (counting pairs s.t. p+2*r = p+12 is the
smallest prime greater than prime p), the theory he develops predicts
4460654.7 such pairs between 10^6 and 10^9, while the actual count
is 4460952.

Here's a "simple question" for you, then: what do /you/ estimate the
number of gap=12 consecutive-prime pairs to be between 10^6 and 10^9?
Can you do that at all with your approach in reasonable time? If so,
do you also get it right to 4 significant digits?

I'll defer on doing the calculation as once you figure out that the
prime count itself can be calculated with simple equations,

Not efficiently. It can be approximated efficiently.

but the count of twin primes cannot be,

Hardy & Littlewood's conjecture offers an efficient way to approximate that
count too, and has been computationally verified. Whether there exist
"simple equations" to compute the exact count depends on how you define
"simple equations".
For example, the exact count of twin prime pairs whose smaller member is <=
x = the sum of pi(p+2)-pi(p) across all prime p <= x. If you insist on
calling Legendre's formula for pi(x) a "simple equation", then you'd look
pretty silly trying to claim that just adding a bunch of pi(i) terms
together is suddenly /not/ a "simple equation". It's simple and exact, but
computationally intractable, same as pi(x) itself.

and realize that primes have no preference for a particular residue
modulo another prime,

See above for cautions about leaping to wrong conclusions based on assuming
that asymptotic ("in the large") independence also holds "in the small".
You've already demonstrated a blind spot wrt that about the size of
Jupiter's spot ;-)

then you know you have a probabilistic system.

Hardy & Littlewood's twin-prime conjecture is sometimes explained in
probabilistic terms, but H&L themselves didn't argue that way.

If you can find accurate methods simpler and as fast as Brent's, then
someone might care. Note that to show "accurate" you must do
extensive computational verification; hand-waving probability
arguments won't convince anyone.

It's not about convincing people, it's about what's true.

To put it less kindly, your "hand-waving probability arguments" aren't
proofs, and you've shown no ability so far to even /approach/ a correct
probability proof. Your writing about probability is hopelessly sloppy.

Now the physics people should be wondering how there is a debate here,

There isn't in reality. There's you versus people who have studied the
topic, and, as above, you decline to even try to present evidence.

as if primes have this random behavior, then of course, they are part
of a random system and you have to use probability and statistics.

So how /did/ H&L come up