# calculate mutual information using joint probability distribution table

let us suppose we have following joint probability distribution table

i would like to calculate mutual information between two variable, first of all i have calculated marginal distributions

and i used following formula

which i have considered as this one

Using excel I have calculated following table

zero is written because it is accepted generally that

$0*log(0)=0$

so finally i got following result

0.334497797


because it is different from zero, that means that these two random variable are not independent right?

Yes. That can also be seen by checking that the joint probability doesn't equal the product of the marginals (at least for some values). For example $P(X=0,Y=0)=0.2$ while $P(X=0)P(Y=0)= 0.5 \times 0.3 = 0.15$