new functions: expectation, entropy, KL divergence

I've written some new functions.