Author Topic: Gasoline problems  (Read 15028 times)

testpost

  • Newbie
  • *
  • Posts: 23
Gasoline problems
« on: 八月 04, 2004, 02:06:24 pm »
Inspired by Mr Pazzle, I post a question:
(Forgive my ugly sentence and the lengthy post)

An oil field is found near an island. Soon after,
a gasoline refining station built right on the
island. And this becomes a gasoline supplier
for surrounding area.

A transport company is response to deliver gasoline
from port A on the island to the nearest port B.

Company owns only 1 type of vessel which carries
upto v liter of gasoline (include its own tank). It
consumes gas carried when sailing.

Assumption a:
Sailing certain distance of this vessel consumes
the same amount of gas regardless the load and any
other factors. Sailing s km always use v liter of
gas.

Assumption b:
Vessle can feed each other any where they meet.
(i.e. it can stay in middle between A and B to
serve as a temporary gas station)

Assumption c:
The company owns unlimited vessel at port A.

Assumption d:
B have no other source of gasoline except from A.

Question 1:
Provided (n*v) liter of gas at A, How far theoretically
a vessle can go? [Consider n>1, measure it using s]

Question 2:
Provided (n*v) liter of gas at A, How for theoretically
a vessle can go if all vessel are required to go back
to A?

If you don't get 1 and 2, try this:
Question 3:
Gas sales at c cents per liter at A. at B, s km away from
A, what is the cheapest price (theoretically) for gas?
[Only from gas cost perspective]

Question 4:
Add this requirement to Q3: All vessel must goback to A
at end of the day?

If 1, 2 is too easy for you, try this:
Given: Gas sales at c cents per liter at A.
Require: All vessel must goback to A at end of the day.

5. How many liter of gas must be shipped out to B per
day to maintain 10c cents per liter at B?

Still easy? Oops, try to tell me:
6. Where you can find the cheapest gas in US continent?
testposttestposttestpost

packman

  • Full Member
  • ***
  • Posts: 226
Gasoline problems
« Reply #1 on: 八月 04, 2004, 02:33:53 pm »
Hi, testpost:
 It is better to open a new thread for a new problem.
 Anyway, here's my answer:

Question 1:
Provided (n*v) liter of gas at A, How far theoretically
a vessle can go? [Consider n>1, measure it using s]
n*s. Oops, now the boat is stuck there.

Question 2:
Provided (n*v) liter of gas at A, How for theoretically
a vessle can go if all vessel are required to go back
to A?
n*s/2, waste all the gasoline for nothing

Question 3:
Gas sales at c cents per liter at A. at B, s km away from
A, what is the cheapest price (theoretically) for gas?
[Only from gas cost perspective]
n*c/(n-1)

Question 4:
Add this requirement to Q3: All vessel must goback to A
at end of the day?
n*c/(n-2)

5. How many liter of gas must be shipped out to B per
day to maintain 10c cents per liter at B?
You mean 10 times higher? then 20v/9

6. Where you can find the cheapest gas in US continent?
This is a guess: Texas?? :wink:
简单==完美

testpost

  • Newbie
  • *
  • Posts: 23
Gasoline problems
« Reply #2 on: 八月 04, 2004, 03:22:20 pm »
Question 1:
n*s. Oops, now the boat is stuck there.


You cannot get there. Be aware one boat can
only carry v not n*v. If you need carry all
gas, you need n boat and if all of them go
straight, they stucked at s not n*s.

Question 2 to 5:
When you find out that is costful to get
any further than s, the gas price won't cheap.

Question 6:
This is the most tricky question. My friend told
me "underground". Quite true but not enough. I
think there is a "slice" difference between raw
oil and gas. I have no answer to it.
testposttestposttestpost

packman

  • Full Member
  • ***
  • Posts: 226
Gasoline problems
« Reply #3 on: 八月 04, 2004, 03:45:20 pm »
Oops, I misunderstood the question. Will come back later.
简单==完美

万精油

  • Administrator
  • Hero Member
  • *****
  • Posts: 1831
Gasoline problems
« Reply #4 on: 八月 04, 2004, 03:49:18 pm »
Testpost,

  Please post your puzzle as a new topic, after you did that, I will remove your post here.

  Packman should also repost your follow up under the new thread.

  I should be able to do that, but don't know how right now. Still learning.

Elixir

  • Jr. Member
  • **
  • Posts: 32
Re: Gasoline problems
« Reply #5 on: 八月 04, 2004, 04:31:17 pm »
I modified my answer, it should be:

Question 1:
Provided (n*v) liter of gas at A, How far theoretically
a vessle can go? [Consider n>1, measure it using s]

s(1+1/2+1/3+...+1/n)

Question 2:
Provided (n*v) liter of gas at A, How for theoretically
a vessle can go if all vessel are required to go back
to A?

s(1+1/2+1/3+...+1/n)/2

If you don't get 1 and 2, try this:
Question 3:
Gas sales at c cents per liter at A. at B, s km away from
A, what is the cheapest price (theoretically) for gas?
[Only from gas cost perspective]

close to c

Question 4:
Add this requirement to Q3: All vessel must goback to A
at end of the day?

close to c also

If 1, 2 is too easy for you, try this:
Given: Gas sales at c cents per liter at A.
Require: All vessel must goback to A at end of the day.

5. How many liter of gas must be shipped out to B per
day to maintain 10c cents per liter at B?

between 8V and 9V

Still easy? Oops, try to tell me:
6. Where you can find the cheapest gas in US continent?[/quote]

Google: cheap gas

testpost

  • Newbie
  • *
  • Posts: 23
Gasoline problems
« Reply #6 on: 八月 04, 2004, 06:30:51 pm »
Good work, Elixir. You are getting close.

Question 1:
s(1+1/2+1/3+...+1/n)

Well done.

Question 2:
s(1+1/2+1/3+...+1/n)/2

Very close, Would you explain? In your explain, you will sure
find the right answer.

Question 3-4:
close to c

How close? Indeed, not realy.

Question 5:
between 8V and 9V

Good guess. Could you explain?
testposttestposttestpost

Elixir

  • Jr. Member
  • **
  • Posts: 32
Gasoline problems
« Reply #7 on: 八月 04, 2004, 07:37:11 pm »
Quote from: testpost
Good work, Elixir. You are getting close.

Question 1:
s(1+1/2+1/3+...+1/n)

Well done.

Question 2:
s(1+1/2+1/3+...+1/n)/2

Very close, Would you explain? In your explain, you will sure
find the right answer.

N vessels sail for 1/2n, 1st vessel fill the rest n-1 vessels up and wait there  with 1-1/2n-(n-1)*/2n=1/2 gas, when the n-1 vessels come back all empty, the 1st just have the right  amount of gas (1/2) to make everyone back.
Apply the same deduction on the n-1 vessels, you got the formula.
I thought I could prove it's the best solution. The sketch is that you want to minimize the distance the 1st vessel travels, and can prove  that 1st shouldn't sail less than 1/2n. So, what's the correct answer and what's wrong in my proof?



Question 3-4:
close to c

How close? Indeed, not realy.
I really just guessed on these two questions. I felt that cost  always decreases as the number of vessels increases.  I don't know how to calculate the limit.  Is it a number close to 3?



Question 5:
between 8V and 9V

Good guess. Could you explain?
I did a napkin paper calculation. For 8 vessels, the cost is about 10.1, for 9 vessels, the cost is about 9.6.
Code: [Select]

testpost

  • Newbie
  • *
  • Posts: 23
Gasoline problems
« Reply #8 on: 八月 04, 2004, 09:10:18 pm »
Question 2.
Sorry. I have to correct my own answer. You are 100% right.

Question 5:
I could be wrong: the number I have is (round up) to 12.
where the cost ~ 9.9468c
testposttestposttestpost

万精油

  • Administrator
  • Hero Member
  • *****
  • Posts: 1831
Gasoline problems
« Reply #9 on: 八月 06, 2004, 11:52:00 am »
The classical version of this question asks how far can one truck go given n barrel of gasoline.  More precisely, the question goes like this:

A pick-up truck is in the desert beside N 50-gallon gas drums, all full.
The truck's gas tank holds 10 gallons and is empty.  The truck can carry
one drum, whether full or empty, in its bed.  It gets 10 miles to the gallon.
How far away from the starting point can you drive the truck?

testpost

  • Newbie
  • *
  • Posts: 23
Gasoline problems
« Reply #10 on: 八月 06, 2004, 07:40:37 pm »
Thanks for Prof Wan's rewording, it looks much better.

Let me try to give the answer for it: (the same as
Elixir's post, but lengthy)

The longest approach is to use up all gas and minimize
backward driving.

All your backward driving is for another gas drum. so
no drum carry in this type of driving.

Assuming gas drums are disposed at postion a1 < a1+a2 <
a1+a2+a3 < ..., It is easily to know that total back driving
for truck is: (N-1)a1 + (N-2)a2 + ...

The most efficient way is to use up gas drum 1 at a1,
drum 2 at a1+a2, ...

If I Ignore the tank, 1/5 of the drum (otherwise the
result will be slightly different), I will get:
an = 50L/(2N-2n+1) * 10mile/L = 500mile/(2N-2n+1)
(N-n forth driving, N-n-1 back driving)

a1+a2+...+aN = (1/3+1/5+...+1/(2N-1)) * 500mile
with last drum of gas, here's an extra 500 mile. So it
end up to S = 500mile * (1+1/3+1/5+...+/(2N-1))

Consider 10L, or 100mile of tank, It would be adjusted
to: S + 100mile - 100mile / (2N-1).

The different between this one and Elixir's post is caused
by the fact we left drums in field.
testposttestposttestpost