Lingyis said: 36 medals, 6 days.
i originally wrote down the equations for the series... but noticed that it gets too complex too quickly, with the recursive equations hardly easy to solve. after staring at it for a while, i realized it's best to work backwards--starting from the last day. once you realize the last day has to be on a day that's a multiple of 6 (because of the 1/7 condition), the rest is basically tedious work and showing that this answer is the unique solution. |
You know, it's funny. I had a different answer that I thought was right and hell, it is, if you allow decimals to become the natural number before them (i.e. 7,99 is 7). Redoing the exercise through my very own procedure, I arrive at your same answer, it seems there's something I didn't consider (or considered wrong) last time.
However the other answer is also right if what I said above is true. Funny huh? My answers were 57 and 7. Do the try, it fits extremely well, and arguably it is a better answer since the number of medals given per day doesn't match the number of days except for the last one (and maybe some days, I don't recall).
Also, the equations are:
For the first day: (m+6)/7=k and for the second day: (6m+78)/7=k; where k is the number of medals given per day. If we say k is the same for every day, then (m+6)/7=(6m+78)/7. Solving this gives us the answer m=36 and then k=6, and then I proceed to show that it's right.
Your answer is right, but I don't get your argument for the day being a multiple of 6 if there's the 1/7 condition.
My other answer ended up being the same first day but a different second day, where I messed up the part of what remained) and k would give me a fractioned result. That's when I made the addition of the first day and the second day, to find a new k. I equaled this one with the first day and k surprisingly gave me a 12. Then I got m=57 and n=7. Doing the procedure, I found that in certain divisions for the number 7, I got decimals, and I decided to lower these decimals to the highest natural number before them. In the end, everything fit like a puzzle.
So who's right? I'd say you and my new answer are right because I seriously believe I messed up the equation for the second day in my first procedure. Congratulations!
***
For your interview problem, I'm going to say this:
I begin with the 10th floor, if it doesn't break, I go up to the 20th if it doesn't break, the 30th, and so on.
At one of those ten floors it must break, then I just go down to the one I tried before +1 (so for example, if it broke on the 40th floor, I go to the 31st) and start going from there and up.
This would take a maximum of 20 trials, supposing it breaks at the 100th floor for the first plate, then I lower to the 91st and it doesn't break until I reach the 100th floor again.
That's what I'd do anyway. Can you really get a better strategy than that?
EDIT: So I was thinking about this problem some more and I came with similar solutions that also give me a maximum of 20 trials...it's if you jump in intervals of 8, 9, 11, 12 and 13. Any lower or higher than that and the maximum turns into 21.