# "dog And Soldiers" Math Puzzle

8 replies to this topic

### #1 CraigD

CraigD

Creating

• 8034 posts

Posted 03 March 2017 - 07:09 AM

A colleague of mine gave me the following puzzle (wording my own):

A square formation of soldiers 50 m on each side move perpendicular to a side a distance of 50 m.
In the same amount of time, a dog moves at a constant speed around the formation, ending at the same place on the square it started.
How far does the dog travel?

He told me he had found the answer, years ago when he encountered the puzzle, in about 30 minutes.

So I undertook to find the solution. It’s easy to imagine the path the dog follows – something like this:

- but the “constant speed” part of the puzzle means you can’t make simplifying assumption like the dog crossing each side of the moving square in the same amount of time (which give an easy answer of $\frac{50}{4} ( 2 \sqrt{4^2+1} + 8 ) \dot= \, 203.08 \,\mbox{m}$). Instead, I wrote an equation for the time $t$ it takes the square to move 50 m and the dog to around the square,
$\frac{L}{v_1} = t = \frac{2L}{\sqrt{v_2^2 -v_1^2}} +\frac{L}{v_2-v_1} +\frac{L}{v_2+v_1}$
where $L$ is the length of the sides of the square, $v_1$ square’s speed, $v_2$ the dog’s speed
, substituted $L=1$ and $v_1=1$ for ease, solved for $v_2$, then scaled it up from $L=1$ to $L=\, 50 \,\mbox{m}$

After way more than 30 min, I wound up with a mathematical beast, a quartic equation, which after looking up and use the general solution to quartic equations, gave me I think the correct answer,
Spoiler
.

My colleague has a less-than-10-year-old a PhD in Physics vs my 35-year-old BS in Math, so maybe he’s just more clever and faster than me, but I’m thinking the solution should be much simpler to find than this. Thoughts?

### #2 phillip1882

phillip1882

Thinking

• Members
• 648 posts

Posted 03 March 2017 - 11:36 AM

so lets take this puzzle apart piece by piece. you have a square measuring 50 meters, and moving 50 meters in one direction. let's say it moves at the rate of 1 meter per minute. which means the dog needs to get completely around the square in 50 minutes. so, let's assume for the sake of argument the dog travels 2 meters per minute.

then it would hit the north after 50/3 meters, hit the east after 50*sqrt(2)/2, hit the south after 25, then finally the west after  50*sqrt(2)/2 meters.

now this gives a total of 112 meters roughly. but it gives us a much clearer view of the problem.

does this help solve?

Edited by phillip1882, 03 March 2017 - 12:09 PM.

### #3 phillip1882

phillip1882

Thinking

• Members
• 648 posts

Posted 03 March 2017 - 12:03 PM

50/(m+1) +2*(50*sqrt(2)/(m)) +(50/(m-1)) = 50

100*m/(m^2-1) +100*sqrt(2)/m = 50

100m^2/(m^2-1) +100*sqrt(2) = 50*m

100m^2 +100*sqrt(2)*m^2 -100*sqrt(2) =50*m^3 -50*m

50*m^3 -100*(sqrt(2)+1)*m^2 -50*m +100*sqrt(2)

plugging into wolfram alpha and solving i get, m = 4.915. or 50*4.915 = 245.75

Edited by phillip1882, 03 March 2017 - 12:26 PM.

### #4 phillip1882

phillip1882

Thinking

• Members
• 648 posts

Posted 03 March 2017 - 12:31 PM

hmm i just realized that my calculations are all wrong. this problem is tougher than it looks.

Edited by phillip1882, 03 March 2017 - 12:31 PM.

### #5 spartan45

spartan45

• Members
• 71 posts

Posted 03 March 2017 - 03:38 PM

This question reminds me of an investment company glossy brochure I once received. There were graphs, stats, tables and loads of technical data to convince me how successful the company was. The problem was I couldn’t understand the data, it was gobbledegook. Probably the company hoped no-one would want to admit either to them-selves or anybody else they didn’t understand it and so be foolish enough to invest in a company they thought only clever people would use. Needless to say, nothing ever came of the company and it disappeared (probably along with people’s money).

I have always liked the saying ‘keep it simple’, so to solve the posted question:

Given: The soldiers move perpendicular to a side at a distance of 50meters.

This means instead of standing up, the soldiers lay flat on the ground. The dog only has to run around them, so the answer is 200 meters.

### #6 OceanBreeze

OceanBreeze

Explaining

• Members
• 527 posts

Posted 05 March 2017 - 02:38 AM

A colleague of mine gave me the following puzzle (wording my own):

A square formation of soldiers 50 m on each side move perpendicular to a side a distance of 50 m.
In the same amount of time, a dog moves at a constant speed around the formation, ending at the same place on the square it started.
How far does the dog travel?

He told me he had found the answer, years ago when he encountered the puzzle, in about 30 minutes.

So I undertook to find the solution. It’s easy to imagine the path the dog follows – something like this:
170203 dog and soldiers puzzle.png
- but the “constant speed” part of the puzzle means you can’t make simplifying assumption like the dog crossing each side of the moving square in the same amount of time (which give an easy answer of $\frac{50}{4} ( 2 \sqrt{4^2+1} + 8 ) \dot= \, 203.08 \,\mbox{m}$). Instead, I wrote an equation for the time $t$ it takes the square to move 50 m and the dog to around the square,
$\frac{L}{v_1} = t = \frac{2L}{\sqrt{v_2^2 -v_1^2}} +\frac{L}{v_2-v_1} +\frac{L}{v_2+v_1}$
where $L$ is the length of the sides of the square, $v_1$ square’s speed, $v_2$ the dog’s speed
, substituted $L=1$ and $v_1=1$ for ease, solved for $v_2$, then scaled it up from $L=1$ to $L=\, 50 \,\mbox{m}$

After way more than 30 min, I wound up with a mathematical beast, a quartic equation, which after looking up and use the general solution to quartic equations, gave me I think the correct answer,
Spoiler
.

My colleague has a less-than-10-year-old a PhD in Physics vs my 35-year-old BS in Math, so maybe he’s just more clever and faster than me, but I’m thinking the solution should be much simpler to find than this. Thoughts?

I don't know any easier way, except to use a graphic calculator to solve the quartic.

### #7 sluggo

sluggo

• Members
• 62 posts

Posted 07 March 2017 - 10:33 AM

This was solved geometrically with a CAD system.

Begin with a first approximation: the square moves 50m while the dog moves 200m. Dog speed a = 4x square speed b. Speed a must be constant. Square moves upward.

Considering only the vertical motion components of the dog; up, right, down, left,

using a=1 (side/time unit) the net motion is

A spreadsheet reveals b between .2 and .3.

Expanding the range to 2 decimals, b = .24.

Using a=1 and b=.24, the return point is .05 m high. Converting to meters:

Total distance is 50(1.32+1.03+.81+1.03) = 50(4.19) = 209.5 m.

That's close enough for me, for a problem that doesn't offer a prize!

### #8 CraigD

CraigD

Creating

• 8034 posts

Posted 18 March 2017 - 11:02 AM

This was solved geometrically with a CAD system.
Begin with a first approximation: the square moves 50m while the dog moves 200m. Dog speed a = 4x square speed b. Speed a must be constant. Square moves upward.
Considering only the vertical motion components of the dog; up, right, down, left,
using a=1 (side/time unit) the net motion is
eq-dog.png

Huh – that looks wrong. It give a solution of $b \dot= 0.239347$, which doesn’s match the solution for a I got above. When I start with the original equation and substitute for a=1, I get
$\frac{b}{1-b^2} +\frac{b}{\sqrt{1-b^2}} = \, .5$
or
$\frac{b + b\sqrt{1-b^2}}{1-b^2} = \, .5$
which has a solution of $b \dot= 0.239170$

In an exercise of LaTeX porn, here’s the exact solution for the speed of the dog/speed of the square:

For some reason, I can't get this to render in Hypography's LaTeX

### #9 sluggo

sluggo

• Members
• 62 posts

Posted 22 March 2017 - 11:26 AM

Begin with a first approximation: the square moves 50m while the dog moves 200m. Dog speed a = 4x square speed b. Speed a must be constant. Square moves upward.

Considering only the vertical motion components of the dog; up, right, down, left,

using a=1 (side/time unit) the (corrected) expression is

A spreadsheet reveals b between .2 and .3.

Expanding the range to 5 decimals, b = .23917.

Converting to meters:

Net distance is 50(1.314354-.806992+.49264) = 50(.99999) = 50 m.
Total distance is 50(1.31454+.806992+2.05978) = 50(4.181125) = 209.0563m.

Square moves (4.181125)*(.23917)=1.0000 side=50m.

Remember, using the continuum never yields a final value for non rational numbers.

#### Attached Thumbnails

Edited by sluggo, 22 March 2017 - 11:28 AM.