# in the Hare and Hounds game, will Hare always win?

**URL:** <https://boards.straightdope.com/t/in-the-hare-and-hounds-game-will-hare-always-win/569378>\
**Category:** Factual Questions\
**Created:** [January 29, 2011, 5:13am UTC](https://boards.straightdope.com/t/in-the-hare-and-hounds-game-will-hare-always-win/569378 "2011-01-29T05:13:06Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![septimus](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/septimus/32/410_2.png) [@septimus](https://boards.straightdope.com/u/septimus)\
**Post date:** [February 4, 2011, 7:23am UTC](https://boards.straightdope.com/t/in-the-hare-and-hounds-game-will-hare-always-win/569378/21 "2011-02-04T07:23:15Z")

</div>

> [@SCSimmons](#):
>
> He’ll know it’s been solved when he sees a solution. 😉
> 
> I just PM’d you my e-mail address–I’d love to see the code.

Source sent (and will send to any who want it). I’d never heard of [Hare and Hounds](http://en.wikipedia.org/wiki/Hare_and_Hounds_%28board_game%29) before this thread, but assume the game we speak of is the one described at Wikipedia.

While this game has 11 cells and 3 hounds, there’s a similar game I played as a child, Fox and Dogs, with 32 cells and 4 dogs. But either of these games is easy to solve with computer, or even by hand. (In fact it is almost trivial to adapt the source I send for Fox and Dogs, though I’ll send source for that too if you need it. 😃 )

The claim that this game might not have been solved astounded me, frankly. The program I sent solves it with brute force in 1 millisecond or less, so computation isn’t the issue. (Perhaps I solved a different variant than is intended, but I think almost any variant would be similarly trivial.) While I’ll stipulate that most “programmers” wouldn’t have a clue how to solve a game, the number on the planet that _could_ is at least 100,000, I’d guess, rounded to the nearest power of ten. Someone upthread mentioned an on-line player that learns a strategy interactively: that’s much harder than solving the game.

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [February 4, 2011, 9:55pm UTC](https://boards.straightdope.com/t/in-the-hare-and-hounds-game-will-hare-always-win/569378/22 "2011-02-04T21:55:37Z")

</div>

Of course, it’d be good to double-check it by pitting your code against one of the many Java versions of the game you can find online. Just have the two open in different windows, and copy the moves from one to the other. It might be that your implementation of the game is incomplete, and the existing implementations can win by making a move your code didn’t realize was possible.

---

<div class="post-metadata">

**Author:** ![septimus](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/septimus/32/410_2.png) [@septimus](https://boards.straightdope.com/u/septimus)\
**Post date:** [February 5, 2011, 8:19am UTC](https://boards.straightdope.com/t/in-the-hare-and-hounds-game-will-hare-always-win/569378/23 "2011-02-05T08:19:19Z")

</div>

> [@Chronos](#):
>
> Of course, it’d be good to double-check it by pitting your code against one of the many Java versions of the game you can find online. Just have the two open in different windows, and copy the moves from one to the other. It might be that your implementation of the game is incomplete, and the existing implementations can win by making a move your code didn’t realize was possible. [septimus’ emphasis]

I guess I failed to underline or emphasize the text which mentioned my solution was derived with computer. It would be hard for even a human to overlook a move in this game since there are so few. Hare must get to the very center to have as many as eight moves. I’m not sure of the status of the “Pentium bug” but even if it actually can’t count to eight – there may be no worry! Hounds are able to prevent Hare from getting to the center cell, at least in the common variation.

Thanks for allowing me to pit my code against just one on-line Java. I chose [this one](http://www.mazeworks.com/hounds/index.htm); set it to expert and played the Hounds. The final score was Player 4, Computer 0. This seemed to conclude the experiment as the Computer made exactly the same Hare moves in every game. The Hounds made the same ten moves each time, leading to checkmate. These moves (some of which may seem quite counter-intuitive) were  
Center right  
Center right  
Center right  
Bottom diagonal  
Top down  
Front down  
Back up  
Center Diagonal  
Back Diagonal  
Center Right checkmates

I’m sure your remarks were good-natured and well-intentioned, **Mr. Chronos**. I’d be curious, however, what your reaction would be if our positions were reversed, i.e. if I took a similarly condescending position in a thread, e.g. of physics, where _you_ should be teacher, and _I_ learner.

---

<div class="post-metadata">

**Author:** ![DCnDC](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/dcndc/32/2842_2.png) [@DCnDC](https://boards.straightdope.com/u/DCnDC)\
**Post date:** [February 5, 2011, 1:50pm UTC](https://boards.straightdope.com/t/in-the-hare-and-hounds-game-will-hare-always-win/569378/24 "2011-02-05T13:50:51Z")

</div>

Interesting. I commented upthread that I didn’t know if it was solved only because I had actually never seen it before reading the OP, which posits the opposite results of your conclusion.

I will add that I actually came to the same conclusion as the OP after playing against the Java version of the game on expert: I was eventually able to always win as the Hare because of this rule: “…if the hounds move 10 times in a row without advancing (i.e. they only move up and down) then the hounds are stalling and the hare wins.” This occurs at the point where the hounds inevitably occupy each of the three center positions; the hare is moving back and forth from its starting position at the far right and just going back and forth from there to the top right hexagon (the rear hound will just go up and down 10 times, resulting in a draw which=hare wins).

---

<div class="post-metadata">

**Author:** ![DCnDC](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/dcndc/32/2842_2.png) [@DCnDC](https://boards.straightdope.com/u/DCnDC)\
**Post date:** [February 5, 2011, 2:00pm UTC](https://boards.straightdope.com/t/in-the-hare-and-hounds-game-will-hare-always-win/569378/25 "2011-02-05T14:00:22Z")

</div>

OTOH, perhaps that is merely a flaw in the programming of the computer’s play. I don’t have the programming knowledge to map out all of the possible moves so I don’t know.

---

<div class="post-metadata">

**Author:** ![drhess](https://avatars.discourse-cdn.com/v4/letter/d/94ad74/32.png) [@drhess](https://boards.straightdope.com/u/drhess)\
**Post date:** [February 5, 2011, 5:16pm UTC](https://boards.straightdope.com/t/in-the-hare-and-hounds-game-will-hare-always-win/569378/26 "2011-02-05T17:16:06Z")

</div>

> [@DCnDC](#):
>
> Interesting. I commented upthread that I didn’t know if it was solved only because I had actually never seen it before reading the OP, which posits the opposite results of your conclusion.
> 
> I will add that I actually came to the same conclusion as the OP after playing against the Java version of the game on expert: I was eventually able to always win as the Hare because of this rule: “…if the hounds move 10 times in a row without advancing (i.e. they only move up and down) then the hounds are stalling and the hare wins.” This occurs at the point where the hounds inevitably occupy each of the three center positions; the hare is moving back and forth from its starting position at the far right and just going back and forth from there to the top right hexagon (the rear hound will just go up and down 10 times, resulting in a draw which=hare wins).

Yes, without the “hare wins in draw” rule, I think the game may always draw. So like many “pub or parlor games”, it’s just a fun novelty when you encounter it, and if you play infrequently (or are young or not too focused, or dare I say obsessed or smart enough to figure it out precisely) it is just good fun.

Thanks all for the discussion.

---

<div class="post-metadata">

**Author:** ![Pasta](https://avatars.discourse-cdn.com/v4/letter/p/ecccb3/32.png) [@Pasta](https://boards.straightdope.com/u/Pasta)\
**Post date:** [February 5, 2011, 6:04pm UTC](https://boards.straightdope.com/t/in-the-hare-and-hounds-game-will-hare-always-win/569378/27 "2011-02-05T18:04:19Z")

</div>

> [@drhess](#):
>
> Yes, without the “hare wins in draw” rule, I think the game may always draw.

Isn’t this in conflict with **septimus** ’s result?

FWIW - I had also never heard of the game, but I immediately thought it to be imminently solvable. (I also solve games regularly for fun and profit, and this one appears trivial. If I have any downtime today, I might solve it myself…)

---

<div class="post-metadata">

**Author:** ![SCSimmons](https://avatars.discourse-cdn.com/v4/letter/s/e495f1/32.png) [@SCSimmons](https://boards.straightdope.com/u/SCSimmons)\
**Post date:** [February 5, 2011, 6:24pm UTC](https://boards.straightdope.com/t/in-the-hare-and-hounds-game-will-hare-always-win/569378/28 "2011-02-05T18:24:18Z")

</div>

> [@septimus](#):
>
> I’m sure your remarks were good-natured and well-intentioned, **Mr. Chronos**. I’d be curious, however, what your reaction would be if our positions were reversed, i.e. if I took a similarly condescending position in a thread, e.g. of physics, where _you_ should be teacher, and _I_ learner.

Having done both, I think computer programming is harder than physics, **septimus**. (Sorry, **Chronos**!)

There’s a bug in your program in determining hare wins by repetition. I can’t find it–the coding looks correct to me\*, but something’s slipping through. Try selecting move A for the rabbit each turn. You’ll notice that the dogs’ seventh move repeats the position from after their fifth, and after this the program will happily enter an unlimited repetition. You can continue to enter A indefinitely, moving the rabbit back and forth along the lower-right diagonal, and the computer will respond by moving that same dog up and down along the back vertical. This should be a rabbit win after ten consecutive vertical moves (actually six, with the default MAXWAIT value you have set), but the program never acknowledges this …

\*My C is rustier than you can possibly imagine. I didn’t really expect to be able to figure out a subtle bug. I may try to rework this in an OO language …

---

<div class="post-metadata">

**Author:** ![DCnDC](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/dcndc/32/2842_2.png) [@DCnDC](https://boards.straightdope.com/u/DCnDC)\
**Post date:** [February 5, 2011, 6:29pm UTC](https://boards.straightdope.com/t/in-the-hare-and-hounds-game-will-hare-always-win/569378/29 "2011-02-05T18:29:44Z")

</div>

> [@Pasta](#):
>
> FWIW - I had also never heard of the game, but I immediately thought it to be imminently solvable. (I also solve games regularly for fun and profit, and this one appears trivial. If I have any downtime today, I might solve it myself…)

I’ve played it through many dozens of times and I can win it with the hare almost every time. The problem is the “draw=hare wins” rule. Every game I’ve played since learning how to win with hare eventually ends up with [this arrangement](http://img143.imageshack.us/img143/3564/hareandhounds.png), from which the hare has merely to stall for 10 turns to win, in which case it would seem that if the game were to be solved, it would be solved in the hare’s favor, not the hounds.

---

<div class="post-metadata">

**Author:** ![septimus](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/septimus/32/410_2.png) [@septimus](https://boards.straightdope.com/u/septimus)\
**Post date:** [February 5, 2011, 6:49pm UTC](https://boards.straightdope.com/t/in-the-hare-and-hounds-game-will-hare-always-win/569378/30 "2011-02-05T18:49:19Z")

</div>

> [@SCSimmons](#):
>
> There’s a bug in your program in determining hare wins by repetition.

Maybe I’m a sadist but I inflicted a deliberate bug just to see if you were serious about running the program. 😉 The very last call to dog\_canwin needs to increment that wait count argument; here’s the corrected line:

```auto

				dog_canwin(1, thepos & 0xf,
					(thepos & 0xffe0) >> 5,
					((thepos & 0xff0000) >> 16) + 1, -1);

```

---

<div class="post-metadata">

**Author:** ![ZenBeam](https://avatars.discourse-cdn.com/v4/letter/z/3ab097/32.png) [@ZenBeam](https://boards.straightdope.com/u/ZenBeam)\
**Post date:** [February 5, 2011, 7:00pm UTC](https://boards.straightdope.com/t/in-the-hare-and-hounds-game-will-hare-always-win/569378/31 "2011-02-05T19:00:43Z")

</div>

**Septimus** , when your program is run, can it force a win without ever getting in the position in **DCnDC** ’s link, or can the dogs win from there?

> [@Septimus](#):
>
> Maybe I’m a sadist but I inflicted a deliberate bug […]

Well, this is kind of lame. We’re all adults here, but whatever. So are you now saying your program always wins _with the bug included_, or are you saying the program always wins _even without the bug_?

ETA: **DCnDC** , in your position, is it the hare’s move, or the dogs?

---

<div class="post-metadata">

**Author:** ![septimus](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/septimus/32/410_2.png) [@septimus](https://boards.straightdope.com/u/septimus)\
**Post date:** [February 5, 2011, 7:23pm UTC](https://boards.straightdope.com/t/in-the-hare-and-hounds-game-will-hare-always-win/569378/32 "2011-02-05T19:23:16Z")

</div>

> [@ZenBeam](#):
>
> **Septimus** , when your program is run, can it force a win without ever getting in the position in **DCnDC** ’s link, or can the dogs win from there?
> 
> Well, this is kind of lame. We’re all adults here, but whatever. So are you now saying your program always wins _with the bug included_, or are you saying the program always wins _even without the bug_?
> 
> ETA: **DCnDC** , in your position, is it the hare’s move, or the dogs?

In the position you refer to, I assume it is Hare’s move. This position seems to be key. This position is arrived at in the detailed ten-move checkmate I posted earlier, and, I think, in the game SCSimmons describes; Hounds’ last move was “Top Down”; after Hare moves up, you play “Front Down” to arrive at

```auto

   * * R
* D D * *
   * * D R=Hare; D=Hound

```

Hare moves down (at least at the Java page I mentioned); you play Back up; Hare goes right; you play “Center Diagonal” to arrive, with Hare to move, at

```auto

   * * D
* D * * R
   * * D

```

Sorry for the attempt at humor about the “bug” which affects only the demo play, not the solution. Hounds win if they’re allowed 5 vertical moves. If there’s interest I’ll post Hare’s strategy to beat Hounds when they’re allowed only 4 vertical moves. (Or SCSimmons can do so easily enough, now that we know he’s serious. 🆒)

---

<div class="post-metadata">

**Author:** ![DCnDC](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/dcndc/32/2842_2.png) [@DCnDC](https://boards.straightdope.com/u/DCnDC)\
**Post date:** [February 5, 2011, 8:14pm UTC](https://boards.straightdope.com/t/in-the-hare-and-hounds-game-will-hare-always-win/569378/33 "2011-02-05T20:14:30Z")

</div>

**ZenBeam** it is the hounds’ move.

Move the front hound down and you arrive here:

```auto

   * * R
* D D * *
   * * D

```

and it is the hounds’ move. From this position, the hare can stall indefinitely, because moving the center hound is suicide, therefore only the front and back hounds are in play, in which case the hare can always force a draw, which = hare wins.

---

<div class="post-metadata">

**Author:** ![SCSimmons](https://avatars.discourse-cdn.com/v4/letter/s/e495f1/32.png) [@SCSimmons](https://boards.straightdope.com/u/SCSimmons)\
**Post date:** [February 5, 2011, 9:00pm UTC](https://boards.straightdope.com/t/in-the-hare-and-hounds-game-will-hare-always-win/569378/34 "2011-02-05T21:00:34Z")

</div>

I’m always serious.

OK, I’m rarely serious, but I’m serious today. That was annoying. :mad: OK, mainly that I didn’t see that counter wasn’t incrementing.

It does work, though. Once the program can see the loops coming up, it adjusts its strategy … I can see where my intuition was leading me wrong, now. I had assumed that if a position repeats, then we had necessarily entered a loop. The program has the same input in that situation, so won’t it try the same move in response as it did the last time that position came up?

That’s true in the buggy version, but not when the code is corrected. I was surprised that the second time the row-of-three position came up in one of my tests, the computer made a different move that it had the previous time. 😕 But of course–the other piece of information it’s using isn’t on the board–it’s the number of consecutive vertical moves it’s already made. That closes off a bunch of trees on its search.

So, now to find that winning hare strategy when the hounds are limited to four vertical moves …

---

<div class="post-metadata">

**Author:** ![SCSimmons](https://avatars.discourse-cdn.com/v4/letter/s/e495f1/32.png) [@SCSimmons](https://boards.straightdope.com/u/SCSimmons)\
**Post date:** [February 5, 2011, 9:15pm UTC](https://boards.straightdope.com/t/in-the-hare-and-hounds-game-will-hare-always-win/569378/35 "2011-02-05T21:15:11Z")

</div>

> [@DCnDC](#):
>
> **ZenBeam** it is the hounds’ move.
> 
> Move the front hound down and you arrive here:
> 
> ```auto
> 
> * * R
> * D D * *
> * * D
> 
> ```
> 
> and it is the hounds’ move. From this position, the hare can stall indefinitely, because moving the center hound is suicide, therefore only the front and back hounds are in play, in which case the hare can always force a draw, which = hare wins.

I’ve never seen that position show up after a rabbit move–only after a hound move.

---

<div class="post-metadata">

**Author:** ![ultrafilter](https://avatars.discourse-cdn.com/v4/letter/u/3d9bf3/32.png) [@ultrafilter](https://boards.straightdope.com/u/ultrafilter)\
**Post date:** [February 5, 2011, 9:22pm UTC](https://boards.straightdope.com/t/in-the-hare-and-hounds-game-will-hare-always-win/569378/36 "2011-02-05T21:22:14Z")

</div>

There’s a chapter on the Hare and Hounds in volume 3 of the second edition of “Winning Ways for your Mathematical Plays”, which is the definitive work on combinatorial game theory. I don’t have a copy of the book, but from what I’ve read in Amazon’s preview, it looks like the game is solved for small boards and at least one semi-infinite board.

---

<div class="post-metadata">

**Author:** ![DCnDC](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/dcndc/32/2842_2.png) [@DCnDC](https://boards.straightdope.com/u/DCnDC)\
**Post date:** [February 5, 2011, 9:25pm UTC](https://boards.straightdope.com/t/in-the-hare-and-hounds-game-will-hare-always-win/569378/37 "2011-02-05T21:25:12Z")

</div>

> [@SCSimmons](#):
>
> I’ve never seen that position show up after a rabbit move–only after a hound move.

It is the hounds’ move once the board is in this arrangement:

```auto

   * * *
* D D D R
   * * *

```

so if the front hound moves down, the rabbit moves up, and you get:

```auto

   * * R
* D D * *
   * * D

```

because the hounds’ only move, really, is to move either the front hound or back hound up or down, neither of which matters because the hare can simply go back and forth from the far right, forcing the hounds to return the to middle or leave an opening for the hare to escape.

---

<div class="post-metadata">

**Author:** ![septimus](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/septimus/32/410_2.png) [@septimus](https://boards.straightdope.com/u/septimus)\
**Post date:** [February 5, 2011, 10:18pm UTC](https://boards.straightdope.com/t/in-the-hare-and-hounds-game-will-hare-always-win/569378/38 "2011-02-05T22:18:31Z")

</div>

> [@DCnDC](#):
>
> It is the hounds’ move once the board is in this arrangement:
> 
> ```auto
> 
> * * *
> * D D D R
> * * *
> 
> ```

Agreed that from here Hounds lose. So we need to examine prior moves and locate Hounds’ blunder.

> [@SCSimmons](#):
>
> That was annoying. :mad: OK, mainly that I didn’t see that counter wasn’t incrementing.

To the contrary, I’m very impressed you almost found that bug. While my code has a nice tendency to behave as intended, my source is widely deprecated as indecipherable, useful mainly for obfuscation. :smack:

---

<div class="post-metadata">

**Author:** ![SCSimmons](https://avatars.discourse-cdn.com/v4/letter/s/e495f1/32.png) [@SCSimmons](https://boards.straightdope.com/u/SCSimmons)\
**Post date:** [February 5, 2011, 11:32pm UTC](https://boards.straightdope.com/t/in-the-hare-and-hounds-game-will-hare-always-win/569378/39 "2011-02-05T23:32:23Z")

</div>

> [@septimus](#):
>
> To the contrary, I’m very impressed you almost found that bug. While my code has a nice tendency to behave as intended, my source is widely deprecated as indecipherable, useful mainly for obfuscation. :smack:

But very efficient! 😃

---

<div class="post-metadata">

**Author:** ![DCnDC](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/dcndc/32/2842_2.png) [@DCnDC](https://boards.straightdope.com/u/DCnDC)\
**Post date:** [February 5, 2011, 11:48pm UTC](https://boards.straightdope.com/t/in-the-hare-and-hounds-game-will-hare-always-win/569378/40 "2011-02-05T23:48:16Z")

</div>

> [@septimus](#):
>
> Agreed that from here Hounds lose. So we need to examine prior moves and locate Hounds’ blunder.

I’m not sure it’s possible to either not end up in that arrangement or otherwise win the game for hounds.

Let’s look at the alternative strategy which would be to advance all three hounds up the board.

Obviously, if the hare gets to the middle hexagon there is no way to stop it from escaping, so the hounds’ first priority no matter what is to occupy that space, yielding:

```auto

   D * *
* * D * R
   D * *

```

Then, if we move the other two hounds up, no matter what the hare does we’ll end up with:

```auto

   * D *
* * D * R
   * D *

```

and because there is no way we can advance the middle hound and not lose, another move later we get either:

```auto

   * * D
* * D * *
   * D R

```

or:

```auto

   * D R
* * D * *
   * * D

```

Now, at this point we’re essentially out of moves because we still can’t move out of that middle hexagon and advancing the forward hound gives the hare an out, so we can only repeatedly move our forward hound vertically and ten turns later we lose.

So I would have to conclude that you were correct, it is definitely solvable, but just for the opposite team. How does that look to you? Did I miss anything?

[Previous page](https://boards.straightdope.com/t/in-the-hare-and-hounds-game-will-hare-always-win/569378.md?page=1)

[Next page](https://boards.straightdope.com/t/in-the-hare-and-hounds-game-will-hare-always-win/569378.md?page=3)
