You have two fuses… they burn at different rates and not at
steady rates. BUT! They only burn for one hour. One could burn the
entire way except one inch within one minute, then spend the last 59 on
that last inch, for example.
You also have to use this to somehow time 45 minutes exactly. How would you do it?
11,392 Views |
light both ends of fuse 1 and one end of fuse 2 at the same time. Fuse 1 will take exactly 30 minutes to burn out since you are burning both ends at the same time. The instant that fuse 1 burns out, light the other end of fuse 2. At that point fuse 2 has burned for 30 minutes and has 30 minutes remaining. By burning the other end of fuse 2, the remaining burning time will be halved to 15 minutes. So the total time is 30 + 15 = 45 minutes.
We can measure 30mins.45mins and 1hr and 2hr in this case.
Can anybody suggest an algorithm with which u can find all measurable time intervals for ‘n’ number of fuses.
“light both ends of fuse 1 and one end of fuse 2 at the same time. Fuse 1 will take exactly 30 minutes to burn out since you are burning both ends at the same time.” …Answer one consider that rate of burning is same..which is contradictory to question.
Answer 1 is correct, it does not contradict the given, whatever the distribution of the fuse, it will take 30 min to burn up if lighted in both ways and if 30 min later u light the second end of the rope it will take 30/2 min to end.
An algorithm to get all possible time intervals:
we have to notice that there is kind of **pattern** when adding new fuse
Notice
1 Fuse –> 60 , 30
2 Fuses–> 120, 90, 75, 60, 45, 30
3 Fuses–> 180, 165, 150, 135, 120, ….
Here is the algorithm (it is a simple recursive one)
void GetPossibleTimeIntervals(int n, int *intervals, int* numOfIntervals)
{
if(n == 1)
{
intervals[0] = 60;
intervals[1] = 30;
*numOfIntervals = 2;
}
else
{
GetPossibleTimeIntervals(n-1, intervals, numOfIntervals);
int newTime = intervals[*numOfIntervals-1] / 2;
int i = *numOfIntervals;
int j = 0;
for(j = 0; j 30)
intervals[(*numOfIntervals)++] = intervals[j] - newTime;
intervals[(*numOfIntervals)++] = intervals[j] + newTime;
}
}
}
Please note that you have to remove the duplicates from the array…also, i didnt consider fractions (30 seconds, 15 seconds)..you will need to adapt the array type to float and work accordingly.
janet jackson nude [url=http://www.forumprofi2.de/forum4508]janet jackson nude[/url]
Is it too dumb just to suggest that you start one fuse 15 minutes before the other, and begin counting from when the second fuse is lit? When the first fuse runs out, 45 minutes will have elapsed.
?
Answer 8 is correct in the first part. It is dumb.
You don’t have a watch, otherwise, why would you need these fuses to measure time?
Now, let me consider this solution on the concrete example. Fuse one has the following property: it is 10 inches long and it burns at 1/15 inches per minute for the first 45 minutes and then (due to heat from burning) undergoes a phase transition and starts burning at 7/15 inches per minute. So, all in all, it will burn for exactly one hour. But, if I light it from both ends it will burn for… 1/15*45 + 1/15*45 = 6 inches before the phase transition, and then for another 15*4/7 =~ 8.6 minutes. Total of 53.6 minutes, not half an hour.
Leave an Answer/Comment