Udemy
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Discrete Math for CS and AI, Seen and Solved Step by Step
New

Discrete Math for CS and AI, Seen and Solved Step by Step

Logic, proofs, counting, probability, graphs and modular arithmetic, through animated worked problems and practice sets
Created byBen Wallbaum
Last updated 10/2026
English
GermanEnglish

What you'll learn

  • Translate English statements into propositional and predicate logic, then test or simplify them with truth tables and equivalence laws
  • Write short proofs by direct argument, contrapositive, contradiction, cases and induction, and find the flaw in an invalid proof
  • Describe data and code with sets, functions and relations; classify functions and relations (equivalence, partial order)
  • Count arrangements and selections with the sum and product rules, permutations, combinations, pigeonhole and inclusion-exclusion
  • Compute conditional probabilities, apply Bayes' rule and linearity of expectation, and estimate hash-collision odds
  • Compute gcds and modular inverses with Euclid's algorithm and trace a small RSA encryption and decryption by hand
  • Model problems as graphs and trees and trace BFS, DFS, Dijkstra, minimum spanning trees and topological sort
  • Set up and solve recurrences, and compare running times with O, Omega and Theta, including the simplified Master Theorem

Course content

11 sections • 32 lectures • 2h 2m total length
  • Where discrete math runs your code3:14

    See where sets, functions and counting already run inside everyday code and AI, and how this course will teach them.

  • Your first solve: how many passwords?2:53

    Count the outcomes of a multi-step choice with the product rule, and see why length beats character variety in passwords.

  • Quiz: warm-up

Requirements

  • High-school algebra
  • No calculus, linear algebra or programming required. The short Python checks you'll see are optional.

Description

This course contains the use of artificial intelligence.

Discrete math is the toolkit under every program you write and every model you train. A tokenizer is a set and a function. A hash is a pigeonhole argument. Encryption is modular arithmetic. Search is graph traversal. And the cost of attention is a Big-O question.

This course teaches that toolkit the way it sticks: you watch each idea build up on screen, you solve it yourself, then you practise.

How it works

  • Watch. Every concept is animated step by step: truth tables fill in row by row, proofs assemble line by line, graphs get searched in front of you, recursion trees unfold

  • Solve. Every lecture stops for a "your turn" problem. Pause, try it, then see the worked answer

  • Practise. Every section ends with a quiz and a downloadable practice set that ramps from warm-up to challenge, with every solution worked out in full

What makes it different

  • Proofs as a skill. You get a whole section on writing proofs (direct, contrapositive, contradiction, cases), including a lab where you find the bug in flawed proofs. Induction then reappears for code: loop invariants

  • Every topic tied to real CS and AI. For example: SAT solvers in package managers, naive Bayes spam filtering, birthday-bound hash collisions, RSA and the move to post-quantum standards, BFS/Dijkstra/topological sort, why attention is quadratic, and how byte pair encoding builds a tokenizer

  • Compact. About two hours of focused video in eleven sections. The practice sets are where you spend the extra time

  • Checked. Facts are sourced to primary references, and every number and answer in the course was verified by a script

Who this course is for:

  • CS and software-engineering students taking, or about to take, a first discrete math course
  • Self-taught developers and bootcamp graduates filling the theory gap for algorithms, interviews or a CS degree
  • ML and AI learners who want the logic, counting, probability and graph foundations under the models they use