Calculate probabilities from tree diagram (#758)