Counting and calculating probabilities