computes prior and conditional probabilities