Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Probability-Statistics-Jupy…
GitHub Repository: Probability-Statistics-Jupyter-Notebook/probability-statistics-notebook
Path: blob/master/notebook-for-reviewing/chapter_1_probability_theory.ipynb
388 views
Kernel: Python 3

Chapter 1 Probability Theory

1.1 Introduction

Experiment: Any process or procedure for which more than one outcome is possible.

Sample Space SS: All the possible outcomes.

Probability P(xi)P(x_i) meet the requirement: 0pi1,i=1,2,,n0\leq p_i\leq 1, i=1, 2, \dots, n and p1+p2++pn=1p_1 + p_2 + \dots + p_n = 1.

1.2 Events

Event AA: An event is a subset of the sample space. The probability of an event is obtained by the probabilities of the outcomes contained within the event.

P(A)=P(x),xAP(A) = \sum P(x), x\in A

Complements of envents AA': Everything in the sample space not contained within event.

P(A)+P(A)=1P(A)+P(A')=1

Elementary event: An event only contains one individual outcome.

1.3 Intersection of Events

Intersection ABA\cap B: Outcomes within both events AA and BB.

Union ABA\cup B: Outcomes within event AA or event BB.

A(BC)=(AB)CA\cap (B\cap C) = (A\cap B)\cap C

P(AB)=P(A)+P(B)P(AB)P(A\cup B) = P(A) + P(B) - P(A\cap B)

P(AB)=P(AB)+P(AB)+P(AB)P(A\cup B) = P(A\cap B') + P(A'\cap B) + P(A\cap B)

(AB)=AB(A\cup B)' = A' \cap B'

(AB)=AB(A\cap B)' = A' \cup B'

(ABC)=A+B+C(AB)(BC)(CA)+(ABC)(A\cup B\cup C) = A + B + C - (A\cap B) - (B\cap C) - (C\cap A) + (A\cap B\cap C)

1.4 Conditional Probability

P(AB)=P(AB)P(B),P(B)>0P(A|B) = \frac{P(A\cap B)}{P(B)}, P(B)>0

P(AB)=P(AB)P(B)P(AB)=P(B)P(AB)P(A|B) = \frac{P(A\cap B)}{P(B)} \Longrightarrow P(A\cap B) = P(B)P(A|B)

1.5 Probabilities of Event Intersections

P(ABC)=P(ABC)P(BC)P(ABC)=P(BC)P(ABC)P(A|B\cap C) = \frac{P(A\cap B\cap C)}{P(B\cap C)} \Longrightarrow P(A\cap B\cap C) = P(B\cap C)P(A|B\cap C)

P(A1An)=P(A1)P(A1A2)P(A3A1A2)P(AnA1An1)P(A_1 \cap \dots \cap A_n) = P(A_1)P(A_1|A_2)P(A_3|A_1\cap A_2)\dots P(A_n|A_1\cap \dots \cap A_{n-1})

Independent: One event's occur would not affect another event.

  1. P(AB)=P(A)P(A|B) = P(A)

  2. P(BA)=P(B)P(B|A) = P(B)

  3. P(AB)=P(A)P(B)P(A\cap B) = P(A)P(B)

1.6 Posterior Probability

If an event BB is contained within a sample space AA, then we have P(B)=i=1nP(Ai)P(BAi)P(B) = \sum_{i=1}^{n}P(A_i)P(B|A_i)

The Bayes' Theorem:

P(AiB)=P(Ai)P(BAi)j=1nP(Aj)P(BAj)P(A_i|B) = \frac{P(A_i)P(B|A_i)}{\sum_{j=1}^{n}P(A_j)P(B|A_j)}