Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Which methods I can use to predict next number from a series of numbers ?

I know the min & max possible number in advance.

share|improve this question
3  
Any method that works. –  copper.hat May 14 '12 at 6:49
12  
Plug your sequence (if it is composed of integers) here =) –  Artem May 14 '12 at 6:55
5  
Know the person who asked the question well enough to guess. Mathematically, there isn't really a right answer. –  Alex Becker May 14 '12 at 6:55
3  
The hard copy of the Encyclopedia of Integer Sequences had a long introductory part in which methods were discussed. So far as I can see, that part did not make it into the online encyclopedia. –  Gerry Myerson May 14 '12 at 7:22
10  
@mixedmath et al, I object to the closure of this as "not a real question." When a sequence comes up in real life, there are useful methods for trying to work out the rule behind it and then working out more terms. Just because most of the commenters have gone for the easy "it coould be anything!" reply doesn't mean good replies more in the spirit of the question are impossible. –  Gerry Myerson May 15 '12 at 0:46

3 Answers 3

up vote 20 down vote accepted

Nowadays, the #1 method for predicting the next number from a sequence (assuming the sequence has come up in a "natural" way) is to look it up in the Online Encyclopedia of Integer Sequences. In his 1973 book, A Handbook of Integer Sequences, Sloane gives some suggestions as to what to do if your sequence is not in the Encyclopedia/Handbook. These include,

  1. Add or subtract 1 or 2 from all the terms, and try looking it up again;

  2. Multiply all the terms by 2, or divide by any common factor, and try looking it up again;

  3. Look for a recurrence.

Sloane elaborates on this last suggestion. He mentions the method of differences, where you replace the sequence $a_0,a_1,\dots$ with $a_1-a_0,a_2-a_1,\dots$ and, if necessary, repeat the differencing, until you get something with an obvious pattern. Of course, then you have to know what to do with a recurrence once you have one, but that's another story.

Sloane also says that if a sequence is close to a known sequence, you can try subtracting off the known sequence, and then dealing with the residual by one of the above methods.

If the ratios $a_{n+1}/a_n$ seem to be close to a recognizable sequence $r_n$, then look at the sequence given by $a_{n+1}-r_na_n$.

Factoring the numbers in a sequence, or in a sequence close to the given sequence, will often give a clue as to what is going on.

For examples of all these principles (and others that I haven't mentioned) in operation, I refer you to the Handbook.

share|improve this answer

One possibility is to use Maple's gfun package to guess a generating function. See http://algo.inria.fr/libraries/papers/gfun.html

share|improve this answer
    
Indeed, if someone asks "Which methods I can use", pointing to the actual software is highly reasonable. There is also a guessing package in FriCAS, though I've never used it. The documentation seems to be in FriCAS itself, so I can't point to a webpage with the description. No doubt there is something of that kind for Mathematica too. –  Yrogirg May 16 '12 at 10:07
2  
@Yrogirg: Sure, Mathematica has InterpolatingPolynomial[], FindSequenceFunction[], and FindLinearRecurrence[], among other things... –  J. M. May 16 '12 at 10:44

As for the software, from Christian Krattenthaler's home page:

If you need to guess sequences of numbers very often, then my Mathematica "guessing machine" RATE (which has now become part of Neil Sloane's Encyclopedia of Integer Sequences) may be useful for you. The Maple implementation by François Béraud and Bruno Gauthier is called GUESS. A Maxima implementation, DEVINE, written by Martin Rubey, is also available. The Axiom guessing package Guess, also written by Martin Rubey, is even more powerful as its range of detected formulas is larger.

For the hyperlinks to packages go to the page itslef. As for the Guess package it is present in FriCAS too and there were changes to it during the past year.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.