Wednesday, March 04, 2015

My prime counting confidence booster

Mathematical discovery can give you confidence boosters impossible for anyone to remove, like one of my favorites is MY prime number counting function in its sieve form.

Where pj is the jth prime:

P(x,n) = x - 1 - sum for j=1 to n of {P([x/pj],j-1) - (j-1)}

That summation will count primes if you make sure n equals the count of primes up to sqrt(x), but no higher. And it is integers only in there. I'm using the bracket form of the floor() function so for instance [10/3] = 3.

And an example of what it gives is P(100,4) = 25.

Which is the count of primes up to 100, where there are 25. And in its sieve form it needs to be given the primes up to sqrt(100) = 10, and there are 4 of them.

And those primes are: 2, 3, 5 and 7.

It needs those same primes up until 121, so they will count up to 120.

That's using the form where it needs to be told the primes up to sqrt(x), but you can fully mathematicize it into a form where it finds them on its own. But that slows it down and it looks a little more complicated.

Turns out you cannot express a prime number counting function as simply that works as fast.

What I said there is very specific and highly checkable.

For instance, you can write a computer program implementing it, and do timing tests, as well as check lines of code needed versus any other algorithms for counting primes.

It's the best by those criteria ever found which is verifiable by objective measures.

That's one of the best things about mathematics, of course, the ability to check! Opinions? Not needed.

Which is the kind of thing that can make me feel better if things get me down.

It's also great for figuring out social stuff, as everything I've written here is true, and the harder thing is accepting that I can confidently claim to have one of the greatest finds in mathematical history. It just feels wrong to admit it. I work at that feeling.

But how other people react, what they believe? Now that's another subject entirely.

I think some people rely more on community than facts: trusting that if enough people believe something it must be true.

That's why reality testing is so important.

And that's just one of my mathematical confidence boosters. It is not my greatest discovery either.

Which raises that question, what makes a mathematical discovery "great"?

In this case it's an assertion based entirely on merit: simpler, fastest for its size, smaller, does more.

Each of those assertions--checkable.

Nothing else for counting prime numbers is even close when objectively compared.


James Harris

No comments: