Design DP for optimal BST given key probabilities
Given sorted unique keys and one nonnegative successful-search probability for each key, design dynamic programming that returns the minimum expected number of comparisons. Probabilities must sum to 1. A key at the root has depth 1, so a key at depth d contributes d times its probability. Unsuccessful searches are not modeled.