## An easy one

A forum for good logic/math puzzles.

Moderators: jestingrabbit, Moderators General, Prelates

### An easy one

You have a car and gasoline for 5 kilometers. I'll give you $4 per kilometer towards the north, and$ 3 per kilometer to the east. What is the
maximum amount of money you can win?
pebete

Posts: 4
Joined: Sun Aug 16, 2009 9:17 pm UTC

Spoiler:
$25, provided there's a straight road in the proper direction. Small Government Liberal Qaanol Posts: 2233 Joined: Sat May 09, 2009 11:55 pm UTC ### Re: An easy one Qaanol is correct, but hasn't explained much, so here's an explanation using the method of Lagrange multipliers. Spoiler: Let x be the number of kilometers to the east from my origin to my destination, and let y be the number of kilometers north. We want to maximize 3x+4y given the constraint x2+y2=25. Using a Lagrange multiplier, the optimal x and y will be a critical point of 3x+4y+h(25-x2-y2), so 3-2hx=4-2hy=25-x2-y2=0. Thus x=3, y=4, and h=1/2, or else x=-3, y=-4, and h=-1/2. Plugging in both sets of values, we find the optimal value of 3x+4y is 25, and is obtained when x=3 and y=4. (Of course we could easily have found y in terms of x, and used techniques from 1-variable calculus, but Lagrange multipliers are always more fun.) Anyone have a slicker proof? I'm looking forward to the day when the SNES emulator on my computer works by emulating the elementary particles in an actual, physical box with Nintendo stamped on the side. "With math, all things are possible." —Rebecca Watson skeptical scientist closed-minded spiritualist Posts: 5920 Joined: Tue Nov 28, 2006 6:09 am UTC Location: Madison, Wisconsin ### Re: An easy one Spoiler:$20

4(the maximum paid per kilometer) * 5 (the number of kilometers you have gas for)
Nem

Posts: 152
Joined: Fri Aug 14, 2009 12:19 pm UTC

### Re: An easy one

Nem wrote:4(the maximum paid per kilometer) * 5 (the number of kilometers you have gas for)

Think "diagonal".
TEAM SHIVAHN
Pretty much the best team ever

Yeah, 25,000 politicians is probably too much so it's best to keep it at 3.
--Thesh

poxic
Eloquently Prismatic

Posts: 3512
Joined: Sat Jun 07, 2008 3:28 am UTC
Location: Left coast of Canada

### Re: An easy one

*head desk* Darn, why did I keep reading that as South? Retrospectively I shouldn't have expected it to be that simple.

Okay then. I guess this wanders into the realm of number problems I suck at but:
Spoiler:
A = 4 money in Northern direction
B = 3 money in Eastern direction
D = Kilometers you have fuel for

A/B = 0.75
1-0.75 = 0.25
C = D*A
= 20
Total winnings = C+(C*0.25)
=25

?
Nem

Posts: 152
Joined: Fri Aug 14, 2009 12:19 pm UTC

### Re: An easy one

*thinks spherically*

Spoiler:
If I can choose to have the "east" measured before the "north", and if I can choose my starting location, then I can get arbitrarily close to $(20+15π) ≈$67.12.

Start *almost* 5km from the North Pole, and drive *almost* due north, so you end up *almost* at the Pole, and *almost* 180º of longitude east from where you started. Over that distance Earth is approximately flat, so the eastward component is *almost* half the circumference of a circle with radius 5km, so 5π-km. Then the northward component is *almost* 5km. Total payout is *almost* 5($4) + 5π($3).

Of course, if you measure the northward component first, the payout is arbitrarily close to $20, and thus suboptimal. Small Government Liberal Qaanol Posts: 2233 Joined: Sat May 09, 2009 11:55 pm UTC ### Re: An easy one skeptical scientist wrote:Anyone have a slicker proof? Spoiler: We seek (x, y) on the circle with radius 5, such that (3, 4).(x, y) is maximised. This means that (x, y) must be parallel to (3, 4); spotting the 3-4-5 triangle gives (x, y) = (3, 4). Generally I try to make myself do things I instinctively avoid, in case they are awesome. -dubsola Ended Posts: 1458 Joined: Fri Apr 20, 2007 3:27 pm UTC Location: The Tower of Flints. (Also known as: England.) ### Re: An easy one Spoiler: My above spherical version also works in reverse, starting (almost) at the South Pole and ending up (almost) 5km north and (almost) 180º east, provided the driver can choose to have the north measured before the east. On the other hand, if the north and east are measured continuously and instantaneously, as by an accelerometer or equivalent, then the sphere is "unwrapped" into a Cartesian plane and the answer is the same as originally posted. In addition to the Lagrange multipliers and the dot product previously mentioned, the optimum result can also be proved by writing everything in terms of the angle θ counterclockwise from due east and setting the derivative of payout with respect to θ equal to zero. This one might be a bit harder: If the east and north are measured separately at the end, and the contest-holder/payer gets to decide which is measured first, what's the most amount of money that can be won? The payer wants to minimize the payout. For simplicity, let's assume this is on a "flat-enough" Earth over the distances covered, and the driver gets to pick the starting point and route. Small Government Liberal Qaanol Posts: 2233 Joined: Sat May 09, 2009 11:55 pm UTC ### Re: An easy one Qaanol: Wouldn't the best way be to go very slightly west at the north pole if east is measured first? This gives you almost 360 degrees of circumference. quintopia Posts: 2790 Joined: Fri Nov 17, 2006 2:53 am UTC Location: atlanta, ga ### Re: An easy one I was assuming anything more than 180º east would be counted as some distance west, with zero (or negative?) winnings. For my last problem, here's how it can be set up. I haven't solved it yet: Spoiler: For locations reasonably close to the North Pole, where Earth's surface can be approximated by polar coordinates, the starting location is \large[r_1, \,\theta_1] and the ending location is \large[r_2, \,\theta_2]. Since we want to end up moving north, \large r_1 > r_2. Without loss of generality we can let \large\theta_1 = 0 and \large 0 < \theta_2 < \pi Payout: \large5(r_1 - r_2) + 3(\theta_1 - \theta_2)r_2 Constraint: \large5^2 = r_1^2 + r_2^2 - 2r_1r_2cos(\theta_1 - \theta_2) Small Government Liberal Qaanol Posts: 2233 Joined: Sat May 09, 2009 11:55 pm UTC ### Re: An easy one skeptical scientist wrote:Anyone have a slicker proof? [url]http://www.wolframalpha.com/input/?i=max%283x%2B4y%29+where+x^2%2By^2%3D25[/url] Well, I wouldn't call it a *proof*. Edit: Why isn't [url] working? Gah. When will we win the war on memes? u38cg Posts: 187 Joined: Thu Jul 23, 2009 5:11 pm UTC Location: Edinburgh, Scotland ### Re: An easy one I...am very confused. 5 kilometers worth of gas. Most money made traveling north (4$). Travel that way until gas runs out. 5 x 4 = 20.

...

I'm missing something important, aren't I?
For Science! And Cake! Most certainly for cake. Science can wait.

Generation: -16 + 32i

jroshak

Posts: 9
Joined: Sat Aug 22, 2009 5:25 pm UTC

### Re: An easy one

There is a basic proof for the answer.

Spoiler:
This is actually just Cauchy's inequality.

http://mathworld.wolfram.com/CauchysInequality.html

Let a be the north distance you travel, and b the east distance. Then a^2+b^2=5^2.
By Cauchy's Inequality, (4*a+3*b)^2 <= (3^2+4^2)*(a^2+b^2) = 25^2.
The maximum profit 4*a+3*b = 25 is achieved when a/4=b/3 i.e. when a=4, b=3.

It is perhaps easier to think geometrically. The profit going on a vector v is the dot product of 4 with (4,3). Given a magnitude constraint on v, the maximum dot product is attained with v aligned with (4,3). Also, if v is off by an angle \theta, the profit decreases by a factor of cos(\theta).
sockfolder

Posts: 6
Joined: Wed Jun 24, 2009 12:05 am UTC

### Re: An easy one

jroshak wrote:I...am very confused.

5 kilometers worth of gas. Most money made traveling north (4$). Travel that way until gas runs out. 5 x 4 = 20. ... I'm missing something important, aren't I? Yes. Have a look at what happens if you drive in some other directions. North east, for instance. ameretrifle wrote:Magic space feudalism is therefore a viable idea. jestingrabbit Posts: 5184 Joined: Tue Nov 28, 2006 9:50 pm UTC Location: Sydney ### Re: An easy one is there anything wrong with Nem's solution? That's how I went about it as well, it seems less complicated. myhatisawesome Posts: 2 Joined: Tue Aug 25, 2009 7:43 am UTC ### Re: An easy one myhatisawesome wrote:is there anything wrong with Nem's solution? That's how I went about it as well, it seems less complicated. Nem's first solution or Nem's second solution? The first is just wrong, the second is kinda incomprehensible to me. ameretrifle wrote:Magic space feudalism is therefore a viable idea. jestingrabbit Posts: 5184 Joined: Tue Nov 28, 2006 9:50 pm UTC Location: Sydney ### Re: An easy one If you want to be really pedantic, then start just east of the 180th meridian, and drive west over it. Technically, you just went (circumference of the Earth - distance you actually drove) kilometers east. (Same as saying that the Aleutian Islands are the easternmost point of the US, since they're over the 180th meridian.) alethiophile Posts: 21 Joined: Thu Apr 03, 2008 3:03 pm UTC ### Re: An easy one Slick as hell solution: Draw a right angled triangle, where sides of length 3 and 4 intersect at 90 degrees. The car travels along the hypotenuse, of length 5. It has travelled exactly 4 units north, and 3 units east. Hence, amount = 4*4 + 3*3 = 25 Ankit1010 Posts: 135 Joined: Fri Feb 11, 2011 11:32 am UTC ### Re: An easy one Ankit1010 wrote:Slick as hell solution: Draw a right angled triangle, where sides of length 3 and 4 intersect at 90 degrees. The car travels along the hypotenuse, of length 5. It has travelled exactly 4 units north, and 3 units east. Hence, amount = 4*4 + 3*3 = 25 That proves that its possible to make$25, but it doesn't prove that its the best that can be done.
ameretrifle wrote:Magic space feudalism is therefore a viable idea.

jestingrabbit

Posts: 5184
Joined: Tue Nov 28, 2006 9:50 pm UTC
Location: Sydney

### Re: An easy one

if given a huge mountain driving NE on a sloped road, all i have to do is stick the car in neutral and let it roll for an indefinite amount of lenght before the car comes to a stop. let the car idle the whole time down until it reaches the lowest point in the valley then driving the rest of the way for how much gas is left, or let it go out of gas and keep rolling untill it reaches said point in valley.

lots o money, now that the amount of gas in not important anymore.

Click Me! <---- Click There!
Spoiler:

Kromix

Posts: 289
Joined: Thu Mar 25, 2010 7:26 pm UTC
Location: DFW, Great State of Texas

### Re: An easy one

The answer I came up with doesn't look right, so I suspect theres a mistake in my working somewhere.

Spoiler:
Answer: $22.18800784900916488073366933828 I made price a function of x, then differentiated it to find when price' = 0. km north = x km east = y price = 0 sqrt(x^2 + y^2) = 5 x^2 + y^2 = 25 price = 4x + 3y want price' = 0 p = 4x + 3y = 4x + 3sqrt(25 - x^2) = 4x + sqrt(225 - 9x^2) p' = 4 - 18x/sqrt(225 - 9x^2) = 4 - 6x/sqrt(25 - x^2) When p' = 0 4 - 6x/sqrt(25 - x^2) = 0 -6x/sqrt(25 - x^2) = -4 x/sqrt(25 - x^2) = 2/3 x = 2/3 sqrt(25 - x^2) x = sqrt(4/9(25 - x^2)) x = sqrt(100/9 - 4/9 x^2) x^2 = 100/9 - 4/9 x^2 13/9 x^2 = 100/9 13x^2 = 100 x^2 = 100/13 x = +/- sqrt(100/13) x = 10 / sqrt(13) x = 2.773500981126145610091708667285 y = sqrt(25 - x^2) y = sqrt(25 - 100/13) y = 4.1602514716892184151375630009275 p = 4x + 3y p = 40/sqrt(13) + sqrt(225 - 900/13) p = 40/sqrt(13) + sqrt(2925/13 - 900/13) p = 40/sqrt(13) + sqrt(2025/13) p = 40/sqrt(13) + 45sqrt(1/13) p = 40/sqrt(13) + 45/sqrt(13) p = 80/sqrt(13) teelo Posts: 250 Joined: Thu Apr 08, 2010 11:50 pm UTC ### Re: An easy one teelo wrote: Spoiler: p = 4x + 3y = 4x + 3sqrt(25 - x^2) = 4x + sqrt(225 - 9x^2) p' = 4 - 18x/sqrt(225 - 9x^2) Spoiler: What's the derivative of sqrt(x)? Nitrodon Posts: 442 Joined: Wed Dec 19, 2007 5:11 pm UTC ### Re: An easy one Simple proof by single-variable calculus. Spoiler: ____/|_^ ___/_|_| __/__|_North * 4$
_/___|_|
/____|_|
-East*3$-> Hypotenuse = distance traveled f(x)= 4(hyp)(sinx) + 3(hyp)(cosx) hyp = 5, as the total distance possible to be traveled is 5 km f(x)= 20sinx+15cosx, is the amount of money made as a function of the angle f'(x)= 20cosx-15sinx , critical points occur when f'(x)=0 20cosx-15sinx=0 20cosx=15sinx 3/4 tanx=1 tanx = 4/3 x = arctan (4/3), restricting this to 360 degrees, you have x = 53.130 or x = 233.130 f''(x) = -20sinx-15cosx, computating x=53.130, x= 233.130 gets the following f''(53.130) < 0 , concave down f''(233.130) > 0 , concave up Therefore, as f'(53.130) = 0 and f''(53.130) < 0, x=53.130 is a relative maximum, whereas f''(233.130) is a minimum. Evaluating endpoints, x=0,360, and the maximum x=53.130 f(0) = 15$
f(360) = 20$f(53.130) = 25$

Therefore, the maximum profit is gained by driving at 53.130 degrees, with 0 degrees starting eastward like in a unit circle.
Also, tanx = 4/3 corresponds to a 3-4-5 triangle, with the side parallel to the north being 4.
So, driving along the hypotenuse of a 3-4-5 triangle would net the most money, with 3 going east and 4 going north from the beginning position.
actoultrepreu

Posts: 1
Joined: Thu Jan 20, 2011 8:27 pm UTC

### Re: An easy one

Spoiler:
Good point. 1/2sqrt(x)

Leave me alone, been 6 years since I did calc at uni

Spoiler:
Corrected DERP just shows the same answer declared earlier: highest price is \$25

km north = x
km east = y
price = 0

sqrt(x^2 + y^2) = 5
x^2 + y^2 = 25

price = 4x + 3y

want price' = 0

p = 4x + 3y
= 4x + 3sqrt(25 - x^2)
= 4x + sqrt(225 - 9x^2)
p' = 4 - 9x/sqrt(225 - 9x^2)
= 4 - 3x/sqrt(25 - x^2)
When p' = 0
4 - 3x/sqrt(25 - x^2) = 0
-3x/sqrt(25 - x^2) = -4
x/sqrt(25 - x^2) = 4/3
x = 4/3 sqrt(25 - x^2)
= sqrt(16/9(25 - x^2))
= sqrt(400/9 - 16/9 x^2)
x^2 = 400/9 - 16/9 x^2
25/9 x^2 = 400/9
25x^2 = 400
x^2 = 400/25
x^2 = 16
x = +/- 4
When x = 4, y = 3, price = 25.
teelo

Posts: 250
Joined: Thu Apr 08, 2010 11:50 pm UTC

Return to Logic Puzzles

### Who is online

Users browsing this forum: No registered users and 4 guests