how do I calculate probability
This is too general a question to be answered briefly here.
Provide a specific example of the sort of probabilistic problems you want to solve.
.