section_path: Mathematical treatment/Conditional probability
section_name: Conditional probability
paragraph_text: Conditional probability
  
  Conditional probability is the probability of some event A, given the occurrence of some other event B. Conditional probability is written P (A ∣ B) {\displaystyle P(A\mid B)}, and is read "the probability of A, given B ". It is defined by
  
  P (A ∣ B) = P (A ∩ B) P (B) {\displaystyle P(A\mid B)={\frac {P(A\cap B)}{P(B)}}\,}
  
  If P (B) = 0 {\displaystyle P(B)=0} then P (A ∣ B) {\displaystyle P(A\mid B)} is formally undefined by this expression. In this case A {\displaystyle A} and B {\displaystyle B} are independent, since P (A ∩ B) = P (A) P (B) = 0. {\displaystyle P(A\cap B)=P(A)P(B)=0.} However, it is possible to define a conditional probability for some zero-probability events, for example by using a σ-algebra of such events (such as those arising from a continuous random variable).
  
  For example, in a bag of 2 red balls and 2 blue balls (4 balls in total), the probability of taking a red ball is 1 / 2; {\displaystyle 1/2;} however, when taking a second ball, the probability of it being either a red ball or a blue ball depends on the ball previously taken. For example, if a red ball was taken, then the probability of picking a red ball again would be 1 / 3, {\displaystyle 1/3,} since only 1 red and 2 blue balls would have been remaining. And if a blue ball was taken previously, the probability of taking a red ball will be 2 / 3. {\displaystyle 2/3.}