g , on any given day follows a probability distribution p G ( g ) .
Some people buy their gas whenever their tank reaches empty. A smarter strategy (which we'll call "Wait long, buy low") is to wait for a good price, and then buy a lot of it. Suppose the price of fuel per gallon,To use the "Wait long, buy low" strategy, one buys gas once per month on the first day that the price is unlikely to be lower in a run of 30 days. If the price doesn't satisfy that condition in the first 29 days, then you buy gas on the 30th day, regardless of its price.
What is the average amount (in dollars) that you pay for gas per gallon in any given month?
Assumptions and Details
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
This approach is incorrect because the problem is about evaluating the effect of a given threshold, not finding an optimal one.
Here is one way to get to the answer without programming.
Please excuse me for posting an image since I am not good enough with LaTeX yet.
p.s. One way to turn this into a true programming problem would be to buy gas on such a day that it is unlikely to witness a lower price on the "remaining" days, which means we will accept higher prices as we get nearer to the end of the month. Also, this strategy seems to be better, judging from the outputs of my program centered around 2.561.
If someone would like to run some massive simulation, I am attaching my code.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 |
|
Problem Loading...
Note Loading...
Set Loading...
Let Φ ( x ) denote the area under the standard normal distribution in the range [ − ∞ , x ] . Assume that we set a threshold of x for buying the gas. Hence our expected cost would be C ( x ) = x ( 1 − ( 1 − Φ ( σ G x − g ˉ ) ) 2 9 ) + g ˉ ( 1 − Φ ( σ G x − g ˉ ) ) 2 9 Here the first term gives the expected cost when the gas price falls below x in the first 2 9 days and the second term gives the expected cost when it does not. Now the answer may be obtained by optimizing C ( x ) over x graphically.