# 16-17 (1.2 probability theory)

2022-01-26 23:29:34 CNpupil

Now suppose we choose a box at random , The result is a blue box . then , The probability of choosing an apple is the score of the apple in the blue box , namely $3/4$, therefore $p(F=a|B=b)=3/4$​. in fact , We can write all four conditional probabilities for the type of fruit , Given the selected box

$p(F=a|B=r)=1/4\tag{1.16}$
$p(F=o|B=r)=3/4\tag{1.17}$
$p(F=a|B=b)=3/4\tag{1.18}$
$p(F=o|B=b)=1/4\tag{1.19}$

Again, pay attention to , These probabilities are standardized , therefore

$p(F=a|B=r)+p(F=o|B=r)=1\tag{1.20}$

alike

$p(F=a|B=b)+p(F=o|B=b)=1\tag{1.21}$

We can now use the sum product rule of probability to evaluate the overall probability of choosing Apple

$p(F=a)=p(F=a|B=r)p(B=r)+p(F=a|B=b)p(B=b)=\frac{1}{4}\times\frac{4}{10}+\frac{3}{4}\times\frac{6}{10}=\frac{11}{20}\tag{1.22}$

thus , Use summation rules , $p(F=o)=1-11/20=9/20$.

contrary , Suppose we were told to choose a piece of fruit , It's an orange , We want to know which box it comes from . This requires us to evaluate the probability distribution on the box conditional on fruit identity , and （1.16）（1.19） The probability in gives Probability distribution on fruit conditional on box identity . Using Bayes Theorem , We can solve the inverse problem of conditional probability

$p(B=r|F=o)=\frac{p(F=o|B=r)p(B=r)}{p(F=o)}=\frac{3}{4}\times\frac{4}{10}\times\frac{20}{9}=\frac{2}{3}\tag{1.23}$

According to the summation rule , $p(B=b|f=o)=1-2/3=1/3$.

We can make the following important explanations for Bayesian Theorem . If we are asked which box we chose before being told the identity of the selected fruit , Then the most complete information we can get is probability $p(B)$​. We call it a priori probability , Because it is the probability available before we observe the characteristics of fruit . Once we are told that the fruit is an orange , We can use Bayesian theorem to calculate probability $p(B|F)$, We call it a posteriori probability , Because it's when we observe $F$ Then the probability . Please note that , In this case , The prior probability of choosing the red box is $4/10$, So we are more likely to choose the blue box than the red box . However , Once we observe the selected fruit, the orange , We find that the posterior probability of the red box is now $2/3$, So the box we are more likely to choose now is actually red . This result is in line with our intuition , Because the proportion of oranges in the red box is much higher than that in the blue box , Therefore, the observed fruits when oranges provide important evidence to support the red box . in fact , The evidence is strong enough , Beyond previous evidence , Makes it more likely to choose a red box instead of a blue box .

Last , We noticed that , If the joint distribution of two variables is decomposed into the product of edges , bring $p(X,Y)=p(x)p(Y)$, that $X$ and $Y$ Called independent . From the product rule , We see $p(Y|X)=p(Y)$, So given $X$ Of $Y$ The conditional distribution of is indeed consistent with $X$ The value of has nothing to do with . for example , In our fruit box example , If each box contains the same proportion of apples and oranges , that $p(F|B)=p(F)$, So choose （ such as ） The probability of an apple has nothing to do with which box to choose .

https://en.cdmana.com/2022/01/202201262329301097.html