tag:blogger.com,1999:blog-4115025577315673827.post7332732591185944664..comments2019-08-23T16:42:38.981+05:30Comments on CSE Blog - quant, math, computer science puzzles: Gaadi chalaoUnknownnoreply@blogger.comBlogger13125tag:blogger.com,1999:blog-4115025577315673827.post-32494259096740405072011-07-17T12:39:06.089+05:302011-07-17T12:39:06.089+05:30@Pratik: ohhhh Thnx
but if once we can ignore that...@Pratik: ohhhh Thnx<br />but if once we can ignore that I used 2*Pie*R thing and consider it for a general arbitrary path then also it seems logical to me that we could find atleast one segment of the path which the car would not be able to cover and hence contradicting the assumption. <br />If the above approach is correct?????Unknownhttps://www.blogger.com/profile/14893097042940620429noreply@blogger.comtag:blogger.com,1999:blog-4115025577315673827.post-87647994172988466102011-07-06T13:46:30.259+05:302011-07-06T13:46:30.259+05:30@Unknown, I did not think of the word "circul...@Unknown, I did not think of the word "circular" as a circle type circular. The other solutions presented do not need to assume anything about the shape. It just means that its a round trip around a point.Pratik Poddarhttps://www.blogger.com/profile/11577606981573330954noreply@blogger.comtag:blogger.com,1999:blog-4115025577315673827.post-72422996817574759912011-06-22T17:55:08.988+05:302011-06-22T17:55:08.988+05:30I want to know if this could be a possible solutio...I want to know if this could be a possible solution:<br /><br />Lets say there does not exist any fuel dump from which one car, starting with an empty gas tank, can complete the round trip. so it means irrespective we start from any fuel dump, on the way from some fuel dump we will not be able to reach the next fuel dump.<br /><br />Now lets say there are r fuel dumps with {x1, x2, ....xR} fuel .<br />Given (x1+x2+...XR)*k=2*Pie*R where k is the dist travelled in 1 litre fuel.<br /><br />Lets say we start at the station containing x1 fuel. and last fuel pump reached was xJ i.e we couldn't reach x(J+1). <br />that is (x1+x2+..xJ)<2*Pi*R-(XJ+1+...xR) which is a contradiction.<br />x1 could be any fuel pump therefore our assumption is wrong.Unknownhttps://www.blogger.com/profile/14893097042940620429noreply@blogger.comtag:blogger.com,1999:blog-4115025577315673827.post-32660558409473741962011-02-18T22:20:37.571+05:302011-02-18T22:20:37.571+05:30@Pratik.
Understood the solution..Thanks ya!!@Pratik.<br /><br />Understood the solution..Thanks ya!!Himanshuhttps://www.blogger.com/profile/16154237895449493538noreply@blogger.comtag:blogger.com,1999:blog-4115025577315673827.post-74100269074979621672011-02-16T02:25:23.231+05:302011-02-16T02:25:23.231+05:30@Himanshu,
Rephrasing the solution- Suppose in the...@Himanshu,<br />Rephrasing the solution- Suppose in the algorithm when you begin with lots of gas. When you are doing the trip, say the lowest gas fill across time is K gallons. So, at some particular time, tank had K gallons and at all other times, it had greater than K gallons. The solution is just that, if you start with this point, i.e. with 0 gallons of gas, at all points you have something positive (as K is the minimum filled amount across time). So, one can be sure that if you are starting from this point, you will complete the trip. I hope that clarifies it. Best!Pratik Poddarhttps://www.blogger.com/profile/11577606981573330954noreply@blogger.comtag:blogger.com,1999:blog-4115025577315673827.post-88518359873966362412011-02-10T22:54:11.057+05:302011-02-10T22:54:11.057+05:30@Pratik,
can you explain this statement in more de...@Pratik,<br />can you explain this statement in more detail, possibly with some example :<br />"Assume the least amount in question was, say, K gallons. Assume also you can start your second trip with this amount of gasoline. As before, as you go, record the amounts of fuel on reaching the gas stations on your way around the trek. The list of numbers will be the same as on the first trip but shifted circularly. Thus if you remove K from each of the numbers on the list, none of the numbers will become negative."<br /><br />Nice qs btw :)Himanshuhttps://www.blogger.com/profile/16154237895449493538noreply@blogger.comtag:blogger.com,1999:blog-4115025577315673827.post-18484348294340486192010-01-07T01:09:44.175+05:302010-01-07T01:09:44.175+05:30@Giridhar.. Sorry again.. I misinterpreted your an...@Giridhar.. Sorry again.. I misinterpreted your and Asad's solutions. They are correct. Thanks.Pratik Poddarhttps://www.blogger.com/profile/11577606981573330954noreply@blogger.comtag:blogger.com,1999:blog-4115025577315673827.post-59982605962593151262010-01-04T20:35:59.653+05:302010-01-04T20:35:59.653+05:30Even my solution gives starting point. At each sta...Even my solution gives starting point. At each stage, solution for the modified track can be extended to get the solution for the original track.Giridharhttps://www.blogger.com/profile/06086734346209959881noreply@blogger.comtag:blogger.com,1999:blog-4115025577315673827.post-31613534873663948702010-01-04T20:10:44.441+05:302010-01-04T20:10:44.441+05:30@Asad.. Your solution is correct.. I understand it...@Asad.. Your solution is correct.. I understand it now. Thanx :)Pratik Poddarhttps://www.blogger.com/profile/11577606981573330954noreply@blogger.comtag:blogger.com,1999:blog-4115025577315673827.post-63138511886006730842010-01-04T17:18:27.977+05:302010-01-04T17:18:27.977+05:30You asked only for the proof, not the solution :)....You asked only for the proof, not the solution :).<br />Nonetheless, the starting point can be found out from my solution by working backwards. (Note that A, the starting pump, has lesser fuel than what is required to cover the distance. If we work backwards, removing pumps and shortening the circle, we would reach the case n=1 which will give the starting point).Asad Alihttps://www.blogger.com/profile/07133281473683565210noreply@blogger.comtag:blogger.com,1999:blog-4115025577315673827.post-9512648096703525642009-12-30T23:27:23.793+05:302009-12-30T23:27:23.793+05:30@Asad @Giridhar.. Your solution does not give me w...@Asad @Giridhar.. Your solution does not give me where to start. It cannot be the case that you can do it starting from any gas station.<br /><br />Nice solution at http://www.cut-the-knot.org<br /><br />Imagine having a big tank with enough gas for a round trip and enough room for going through the motions of emptying every gas station on your way. Start at any station and mind to record the amount of gasoline on reaching gas stations on your way around. At the end of the trip, when you pull into the station of departure with the original amount of gas, check your list. The station marked with the least number is the one where you want to start on an empty tank.<br /><br />Proof:<br />Assume the least amount in question was, say, K gallons. Assume also you can start your second trip with this amount of gasoline. As before, as you go, record the amounts of fuel on reaching the gas stations on your way around the trek. The list of numbers will be the same as on the first trip but shifted circularly. Thus if you remove K from each of the numbers on the list, none of the numbers will become negative.Pratik Poddarhttps://www.blogger.com/profile/11577606981573330954noreply@blogger.comtag:blogger.com,1999:blog-4115025577315673827.post-10719565421488185462009-12-24T10:24:54.289+05:302009-12-24T10:24:54.289+05:30Let D, F represent the length of circular track &a...Let D, F represent the length of circular track & the total amount of fuel available, respectively, at a given stage.<br /><br />Initially D = F ; this is the invariant we maintain thru out the process.<br /><br />First fix upon the direction ( clockwise/ anticlockwise ).<br /><br />Going around the track in the chosen direction you are guaranteed to find a petrol pump, say A, which has more(sufficient) petrol than(that) is needed to cover the distance to the next petrol pump, say B,( or else it implies that D > F, which is not true).<br /><br />Now we modify the track as follows :: we remove A and the track between A & B, and dump the excess petrol ( if any ) in to the next petrol pump B. Observe that we still have D = F on this modified track;<br /><br />We will carry out this process, going around in the chosen direction, until there are 2 pumps left. We can argue case-by-case at this stage.Giridharhttps://www.blogger.com/profile/06086734346209959881noreply@blogger.comtag:blogger.com,1999:blog-4115025577315673827.post-48918480489394276182009-12-23T23:08:55.385+05:302009-12-23T23:08:55.385+05:30Let's prove it by induction. For 1 petrol pump...Let's prove it by induction. For 1 petrol pump it is trivial. Suppose it holds true for n petrol pumps. Now for the n+1 case pick one petrol pump which has petrol less than what is required to reach the next petrol pump and call it point A on the circle (Note that there will always be at least one such pump barring the trivial case where each pump has just enough fuel to reach the next one).<br />Now draw an arc on the circle, starting from this pump, and covering the distance equal to the petrol in this pump. Let's call the other endpoint B.<br />"Remove" this arc from the circle. Now the resulting circle with AB removed has n petrol pumps which have more petrol than the length. A solution exists for this from the induction hypothesis. But since there is an extra length of AB to be covered note that you can cover AB by using the petrol of petrol pump A only.<br /><br />I hope the solution is clear. Drawing it on a paper would have been a better way to explain :)Asad Alihttps://www.blogger.com/profile/07133281473683565210noreply@blogger.com