Sunday, 16 September 2012

Solution: Toggling of 100 switches..

  Adjust the font size     Reset ↕


This is a little tricky. Say switches nos are 1 to 100.
after 1st round, all switches are ON (All were OFF, so toggling will make all ON)
after 2nd round, all switches divisible by 2 (switch no divisible by 2) are TOGGLED
after 3rd round, all switches divisible by 3 (switch no divisible by 3) are TOGGLED
after 4th round, all switches divisible by 4 (switch no divisible by 4) are TOGGLED

In other way, we can see that all switches having ODD no of divisors are going on be ON, and all switches with EVEN no of Divisors are going to be OFF.
e.g. Switch No
1 == >> divisor is 1 (ODD count), will be ON
2 == >> divisors are 1, 2 (EVEN count), will be OFF
3 == >> divisors are 1,3 (EVEN count), will be OFF
4 == >> divisors are 1, 2, 4 (ODD count), will be ON
Now how to find out all nos from 1 to 100 having ODD no of divisors. This is again tricky. Only SQUARE Nos will have ODD no of divisors :-) so simple.
So nos with ODD divisor count are: 1,4,9,16,25,36,49,64,81,100
So answer is: Switches with SQUARED no will be ON after 100 rounds (All other will be OFF).


Click Here To add Comment

Your feedback is always appreciated.
I will try to reply to your queries as soon as time allows.
Please do not spam Spam comments will be deleted immediately upon our review.

Blogger Widgets

Recent comments

Send Quick Massage


Email *

Message *

Recent posts

Total Pageviews