惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
SegmentFault 最新的问题
Jina AI
Jina AI
罗磊的独立博客
V
Visual Studio Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
J
Java Code Geeks
U
Unit 42
Microsoft Azure Blog
Microsoft Azure Blog
B
Blog RSS Feed
爱范儿
爱范儿
酷 壳 – CoolShell
酷 壳 – CoolShell
Last Week in AI
Last Week in AI
T
The Blog of Author Tim Ferriss
腾讯CDC
Hugging Face - Blog
Hugging Face - Blog
T
Tailwind CSS Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
I
InfoQ
月光博客
月光博客
博客园_首页
Vercel News
Vercel News
P
Proofpoint News Feed
GbyAI
GbyAI
Y
Y Combinator Blog

The Guardian

New Zealand’s North Island braces for Cyclone Vaianu with thousands ordered to evacuate Artemis II splashdown – in pictures Swalwell denies allegations of sexual assault as calls grow for him to withdraw from California governor race Trump news at a glance: Epstein survivors have words for Melania Trump after surprise statement Multiple people face charges, including murder, in California fireworks blast Rory McIlroy surges into six-shot Masters lead with stunning second-round flourish Roberto De Zerbi targets ‘Ange-ball’ revival to save Spurs from relegation Bath hit back to reach semi-final after stunning Northampton in 11-try epic Australia crash out of BJK Cup after Britain secure upset with doubles win Zebras, wealth and power: Hungary’s election tests Orbán’s grip on power ‘TikTok effect’ brings sellout crowds and younger fans to Grand National meeting King signs up David Beckham to his Chelsea flower show team The war over Omagh’s gold: the £21bn mine plan tearing a community apart Britain’s shadow workforce is paid as little as 65p an hour. Who cares for the carers? Tim Dowling: my wife is on a quest to restore my thinning hair SUVs are making Britain’s potholes worse, say scientists Blind date: ‘She claimed she was usually shy. I wouldn’t have guessed’ I’m a sauna person now: the Becky Barnicoat cartoon ‘I got everything I dreamed of – when I had no ability to handle it’: Lena Dunham on toxic fame, broken friendships and her ‘lost decade’ Six great reads: the man who let snakes bite him, masked heavy metal and the brutal reality for foreign students in the UK Meera Sodha’s recipe for noodles with rose beancurd, spring greens and egg Cuba’s doctors were a lifeline for the world. Now the Caribbean is shamefully complicit in the US drive to expel them An environmental disaster in Moldova has Russia’s fingerprints all over it ‘This is as important as your teeth’: are you skipping this key part of mouth hygiene? Man arrested after four die trying to cross Channel in small boat Ukraine war briefing: doubts linger in Kyiv over Moscow’s promise to uphold Orthodox Easter ceasefire Ichiro Suzuki statue unveiling goes awry as bronze bat snaps during ceremony Arrest of national war hero Ben Roberts-Smith cuts deeply to core of Australian psyche European football: Real Madrid held at home by Girona to extend winless run ‘You come back different’: how rugby players change after motherhood
Did you solve it? Are you as s-s-smart as a snake?
Alex Bellos · 2026-04-28 · via The Guardian

Earlier today I asked you this slippery question. Here it is again with the solution.

Snakes in a cage

Two snakes of equal width are in a cage. One is long and the other is short.

Design two escape passages, A and B, that lead from the bottom of the cage such that

The short snake can escape down A, but the long snake can’t.

The long snake can escape down B, but the short snake can’t.

The passages must have no moving parts, trapdoors or levers. Assume that the snakes have circular cross-sections, and the diameter is the same at all points along their bodies. The snakes can wriggle but they can’t squeeze through passages that are narrower than they are wide.

Solution

Passage A must have some kind of a loop, where the loop is longer than the small snake but shorter than the long one. Here’s a sketch of an escape route that works.

snakes puzzle

The passage is a tube that has the same diameter as the snake. The snakes will follow the arrows. When the long snake doubles back and reaches the place where the tube meets itself, it cannot get through because its body is blocking the way. The short snake does not have that problem and can pass.

Note that a snake cannot turn “right” at the join. This is because the gap from the top to the bottom tube is not wide enough. To show this I have drawn the cross section at the join. It has the outline of two overlapping circles. When the snake is in the top tube, it cannot squeeze into the bottom tube, so it must follow the arrows and go into the loop. When the long snake goes round the loop and meets itself again, its body in the top tube will cut off part of the lower tube, so it will not be able to get through.

Passage B is simpler. You just need the passage to pass though some kind of hole in the floor that the short one will not be able to move over without falling in, but that will not pose a problem for the long one. (We need to assume non-zero rigidity in the snake.)

Thanks for all the herpetological jokes below the line in the original post. Not all of them were as painful as a snake bite!

I’ll be back in two weeks.

Source: Kvantik Magazine 2014.

I’ve been setting a puzzle here on alternate Mondays since 2015. I’m always on the look-out for great puzzles. If you would like to suggest one, email me.