this post was submitted on 06 Aug 2025
467 points (99.2% liked)

xkcd

12507 readers
674 users here now

A community for a webcomic of romance, sarcasm, math, and language.

founded 2 years ago
MODERATORS
 

xkcd #3125: Snake-in-the-Box Problem

Title text:

Chemistry grad students have been spotted trying to lure campus squirrels into laundry hampers in the hope that it sparks inspiration.

Transcript:

Transcript will show once it’s been added to explainxkcd.com

Source: https://xkcd.com/3125/

explainxkcd for #3125

top 34 comments
sorted by: hot top controversial new old
[–] ImplyingImplications@lemmy.ca 41 points 2 days ago (2 children)

What about goats in circular pens? A goat is tied to the fence of a circular pen. How long does the rope need to be so that the goat can reach exactly half of the pen's area? What sounds like a high school math problem was eventually solved in 2020 via complex analysis.

Here's the answer:

[–] frank@sopuli.xyz 13 points 2 days ago (1 children)

What's really neat about this problem is that the 3D example, a bird in a cage, was solved sooner and is much simpler

[–] kureta@lemmy.ml 4 points 1 day ago

I thought "wtf" after reading the problem, said "wtf" out loud after reading this comment. pretty neat :)

[–] Tangent5280@lemmy.world 15 points 2 days ago (2 children)

I feel like the answer should be much simpler than that equation salad.

[–] bstix 12 points 2 days ago

The difficulty is that the goat is tied to the fence.

It would be a lot easier to put a pole in the center of the circle.

The length of the rope would then be 0.5 x sqr(2) x fence radius.

[–] peoplebeproblems@midwest.social 12 points 2 days ago

Equation salad? It's elegant. Well, according to my father who was a math professor.

Deriving that monstrosity must be something out of a grad school horror novel.

[–] nialv7@lemmy.world 30 points 2 days ago (2 children)

Randall forgot psychology, which has involved a ton of putting animals in boxes...

[–] twice_hatch@midwest.social 12 points 2 days ago

In computer science, you steal the box from the psych department and put children in it so you can sell them loot crates

[–] FooBarrington@lemmy.world 5 points 2 days ago

Also zoology

[–] WilloftheWest@feddit.uk 7 points 2 days ago* (last edited 2 days ago)

We have one for combinatorics: Ask Fibonacci about his rabbits.

[–] youCanCallMeDragon@lemmy.world 4 points 1 day ago (1 children)

In biology it’s less of a “thought” experiment

[–] Agent641@lemmy.world 2 points 1 day ago* (last edited 1 day ago)

More of a "This is how we weigh a critter that won't stay put for more than .3 seconds"

[–] morphballganon@lemmynsfw.com 8 points 2 days ago* (last edited 2 days ago) (4 children)

Either I'm misunderstanding the problem or a length of 8 is possible.

Edit: found my mistake, far left edge has two non-consecutive segments on adjacent corners. Leaving this up in case anyone else tries for a better score.

[–] squaresinger@lemmy.world 3 points 2 days ago (1 children)

1000052407

This should do it, or am I missing something?

[–] leftzero@lemmy.dbzer0.com 7 points 2 days ago

The head would share an edge with the arse (supposing the arse is on the first bend from the tail).

[–] RagingHungryPanda@piefed.social 2 points 2 days ago (1 children)

I'm just nodding along and hoping no one notices i don't know what's happening

you mean the snake didn't know internal affairs was on to them the entire time?

[–] draycs@lemmy.world 2 points 2 days ago (1 children)

Unless your snake is an ouroboros, I don't think folks will count the head and tail as consecutive

[–] morphballganon@lemmynsfw.com 2 points 2 days ago

The head and tail aren't adjacent if you only look at my blue line and not the original. But my attempt fails due to the far left edge.

[–] DosDude@retrolemmy.com 1 points 2 days ago* (last edited 2 days ago) (1 children)
[–] leftzero@lemmy.dbzer0.com 7 points 2 days ago

Your snake has two heads.

Also, one of them shares an edge with the tail.

[–] don@lemmy.ca 9 points 2 days ago

I guess a key thought experiment doesn’t qualify as a reason, and also we are supposed to conveniently forget about putting spherical cows in a vacuum just because.

[–] ShinkanTrain@lemmy.ml 5 points 2 days ago

I'm still trying to fill that hotel with infinite monkeys

[–] ksigley@lemmy.world 5 points 2 days ago

There really is an xkcd for everything.

[–] MarauderIIC@lemmy.zip 4 points 2 days ago

My combinatorics professor used gnomes!

[–] BlackLaZoR@fedia.io 5 points 2 days ago (3 children)

I'd expect something around ~200 for n=9 and ~400 for n=10, but I imagine this is too big to be brute forced by raw computing

[–] elrik@lemmy.world 8 points 2 days ago (1 children)
[–] Klear@lemmy.world 1 points 2 days ago

Wow, it already lists the xkcd in the links section. I have a feeling that snake is gonna bite its tail soon.

[–] nialv7@lemmy.world 2 points 2 days ago* (last edited 2 days ago)

Some trivial bounds: F(n-1) + 1 <= F(n) <= F(n-1) * 2 + 1.

Also F(n) <= 2^(n-1)

[–] four@lemmy.zip 2 points 2 days ago (1 children)

I'd think that it's not "too much to be brute forced", but probably no one has thrown enough resources at that recently

[–] BlackLaZoR@fedia.io 1 points 2 days ago

With each additional dimension, the amount of possible combinations grows exponentially. Without serious optimization efforts, computation requirements get prohibitive very, very fast

[–] Part4@infosec.pub 1 points 2 days ago* (last edited 2 days ago) (2 children)

This is not my wheelhouse, and presumably were what I am about to suggest be right a million other people would have already pointed it out (not on lemmy necessarily, just in general). But aren't all of those sides equal so the relationship between snake's and any cube side's length effectively (as we see it anyway) shrinks/grows as it moves around the hypercube.

To be honest I don't even understand what the cartoon means by 'two non-consecutive parts of its coils' so I wouldn't take my word for anything.

[–] sanguinepar@lemmy.world 5 points 2 days ago

Took me a while to follow that too! The three examples of fails at the top each show instances where there are non-consecutive parts of the snake on adjacent corners - it's the lines highlighted in red.

Basically no two parts of the snake that aren't directly joined to each other in the snake are allowed to be on corners which are only a line apart.

I think.

[–] Phoenix3875@lemmy.world 2 points 2 days ago* (last edited 2 days ago)

Any two coils that are not directly connected. For example, suppose we number from the head, coil 1, 2, 3, 4. Then pairs that are not directly connected are: (1, 3), (1, 4), (2, 4). The endpoints of these pairs of segments cannot be connected by an edge of the cube.