SMS: Probability and algorithms