Probability and Arrays

Learn how to calculate probabilities using programming.

Introduction to probability

Probability is a critical concept of discrete mathematical operations. Like the set theory concepts, probability concepts are also applied diversely in computer science and the programming world.

Before looking at code, let’s discuss what probability means. Consider heads and tails. If we flip a coin, there’s a 50-50 probability of getting heads or tails. But the equation changes when we throw a dice up in the air.

Get hands-on with 1200+ tech skills courses.