VOOZH about

URL: https://www.coursera.org/learn/discrete-mathematics-for-computer-science-counting-probability

⇱ Discrete Math for Computer Science - Counting & Probability | Coursera


Discrete Math for Computer Science - Counting & Probability

Keep adding new skills with 10,000+ programs for $239 (usually $399). Save now.

Discrete Math for Computer Science - Counting & Probability

Included with

Ask Coursera

Gain insight into a topic and learn the fundamentals.
Beginner level

Recommended experience

1 week to complete
at 10 hours a week
Flexible schedule
Learn at your own pace

Gain insight into a topic and learn the fundamentals.
Beginner level

Recommended experience

1 week to complete
at 10 hours a week
Flexible schedule
Learn at your own pace

What you'll learn

  • Use propositional and predicate logic to model and reason about computer science problems.

  • Use permutations, combinations, and inclusion–exclusion to solve combinatorial problems.

  • Analyse uncertainty using probability, conditional probability, and random variables.

Skills you'll gain

Details to know

Shareable certificate

Add to your LinkedIn profile

Recently updated!

February 2026

Assessments

7 assignments

Taught in English

Build your subject-matter expertise

This course is part of the Discrete Mathematical Tools for Computer Science Specialization
When you enroll in this course, you'll also be enrolled in this Specialization.
  • Learn new concepts from industry experts
  • Gain a foundational understanding of a subject or tool
  • Develop job-relevant skills with hands-on projects
  • Earn a shareable career certificate

There are 8 modules in this course

This course develops the mathematical tools needed to count, measure uncertainty, and reason about random processes, which are central to computer science, data analysis, and algorithm design. Building on the logical foundations from the first course, it introduces combinatorial counting techniques and probability theory through a discrete, computation-oriented lens.

The course begins with the fundamentals of counting, including the product rule, sum rule, permutations, combinations, and binomial coefficients. You will learn how to count complex structures efficiently using techniques such as the principle of inclusion and exclusion, with applications ranging from algorithm analysis to data organization. The second half of the course focuses on probability, emphasizing its deep connection to counting. Topics include sample spaces, events, conditional probability, independence, and Bayes’ Theorem. You will also study random variables, probability distributions, expectation, and variance, gaining tools to model and analyze randomized algorithms and real-world uncertainty. Throughout the course, abstract concepts are reinforced with concrete examples drawn from computing, games of chance, and classic probability puzzles. By the end, learners will be able to systematically count possibilities, compute probabilities, and reason rigorously about randomness—skills essential for advanced study in algorithms, data science, machine learning, and beyond.

This module teaches how to count arrangements, selections, and possibilities using permutations, combinations, binomial coefficients, and inclusion-exclusion. It covers probability fundamentals, conditional probability, random variables, and iconic problems like the Monty Hall dilemma to handle uncertainty. These tools are crucial for analyzing algorithm efficiency, game design, randomized systems, machine learning, and risk assessment.

What's included

1 reading

1 readingTotal 10 minutes
  • Introduction to Discrete Math for Computer Science (Counting & Probability)10 minutes

Counting techniques provide systematic methods for determining the number of possible outcomes in discrete structures. This topic introduces basic counting principles such as the sum rule and product rule.

What's included

15 videos1 reading1 assignment

15 videosTotal 41 minutes
  • Basics of Counting Overview3 minutes
  • Basics of Counting_intro8 minutes
  • Product Rule_Intro, Example1 & 21 minute
  • (Optional) Product Rule_Example3 & 42 minutes
  • (Optional) Product Rule_Example5 & 62 minutes
  • Sum Rule_Example1 minute
  • (Optional) Using Both Product and Sum Rules_Example12 minutes
  • (Optional) Using Both Product and Sum Rules_Example23 minutes
  • (Optional) InclassEx2 minutes
  • Tree Diagrams_Intro, Example1 & 23 minutes
  • The Pigeonhole Principle_Intro & Example12 minutes
  • (Optional) The Pigeonhole Principle_Example22 minutes
  • (Optional) The Pigeonhole Principle_Example33 minutes
  • The Pigeonhole Principle_Generalized Pigeonhole Principle_Intro & Example13 minutes
  • (Optional) The Pigeonhole Principle_Generalized Pigeonhole Principle_Example2 & 35 minutes
1 readingTotal 30 minutes
  • Basics of Counting30 minutes
1 assignmentTotal 20 minutes
  • Quiz 120 minutes

This topic studies methods for counting arrangements and selections of objects. It distinguishes between ordered and unordered selections and introduces formulas for permutations and combinations.

What's included

16 videos1 reading1 assignment

16 videosTotal 65 minutes
  • Permutations and Combinations Overview2 minutes
  • Permutations and Combinations_intro1 minute
  • (Optional) Permutations_Example14 minutes
  • Permutations_Number of k-Permutations3 minutes
  • (Optional) Permutations_Example2 & 31 minute
  • Permutations_Permutation & k-Permutation Definition2 minutes
  • (Optional) Permutations_Example4 & 5 & 63 minutes
  • (Optional) Permutations_Example76 minutes
  • Combinations_Intro & k-Combinations, Proof7 minutes
  • (Optional) Combinations_Example1 & 29 minutes
  • Combinations_Combinatorial Proof and Bijection Principle_Intro & Examples5 minutes
  • Generalized Permutations and Combinations_Permutations with Indistinguishable Objects_Intro & Example4 minutes
  • Generalized Permutations and Combinations_Distributing Objects into Boxes_Intro & Example2 minutes
  • Generalized Permutations and Combinations_Indistinguishable objects Distinguishable boxes_Theorem & Example8 minutes
  • Generalized Permutations and Combinations_Combinations with Repetition_Intro & Examples3 minutes
  • (Optional) InclassEx5 minutes
1 readingTotal 30 minutes
  • Permutations and Combinations30 minutes
1 assignmentTotal 20 minutes
  • Quiz 220 minutes

Binomial coefficients arise in counting combinations and in the expansion of binomial expressions. This topic covers the binomial theorem, Pascal’s identity, and important combinatorial identities.

What's included

13 videos1 reading1 assignment

13 videosTotal 59 minutes
  • Binomial Coefficients Overview3 minutes
  • Binomial Coefficients_Intro1 minute
  • Binomial Theorem_Example1, Definition & Proof6 minutes
  • (Optional) Binomial Theorem_Example2 & 31 minute
  • Binomial Theorem_Corollary1 & Combinatorial Proof7 minutes
  • Binomial Theorem_Corollary2 & Pascal’s Triangle4 minutes
  • Binomial Theorem_Corollary31 minute
  • Pascal’s Identity and Triangle_Pascal's Identity & Combinatorial proof of Pascal’s identity11 minutes
  • Pascal’s Identity and Triangle_Pascal’s Triangle1 minute
  • Some Other Identities_Vandermonde's Identity6 minutes
  • Some Other Identities_Vandermonde's Identity_Corollary3 minutes
  • Some Other Identities_Counting bit strings & Proof9 minutes
  • (Optional) InclassEx5 minutes
1 readingTotal 30 minutes
  • Binomial Coefficients30 minutes
1 assignmentTotal 30 minutes
  • Quiz 330 minutes

The inclusion–exclusion principle provides a systematic way to count elements in overlapping sets. It is widely used in counting problems involving unions of multiple sets.

What's included

13 videos1 reading1 assignment

13 videosTotal 78 minutes
  • The Inclusion-Exclusion Principle Overview3 minutes
  • The Inclusion-Exclusion Principle_Intro1 minute
  • Two Finite Sets_Intro & Examples3 minutes
  • Three Finite Sets_Intro3 minutes
  • (Optional) Three Finite Sets_Example2 minutes
  • Inclusion-Exclusion Principle_Theorem6 minutes
  • Inclusion-Exclusion Principle_Proof8 minutes
  • Number of Onto Functions_Intro & Example114 minutes
  • (Optional) Number of Onto Functions_Example22 minutes
  • Derangement_Example1 & Proof15 minutes
  • (Optional) Derangement_Example22 minutes
  • Probability of a derangement3 minutes
  • (Optional) InclassEx18 minutes
1 readingTotal 30 minutes
  • The Inclusion-Exclusion Principle30 minutes
1 assignmentTotal 20 minutes
  • Quiz 420 minutes

This topic introduces probability as a measure of uncertainty based on counting outcomes. It defines experiments, sample spaces, events, and basic probability rules.

What's included

21 videos1 reading1 assignment

21 videosTotal 68 minutes
  • Introduction to Probability Overview2 minutes
  • The Hatcheck Problem Revisited1 minute
  • Probability_Definitions2 minutes
  • (Optional) Probability_Example2 minutes
  • Poker_Intro3 minutes
  • (Optional) Poker_Ex14 minutes
  • (Optional) Poker_Ex26 minutes
  • (Optional) Poker_Ex35 minutes
  • (Optional) Poker_Ex44 minutes
  • Mark Six4 minutes
  • Sampling with/without replacement1 minute
  • Complement of Event_Theorem2 minutes
  • (Optional) Complement of Event_Example2 minutes
  • Union of Events & Inclusion-Exclusion Principle for Probability, Complement and Union Events4 minutes
  • Probability Distribution2 minutes
  • Uniform Distribution & Non-Uniform Distribution2 minutes
  • Probability of an Event2 minutes
  • Independence_Definition2 minutes
  • (Optional) Independence_Examples6 minutes
  • Pairwise and Mutual Independence6 minutes
  • (Optional) InclassEx6 minutes
1 readingTotal 10 minutes
  • Introduction to Probability10 minutes
1 assignmentTotal 20 minutes
  • Quiz 520 minutes

Conditional probability measures the likelihood of events given prior information. This topic introduces independence and Bayes’ theorem, enabling probabilistic reasoning in real-world decision making.

What's included

15 videos1 reading1 assignment

15 videosTotal 69 minutes
  • Conditional Probability and Bayes' Theorem Overview5 minutes
  • Conditional Probability and Bayes' Theorem_Intro1 minute
  • Conditional Probability6 minutes
  • (Optional) Conditional Probability_Example13 minutes
  • (Optional) Conditional Probability_Example24 minutes
  • Conditional Probability_The Birthday Problem4 minutes
  • Independence Revisited3 minutes
  • Independence Example Revisited2 minutes
  • Bayes’ Theorem_Theorem & Example1, Explanation10 minutes
  • (Optional) Bayes’ Theorem_Example21 minute
  • (Optional) Bayes’ Theorem_Example35 minutes
  • Bayesian Spam Filter_Intro & Example4 minutes
  • Generalized Bayes’ Theorem_Theorem & Example2 minutes
  • Monty Hall Problem12 minutes
  • (Optional) InclassEx6 minutes
1 readingTotal 30 minutes
  • Conditional Probability and Bayes' Theorem30 minutes
1 assignmentTotal 20 minutes
  • Quiz 620 minutes

Random variables assign numerical values to outcomes of random experiments. This topic covers discrete and continuous distributions, expectation, and variance, forming the foundation of probability modeling.

What's included

28 videos1 reading1 assignment

28 videosTotal 132 minutes
  • Random Variables Overview3 minutes
  • Random Variables2 minutes
  • Distribution of a Random Variable1 minute
  • Bernoulli Trials4 minutes
  • Binomial Distribution_Theorem & Example3 minutes
  • Continuous Probability Distribution3 minutes
  • Infinite Sample Space3 minutes
  • Geometric Distribution2 minutes
  • Expected Value_Definition, Theorem & Example8 minutes
  • Expected Value_Example_Binomial Distribution2 minutes
  • Linearity of Expectations_Theorem & Proof4 minutes
  • Indicator Random Variables_Intro3 minutes
  • (Optional) Indicator Random Variables_Example_the Hatcheck Problem4 minutes
  • (Optional) Indicator Random Variables_Example_Hiring Problem15 minutes
  • (Optional) Indicator Random Variables_Example_Balls and Bins4 minutes
  • Average-case Analysis of Algorithms_Definition & Example_Linear Search8 minutes
  • (Optional) Average-case Analysis of Algorithms_Example_Insertion Sort8 minutes
  • Geometric Distribution_Definition & Theorem2 minutes
  • (Optional) Geometric Distribution_Example_Coupon Collector7 minutes
  • Independent Random Variables_Definition, Theorem & Proof9 minutes
  • (Optional) Independent Random Variables_Example6 minutes
  • Variance and Standard Deviation_Definition8 minutes
  • Variance_Theorem2 minutes
  • (Optional) Variance_Example3 minutes
  • Bienaymé’s Formula_Theorem & Proof3 minutes
  • (Optional) Bienaymé’s Formula_Example13 minutes
  • (Optional) Bienaymé’s Formula_Example26 minutes
  • (Optional) InclassEx6 minutes
1 readingTotal 30 minutes
  • Random Variables30 minutes
1 assignmentTotal 20 minutes
  • Quiz 720 minutes

Earn a career certificate

Add this credential to your LinkedIn profile, resume, or CV. Share it on social media and in your performance review.

Instructor

The Hong Kong University of Science and Technology
11 Courses230,888 learners

Explore more from Algorithms

Why people choose Coursera for their career

👁 Image

Felipe M.

Learner since 2018
"To be able to take courses at my own pace and rhythm has been an amazing experience. I can learn whenever it fits my schedule and mood."
👁 Image

Jennifer J.

Learner since 2020
"I directly applied the concepts and skills I learned from my courses to an exciting new project at work."
👁 Image

Larry W.

Learner since 2021
"When I need courses on topics that my university doesn't offer, Coursera is one of the best places to go."
👁 Image

Chaitanya A.

"Learning isn't just about being better at your job: it's so much more than that. Coursera allows me to learn without limits."

Frequently asked questions

To access the course materials, assignments and to earn a Certificate, you will need to purchase the Certificate experience when you enroll in a course. You can try a Free Trial instead, or apply for Financial Aid. The course may offer 'Full Course, No Certificate' instead. This option lets you see all course materials, submit required assessments, and get a final grade. This also means that you will not be able to purchase a Certificate experience.

When you enroll in the course, you get access to all of the courses in the Specialization, and you earn a certificate when you complete the work. Your electronic Certificate will be added to your Accomplishments page - from there, you can print your Certificate or add it to your LinkedIn profile.

Yes. In select learning programs, you can apply for financial aid or a scholarship if you can’t afford the enrollment fee. If fin aid or scholarship is available for your learning program selection, you’ll find a link to apply on the description page.

Financial aid available,