🎲 Probability

Random experiments, events, conditional probability, Bayes theorem — uncertainty ko mathematically measure karo!

🎰 1. Basic Concepts

Random Experiment: Jiska result pehle se nahi pata — jaise coin toss, dice roll, card draw.

Sample Space (S): Sabhi possible outcomes ka set. Coin = {H,T}. Dice = {1,2,3,4,5,6}.

Event: Sample space ka koi subset — jo hum chahte hain wo ho.

Events ke Types

Event TypeDefinitionExample (dice)
Simple EventSirf ek outcome{3} = sirf 3 aaye
Compound EventDo ya zyada outcomes{2,4,6} = even number
Sure EventS itself — hamesha hoga1 se 6 ke beech number aana
Impossible EventEmpty set — kabhi nahi hoga7 aana
ComplementaryA' = S − AA={1,2,3} → A'={4,5,6}
Mutually ExclusiveA∩B = ∅ (common element nahi)Even aur Odd numbers

Classical Probability

P(A) = n(A) / n(S) = Favourable outcomes / Total outcomes Properties: 0 ≤ P(A) ≤ 1 (probability hamesha 0 aur 1 ke beech) P(S) = 1 (sure event) P(∅) = 0 (impossible event) P(A') = 1 − P(A) (complementary rule)
Example: Basic Probability

Ek deck of 52 cards mein se ek card randomly nikala jaata hai. Find:

(a) P(King) = 4/52 = 1/13

(b) P(Red card) = 26/52 = 1/2

(c) P(Face card) = 12/52 = 3/13 (4 kings + 4 queens + 4 jacks)

(d) P(not a spade) = 1 − 13/52 = 3/4

🔗 2. Addition aur Multiplication Rules

Addition Rule

P(A ∪ B) = P(A) + P(B) − P(A ∩ B) Special case — Mutually Exclusive events (A ∩ B = ∅): P(A ∪ B) = P(A) + P(B)
Example: Addition Rule

Ek dice mein: A = even number = {2,4,6}, B = greater than 4 = {5,6}

P(A) = 3/6 = 1/2, P(B) = 2/6 = 1/3, P(A∩B) = P({6}) = 1/6

P(A∪B) = 1/2 + 1/3 − 1/6 = 3/6 + 2/6 − 1/6 = 4/6 = 2/3

Multiplication Rule (Independent Events)

Events A aur B independent hain agar ek ka result doosre ko affect nahi karta. P(A ∩ B) = P(A) × P(B) [Independent events] P(A ∩ B) = P(A) × P(B|A) [General — dependent events bhi]
Example: Independent Events

Ek fair coin do baar toss kiya. P(dono heads) = ?

P(H₁) = 1/2, P(H₂) = 1/2 (independent!)

P(H₁ ∩ H₂) = 1/2 × 1/2 = 1/4

🔀 3. Conditional Probability

Jab humein pata ho ki ek event ho chuki hai, toh doosre event ki probability kya hogi?

P(B|A) = P(A ∩ B) / P(A) [probability of B given A has occurred] P(A|B) = P(A ∩ B) / P(B) Note: P(A ∩ B) = P(A) × P(B|A) = P(B) × P(A|B)
S A only A∩B B only P(B|A) = area of A∩B ÷ area of A
Example: Conditional Probability

2 red aur 3 blue balls ke bag se 2 balls nikale gaye bina replacement ke. P(dono red) = ?

1
P(1st red) = 2/5
2
P(2nd red | 1st red) = 1/4 (ab 1 red, 3 blue bachi hain)
3
P(both red) = 2/5 × 1/4 = 2/20 = 1/10

🌳 4. Total Probability aur Bayes Theorem

Total Probability Theorem

Agar B₁, B₂, ..., Bₙ exhaustive aur mutually exclusive events hain (partition of S): P(A) = Σ P(Bᵢ) × P(A|Bᵢ) = P(B₁)P(A|B₁) + P(B₂)P(A|B₂) + ... + P(Bₙ)P(A|Bₙ) "Har branch ki probability × us branch se A hone ki probability — sab add karo"

Bayes Theorem

P(Bᵢ|A) = P(Bᵢ) × P(A|Bᵢ) / P(A) P(Bᵢ) × P(A|Bᵢ) = ───────────────────────────── Σⱼ P(Bⱼ) × P(A|Bⱼ) "Given A hua, Bᵢ kitni probability se cause tha?"
Example: Bayes Theorem — Classic Problem

Factory mein 3 machines A, B, C hain. A 50%, B 30%, C 20% production karti hain. Defect rate: A=2%, B=3%, C=5%.

Randomly ek defective item mila. Probability ki wo machine A se aaya?

1
P(A)=0.5, P(B)=0.3, P(C)=0.2
2
P(D|A)=0.02, P(D|B)=0.03, P(D|C)=0.05
3
P(D) = 0.5×0.02 + 0.3×0.03 + 0.2×0.05 = 0.010 + 0.009 + 0.010 = 0.029
4
P(A|D) = (0.5×0.02)/0.029 = 0.010/0.029 = 10/29 ≈ 0.345
💡 Board exam mein Bayes theorem ka ek full problem zaroor aata hai — tree diagram banaao, phir formula use karo. Calculation easy ho jaati hai!

🎯 5. Practice Questions

Q1: Two Dice

Do dice throw kiye. P(sum = 7) = ? Answer: 6/36 = 1/6 (outcomes: (1,6),(2,5),(3,4),(4,3),(5,2),(6,1))

Q2: Cards

52 cards mein se 2 successively nikale (without replacement). P(dono Ace) = ? Answer: 4/52 × 3/51 = 12/2652 = 1/221

Q3: Conditional

P(A) = 0.4, P(B) = 0.5, P(A∩B) = 0.2. Find P(A|B) aur P(B|A).

P(A|B) = 0.2/0.5 = 0.4; P(B|A) = 0.2/0.4 = 0.5

(Matlab: A aur B independent hain! P(A|B) = P(A) aur P(B|A) = P(B))

🔬 Probability Lab Open Karo →