SMS: Fundamentals of pattern recognition