Entropy of two dice

Alice rolls two dice, and wants to communicate their sum to Bob. What is the entropy of this message?

Round your answer to the nearest hundredth.


The answer is 3.27.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

First, let's figure out probability of each even occurring. Dice has numbers 1,2,3,4,5 and 6. The sum of two dice therefore takes values from 2 to 12. To get sum = 2, dice a a must show 1 and dice b b must show 1 too. The probability of such event occurring is 1 6 1 6 = 1 36 \frac{1}{6}*\frac{1}{6} = \frac{1}{36} . To get sum = 3, dice a a must show 1 while dice b b must show 2. However, the sum = 3 also when dice a a is 2 while dice b b is 1. Therefore, probability of getting the sum = 3 is 1 6 1 6 + 1 6 1 6 = 2 36 \frac{1}{6}*\frac{1}{6} + \frac{1}{6}*\frac{1}{6} = \frac{2}{36} . If we continue with this logic, the sum with highest probability will be 7: there are 6 possible combinations of two numbers from 1 to 6 to give the sum = 7. After 7, probability of next sums will decline. For example, to get sum = 12, both dice must show 6, which is an event with probability 1 6 1 6 = 1 36 \frac{1}{6}*\frac{1}{6} = \frac{1}{36} . The final formula to calculate entropy is 1 36 l o g 2 ( 36 1 ) + 2 36 l o g 2 ( 36 2 ) + 3 36 l o g 2 ( 36 3 ) + . . . + 6 36 l o g 2 ( 36 6 ) + 5 36 l o g 2 ( 36 5 ) + 4 36 l o g 2 ( 36 4 ) + . . . + 1 36 l o g 2 ( 36 1 ) = 3.274402 \frac{1}{36}log_2(\frac{36}{1}) + \frac{2}{36}log_2(\frac{36}{2}) + \frac{3}{36}log_2(\frac{36}{3}) + ... + \frac{6}{36}log_2(\frac{36}{6}) + \frac{5}{36}log_2(\frac{36}{5}) + \frac{4}{36}log_2(\frac{36}{4}) + ... + \frac{1}{36}log_2(\frac{36}{1}) = 3.274402

Daniel Jansson
Jul 16, 2020

Solving the problem using Mathematica:

1
2
pmf[x_] = (6 - Abs[x - (6 + 1)]) / 36;
-Sum[pmf[x] * Log2[pmf[x]], {x, 2, 12}] // N

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...