English
Tamil Nadu Board of Secondary EducationHSC Science Class 11

There are 7 tumblers on a table, all standing upside down. You are allowed to turn any 2 tumblers simultaneously in one move. Is it possible to reach a situation when all the tumblers - Computer Science

Advertisements
Advertisements

Question

There are 7 tumblers on a table, all standing upside down. You are allowed to turn any 2 tumblers simultaneously in one move. Is it possible to reach a situation when all the tumblers are right-side-up?

Answer in Brief

Solution

Let u – No. of tumblers right side up
v – No. of tumblers upside down
Initial stage : u = 0, v = 7 (All tumblers upside down)
Final stage output: u = 7, v = 0 (All tumblers right side up)

Possible Iterations:
(i) Turning both up side down tumblers to right side up
u = u + 2, v = v – 2 [u is even]

(ii) Turning both right side up tumblers to upside down.
u = u – 2, v = v + 2 [u is even]

(iii) Turning one right side up tumblers to upside down and other tumblers from upside down to right side up.
u = u + 1 – 1 = u, v = v + 1 – 1 = v [u is even]

Initially u = 0 and continues to be even in all three cases. Therefore u is always even. Invariant: u is even (i. e. No. of right side up tumblers are always even)
But in the final stage (Goal), u = 7 and v = 0 i. e. u is odd.
Therefore it is not possible to reach a situation where all the tumblers are right side up.

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

APPEARS IN

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

Englishहिंदीमराठी


      Forgot password?
Use app×