7

Let's say I want a formula that takes any number and makes it into 170, and I come up with a formula that I think does it. If I plug 1 into it, 2 into it, 3 into it, etc. up to a pretty large number and it works, can I call the formula proven?

10 Answers10

6

No. Consider the famous quadratic polynomial $$ P(n) = n^2+n+41 $$ that Euler first noticed in 1772. Does this polynomial generate all prime numbers? Try plugging in any natural number less than $40$ and you may be convinced, but ah...what about when you plug in $n=40$? Sad day.

  • 2
    In fact, it should be obvious that it fails to always be prime, as $41\mid P\left(41\right)$. – Brian May 06 '15 at 01:08
  • And by that same argument there isn't a polynomial which can produce all primes. – hjhjhj57 May 06 '15 at 21:40
  • @BrianScholl Yes, that is what I noticed immediately too--it is interesting, though, that it fails for $n=40$ first, but you are quite right that failing for $n=41$ should be rather obvious. – Daniel W. Farlow May 06 '15 at 21:49
2

If you know enough about the structure your function (ex. that it is a polynomial of some fixed degree n), then knowing a large number of points may be enough to determine it.

For example, perhaps my function is of the form $f(x) = ax^2 + bx + c$, and I know $f(0) = 0$, $f(1) = 0$, $f(2) = 0$. Then this enough to determine $f$ by algebraically solving for the coefficients a, b and c.

However, by allowing the degree of the polynomial to be large, we could write down infinitely many polynomial functions taking the same values on a finite set of points. So in general one really has to know a lot to determine a function by testing a few values.

Elle Najt
  • 20,740
1

No. It quite fits the classic joke about the physicists, for whom that would be enough to call it proved, against the mathematicians which need a complete proof.

There are some nice examples (i'll try to recall them asap) of such formulas which are correct for billions of consequitive natural numbers, yet fail at some point.

A (but not only) correct way of proving such formula (assuming you are interested in a proof for all natural numbers, but not more) is mathematical induction - you should read about it.

A more general concept is transfinite induction that can help prove such formulas for any well-ordered set.

1

No, it is never enough to check a number of examples, unless of course there are a finite number of cases. Check out this previous question for many examples of exactly this problem.

Eff
  • 12,989
1

This remind me of an old joke that "how academics prove all odd numbers are primes", where part of the joke say a statistician prove the statement by "'randomly' choose 47, which is prime; choose 89, which is prime, choose 101, which is prime. Therefore all odd numbers are primes".

Applying many cases to see whether they work is a common start. This gives you evidence that "probably this statement is true". Also applying some cases may provide you some ideas about how a statement can be proved. Notice the word "probably", maybe you tried hard, but it is possible that you have bad luck. For example, Fermat number. Fermat found that first 5 numbers of the sequences are prime. At his era, it was a hard work without the help of computer. However, the 6$^\text{th}$ one is not prime.

However, I believe your intuition still has some value. Somehow your idea has some relation with mathematical induction. If you simply apply $1,2,3,\dots$, you cannot do this infinite times. However, induction is like you want to show that you can go to any step of an infinite stair. First you prove that you can go to the first step. Then you prove that if you are at $n$th step, you can make one more move and go to the next step. Therefore you can go to any stair. This analogy is not very rigorous, (if an analogy is perfect, why do we need definition?) but I believe it intuitively works very well.

Hope this can help you.

MonkeyKing
  • 3,178
1

No, it's not, because in some cases the pattern might fail precisely after the point you stop looking. The pattern might also fail where you fail to look. Given $n \in \mathbb{Z}$, consider this function: $$f(n) = \lfloor \sin n \rfloor + \left\lceil \frac{n \pmod 6}{2} \right\rceil - \delta_0^{n \pmod 3} + 13^2.$$ (Here $n$ is assumed to be radians, and $\delta$ is the infamous Kronecker delta function). This works for $0 < n < 5$. It also works for $n = 10^7$. But $f(5) = 172$. In fact, $f(n)$ fluctuates around 170.

Here's a much simpler one: $f(x) = x^0 + 13^2$. As long as $x \neq 0$, we'll have $f(x) = 170$. It should be relatively easy to prove this is true without having to go through the calculations with any specific value of $x$.

Remember: a single counterexample is enough to disprove, but a trillion examples are not enough to prove.

Robert Soupe
  • 14,663
  • 2
    The user doesn't know what induction is but we've introduced the Kronecker delta function, radians, modulus, and trig functions to demonstrate basic logic... doesn't seem like a very good example – en_Knight May 06 '15 at 03:55
  • 1
    @en_Knight A downvote might be in order. I will upvote if you come up with a simpler function that delivers 170 for a wider but finite range of values. – Robert Soupe May 06 '15 at 12:19
1

A mathematician will say what he means and will mean what he says. If he says "this formula maps all natural numbers to 170" then it means that the mathematician can prove that the formula maps /all natural numbers/ to 170.

As another example, when a mathematician says "there is no general formula for the solution of an arbitrary fifth degree polynomial" he doesn't mean that "we haven't found one yet." It means that he can prove that the thing does not exist.

We never present any claims as true unless we can prove it in mathematics, that is, prove /exactly what we said/ from deductive logic.

1

Here's a very contrived example: $$f(n) = \Big\lfloor \frac{\pi(n)}{10^7} \Big\rfloor + 170,$$ where $\pi(x)$ is the prime counting function. You'd have to go above $n = 179424672$ to find a counterexample. Of course "$f(n) = 170$ always" is easy enough to disprove if you know that there are infinitely many prime numbers, so it requires very little actual computation to disprove.

Bob Happ
  • 582
1

You can think of this probabilistically. Let's say I want to test a hypothesis (you can think of any real world example, such as drug testings) and I want to make sure that I'm right in at least $p\% > 0$ cases to be satisfied. But, if I have some statement about natural numbers (or some infinite subset of natural numbers) and I check it to be true for all the numbers lesser than some large $n$, I am still $0\%$ sure my statement is correct since $\frac n \infty = 0$. No matter how many different numbers you check, ultimately you didn't catch even a tiny fraction. That is why we use deductive reasoning in mathematics, not empirical experiments.

Ennar
  • 23,082
  • When you divide by infinity what you "are really talking about a limiting process in which the denominator is going towards infinity." http://tutorial.math.lamar.edu/Classes/CalcI/TypesOfInfinity.aspx Still I'm upvoting. – Robert Soupe May 07 '15 at 03:08
  • 1
    @Robert Soupe Yes, I'm aware, of course, I was just assuming OP might be lesser introduced in the formalism. To be precise, we can write it down as $\lim_{k\to\infty} \frac{\mu n}{\mu k}$ where $\mu$ is the counting measure. – Ennar May 07 '15 at 04:29
  • 1
    This got me thinking about probability measures on natural numbers. I naturally thought about something like $P(A) = \lim_{n\to\infty}\frac{\mu(A\cap n)}{\mu{n}}$ where $\mu$ is the counting measure and $n = { 0, 1,\ldots , n -1 }$, but this is not $\sigma$-additive. There is interesting post about this by Qiaochu Yuan. – Ennar May 07 '15 at 12:24
0

No you can't... A classical example of such mistake:

3,5,7 are prime numbers and so every odd number is prime

See also this question for much more counter-examples.

Surb
  • 55,662