Foundations of Discrete Mathematics with Algorithms and Programming