Random Colourings of a Chessboard

The squares of a 3 × 3 3 \times 3 board are randomly coloured black or white. Let W W be the number of white squares and B B the number of black squares. The expected value of B W \vert B - W \vert can be expressed as a b \frac{a}{b} where a a and b b are coprime positive integers. What is the value of a + b a + b ?

Details and assumptions

The board is blank at the start.


The answer is 443.

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.

8 solutions

Ryan Phua
May 20, 2014

The expected value of B W |B-W| refers to a weighted mean of all the possible values which B W |B-W| can take on.

Since B B and W W can only take positive integers, ranging from 0 0 to 9 9 , B W = 1 , 3 , 5 , 7 , 9 |B-W| = 1,3,5,7,9 only.

For example, for B W = 9 |B-W| = 9 , either B = 9 , W = 0 B=9, W=0 or B = 0 , W = 9 B=0, W=9 . Thus, the probability of B W = 9 |B-W|=9 can be expressed as 2 ( 9 0 ) 2 9 = 2 512 \frac {2{9 \choose 0}}{2^9}=\frac {2}{512} .

In general, if B W = m |B-W|=m , then its probability is 2 ( 9 9 m 2 ) 2 9 = ( 9 9 m 2 ) 256 \frac {2{9 \choose {\frac {9-m}{2}}}}{2^9}=\frac {9 \choose {\frac {9-m}{2}}}{256} .

Note: The probabilities are calculated by multiplying the number of ways to have n n squares of one colour by 2, where n n is an integer and 1 n 9 1 \leq n \leq 9 , since there are 2 possible colours. Also, as there are n n squares of one colour, there will be 9 n 9-n squares of the other colour.

Thus, the expected value of B W |B-W| is given as:

9 ( 9 9 9 2 ) 256 + 7 ( 9 9 7 2 ) 256 + 5 ( 9 9 5 2 ) 256 + 3 ( 9 9 3 2 ) 256 + 1 ( 9 9 1 2 ) 256 9 \cdot \frac {9 \choose {\frac {9-9}{2}}}{256}+7 \cdot \frac {9 \choose {\frac {9-7}{2}}}{256}+5 \cdot \frac {9 \choose {\frac {9-5}{2}}}{256}+3 \cdot \frac {9 \choose {\frac {9-3}{2}}}{256}+1 \cdot \frac {9 \choose {\frac {9-1}{2}}}{256}

= 1 256 ( 9 ( 9 0 ) + 7 ( 9 1 ) + 5 ( 9 2 ) + 3 ( 9 3 ) + 1 ( 9 4 ) ) ={\frac {1}{256}}({9 \cdot {9 \choose 0}}+{7 \cdot {9 \choose 1}}+{5 \cdot {9 \choose 2}}+{3 \cdot {9 \choose 3}}+{1 \cdot {9 \choose 4}})

= 1 256 ( 9 + 63 + 180 + 252 + 126 ) =\frac {1}{256}(9+63+180+252+126)

= 630 256 =\frac {630}{256}

= 315 128 =\frac {315}{128}

Thus, a + b = 315 + 128 = 443 a+b=315+128=443 .

What would be a simple formula for the general case of n n squares? I.e. evaluate

1 2 n r = 0 n ( n r ) n 2 r . \frac{1}{2^n} \sum_{r=0}^n {n \choose r} |n-2r|.

Calvin Lin Staff - 7 years ago

If the board squares were randomly colored black and white, then B W |B-W| can take only five discrete values, namely 9 , 7 , 5 , 3 , 1 9 , 7 , 5 , 3 , 1 . This can be explained as follows:-

In case of all squares are black or white, then B W = 9 |B-W|=9

In case only one square is black or white, then B W = 7 |B-W|=7 , and so on ...

The next step we calculate the frequency of each value:-

The frequency of each of the five discrete values can be expressed as a combination ( a b ) {a \choose b}

where:- a = a= the total number of squares, b = b= the number of squares of one color

For example:- the frequency of the value 5 5 can be expressed calculated as ( 9 2 ) × 2 {9 \choose 2}\times2 , where the two factor comes from the fact that B W = 5 |B-W|=5 occurs when there are two white squares (rest black) of two black squares (rest white)

The calculated frequencies are as follows:- 2 2 for 9 9 , 18 18 for 7 7 , 72 72 for 5 5 , 168 168 for 3 3 , 252 252 for 1 1 , totaling 512 = 2 9 512=2^9

Finally, the weighted mean (expected value) is 9 × 2 + 18 × 7 + 72 × 5 + 168 × 3 + 252 × 1 512 = 315 128 \frac {9\times2+18\times7+72\times5+168\times3+252\times1}{512}=\frac {315}{128} , making the solution 315 + 128 = 443 315+128=443

Jian Feng Gao
May 20, 2014

We know that the total possible ways of coloring will be 2^9 (either black of white)

We have 5 cases

9 white, 0 black - can be done in 9C0=1 way, therefore value of |B−W|= 9

8 white, 1 black - can be done in 9C1 = 9 ways, therefore value of |B−W|= 7

7 white 2 blacks - can be done in 9C2= 36 ways, therefore value of |B−W|= 5

6 white 3 blacks - can be done in 9C3 = 84 ways, therefore value of |B−W|= 3

5 white 4 blacks - can be done in 9C4 = 126 ways, therefore value of |B−W|= 1

The same will happen for 4 white 5 blacks, 3 white 6 blacks, 2 white 7 blacks, 1 white 8 blacks, and 9 white 0 blacks.

Therefore the expected value is of |B−W| is calculated from;

(1/2^9) x (2x9x1 + 2x9x7 + 2x36x5 + 2x84x3 + 2x126x1)

=1260/512 =315/128

Therefore, the value of a+b

Notice the value of B W |B - W| equals 9 when there are 9 black or 9 white squares, 7 when there are 8 of one color and one of the other, 5 when there are 7 of one color and 2 of the other, 3 when we have 6 of one color and 3 of the other, and 1 when we color 5 of one color and 4 of the other. Notice that these colorings can be done by choosing a certain number of squares to paint black, and leave the remaining squares white, we can do this in ( 9 x ) {9 \choose x} ways where x is the number of black squares we need. We then calculate the expected value by multiplying each value of B W |B - W| by its probability, considering there are 2 9 2^9 possible outcomes in all since each of the nine squares can be colored black or white, we then obtain that the expected value equals i = 0 9 ( 9 x ) 2 9 x ( 9 x ) \displaystyle \sum_{i=0}^9 \frac{{9 \choose x}}{2^9} \cdot |x - (9-x)| , which works out to 315 128 \frac{315}{128} , from which a + b = 315 + 128 = 443 a + b = 315 + 128 = 443

Karan Theron
May 20, 2014

There are 9 squares. So total number of ways in which the board can be colored will be 2^9.

Different possible values of |B - W| are:- i) 9 No of ways = C(9, 0) + C(9, 9) = 2 ii) 7 No of ways = C(9, 1) + C(9, 8) = 18 iii) 5 No of ways = C(9, 2) + C(9, 7) = 72 iv) 3 No of ways = C(9, 3) + C(9, 6) = 168 v) 1 No of ways = C(9, 4) + C(9, 5) = 252

Expected value = (9 2 + 7 18 + 5 72 + 3 168 + 1*252)/512 = 315/128

a + b = 443

Caroline Sudipa
May 20, 2014

the various cases possible are: (denoting black by B and white by W) difference Product(p) 1. 9B - 9C9 ways 9 9C9* 9 2. 8B,1W - 9C8 ways 7 9C8* 7 3. 7B,2W - 9C7 ways 5 9C7* 5
4. 6B,3W - 9C6 ways 3 9C6* 3 5. 5B,4W - 9C5 ways 1 9C5* 1 and others similarly
Then expected value = (Sum of all p's)/2^9=315/128 Thus a+b=315+128=443

Wittmann Goh
May 20, 2014

To find the value of B W |B-W| , we simply have to find the average of each value multiplied by its probability.

Without loss of generality, assume B W B \geq W since the values are interchangeable.

Expected value of B W |B-W| is therefore [ ( v a l u e o f B W ) × ( n u m b e r o f w a y s t o c o l o r B n u m b e r o f s q u a r e s o u t o f 9 b l a c k ) ] t o t a l n u m b e r o f w a y s t o c o l o r t h e b o a r d \frac{\sum [(value of B-W)\times(number of ways to color B number of squares out of 9 black)]}{total number of ways to color the board} = ( 5 4 ) × ( 9 5 ) + ( 6 3 ) × ( 9 6 ) + ( 7 2 ) × ( 9 7 ) + ( 8 1 ) × ( 9 9 ) + ( 9 0 ) × ( 9 9 ) ( 9 5 ) + ( 9 6 ) + ( 9 7 ) + ( 9 8 ) + ( 9 9 ) =\frac{(5-4)\times{9 \choose 5}+(6-3)\times{9 \choose 6}+(7-2)\times{9 \choose 7}+(8-1)\times{9 \choose 9}+(9-0)\times{9 \choose 9}}{{9 \choose 5}+{9 \choose 6}+{9 \choose 7}+{9 \choose 8}+{9 \choose 9}} = 126 + 252 + 180 + 63 + 9 126 + 84 + 36 + 9 + 1 = 630 256 = 315 128 =\frac{126+252+180+63+9}{126+84+36+9+1}=\frac{630}{256}=\frac{315}{128}

Thus a + b = 315 + 128 = 443 a+b=315+128=443

Calvin Lin Staff
May 13, 2014

For any colouring, B + W = 9 B + W = 9 . Suppose there are k k white squares. This happens with probability ( 9 k ) 2 9 \frac{\binom{9}{k}}{2^9} , and the value of B W \vert B - W \vert is ( 9 k ) k = 9 2 k \vert (9-k)-k \vert = \vert 9 - 2k \vert . We can calculate the expected value of B W \vert B - W\vert by summing over all k k . This gives 1 2 9 k = 0 9 ( 9 k ) 9 2 k = 1 2 9 ( 1 × 9 + 9 × 7 + 36 × 5 + 84 × 3 + 126 × 1 + 126 × 1 + 84 × 3 + 36 × 5 + 9 × 7 + 1 × 9 ) = 1260 2 9 = 315 128 . \begin{aligned} \frac{1}{2^9} \sum\limits_{k=0}^{9} \binom{9}{k} \vert 9-2k \vert &= \frac{1}{2^9} (1 \times 9 + 9 \times 7 + 36 \times 5 + 84 \times 3 + 126 \times 1 + 126 \times 1 + 84 \times 3 + 36 \times 5 + 9 \times 7 + 1 \times 9) \\ &= \frac{1260}{2^9} \\ &= \frac{315}{128}. \end{aligned}

Hence a + b = 315 + 128 = 443 a + b = 315 + 128 = 443 .

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...