In a kingdom far far away, the King decided that the time
has come to find a husband for his princess daughter. The
King wanted to find a worthy lad for his princess, so he
promised to give his daughter away to the first young (or
old) man who would solve the puzzle that has stumped the
best of his court mathematicians for years. The puzzle is
very simple: in a palace, there are 25 rooms arranged in a
square--5 rows of rooms with 5 rooms in each row. In every
room there is a light switch which not only switches on/off
the light in that room, but also switches the lights in the
adjacent rooms--the room to the right, to the left, the
room above and the room below. Initially, all of the
lights are turned off. The goal is to turn the lights on
in every room of the palace.

Answers were Sorted based on User's Feedback



In a kingdom far far away, the King decided that the time has come to find a husband for his princ..

Answer / sajjad

10110
11111
11111
01101
11111

0 - room to switch on the light.

Now where is the princess. :)

Is This Answer Correct ?    0 Yes 1 No

In a kingdom far far away, the King decided that the time has come to find a husband for his princ..

Answer / andy

01101
01110
00111
11011
11000

... and rotations of this.

The problem can be written as a system of 25 equations in 25
unknown over the field Z mod two, and then solved using
linear algebra (hopefully with the aid of a computer).

Is This Answer Correct ?    3 Yes 5 No

In a kingdom far far away, the King decided that the time has come to find a husband for his princ..

Answer / guest

just switch on the 5 lights in the rooms to the right

Is This Answer Correct ?    3 Yes 5 No

In a kingdom far far away, the King decided that the time has come to find a husband for his princ..

Answer / govind

SWitch ON light frm the 13 room, it will switches light frm
al other adjacen ROOMS .... Imagine it....
00000
00000
00000
00000
00000
0-> Indicates the ROOMS
go & switch on frm 3rd row n 3rd column light..

Is This Answer Correct ?    1 Yes 3 No

In a kingdom far far away, the King decided that the time has come to find a husband for his princ..

Answer / mihir gupta

you have to switch on 9 lights....

Is This Answer Correct ?    0 Yes 2 No

In a kingdom far far away, the King decided that the time has come to find a husband for his princ..

Answer / md

f6b2b
gfabc
7a1a3
geadc
e5d4d

1,2,3,4,5,6,7 indicate switch-rooms in order of switching
on their switches.
a corresponds to adjuscent rooms which lit due to step 1
b corresponds to adjuscent rooms which lit due to step 2
....
g corresponds to adjuscent rooms which lit due to step 7

Is This Answer Correct ?    4 Yes 7 No

In a kingdom far far away, the King decided that the time has come to find a husband for his princ..

Answer / manish verma

Only 1 light needs to be switched ON, & it will switch on
the rest of the lighhts.

Is This Answer Correct ?    2 Yes 5 No

In a kingdom far far away, the King decided that the time has come to find a husband for his princ..

Answer / pooja devraj

only 1 light need to switch on, gradually the remaining all
will become on.

1 0 0 0 0
0 0 0 0 0
0 0 0 0 0---->
0 0 0 0 0
0 0 0 0 0

1 1 0 0 0
1 0 0 0 0
0 0 0 0 0---->
0 0 0 0 0
0 0 0 0 0

1 1 1 0 0
1 1 0 0 0
1 0 0 0 0----> like this
0 0 0 0 0
0 0 0 0 0



this is the answer given by "ALPHY"

tz an excellent answer..

i agree....

bt litting frm room one takes a long tym to lite up all 25
rooms..

so to save time lets lit up the room at the center

y waste its advantage like it can lite its adjacent rooms..

quiet quick ryt.


SO.............


it can also be as...


0 0 0 0 0
0 0 0 0 0
0 0 1 0 0---->
0 0 0 0 0
0 0 0 0 0


0 0 0 0 0
0 0 1 0 0
0 1 1 1 0---->
0 0 1 0 0
0 0 0 0 0


0 0 1 0 0
0 1 1 1 0
1 1 1 1 1---->
0 1 1 1 0
0 0 1 0 0

0 1 1 1 0
1 1 1 1 1
1 1 1 1 1---->
1 1 1 1 1
0 1 1 1 0

1 1 1 1 1
1 1 1 1 1
1 1 1 1 1---->
1 1 1 1 1
1 1 1 1 1



ryt?? :)

Is This Answer Correct ?    3 Yes 6 No

In a kingdom far far away, the King decided that the time has come to find a husband for his princ..

Answer / siva

in 4 rooms the lights are made on

Is This Answer Correct ?    2 Yes 9 No

In a kingdom far far away, the King decided that the time has come to find a husband for his princ..

Answer / superman

U have to on 4 light only.

The room of which light need to on is indicated by 0,

11111
10101
11111
10101
11111

Is This Answer Correct ?    2 Yes 13 No

Post New Answer

More Puzzles Interview Questions

Annie, Bunnie, Candy and Dina visited Edy on 14th February. 1. The time of each visit was as follows: - Annie at 8:00 - Bunnie at 9:00 - Candy at 10:00 - Dina at 11:00 Each time mentioned above may be either AM or PM. 2. Candy did not visit Edy between Bunnie and Dina. 3. At least one female visited Edy between Annie and Bunnie. 4. Annie did not visit Edy before both Candy and Dina. Can you tell at what time did they individually visit Edy?

3 Answers  


A worker earns a 5% raise. A year later, the worker receives a 2.5% cut in pay, & now his salary is Rs. 22702.68 What was his salary to begin with?

3 Answers  


Find the 8, 19, 21, 25, 20, ?

10 Answers   Accenture,


Assume for a moment that the earth is a perfectly uniform sphere of radius 6400 km. Suppose a thread equal to the length of the circumference of the earth was placed along the equator, and drawn to a tight fit. Now suppose that the length of the thread is increased by 12 cm, and that it is pulled away uniformly in all directions. By how many cm. will the thread be separated from the earth's surface?

4 Answers  


In Mr. Mehta's family, there are one grandfather, one grandmother, two fathers, two mothers, one father-in-law, one mother-in-law, four children, three grandchildren, one brother, two sisters, two sons, two daughters and one daughter-in-law. How many members are there in Mr. Mehta's family? Give minimal possible answer.

2 Answers  






The minute and the hour hand of a watch meet every 65 minutes. How much does the watch lose or gain time and by how much?

3 Answers   HCL,


In rail road there are some stations. Each station should have tickets to all other stations.If they add some new stations they need 46 more tickets.How many stations are there before and after adding the stations?

0 Answers   Infosys,


Ali Baba had four sons, to whom he bequeathed his 39 camels, with the proviso that the legacy be divided in the following way : The oldest son was to receive one half the property, the next a quarter, the third an eighth and the youngest one tenth. The four brothers were at a loss as how to divide the inheritance among themselves without cutting up a camel, until a stranger appeared upon the scene. Dismounting from his camel, he asked if he might help, for he knew just what to do. The brothers gratefully accepted his offer. Adding his own camel to Ali Baba's 39, he divided the 40 as per the will. The oldest son received 20, the next 10, the third 5 and the youngest 4. One camel remained : this was his, which he mounted and rode away. Scratching their heads in amazement, they started calculating. The oldest thought : is not 20 greater than the half of 39? Someone must have received less than his proper share ! But each brother discovered that he had received more than his due. How is it possible?

2 Answers  


condition: there is a room in which you r sitting in middle.and infront of you there is two persons and two doors.behind 1 door there is success and behind another door there is failure,but you don't know behind which door success is.out of above 2 person one always speak truth and other always lie and you also don't know who speak true and who speak lie. question: you have to select success door by asking only one question....so what only one question you ask to get sucess door? note:you are not supposed to ask two question 1 with each person

2 Answers   Infosys,


Substitute digits for the letters to make the following addition problem true. W H O S E T E E T H A R E + A S ------------------- S W O R D S Note that the leftmost letter can't be zero in any word. Also, there must be a one-to-one mapping between digits and letters. e.g. if you substitute 3 for the letter H, no other letter can be 3 and all other H in the puzzle must be 3.

1 Answers  


Sachin, Dravid and Ganguly played in a Cricket match between India and England. ? None of them scored more than 99 runs. ? If you add the digits of the runs scored by Sachin to his own score, you will get the runs scored by Dravid. ? If you reverse the digits of the runs scored by Dravid, you will get the runs scored by Ganguly. ? The total runs scored by them is 240. Can you figure out their individual scores?

5 Answers  


what is Next number in the series is 1 , 2 , 4 , 13 , 31 , 112 , ?

10 Answers   Infosys,


Categories