Here is a problem I have for a computer class. It's seems kind of mathematical to me and could possibly involve the binary code. I'm not sure, all my ideas lead to dead ends.
Nineteen students are given the opportunity to win a prize by playing a game. After some time to decide on a strategy, all the students will be placed into separate soundproof isolation chambers with absolutely no way to communicate.
The game is played as follows. There are two light switches in a room that will begin in the "off" position. I will bring students into this room one at a time. Each time a student enters the room then he or she must flip one of the switches. All the students will eventually be brought into the room, but some students may be brought in more than one time.
If one person correctly tells me that everyone has been in the room, then everyone wins the prize. However, if someone incorrectly tells me that everyone has been in the room then everyone will be fed to the alligators! Note that either all the students win the prize or else everyone loses.
Your task is to determine a strategy that will be sure to allow everyone to win the prize (and not be eaten by alligators).
Update:The professor told us that there IS a solution to the problem.
Copyright © 2024 EBIN.TIPS - All rights reserved.
Answers & Comments
Verified answer
I've convinced myself it can't be done. You've only got two bits of state available to encode a five bit value (the number of students).
Given the digits used, the backside could desire to be a minimum of 9. sounds like its 13. here is what I did. I found out what the final digit ought to be. by way of fact the -50x term has a nil in the tip of the consistent, it would not make a contribution something to the result. Then to make this artwork out proper while we upload 5x^2 and a hundred twenty five this has to have a nil as that is final digit. So I basically tried stuff till I have been given one that labored. First I decide what 5^2 = 25 is in the backside i pick to aim. i could desire to multiply this via 5, for the 5x^2, yet i actual basically care bearing directly to the final digit so i actual basically could desire to multiply 5 via the final digit the switched over version of 25. although this seems to be, returned I basically could desire to confirm the final digit. as quickly as I upload 5 this desires to get me 0 in the hot base. 25 base 10 = 27 base 9, 7 x 5 = 35 base 10 = 28 base 9, 8 + 5 <> 0 base 9, so no good 25 base 11 = 23 base 11, 3 x 5 = 15 base 10 = 14 base 11, a million + 5 <> 0 base 11, so no good 25 base 10 = 21 base 12, a million x 5 = 5 base 10 = 5 base 12, 5 + 5 <> 0 base 12, so no good 25 base 10 = 1C base 13, C x 5 = 60 base 10 = 40 8 base 13, 8 + 5 = 0 base 13, so it ought to artwork then you definitely basically could desire to plug in and view. 1C x 5 = ninety 8 base 12 ninety 8 + a hundred twenty five = 1C0 base 12 -50(5) = -1C0 base 12 8^2 = sixty 4 base 10 = 4C base 13 4C x 5 = 1B8 base 13 1B8 + a hundred twenty five = 2E0 base 13 -50(8) = -2E0 base 13