private double getEntropy(List<Example> exampleCollection) {
		double positiveExampleCount = 0;
		double negativeExampleCount = 0;
		double q;

		for (Example e : exampleCollection) {
			if (e.getWinner() == 1) {
				positiveExampleCount++;
			} else {
				negativeExampleCount++;
			}
		}

		if (!((positiveExampleCount + negativeExampleCount) == 0)) {
			q = positiveExampleCount
					/ (positiveExampleCount + negativeExampleCount);
		} else {
			q = 1;
		}

		// make q not zero but very small for the sake of correctly carrying out
		// logarithmic calculations

		if (q == 0) {
			q = 0.01;
		} else if (q == 1) {
			q = 0.99;
		}

		double entropy = -(q * (Math.log(q) / Math.log(2)) + (1 - q)
				* (Math.log(1 - q) / Math.log(2)));
		return entropy;
	}