debugged test for joint probability sampling