modified sample_null for independence test