This is a puzzle question .... The warden meets with 23 new prisoners when they arrive. He tells them, "You may meet today and plan a strategy. But after today, you will be in isolated cells and will have no communication with one another. "In the prison is a switch room, which contains two light switches labeled A and B, each of which can be in either the 'on' or the 'off' position. I am not telling you their present positions. The switches are not connected to anything. "After today, from time to time whenever I feel so inclined, I will select one prisoner at random and escort him to the switch room. This prisoner will select one of the two switches and reverse its position. He must move one, but only one of the switches. He can't move both but he can't move none either. Then he'll be led back to his cell. "No one else will enter the switch room until I lead the next prisoner there, and he'll be instructed to do the same thing. I'm going to choose prisoners at random. I may choose the same guy three times in a row, or I may jump around and come back. "But, given enough time, everyone will eventually visit the switch room as many times as everyone else. At any time anyone of you may declare to me, 'We have all visited the switch room.' and be 100% sure. "If it is true, then you will all be set free. If it is false, and somebody has not yet visited the switch room, you will be fed to the alligators." What is the strategy they come up with so that they can be free?
6 14084two MIT math grads bump into each other at Fairway on the upper west side. they haven't seen each other in over 20 years. the first grad says to the second: "how have you been?" second: "great! i got married and i have three daughters now" first: "really? how old are they?" second: "well, the product of their ages is 72, and the sum of their ages is the same as the number on that building over there.." first: "right, ok.. oh wait.. hmm, i still don't know" second: "oh sorry, the oldest one just started to play the piano" first: "wonderful! my oldest is the same age!" problem: how old are the daughters?
2 6100What is the maximum amount of memory any single process on Windows can address? Is this different than the maximum virtual memory for the system? How would this affect a system design?
2 9845Describe the difference between Interface-oriented, Object-oriented and Aspect-oriented programming
1 11509When you?re running a component within ASP.NET, what process is it running within on Windows XP? Windows 2000? Windows 2003?
2 6699Post New Programming Languages AllOther Questions
How do you initialize a static member of a class with return value of some function?
what is adodb??y it is used for connection of V.B and access??what is ado?dao?
1. Consider the following code in our example assembly language: ; an example bit of assembly code ROOT: W FATHER FATHER: W SON1 W SON2 SON1: W NIL W NIL ; ---------------------- SON2: W GRANDSON W NIL GRANDSON: W NIL W NIL NIL = 0 Assemble this code carefully following the two pass model, and show the symbol table at the point marked by the dashed line during each pass.
How will you prove that java swing is multithreaded?
how much fee for deccan soft institute .how to block seat for sandeep sir class reply soonnnn
how to add Servlet-api.jar file into eclipse 3.3.2 ?
could you please tell me how to draw the calibration curve for HPLC {the software which we are using}?
How to print No.of.rows affected after updation using ADO.Net
What is dialog programming?
How to call a C++ function which is compiled with C++ compiler in C code?
You are given some denominations of coins in an array (int denom[])and infinite supply of all of them. Given an amount (int amount), find the minimum number of coins required to get the exact amount. What is the method called?
When will you use shell script/Perl ahead of C/C++?
what are the 3 forms of a prolog term
You are given a dictionary of all valid words. You have the following 3 operations permitted on a word: delete a character, insert a character, replace a character. Now given two words - word1 and word2 - find the minimum number of steps required to convert word1 to word2. (one operation counts as 1 step.)
Diff between IF and where ?