Information counting

52 Views Asked by At

I have a problem from my class:

"In New York City, the probability of rain on the 4th of July is 40%. On Thanksgiving (in November), the probability of rain there is 65%, while the probability of snow is 15%. Which message on the presence or absence of precipitation brings more information - on Thanksgiving or the 4th of July? Compute that information in bits. Precipitation includes both rain and snow."

My solution:

$p($precipitation on 4th July$) = 0.4$, $p($absence$) = 0.6$

$p($precipitation on Thanksgiving$) = 0.8$, $p($absence$) = 0.2$

$I($Presence on Thanksgiving$)$ $= -log_2(0.8) = 0.32$ bit

$I($Presence on the 4th July$)$ $= -log_2(0.4) = 1.32$ bit

$I($Absence on Thanksgiving$)$ $= -log_2(0.2) = 2.32$ bit

$I($Absence on the 4th July$)$ $= -log_2(0.6) = 0.73$ bit

Is it correct?