Suppose there are b black, w white and r red tiles on a table. We are allowed to replace two tiles of different colors with the third color. Note one thing here that this third colored tile is from our pool containing infinite black, white and red tiles.
If we start replacing tiles, can we reach at a state where there is only one tile left on the table?
If YES, then how? and what will be the color of that last tile?
If NO, then why not?
You have to solve this problem with the help of pre-conditions, post-conditions and invariant.
[Example: Let’s say, there are three tiles (1 black, 1 white, 1 red) on the table.
If we pick two tiles (say 1 black and 1 white), we have to replace them with 1 red tile. Now there will be 2 red tiles on the table with no white or black tiles. ]
2 answers
TELL ME THE NSWER
15