# A perfect example for boolean mapping problems

Boolean mapping and other type of mapping is one of the typical adhoc method to solve a question..

My first program is about solving a puzzle of this sort. The puzzle is actually a technothlon math puzzle for school students (pen and paper based, not coding). I had tough time to solve the question using basic math logic, then i wondered “How about solving the question using a program”. That’s how I got introduced myself to the programming world.

The puzzle is as follows :

Q.There are 1000 bulbs and 1000 children in a big hall. The first child lights up all the bulbs. The second one puts off every second bulb. The third child then reverts the state of every third bulb. The fourth one does the same with every fourth bulb and so on. When all the 1000 children do their part, how many bulbs are still switched off?

You might have solved this question, but you may not have tried to write a program for it.

So, after a long time (2 to 3 moths). I have encountered another problem of this sort at codechef.(Closing the Tweets)