question: public static int expectedSizeOfProbabilityTable ( RandomVariable ... vars ) { int expectedSizeOfDistribution = 1 ; if ( null != vars ) { for ( RandomVariable rv : vars ) { if ( ! ( rv . getDomain ( ) instanceof FiniteDomain ) ) { throw new IllegalArgumentException ( "Cannot have an infinite domain for a variable in this calculation:" + rv ) ; } FiniteDomain d = ( FiniteDomain ) rv . getDomain ( ) ; expectedSizeOfDistribution *= d . size ( ) ; } } return expectedSizeOfDistribution ; }
target:  Calculated the expected size of a ProbabilityTable for the provided random variables.