private static double calculateResemblance(int[] MA, int[] MB, int b) {
		int m = 1 << b; // m = 2^b
		
		int[] MAuB = new int[m];
		for (int i = 0; i < m; i++)
		    MAuB[i] = Math.max(MA[i], MB[i]);
		
		// Compute the number of k-shingles
		double SA = HyperLogLog.hyperLogLog(MA);
		double SB = HyperLogLog.hyperLogLog(MB);
		
		// Compute the resemblance
		double SAuB = HyperLogLog.hyperLogLog(MAuB);
		double SAnB = SA + SB - SAuB;
		
		return SAnB / SAuB;
    }