Implementation of pairWise test of Problem2