Beginner's Discrete Mathematics Course π
Learn discrete math essentials for IT, machine learning, and query optimization in this beginner-friendly course.

freeCodeCamp.org
86.9K views β’ Nov 13, 2025

About this video
Learn discrete mathematics in this beginner's course. Discrete mathematics plays a key role in IT solutions, used in machine learning, accelerating queries in search engines and databases, in algorithms such as finding the shortest paths (graph theory), encryption, compression, and many other modern systems/solutions.
This field is constantly evolving along with the development of its key application: computer science. This course is an introduction to this group of mathematical sciences, and we will focus on the most important issues on which other branches of discrete mathematics are based: combinatorics, number theory, prime numbers, and several selected topics: pigeonhole principle, stars and bars principle, Stirling's number, and the Chinese remainder theorem. At the end of the course, there are tips and encouragement for further exploration of this field.
Karol Kurek teaches this course. He is a former math teacher and senior Python developer.
π Course resources: https://github.com/Redysz/Discrete-Mathematics/tree/main
Contact: http://karolkurek.pl
YT Channel: http://youtube.com/@TwoWaysMath
Support: http://buymeacoffee.com/karol_kurek
βοΈ Contents βοΈ
- 00:00:00 Introduction to Discrete Mathematics
- 00:05:20 Permutations: Definition and Examples
- 00:08:27 Applications of Permutations
- 00:10:14 Cycles and Multiset Permutations
- 00:13:13 Counting Permutations: The Formulas
- 00:19:12 Permutations in Python with itertools
- 00:25:18 Custom Python Function for Counting Permutations
- 00:33:23 Heap's Algorithm
- 00:40:59 K-Permutations and K-Tuples
- 00:46:08 The Rule of Product
- 00:53:35 The Rule of Sum
- 00:54:25 Exercises: Rule of Product & Sum
- 01:14:11 The Inclusion-Exclusion Principle
- 01:26:52 Exercises: Inclusion-Exclusion Principle
- 01:44:36 Mathematical Notations (Sigma & Pi)
- 02:30:28 Equinumerosity & Countable Sets
- 03:00:47 Proving Rational Numbers are Countable
- 03:09:16 Prime Numbers & Sieve of Eratosthenes
- 03:27:33 Prime Number Generation in Python
- 03:40:43 Advanced Properties of Prime Numbers
- 03:58:30 GCD & LCM (Greatest Common Divisor & Least Common Multiple)
- 04:22:53 Co-prime Numbers
- 04:29:30 Congruences (Modular Arithmetic)
- 05:00:53 Binomial Coefficients & Pascal's Triangle
- 05:11:11 Combinations
- 05:40:43 Solving a Complex Combinatorics Problem
- 05:51:53 Stirling Numbers
- 06:53:52 Bell Numbers
- 07:00:00 The Chinese Remainder Theorem
- 07:22:16 Conclusion & What's Next
β€οΈ Support for this channel comes from our friends at Scrimba β the coding platform that's reinvented interactive learning: https://scrimba.com/freecodecamp
π Thanks to our Champion and Sponsor supporters:
πΎ Drake Milly
πΎ Ulises Moralez
πΎ Goddard Tan
πΎ David MG
πΎ Matthew Springman
πΎ Claudio
πΎ Oscar R.
πΎ jedi-or-sith
πΎ Nattira Maneerat
πΎ Justin Hual
--
Learn to code for free and get a developer job: https://www.freecodecamp.org
Read hundreds of articles on programming: https://freecodecamp.org/news
This field is constantly evolving along with the development of its key application: computer science. This course is an introduction to this group of mathematical sciences, and we will focus on the most important issues on which other branches of discrete mathematics are based: combinatorics, number theory, prime numbers, and several selected topics: pigeonhole principle, stars and bars principle, Stirling's number, and the Chinese remainder theorem. At the end of the course, there are tips and encouragement for further exploration of this field.
Karol Kurek teaches this course. He is a former math teacher and senior Python developer.
π Course resources: https://github.com/Redysz/Discrete-Mathematics/tree/main
Contact: http://karolkurek.pl
YT Channel: http://youtube.com/@TwoWaysMath
Support: http://buymeacoffee.com/karol_kurek
βοΈ Contents βοΈ
- 00:00:00 Introduction to Discrete Mathematics
- 00:05:20 Permutations: Definition and Examples
- 00:08:27 Applications of Permutations
- 00:10:14 Cycles and Multiset Permutations
- 00:13:13 Counting Permutations: The Formulas
- 00:19:12 Permutations in Python with itertools
- 00:25:18 Custom Python Function for Counting Permutations
- 00:33:23 Heap's Algorithm
- 00:40:59 K-Permutations and K-Tuples
- 00:46:08 The Rule of Product
- 00:53:35 The Rule of Sum
- 00:54:25 Exercises: Rule of Product & Sum
- 01:14:11 The Inclusion-Exclusion Principle
- 01:26:52 Exercises: Inclusion-Exclusion Principle
- 01:44:36 Mathematical Notations (Sigma & Pi)
- 02:30:28 Equinumerosity & Countable Sets
- 03:00:47 Proving Rational Numbers are Countable
- 03:09:16 Prime Numbers & Sieve of Eratosthenes
- 03:27:33 Prime Number Generation in Python
- 03:40:43 Advanced Properties of Prime Numbers
- 03:58:30 GCD & LCM (Greatest Common Divisor & Least Common Multiple)
- 04:22:53 Co-prime Numbers
- 04:29:30 Congruences (Modular Arithmetic)
- 05:00:53 Binomial Coefficients & Pascal's Triangle
- 05:11:11 Combinations
- 05:40:43 Solving a Complex Combinatorics Problem
- 05:51:53 Stirling Numbers
- 06:53:52 Bell Numbers
- 07:00:00 The Chinese Remainder Theorem
- 07:22:16 Conclusion & What's Next
β€οΈ Support for this channel comes from our friends at Scrimba β the coding platform that's reinvented interactive learning: https://scrimba.com/freecodecamp
π Thanks to our Champion and Sponsor supporters:
πΎ Drake Milly
πΎ Ulises Moralez
πΎ Goddard Tan
πΎ David MG
πΎ Matthew Springman
πΎ Claudio
πΎ Oscar R.
πΎ jedi-or-sith
πΎ Nattira Maneerat
πΎ Justin Hual
--
Learn to code for free and get a developer job: https://www.freecodecamp.org
Read hundreds of articles on programming: https://freecodecamp.org/news
Video Information
Views
86.9K
Likes
3.0K
Duration
09:05:36
Published
Nov 13, 2025
User Reviews
4.7
(17) Related Trending Topics
LIVE TRENDSRelated trending topics. Click any trend to explore more videos.