Help with making a function

  • Thread starter Kolika28
  • Start date
  • #1
142
26

Homework Statement:

Ann is in point ##(2,0)## and walks to KFC in ##(-2,0)##.On her way there’s a pond within the curve ##\big|x \big|+\big|y \big|=1##.She walks 5 km/h outside the pond and ##\frac{5\sqrt{5}}{2\sqrt{2}}## km/h in the pond. In which point does she enter the pond, or should she walk around?

Relevant Equations:

The derivative.
Ok. So if i sketch the curve I can see that this pound has a shape of a square. Ann and KFC has the same distance from the pond. I'm able to calculate the time for Ann to walk around the pond, and if she walks in a straight line from where she stands to KFC.
If she walks around it will take about 0,96 hours and if she walks in straight line (enter pond in 1,0), it will take her 0,90. I did this using some simple geometry. But I don't know if Ann should rather enter the pond somewhere else to save time. So this must be an extreme value problem where I should make some sort of a function and find the derivative. I might be wrong about this, but that's the only assumption I have for now. How do I make such a function?
 

Answers and Replies

  • #2
Orodruin
Staff Emeritus
Science Advisor
Homework Helper
Insights Author
Gold Member
16,829
6,650
Assume that she enters the pond at some y value (by symmetry, she must stay at that y value within the pond) and compute the corresponding total time. Minimize wrt y.
 
  • #3
142
26
Assume that she enters the pond at some y value (by symmetry, she must stay at that y value within the pond) and compute the corresponding total time. Minimize wrt y.
Hmm, I'm not sure If I understand correctly. So if she enters at point (0.8, 0.2) she will leave the pond at point (-0.8, 0.2)? I don't understand the symmetry. Why will she stay at that y value within the pond?
 
  • #4
Orodruin
Staff Emeritus
Science Advisor
Homework Helper
Insights Author
Gold Member
16,829
6,650
So if she enters at point (0.8, 0.2) she will leave the pond at point (-0.8, 0.2)?
Yes.

I don't understand the symmetry. Why will
Because the solution must be symmetric to be optimal. The argument is fairly simple. Consider the point where you cross x = 0. Minimizing time given that y(0) on both sides will give you the minimum total given that y(0). Both sides look exactly the same (just mirrored), so the solution must be symmetric. You can extend this argument to conclude that y is constant in the pond (try to do that yourself).

Edit: Note that if you had a non-symmetric path, then one of the sides would give a shorter time and the time could be made shorter by replacing the other side of the path by the mirror image of the shorter time side.
 
  • #5
HallsofIvy
Science Advisor
Homework Helper
41,833
956
Yes, she needs to cross the pond but, since she walks slower in the pond, she wants to make that part as small as possible. She can do that by walking directly from (x, y) to (-x, y). Now the portion of the boundary of the pond in the first quadrant is given by |x|+ |y|= x+ y= 1 or y= 1- x. So she first walks from (2, 0) to (x, 1- x), a distance of [itex]\sqrt{(x-2)^2+ (1- x)^2}[/itex] km. She walks that at 5 km/h so the time required to walk that is [itex]\left(\sqrt{(x-2)^2+ (1- x)^2}\right)/5[/itex] hours. (You don't say what units x and y are in but since you give her speed in "km/h" I will assume they are in km.). In the second quadrant, the edge of the pond is given by |x|+ |y|= -x+ y= 1 so y= x+ 1. She walks, in the pond, at [itex]\frac{5\sqrt{5}}{2\sqrt{2}}[/itex] from x to -x, a distance of 2x, which requires [itex]\frac{5\sqrt{5}}{\sqrt{2}}x[/itex] hours. Finally the last leg of the trip is, again by symmetry, the same as the first so also takes [itex]\left(\sqrt{(x-2)^2+ (1- x)^2}\right)/5[/itex] hours. The entire journey takes [itex]\left(2\sqrt{(x-2)^2+ (1- x)^2}\right)/5+ \frac{5\sqrt{5}}{\sqrt{2}}x[/itex]. Set the derivative of that equal to 0 and solve for x.
 
  • #6
142
26
Yes, she needs to cross the pond but, since she walks slower in the pond, she wants to make that part as small as possible. She can do that by walking directly from (x, y) to (-x, y). Now the portion of the boundary of the pond in the first quadrant is given by |x|+ |y|= x+ y= 1 or y= 1- x. So she first walks from (2, 0) to (x, 1- x), a distance of [itex]\sqrt{(x-2)^2+ (1- x)^2}[/itex] km. She walks that at 5 km/h so the time required to walk that is [itex]\left(\sqrt{(x-2)^2+ (1- x)^2}\right)/5[/itex] hours. (You don't say what units x and y are in but since you give her speed in "km/h" I will assume they are in km.). In the second quadrant, the edge of the pond is given by |x|+ |y|= -x+ y= 1 so y= x+ 1. She walks, in the pond, at [itex]\frac{5\sqrt{5}}{2\sqrt{2}}[/itex] from x to -x, a distance of 2x, which requires [itex]\frac{5\sqrt{5}}{\sqrt{2}}x[/itex] hours. Finally the last leg of the trip is, again by symmetry, the same as the first so also takes [itex]\left(\sqrt{(x-2)^2+ (1- x)^2}\right)/5[/itex] hours. The entire journey takes [itex]\left(2\sqrt{(x-2)^2+ (1- x)^2}\right)/5+ \frac{5\sqrt{5}}{\sqrt{2}}x[/itex]. Set the derivative of that equal to 0 and solve for x.
Thank you so much! It was a really good explanation. The only thing I'm wondering about. You write ##\frac{5\sqrt{5}}{\sqrt{2}}x##, but time is equal to distance/speed. So won't it be ##2x*\frac{2\sqrt{2}}{5\sqrt{5}}##??
 
  • #7
142
26
Yes, she needs to cross the pond but, since she walks slower in the pond, she wants to make that part as small as possible. She can do that by walking directly from (x, y) to (-x, y). Now the portion of the boundary of the pond in the first quadrant is given by |x|+ |y|= x+ y= 1 or y= 1- x. So she first walks from (2, 0) to (x, 1- x), a distance of [itex]\sqrt{(x-2)^2+ (1- x)^2}[/itex] km. She walks that at 5 km/h so the time required to walk that is [itex]\left(\sqrt{(x-2)^2+ (1- x)^2}\right)/5[/itex] hours. (You don't say what units x and y are in but since you give her speed in "km/h" I will assume they are in km.). In the second quadrant, the edge of the pond is given by |x|+ |y|= -x+ y= 1 so y= x+ 1. She walks, in the pond, at [itex]\frac{5\sqrt{5}}{2\sqrt{2}}[/itex] from x to -x, a distance of 2x, which requires [itex]\frac{5\sqrt{5}}{\sqrt{2}}x[/itex] hours. Finally the last leg of the trip is, again by symmetry, the same as the first so also takes [itex]\left(\sqrt{(x-2)^2+ (1- x)^2}\right)/5[/itex] hours. The entire journey takes [itex]\left(2\sqrt{(x-2)^2+ (1- x)^2}\right)/5+ \frac{5\sqrt{5}}{\sqrt{2}}x[/itex]. Set the derivative of that equal to 0 and solve for x.
Yes.


Because the solution must be symmetric to be optimal. The argument is fairly simple. Consider the point where you cross x = 0. Minimizing time given that y(0) on both sides will give you the minimum total given that y(0). Both sides look exactly the same (just mirrored), so the solution must be symmetric. You can extend this argument to conclude that y is constant in the pond (try to do that yourself).

Edit: Note that if you had a non-symmetric path, then one of the sides would give a shorter time and the time could be made shorter by replacing the other side of the path by the mirror image of the shorter time side.
Thank you so much for your help (both of you). You really saved my day! :) The answer I got was that Ann will enter the pond at (0.5, 0.5) or (0.5, -0.5) given the symmetry. I hope this is right!
 
  • #8
LCKurtz
Science Advisor
Homework Helper
Insights Author
Gold Member
9,555
766
Yes, that is correct. But you have to wonder if less than a minute savings is worth the time to take your shoes off and put them back on. :oldsmile:
 
  • #9
HallsofIvy
Science Advisor
Homework Helper
41,833
956
Why are you assuming Amy is wearing shoes?
 
  • #10
LCKurtz
Science Advisor
Homework Helper
Insights Author
Gold Member
9,555
766
Why are you assuming Amy is wearing shoes?
Good point. She could have been at Burning Man and wearing nothing at all. :wideeyed:
 
  • #11
HallsofIvy
Science Advisor
Homework Helper
41,833
956
One of my neighbors told me that, when I was a child. we lived next to her for three years before she knew I HAD shoes!
 

Related Threads on Help with making a function

Replies
5
Views
4K
  • Last Post
Replies
9
Views
2K
Replies
5
Views
4K
  • Last Post
Replies
2
Views
1K
  • Last Post
Replies
4
Views
937
  • Last Post
Replies
3
Views
3K
Replies
4
Views
3K
Replies
3
Views
12K
Top