💎 Ruby 💻 Web Development 🌈 Math 🔭 Data Science


Rubythinking

Chapter 2 - Excercise M2

A globe is being tossed and the result is "Land". With same probability, this globe was either a globe of our Earth or the globe of Mars. We know that the earth is covered 70% by water and the Mars is covered 100% by land.

Here are our facts: $$\text{Pr}[Earth] = \text{Pr}[Mars] = 0.5$$ $$\text{Pr}[Land | Earth] = 0.3$$ $$\text{Pr}[Land | Mars] = 1.0$$

We want to show that $$\text{Pr}[Earth|Land] = 0.23$$

Solution

Let's abbreviate Earth by $E$ and Mars by $M$ as well as water by $W$ and Land by $L$. Straight-forward application of Bayes theorem gives us:

$$ \text{Pr}[E|L] = \frac{\text{Pr}[L|E] \cdot \text{Pr}[E]}{\text{Pr}[L]} $$ We already have all concrete numbers for the numerator, as given in our "fact list" above. So we need to concentrate on computing the denominator $\text{Pr}[L]$.

For that we exploit the fact that we know our planet is either Earth or Mars as two distinct events and no other possibility. By applicaion of the marginalizaion principle we get: $$\text{Pr}[L] = \text{E}[\text{Pr}[L|planet]] = \sum\limits_{p \in \{E, M\}}\text{Pr}[L|p] \text{Pr}[p] = (0.5 \cdot 0.3) + (0.5 \cdot 1.0) = 0.65$$

With the latter info that $\text{Pr}[L]$ is 0.65, we have all the pieces together: $$ \text{Pr}[E|L] = \frac{\text{Pr}[L|E] \cdot \text{Pr}[E]}{\text{Pr}[L]} = \frac{0.3 \cdot 0.5}{0.65}$$

    
      
        0.3*0.5 / 0.65
      
    
  
0.23076923076923075