static applyMaskPenaltyRule4(matrix) {
			let numDarkCells = 0;
			const array = matrix.getArray();
			const width = matrix.getWidth();
			const height = matrix.getHeight();
			for (let y = 0; y < height; y++) {
				const arrayY = array[y];
				for (let x = 0; x < width; x++) {
					if (arrayY[x] === 1) {
						numDarkCells++;
					}
				}
			}
			const numTotalCells = matrix.getHeight() * matrix.getWidth();
			const fivePercentVariances = Math.floor(Math.abs(numDarkCells * 2 - numTotalCells) * 10 / numTotalCells);
			return fivePercentVariances * MaskUtil.N4;
		}
Apply mask penalty rule 4 and return the penalty. Calculate the ratio of dark cells and give
penalty if the ratio is far from 50%. It gives 10 penalty for 5% distance.