Find a course
Age level: University students (18–25)IntermediateMathematics

Discrete Mathematics

Logic, proofs, sets, counting, number theory and graphs for computer science and beyond

⏱ 2 h 50 min5 modules · 12 lessons77 practice questionsFinal exam: 20 questions
Included with this course

Your certificate for this course

Finish the 12 lessons (about 2 h 50 min) and pass the 20-question final exam. Your Certificate of Completion is ready the moment you pass.

  • Your name and this course titlePrinted in classic diploma typography
  • Grade: Pass, Merit or DistinctionOn the gold seal, with your final score
  • Unique ID and QR codeAnyone can verify it in seconds
  • Score report PDFModule-by-module results and exam score
  1. Lessons12 lessons
  2. Final exam20 questions · 70% to pass
  3. CertificatePDF + score report

What you will learn

  • Build truth tables, test logical equivalence and negate statements with quantifiers correctly
  • Write direct proofs, proofs by contrapositive and contradiction, and proofs by mathematical induction
  • Work with sets, power sets and Cartesian products, and classify functions and relations
  • Count arrangements with the product rule, permutations, combinations and inclusion–exclusion
  • Apply the pigeonhole principle and the binomial theorem
  • Compute greatest common divisors with the Euclidean algorithm and calculate in modular arithmetic
  • Analyze graphs with degrees, Euler paths and trees, and run minimum spanning tree and shortest path algorithms by hand

About this course

Calculus studies quantities that change smoothly. Discrete mathematics studies things you can count: true-or-false statements, whole numbers, finite sets, arrangements, networks of connected points. It's the mathematics of computers, which store everything as bits and follow step-by-step rules, and it's a required course for almost every computer science degree.

This free course covers the core topics in one sitting. You'll start with logic: propositions, truth tables, logical equivalences and quantifiers, the same rules that govern if-statements in code and queries in databases. Then you'll learn to write proofs, including direct proof, proof by contradiction and mathematical induction, the technique behind every argument that an algorithm works for all inputs.

Next come sets, functions and relations, the vocabulary used to describe data and the relationships between data. The counting module teaches the product rule, the pigeonhole principle, permutations, combinations and the binomial theorem, so you can count passwords, lottery odds and the steps an algorithm takes without listing every case.

The final module covers number theory and graphs. Modular arithmetic and the Euclidean algorithm power check digits, hashing and the RSA encryption that protects online shopping. Graphs model road maps, social networks and the internet itself; you'll learn Euler paths, trees, minimum spanning trees and shortest paths.

The course is for computer science and math students taking a first discrete math class, programmers who want the theory behind algorithms, and anyone preparing for technical interviews or competitions. You need high school algebra and nothing more. Every lesson mixes short explanations with worked examples, interactive calculators and practice problems, and you can earn a free certificate of completion by passing the final exam.

Syllabus

  1. Logic

    The language of precise reasoning: propositions and connectives, truth tables, logical equivalences, and statements about all or some objects.

    1. Propositions, Connectives and Truth Tables13 min
    2. Logical Equivalence and Conditionals14 min
    3. Predicates and Quantifiers14 min
  2. Proofs and Induction

    Write convincing mathematical arguments: direct proof, contrapositive, contradiction and counterexamples, then mathematical induction for statements about every n.

    1. Direct Proof, Contrapositive and Contradiction15 min
    2. Mathematical Induction15 min
  3. Sets, Functions and Relations

    The vocabulary for describing collections and connections: set operations, power sets, functions and their properties, and equivalence relations.

    1. Sets and Set Operations14 min
    2. Functions and Relations15 min
  4. Counting

    Count without listing: the sum and product rules, complements, the pigeonhole principle, permutations, combinations and the binomial theorem.

    1. Counting Principles and the Pigeonhole Principle14 min
    2. Permutations, Combinations and the Binomial Theorem15 min
  5. Number Theory and Graphs

    Divisibility, the Euclidean algorithm and modular arithmetic behind cryptography, then graphs, Euler paths, trees and the algorithms that run on them.

    1. Divisibility, GCD and Modular Arithmetic15 min
    2. Graphs, Degrees and Euler Paths14 min
    3. Trees, Spanning Trees and Shortest Paths15 min
  6. Final exam and certificate

    20 questions drawn from a pool of 31. Score 70% or more to pass; retakes get a fresh set of questions.

Try a sample question

Let p be "it is raining" and q be "the ground is wet." When is p → q false?

  1. When it is not raining and the ground is wet
  2. When it is not raining and the ground is dry
  3. When it is raining and the ground is dry
  4. When it is raining and the ground is wet
Show the answer

Answer: C. When it is raining and the ground is dry

A conditional is false only when the hypothesis is true and the conclusion is false: rain with dry ground. When it's not raining, the conditional is vacuously true no matter what the ground does (someone may have run a sprinkler). Thinking a false hypothesis makes the conditional false is the classic error.

Proposition
A declarative statement that is either true or false, but not both.
Conjunction
The statement p ∧ q ("p and q"), true only when both p and q are true.
Disjunction
The statement p ∨ q ("p or q"), true when at least one of p, q is true.
Conditional
The statement p → q ("if p then q"), false only when p is true and q is false.
Biconditional
The statement p ↔ q ("p if and only if q"), true when p and q have the same truth value.
Truth table
A table listing the truth value of a compound statement for every combination of truth values of its parts.

Frequently asked questions

What is discrete mathematics?

It is the study of mathematical structures made of separate, countable pieces rather than continuous quantities: logical statements, integers, finite sets, arrangements and graphs. It provides the theory behind computer science, from algorithms and data structures to cryptography and databases.

Is discrete math harder than calculus?

It is different. There are fewer formulas to memorize, but more emphasis on careful reasoning and writing proofs. Students who find calculus mechanical sometimes enjoy discrete math more, and vice versa. Practicing proofs early is the best way to get comfortable.

Why do computer scientists need discrete math?

Logic underlies conditionals and circuits, induction proves algorithms correct, counting analyzes running time and probability, number theory secures communication, and graphs model networks, maps, dependencies and data structures like trees.

What is the difference between a permutation and a combination?

A permutation counts arrangements where order matters, such as gold, silver and bronze medals. A combination counts selections where order does not matter, such as choosing a committee. The number of combinations is the number of permutations divided by the number of ways to order the chosen items.

How do I get better at writing proofs?

Start by writing down exactly what you are given and what you must show, using definitions. Try small examples to see why the claim is true. Choose a technique (direct, contrapositive, contradiction or induction) and write in full sentences. Then reread the proof as a skeptic looking for gaps.

Does this course cover probability?

Only through counting. The counting techniques here are the foundation of discrete probability, but probability distributions and expected value are covered in a separate probability or statistics course.

Is the certificate accepted for college credit?

No. The certificate shows you completed the course and passed the exam, useful for your records or a portfolio, but it is not accredited credit. It is good preparation for a university discrete mathematics course.

Sources and further reading

Related courses

Adults & professionalsBeginner

Math Refresher for Adults

Fractions, percentages, algebra and everyday math, relearned without the stress

Mathematics
2 h 15 min13 lessonsCertificate
TeensIntermediate

SAT Math Prep

Algebra, advanced math, data and geometry for the digital SAT

Mathematics
2 h 5 min10 lessonsCertificate
Adults & professionalsBeginner

Business Math

Percentages, pricing, interest, profit and decision math for real business

Mathematics
2 h 10 min12 lessonsCertificate
University studentsIntermediate

Calculus II: Integrals

Antiderivatives, integration techniques and the applications that use them

Mathematics
2 h 50 min12 lessonsCertificate
KidsBeginner

Addition and Subtraction for Kids

Count on, make ten, carry and borrow: add and subtract big numbers with confidence

Mathematics
55 min7 lessonsCertificate
University studentsIntermediate

Calculus I: Limits and Derivatives

Limits, continuity, differentiation rules and real applications of the derivative

Mathematics
2 h 45 min12 lessonsCertificate