मराठी
तामिळनाडू बोर्ड ऑफ सेकेंडरी एज्युकेशनएचएससी विज्ञान इयत्ता ११

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

प्रश्न

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?

थोडक्यात उत्तर

उत्तर

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
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 8: Iteration and recursion - Evaluation - Section - C [पृष्ठ ११४]

APPEARS IN

सामाचीर कलवी Computer Science [English] Class 11 TN Board
पाठ 8 Iteration and recursion
Evaluation - Section - C | Q 1. | पृष्ठ ११४
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×