How would you tackle a pattern-finding program?

Posted by Neil on Programmers See other posts from Programmers or by Neil
Published on 2011-01-13T10:15:38Z Indexed on 2011/01/13 10:59 UTC
Read the original article Hit count: 164

Filed under:
|

Just to be clear, I don't think this should be question better suited for stackoverflow.com simply because there's not a single answer but a wide range of possible solutions, making this question far more subjective in nature.

I was curious how you guys would tackle a pattern-finding program, which is to say I'd do the following operations:

  1. I enter in some input.
  2. Program predicts my next input based on all previous inputs.
  3. Rinse. Repeat.

Since the amount of input I could provide is so varied, including empty strings, conventional means such as switches or regular expressions are out, since it would require you to have an inkling of information about what to expect.

I was thinking about some form of genetic algorithm, yet even then I don't have a clue as to how to approach a problem of this caliber. I think some feedback mechanism would be necessary as well as to let the program know how close it was.

Anyone had to do a similar type program before?

© Programmers or respective owner

Related posts about algorithms

Related posts about problem-solving