Join 3,442 readers in helping fund MetaFilter (Hide)

Tags:

hydra!
December 22, 2013 1:42 AM   Subscribe

Try to defeat the hydra! (Java required.) More about hydra math.
posted by divabat (27 comments total) 4 users marked this as a favorite

 
It seems like maybe decapitation tactics aren't the best way to kill something that can regrow heads. Just a thought.
posted by Pope Guilty at 2:04 AM on December 22, 2013 [5 favorites]


Captain Kirk would be disappointed.
posted by polymodus at 2:41 AM on December 22, 2013


It's not immediately obvious from some pages how long a victory can take - this page gives some clue. Note that Graham's number is notoriously large.
posted by edd at 3:50 AM on December 22, 2013


So I get that there are no losing strategies, but are some faster than others?
posted by empath at 4:29 AM on December 22, 2013


Seems to work ok without Java, I think it just needs JavaScript.
posted by vasi at 4:40 AM on December 22, 2013


I got it in 165 heads, though of course there's randomness involved so my strategy could have done worse. I focused on removing lower-down dire necks.
posted by vasi at 5:10 AM on December 22, 2013


I got it in 475 heads.
posted by MythMaker at 5:25 AM on December 22, 2013


You actually clicked the thing 475 times?
posted by empath at 5:31 AM on December 22, 2013


AH HOLY SHIT THE "MORE ABOUT HYDRA MATH" THING IS FROM THE FORUM 2000 GUY! My standard profile picture is still because of that website!
posted by Mrs. Pterodactyl at 6:13 AM on December 22, 2013


Hmm, it looks like my strategy actually sucks. Just always choosing the highest head yields a better result in my tests.
posted by vasi at 6:44 AM on December 22, 2013


Needs more torches.
posted by Bromius at 7:25 AM on December 22, 2013 [1 favorite]


I'm pretty sure that fighting a hydra IRL would give me PTSD so bad that the sight of a menorah say would make me a quivering wreck. Hell the flash game got me halfway there.
posted by BrotherCaine at 8:46 AM on December 22, 2013


finally, I could do it in less moves next time
posted by idiopath at 8:46 AM on December 22, 2013


AH HOLY SHIT THE "MORE ABOUT HYDRA MATH" THING IS FROM THE FORUM 2000 GUY!

I was more of a Conversatron guy but OH HOLY SHIT!

Seriously, I miss Q&A sites and it's a shame that that's apparently a dead field of humor.
posted by Pope Guilty at 9:33 AM on December 22, 2013 [2 favorites]


Hmm, it looks like my strategy actually sucks. Just always choosing the highest head yields a better result in my tests.

I did that, and also always went left-right if there were multiple heads at the same height.

I got 715, so I would challenge your assertion that this is 'always better'.

(Yes, I clicked it 715 times. I just saw the incredibly sad wish-giving post from today and the Hydra was just what I needed).
posted by flibbertigibbet at 9:35 AM on December 22, 2013 [1 favorite]


194

get the highest heads first, for parallel heights, get dire first, then regular
posted by idiopath at 12:01 PM on December 22, 2013


By chopping off a head we strictly decrease the ordinal. Because there are no infinite strictly descending sequences of ordinals, the hydra will eventually die, no matter how you chop off heads.

I think this theorem only follows if the hydra doesn't hit back.
posted by advil at 12:35 PM on December 22, 2013


it is remarkable how similar this is to refactoring lisp code
posted by idiopath at 12:46 PM on December 22, 2013 [3 favorites]


Completely arbitrary but 140-ish on my 2nd try, idea is just don't make any moves that would give you a worse-looking tree (i.e. greedy algorithm on tree size/complexity).
posted by polymodus at 1:18 PM on December 22, 2013


"Auto play" does not do well. I've left it going all day:

The hydra currently has: 42 segments, 12 heads, and depth 10. Hercules has cut 33491 heads so far.
posted by Happy Monkey at 2:21 PM on December 22, 2013


This is why you just want to ignore the heads, and do enough hit point damage to the body.

Or, you can try this strategy.
posted by happyroach at 3:39 PM on December 22, 2013


The hydra currently has: 40 segments, 12 heads, and depth 9. Hercules has cut 110885 heads so far.
posted by Happy Monkey at 6:28 AM on December 23, 2013 [1 favorite]


> it is remarkable how similar this is to refactoring lisp code

I'm almost certain that the ordinals constructed in the "hydra math" link are isomorphic to a (recursively defined) set consisting of n-tuples of arbitrary, finite n, where each element in the n-tuple is either a whole number or another tuple.

E.g. if you look at the second hydra, its ordinal is

ωω2·4 + 1 + 1,

which would correspond to

((4,0,1),1).

So you should be able to write the head-cutting transformation as a LISP macro. You should, not me — I don't know LISP. Thank god.
posted by benito.strauss at 10:32 PM on December 23, 2013


The hydra currently has: 36 segments, 11 heads, and depth 6. Hercules has cut 192921 heads so far.
posted by Happy Monkey at 11:34 PM on December 23, 2013


benito.strauss:

No need for macros, that's a needless complexity here. A macro is a function that takes a syntax tree and returns a new syntax tree.

If what you are operating on is data rather than executable syntax it suffices to transform the data itself.

The comparison to refactoring my lisp code is that lisp expressions are nested trees, and I am often trying to exchange depth for breadth for readability reasons.

Also LISP was a language written in the '50s by McCarthy, nobody uses it any more, the languages that descend from it are lisps.
posted by idiopath at 10:06 AM on December 24, 2013 [1 favorite]


I stopped at:

The hydra currently has: 34 segments, 13 heads, and depth 9. Hercules has cut 421395 heads so far.

I'm not going to wait Graham's Number seconds.
posted by Happy Monkey at 11:10 PM on December 25, 2013


It took me 373 heads to finish it off with a better strategy..
posted by Happy Monkey at 11:19 PM on December 25, 2013


« Older Sometimes it's hard to remember that there are Hol...  |  There's a slight problem with ... Newer »


This thread has been archived and is closed to new comments