Basic algorithms in pattern recognition and machine learning