subsetsContainingGivenState function definition