Discrepancy theory