I recently had to create a bail predictor for work in order to save our underwriters time on finding out exactly what the bail amount is going to be for any given charge. I admit that I took the easy way out on the pattern recognition search algorithm by using exponents, but in the process I discovered something that may be useful in the future. What I did was take an input (like "pattern"), look at its length, and then calculate the length of the input as well as all of the patterns within the input. The recursive math looks something like this. Pattern(length of 7) 7 6,6 5,5,5,5 4,4,4,4,