TGViewer
Data Science & Machine Learning Data Science & Machine Learning @datasciencefun ยท 77.8K subscribers
Post #4506 2.31K
๐Ÿš€ Data Science Roadmap 2026

๐Ÿ“˜ Phase 2: Mathematics for Data Science

๐Ÿ“– Topic 4: Probability Basics

Welcome back! ๐Ÿ‘‹

In the previous lesson, you learned about Variance and Standard Deviation, which help us understand how data is spread out.

Now let's learn another fundamental concept in Data Science: Probability.

Probability helps us measure the likelihood that an event will happen. It plays an important role in Machine Learning, Statistics, Bayesian inference, risk analysis, forecasting, and decision-making.

๐Ÿ”น 1. What is Probability?

Probability is a measure of how likely an event is to occur.

Its value ranges from: 0 โ‰ค Probability โ‰ค 1

Where:

0 โ†’ Impossible event

1 โ†’ Certain event

0.5 โ†’ 50% chance

Probability can also be expressed as a percentage.

0.25 = 25%

0.50 = 50%

0.75 = 75%

1.00 = 100%

๐Ÿ”น 2. Basic Probability Formula

When all possible outcomes are equally likely:

Probability(Event) =

Number of favorable outcomes

โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

Total number of possible outcomes

Example

Roll a standard six-sided die: 1, 2, 3, 4, 5, 6

What is the probability of getting a "4"?

1 favorable outcome, 6 possible outcomes

P(4) = 1/6 โ‰ˆ 0.167 = 16.7%

๐Ÿ”น 3. Experiment, Outcome & Event

Experiment: An action that produces an outcome. Ex: Rolling a die

Outcome: A possible result. Ex: 1, 2, 3, 4, 5, or 6

Event: A specific outcome or group of outcomes we're interested in. Ex: Getting an even number โ†’ 2, 4, 6

๐Ÿ”น 4. Sample Space

The set of all possible outcomes.

Coin toss: S = {Head, Tail}

Die: S = {1, 2, 3, 4, 5, 6}

๐Ÿ”น 5. Probability of an Event

Roll a die and want an even number.

Favorable: 2, 4, 6

P(Even) = 3/6 = 0.5 = 50%

๐Ÿ”น 6. Complementary Probability โญ

The complement of an event means the event does not happen.

If P(A) = 0.7

Then: P(Not A) = 1 - P(A) = 1 - 0.7 = 0.3

So there is a 30% probability that A will not occur.

๐Ÿ”น 7. Independent Events

Two events are independent when the occurrence of one does not affect the other.

Ex: Tossing a coin twice.

For independent events: P(A and B) = P(A) ร— P(B)

Ex: P(Head and Head) = 1/2 ร— 1/2 = 1/4 = 25%

๐Ÿ”น 8. Dependent Events

Two events are dependent when the outcome of one affects the probability of the other.

Ex: Bag with 3 Red, 2 Blue balls. Pick one and don't put it back. The probability for the second pick changes.

๐Ÿ”น 9. Conditional Probability โญ

Probability of an event occurring given that another event has already occurred.

Written as: P(A | B) โ†’ "Probability of A given B"

Formula: P(A | B) = P(A โˆฉ B) / P(B)

๐Ÿ”น 10. Real-World Example of Conditional Probability

Company data:

60% customers using Mobile App

30% customers using Mobile App and making a purchase

P(Purchase | App) = P(Purchase โˆฉ App) / P(App) = 0.30 / 0.60 = 0.50

Therefore: 50% of app users make a purchase.

๐Ÿ”น 11. Addition Rule

For two events: P(A or B) = P(A) + P(B) - P(A and B)

If mutually exclusive: P(A or B) = P(A) + P(B)

๐Ÿ”น 12. Multiplication Rule

For independent events: P(A and B) = P(A) ร— P(B)

Ex: Rolling two sixes: P(6 and 6) = 1/6 ร— 1/6 = 1/36

๐Ÿ”น 13. Probability in Data Science โญ

Machine Learning: Models produce probabilities. Ex: P(Spam) = 0.92

Classification: P(Customer will churn) = 78%

Risk Analysis: Estimate likelihood of loan default, fraud, churn, equipment failure

๐Ÿ”น 14. Probability vs Statistics

Probability: Starts with assumptions and predicts possible outcomes. Known model โ†’ Predict outcomes

Statistics: Starts with observed data and tries to understand the underlying population. Observed data โ†’ Learn about the model

๐Ÿ”น 15. Python Example

favorable = 3
total = 6
probability = favorable / total
print(probability)
  • โค 6
More from @datasciencefun
  1. Oct 7, 2026ORDER BY salary DESC LIMIT 5; Mistake 3 โ€” Forgetting that LIMIT applies after sorting Forโ€ฆ
  2. Oct 7, 2026๐Ÿš€ Data Science Roadmap 2026 ๐Ÿ“ Phase 3: SQL for Data Science ๐Ÿ“– Topic 4 โ€” LIMIT LIMIT isโ€ฆ
  3. Oct 7, 2026๐Ÿš€๐—ฃ๐—ฎ๐˜† ๐—”๐—ณ๐˜๐—ฒ๐—ฟ ๐—ฃ๐—น๐—ฎ๐—ฐ๐—ฒ๐—บ๐—ฒ๐—ป๐˜ ๐—ง๐—ฟ๐—ฎ๐—ถ๐—ป๐—ถ๐—ป๐—ด | ๐—•๐—ฒ๐—ฐ๐—ผ๐—บ๐—ฒ ๐—ฎ ๐—™๐˜‚๐—น๐—น๐˜€๐˜๐—ฎ๐—ฐโ€ฆ
  4. Oct 7, 2026๐— ๐—ฎ๐˜€๐˜๐—ฒ๐—ฟ ๐—ฃ๐—ผ๐˜„๐—ฒ๐—ฟ ๐—•๐—œ ๐—ณ๐—ผ๐—ฟ ๐—™๐—ฅ๐—˜๐—˜! ๐Ÿ”ฅ Learn Power BI through these FREE learninโ€ฆ
  5. Oct 2, 2026Data Visualisation tips for beginners
  6. Sep 29, 2026๐—™๐—ฅ๐—˜๐—˜ ๐—ฅ๐—ฒ๐˜€๐—ผ๐˜‚๐—ฟ๐—ฐ๐—ฒ๐˜€ ๐—ง๐—ผ ๐—Ÿ๐—ฒ๐—ฎ๐—ฟ๐—ป ๐—”๐—œ ๐—ถ๐—ป ๐Ÿฎ๐Ÿฌ๐Ÿฎ๐Ÿฒ๐Ÿš€ โ€‹ Explore 6 free resourceโ€ฆ
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook โ†’Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 โ†’