I am using the AnyDice website to calculate probabilities on any number of dice with any arbitrary number of sides. May I please have a link to a formal discussion of this very elegant subject?
There have been hundreds of books written on this topic, and there's even a whole branch of mathematics called Probability that studies this in detail.
This following link discusses the theorems behind it very clearly, written in formal mathematical language: http://mathworld.wolfram.com/Dice.html
This essay specifically looks at how dice are used in RPGs and how to calculate probabilities for them. It might be more helpful than some other resources because it is written with a focus on RPGs.
This playlist on YouTube has some good video tutorials on probability theory.