Determination of the joint probability of a collection of binary random variables: applications to risk measurement