Probabilities Review

Given:
Totals = {20: 16576, 30: 16619, 40: 16632, 50: 16805, 60: 16664, 70: 16704}
Purchases = {20: 3392, 30: 4974, 40: 6670, 50: 8319, 60: 9944, 70: 11713}
totalPurchases = 45012
Sample size (total no. of people) = 100000.0


Purchases[30] : This means the number of persons at age 30 who did a purchase.
Totals[30] : This means the total number of persons at age 30.


- P(Age)
The probability of 30's persons(P(30)): totals[30]/100,000

-P(Purchase)
And P(Purchase) is the overall probability of buying something, regardless of your age:
P(Purchase) = float(totalPurchases) / 100000.0

- P(Purchase|Age) : (نسبة الشراء في هذه الفئة العمرية)
The probability of someone in their 30's buying something
P(Purchase|30)total_persons_of_30s_did_purchase/total_Persons_Of_Age_30 = purchases[30]/totals[30]

-P(Purchase, Age) :  [comma means both and when we say both we mean according to total population] (نسبة شراء هذه الفئة العمرية بالنسبة للمجتمع ككل)
The probability of both being in your 30's and buying something, out of the total population
P(30's, Purchase) = purchases[30] / 100000.0

- If Purchase and Age were independent:
  • P(Purchase | Age)  P(Purchase) (احتمال الشراء لفئة عمرية معينة هو نفس احتمال الشراء لجميع الفئات العمرية حيث لا توجد علاقة بين العمر والشراء)
  • P(Purchase, Age)  P(Purchase) * P(Age) (احتمال\نسبة الشراء لفئة عمرية يساوي نسبة أو احتمال هذه الفئة العمرية مضروب في النسبة العامة\أو الاحتمال العام لجميع عمليات الشراء)
- If Purchase and Age were dependent:
  • P(Purchase | Age) =   P(Purchase, Age) ÷ P(Age)    (Proved Theory)
Prove:
P(Purchase, Age) / P(Age) = Purchases[30]/100,000 ÷ Totals[30]/100,000
  = Purchases[30]/Totals[30]
  = P(Purchase|Age)

Comments

Popular posts from this blog

Maxpooling vs minpooling vs average pooling

Percentiles, Deciles, and Quartiles

Data Warehouse Vs Data Mart