Statistics for Exploiting Structure in Backtracking Algorithms for Propositional and Probabilistic Reasoning