Introduktion till statistik
George Boorman
Curriculum Manager, DataCamp
Vad är sannolikheten för en händelse?
$$ P(\text{event}) = \frac{\text{\# ways event can happen}}{\text{total \# of possible outcomes}} $$
Exempel: myntkast
$$ P(\text{heads}) = \frac{\text{1 way to get heads}}{\text{2 possible outcomes}} = \frac{1}{2} = 50\%$$



$$P(\text{Brian}) = \frac{1}{4} = 25\%$$


$$P(\text{Brian}) = \frac{1}{4} = 25\%$$
Två händelser är oberoende om sannolikheten för den andra händelsen inte påverkas av utfallet av den första.
| Ordernummer | Produkttyp | Nettomängd | Bruttoförsäljning | Rabatter | Returer | Nettoförsäljning |
|---|---|---|---|---|---|---|
| 200 | Basket | 13 | 3744.0 | -316.80 | 0.00 | 3427.20 |
| 201 | Basket | 12 | 3825.0 | -201.60 | -288.0 | 3335.40 |
| 202 | Basket | 17 | 3035.0 | -63.25 | 0.00 | 2971.75 |
| 203 | Art & Sculpture | 47 | 2696.8 | -44.16 | 0.00 | 2652.64 |
| 204 | Basket | 17 | 2695.0 | -52.50 | -110.00 | 2532.50 |

| Produkttyp | Antal order |
|---|---|
| Basket | 551 |
| Art & Sculpture | 337 |
| Jewelry | 210 |
| Kitchen | 161 |
| Home Decor | 131 |
| ... | ... |
| Totalt | 1767 |
$$P(Jewelry) = \frac{Order \ Count(Jewelry)}{Sum(Total \ Order \ Count)}$$
$$P(Jewelry) = \frac{210}{1767}$$
$$P(Jewelry) = 11.88 \%$$
| Produkttyp | Antal order | Sannolikhet |
|---|---|---|
| Basket | 551 | 31,18% |
| Art & Sculpture | 337 | 19,07% |
| Jewelry | 210 | 11,88% |
| Kitchen | 161 | 9,11% |
| Home Decor | 131 | 7,41% |
| ... | ... | ... |
| Totalt | 1767 | 100% |
Introduktion till statistik