Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Just to be clear, I don't think this should be question better suited for 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?

share|improve this question
Have a look at automated regression analysis using genetic algorithms. – rmx Jan 13 '11 at 12:41
How would a genetic algorithm encompass alleles when you don't know what they are? I don't suppose you could provide a more detailed picture of what automated regression analysis does, could you? – Neil Jan 13 '11 at 13:20
up vote 2 down vote accepted

This is called "Pattern Recognition" and is an area of active AI research. Lots of folks do this.

Here, for example, are a bunch of papers on one aspect of this called "Plan Recognition", which is what you're talking about. Software which follows and anticipates what you're doing.

share|improve this answer
Surely what I'm looking for lies on one of the pages you've listed or on a hyperlink of one of those pages. Though I was really hoping I could get a better understanding without being led to a page with formulas. Have you done a program like this before? If so, I would sincerely appreciate your perspective on the subject. – Neil Jan 13 '11 at 13:18
@Neil: Sorry. It actually is complicated. There's no royal road to plan recognition. – S.Lott Jan 13 '11 at 14:03
@Neil: Serious AI is hard. – Paul Nathan Jan 13 '11 at 17:19
If I thought it were easy, I wouldn't be asking you guys. Though I suppose it's a place to start. Thank you for your contribution. :) – Neil Jan 13 '11 at 17:29

Your Answer


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.