English
Tamil Nadu Board of Secondary EducationHSC Science Class 11

Assume an 8 × 8 chessboard with the usual coloring. "Recoloring" operation changes the color of all squares of a row or a column. You can recolor repeatedly. The goal - Computer Science

Advertisements
Advertisements

Question

Assume an 8 × 8 chessboard with the usual coloring. "Recoloring" operation changes the color of all squares of a row or a column. You can recolor repeatedly. The goal is to attain just one black square. Show that you cannot achieve the goal.

Sum

Solution

Let us start with a normal coloured chessboard, with a number of black squares B = 32 and the number of white squares W = 32.
So W – B = 0, which is divisible by 4 and W + B = 64.
W-B = 0 mod 4

Whenever we change the colours of a row or column, we change the colour of 8 squares. Let this row (or column) have w white squares + b black squares w + b = 8 squares.

If this operation B increases (or decreases) by 2n, then W decreases (or increases) by 2n so that W + B = 64, but B – W will change by 4n and it will remain divisible by 4.
W – B = 0 mod 4

After every operation, “B – W mod 4” can have no other values.
But the required state has 63 white squares and 1 black square, so it requires
W - B = 63 - 1 = 62 = 2 mod 4 which is impossible.

shaalaa.com
Invariants
  Is there an error in this question or solution?
Chapter 8: Iteration and recursion - Evaluation - Section - D [Page 114]

APPEARS IN

Samacheer Kalvi Computer Science [English] Class 11 TN Board
Chapter 8 Iteration and recursion
Evaluation - Section - D | Q 1. | Page 114
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×