# Treasure hunt using complex numbers & an inequality

What I did was prove that the distance between the two rocks is 2 times as large as the distance from the middle point of the two rocks to the treasure. I then showed that the dot product of the direction vector of the line connecting the two rocks with the direction vector of the middle point of the two rocks to the treasure is 0, which means that they are orthogonal. So just measure the distance between the rocks, walk halfway, and turn 90 degrees to either left or right, move the measured distance and dig. If its not there, go to the other side instead, and there it is!

Thanks a lot for the help, your tips were very solid indeed. The inequality however.. That one still eludes me..

jbunniii
Homework Helper
Gold Member
The inequality is pretty tough! I posted a request for assistance on the homework helper's forum, and micromass and BruceW were able to come up with two different solutions, both of which involving quite a bit of algebra and trig.

BruceW's is slightly more straightforward, so I'll show how his proof begins. We wish to prove the following:
$$(|z_1| + |z_2|) \left|\frac{z_1}{|z_1|} + \frac{z_2}{|z_2|}\right| \leq 2|z_1 + z_2|$$
Both sides are nonnegative, so the inequality holds if and only if the square is true:
$$(|z_1| + |z_2|)^2 \left|\frac{z_1}{|z_1|} + \frac{z_2}{|z_2|}\right|^2 \leq 4|z_1 + z_2|^2$$
Now express everything in polar coordinates: put ##z_1 = r_1 e^{i\theta_1}## and ##z_2 = r_2 e^{i\theta_2}##. When you plug this back into the squared inequality and simplify, you should get something that looks like this:
$$(r_1^2+r_2^2+2r_1r_2)(2+2cos(\theta_1-\theta_2)) \leq 4(r_1^2+r_2^2+2r_1r_2cos(\theta_1-\theta_2))$$
Now simplify both sides and eventually you should be able to reduce it to
$$cos(\theta_1-\theta_2) \leq 1$$
which is of course true. I don't know if there is a cleaner, more insightful way to do it, perhaps using some geometric observation. I would hope so, but I haven't found it.

TSny
Homework Helper
Gold Member
Now that you've worked the treasure problem, you might enjoy reading this version of the problem on pages 35 -37 of the classic: 1 2 3 ∞

Hmm, alright, lets see. I see what is done, and apart from the squaring I had tried that too. However, I don't understand the simplification that is made, to for example 2 + cos (theta 1 - theta 2) on the left hand side.

What I came to is
(r12+r22+2r1r2)(ei$\theta1$+ei$\theta2)$)2 is smaller than or equal to 4(r1ei$\theta1$+r2ei$\theta2$)2

Writing out the squares is not the issue, but rewriting them to what you have is. Could you enlighten me? :)

Oh, and I can't thank you (all) enough for all the effort you have put into this!

@Tsny: It does seem like a very good read, from the description, and from the fact that Gamow wrote it! (Not that he is necessarily a good writer, but still)

DrClaude
Mentor
I don't understand the simplification that is made, to for example 2 + cos (theta 1 - theta 2) on the left hand side.
Don't forget the absolute value. What you have is
$$\left| e^{i \theta_1} + e^{i \theta_2} \right|^2$$
Use Euler's formula, rewrite the products of cos and sin as cos of a sum of angles, then take the absolute value squared, and you'll find
$$2 + 2 \cos (\theta_1 - \theta_2)$$

mfb
Mentor
What I did was prove that the distance between the two rocks is 2 times as large as the distance from the middle point of the two rocks to the treasure. I then showed that the dot product of the direction vector of the line connecting the two rocks with the direction vector of the middle point of the two rocks to the treasure is 0, which means that they are orthogonal. So just measure the distance between the rocks, walk halfway, and turn 90 degrees to either left or right, move the measured distance and dig. If its not there, go to the other side instead, and there it is!
There is no need to check both sides.

Here is my solution:
With the tree as origin and rock positions r and R, A=(1+i)*r and B=(1-i)*R.
Therefore, the treasure is at (A+B)/2 = r*(1+i)/2 + R(1-i)/2.
If you shift the tree by an amount -x, this is equivalent to shifting both rocks by x, and the treasure is located at (r+X)(1+i)/2 + (R+x)(1-i)/2 = (A+B)/2 + x. Therefore, the treasure is shifted by the same amount as the rocks, and the tree position does not matter for their relative orientation. Choose R as tree position, and the location of the treasure is easy to get (45° to the left of the direction to r, with 1/sqrt(2) its distance).

Don't forget the absolute value. What you have is
$$\left| e^{i \theta_1} + e^{i \theta_2} \right|^2$$
Use Euler's formula, rewrite the products of cos and sin as cos of a sum of angles, then take the absolute value squared, and you'll find
$$2 + 2 \cos (\theta_1 - \theta_2)$$

Hmm, what I thought was that it was defined as ((z1+z2)2)1/2, so that if you square that, the square root just disappears. Am I using the wrong definition? I'll try and work it out your way :)

Edit: Working out the absolute value in terms of euler's formula, I get

-2 sin(θ1) sin(θ2)+2 cos(θ1) cos(θ2)+i (2 sin(θ1) cos(θ2)+2 cos(θ1) sin(θ2)+2 sin(θ1) cos(θ1)+2 sin(θ2) cos(θ2))-sin[sup2[/sup](θ1)+cos21)-sin22)+cos22)

Simplifying that with the angle formula's, I get 2cos(theta1+theta2) -2, which is different from what you have, but also I am left with a whole bunch of imaginary stuff. What am I doing wrong?
@mfb: That is very clever, thanks a lot for all your help, I would not have figured it out on my own.

Last edited:
jbunniii
Homework Helper
Gold Member
Now that you've worked the treasure problem, you might enjoy reading this version of the problem on pages 35 -37 of the classic: 1 2 3 ∞
Ha, I knew this problem sounded familiar, but I couldn't remember where I had seen it before. I was thinking it was in a Sherlock Holmes episode, but that was a different map puzzle.

mfb
Mentor
Hmm, what I thought was that it was defined as ((z1+z2)2)1/2, so that if you square that, the square root just disappears. Am I using the wrong definition? I'll try and work it out your way :)
This does not work with complex numbers. As an example, |z1+z2| and its square are always positive, while (z1+z2)^2 can be complex.

This does not work with complex numbers. As an example, |z1+z2| and its square are always positive, while (z1+z2)^2 can be complex.

Hmm alright. So then is it.. (z1 + z2)(z1* + z2*)? As in, the star is the complex conjugate. If not, I am just not familiar with the formula I guess..

DrClaude
Mentor
Hmm alright. So then is it.. (z1 + z2)(z1* + z2*)? As in, the star is the complex conjugate. If not, I am just not familiar with the formula I guess..
Yes, so you get
$$\left| a + i b \right|^2 = a^2 + b^2$$

jbunniii
Homework Helper
Gold Member
Simplifying that with the angle formula's, I get 2cos(theta1+theta2) -2, which is different from what you have, but also I am left with a whole bunch of imaginary stuff. What am I doing wrong?
\begin{align} \left|e^{i\theta_1} + e^{i\theta_2}\right|^2 &= \left|e^{i\theta_2} (1 + e^{i(\theta_1 - \theta_2)})\right|^2 \\ &= \left|1 + e^{i(\theta_1 - \theta_2)}\right|^2 \\ &= \left|e^{i(\theta_1 - \theta_2)/2} (e^{-i(\theta_1 - \theta_2)/2} + e^{i(\theta_1 - \theta_2)/2})\right|^2 \\ &= \left| (e^{-i(\theta_1 - \theta_2)/2} + e^{i(\theta_1 - \theta_2)/2})\right|^2 \\ &= \left| 2 \cos((\theta_1 - \theta_2)/2) \right|^2 \\ &= 4 \cos^2((\theta_1 - \theta_2)/2) \\ &= 4 \left(\frac{1}{2} + \frac{1}{2} \cos(\theta_1 - \theta_2)\right) \\ &= 2 + 2 \cos(\theta_1 - \theta_2)\\ \end{align}
Probably you can find a way to consolidate a few of the steps to make it shorter.

tiny-tim
Homework Helper
Hi Verdict!
What I have done for the treasure now, is write out the coordinates of the interesting points, as follows:
The origin (0,0) = 0 + 0i = the tree = z1
Rock 1 = z2 = (a,b) = a + ib
Rock 2 = z3 = (c, d) = c + id
Point A = z4 = z2 plus z2 turned by 90 degrees to the left = (a + ib) + (-b + ia) = (a-b, b+a)
Point B = z5 = z3 plus z3 turned by 90 degrees to the right = (c + id) + (d - ic) = (c+d, d-c)
The treasure = z6 = in the middle of point A and B = (a-b+c+d / 2, b+a+d-c /2) = (a-b+c+d)/2 + i(b+a+d-c)/2

Is this useful …

Your result is rather difficult to use, because you've chosen to fix the tree even though the tree is variable!

It would be a lot easier to put the two rocks at ±1, and the tree at a general point z

\begin{align} \left|e^{i\theta_1} + e^{i\theta_2}\right|^2 &= \left|e^{i\theta_2} (1 + e^{i(\theta_1 - \theta_2)})\right|^2 \\ &= \left|1 + e^{i(\theta_1 - \theta_2)}\right|^2 \\ &= \left|e^{i(\theta_1 - \theta_2)/2} (e^{-i(\theta_1 - \theta_2)/2} + e^{i(\theta_1 - \theta_2)/2})\right|^2 \\ &= \left| (e^{-i(\theta_1 - \theta_2)/2} + e^{i(\theta_1 - \theta_2)/2})\right|^2 \\ &= \left| 2 \cos((\theta_1 - \theta_2)/2) \right|^2 \\ &= 4 \cos^2((\theta_1 - \theta_2)/2) \\ &= 4 \left(\frac{1}{2} + \frac{1}{2} \cos(\theta_1 - \theta_2)\right) \\ &= 2 + 2 \cos(\theta_1 - \theta_2)\\ \end{align}
Probably you can find a way to consolidate a few of the steps to make it shorter.

Yeah I just finished doing this in a different (longer!) method, but I do indeed end up with that! :) So now I understand how we get there, that's where the tricks come in I guess. But simplifying it further, to what you have suggested, has failed so far...

I wrote out all the multiplications, and you are left with two terms on the left that are smaller than or equal to two terms on the right, which is nice, but a third term on the left that is bigger than or equal to the term on the right. So that isn't as nice as I had hoped it to be, and it is of course not the same as what you reduced it to. Do you use more identities to get there?

@tiny-tim
Hey, thanks! I did manage to work it out in the end (it's somewhere in this heap of posts, haha), and yeah it is a lot harder than it could have been, sadly. Ah well, if it works, it works. The digging twice part is a nuisance, so it is indeed a lesser answer, but the question didn't technically require me to only dig once, so I guess it's not that bad.

jbunniii
Homework Helper
Gold Member
I wrote out all the multiplications, and you are left with two terms on the left that are smaller than or equal to two terms on the right, which is nice, but a third term on the left that is bigger than or equal to the term on the right. So that isn't as nice as I had hoped it to be, and it is of course not the same as what you reduced it to. Do you use more identities to get there?
Can you show what you currently have? I'll try to talk you through the rest of the simplification.

jbunniii
Homework Helper
Gold Member
Yeah I just finished doing this in a different (longer!) method, but I do indeed end up with that! :)
Here's a much quicker way, FYI:
\begin{align} |e^{i\theta_1} + e^{i\theta_2}|^2 &= \overline{(e^{i\theta_1} + e^{i\theta_2})} (e^{i\theta_1} + e^{i\theta_2}) \\ &= (e^{-i\theta_1} + e^{-i\theta_2}) (e^{i\theta_1} + e^{i\theta_2}) \\ &= 2 + e^{i(\theta_1 - \theta_2)} + e^{-i(\theta_1 - \theta_2)} \\ &= 2 + 2\cos(\theta_1 - \theta_2) \end{align}

Alright, so now I have
4r1r2 + 2r12cos(θ12) + 2r22cos(θ12)

is smaller than or equal to 2r22 + 2r12 +4 r1r2cos(θ12)

So I see that on the LHS the two terms with the cosine are, smaller than or equal to the two corresponding ones on the RHS. However, the cosine on the RHS is smaller than or equal to the term on the left side.

Oh, and one small question:
When you do |z1+z2|², you write (z1+z2)(z1*+z2*). But isn't that just |z1+z2|, without the square?

Last edited:
jbunniii
Homework Helper
Gold Member
Alright, so now I have
4r1r2 + 2r12cos(θ12) + 2r22cos(θ12)

is smaller than or equal to 2r22 + 2r12 +4 r1r2cos(θ12)

So I see that on the LHS the two terms with the cosine are, smaller than or equal to the two corresponding ones on the RHS. However, the cosine on the RHS is smaller than or equal to the term on the left side.
OK, let's see what we can do with this.
\begin{align} 4r_1 r_2 + 2 r_1^2 \cos(\theta_1 - \theta_2) + 2r_2^2\cos(\theta_1 - \theta_2) \leq 2r_2^2 + 2r_1^2 + 4r_1 r_2 \cos(\theta_1 - \theta_2)\\ \end{align}
Moving everything to one side of the inequality, we get
\begin{align} 0 &\leq 2r_1^2 (1 - \cos(\theta_1 - \theta_2)) + 2r_2^2 (1 - \cos(\theta_1 - \theta_2)) + 4r_1 r_2 ( \cos(\theta_1 - \theta_2) - 1) \\ &\leq (2r_1^2 + 2r_2^2 - 4r_1 r_2) (1 - \cos(\theta_1 - \theta_2)) \\ \end{align}
Now it should be pretty easy to argue that both factors on the right hand side are nonnegative.

Alright, so the part with the cosine is obvious indeed: a cosine has a maximal value of 1, so at most, the term is zero, never negative. Inequality holds.
For the first part though.. Of course it makes sense, that if you take something squared, plus something smaller squared, that that is bigger than 2 times something times the smaller one.. It sounds like there is a theorem/inequality for this type of thing, I'll look for it.

Edit: Ok, that was one of the easier things I have missed so far. Got it, inequality proven, thanks so much! You guys are really great.

Also, I made a sneaky edit in my last post:
When you do |z1+z2|², you write (z1+z2)(z1*+z2*). But isn't that just |z1+z2|, without the square?

Last edited:
jbunniii
Homework Helper
Gold Member
When you do |z1+z2|², you write (z1+z2)(z1*+z2*). But isn't that just |z1+z2|, without the square?
No. To see that this is not true, consider the special case where both z1 and z2 are real. Then ##(z_1 + z_2)(z_1^* + z_2^*) = (z_1 + z_2)(z_1 + z_2) = (z_1 + z_2)^2 = |z_1 + z_2|^2##, not ##|z_1 + z_2|##.

No. To see that this is not true, consider the special case where both z1 and z2 are real. Then ##(z_1 + z_2)(z_1^* + z_2^*) = (z_1 + z_2)(z_1 + z_2) = (z_1 + z_2)^2 = |z_1 + z_2|^2##, not ##|z_1 + z_2|##.

Yeah. Trivial, indeed. Hm, I don't know where the confusion came from, I thought I remembered it from my quantum physics course, but that was clearly not the absolute value.

Again, thanks so much, for all the time and effort!