字幕列表 影片播放
Your interstellar police squad has tracked a group of dangerous rebels
你的星際警察在追蹤 一群危險的叛亂份子,
to a cluster of of seven small planets.
他們在七顆相鄰的小行星上,
Now you must apprehend them quickly before their reinforcements arrive.
在他們的援軍到達前, 你要趕快把他們抓起來。
Of course, the rebels won't just stay put.
當然,叛軍不會坐以待斃,
They'll try to dodge you by moving from planet to planet.
他們會在星球間移動以躲開你。
But you have one major advantage.
然而,你有個大優勢:
Every hour, your state-of-the-art cruiser can warp between any two planets,
每小時,你先進的巡航艦能在 任兩座星球間穿梭,
while their beat-up smuggling ship
而對方的老舊走私船
can only jump to an adjacent planet in that same time.
只能在相鄰的星球間移動。
These rebels don't like to stay put.
這些叛軍不喜歡停留,
Every time they can relocate, they will.
當有機會遷移,他們就會做。
Your scouts tell you that the approaching rebel fleet is 10 hours away.
你的偵查員說 叛軍艦隊與你之間距離十小時,
You can't risk letting the rebels escape.
而你不能冒險讓這些叛軍逃跑。
Can you devise a sequence for searching the planets
你能設計一套順序來搜索星球,
that's guaranteed to catch them in 10 warps or less,
不管叛軍如何移動, 都能保證在十步內抓到他們嗎?
no matter what moves they make?
圍捕叛軍並不容易,
Rounding up the rebels won't be easy.
第一,你不知道他們 最初在哪顆星球,
For one, you have no way of knowing which planet they're on to begin with.
因此很難判斷下一步他們會去哪裡。
And without that information, it's hard to determine where they'll move next.
所以該怎麼開始?
So where do you begin?
將問題簡化有助解決這類問題,
When tackling problems of this kind it often helps to simplify things,
我們能更容易想像移動步數。
so you can better understand their dynamics.
想像這群行星有相同排列,
Let's imagine that this cluster has the same arrangement
但沒有最外圈,因此只留下 中心的四顆行星。
but no outermost planets, leaving only the four in the center.
我們依然不知道叛軍位在哪裡,
We still don't know which planet the rebels start on.
但有個關鍵:
But there's one key feature:
三號行星和其他行星都相鄰,
the third planet is adjacent to all others,
這表示,叛軍要不是從此出發 然後移動到其他顆,
which means the rebels either start there and move somewhere else,
不然就從其他顆行星開始,
or start on one of the other planets
接著別無選擇的移動到三號行星。
and have no choice but to move to planet three.
因此,只要在三號星球 連續檢查兩次,就完成任務。
Simply checking planet three twice in a row would do the trick.
三顆外圍行星加進來 會增加一點困難度,
Adding the three outer planet adds a bit more complexity,
但策略是一樣的,
but the same strategy remains.
我們依次分析行星,找到叛軍的位置。
We want to check the planets in an order that will eventually corner the rebels.
有另一個技巧能派上用場:
And there's another insight that can help us:
每小時,叛軍會從偶數行星
each hour, the rebels move from an even-numbered planet
移動到奇數行星,
to an odd-numbered planet,
或相反。
or vice versa.
這讓我們能簡化問題,
This gives us a way to simplify the problem
將行星分成兩群
by dividing the planets into two subsets,
並分別分析。
and tackling each one separately.
首先,我們假設叛軍 一開始位於偶數行星:
For starters, let's assume the rebels begin on an even-numbered planet:
二號、
either two,
四號
four,
或六號。
or six.
我們從二號行星開始。
So we'll search planet two first.
如果他們不在那,那一定是 在四號或六號,
If they're not there, they must have started on either four
表示接下來可以移動到三號、
or six.
五號
which means they can move to three,
或七號。
five,
三號行星在中間,叛軍在此 有最多的選擇逃跑,
or seven.
因此我們下一步檢查那裡。
Planet three at the center gives them the most options for their next move,
如果沒找到,他們 一定在五號
so we'll want to check there next.
或七號,
If we don't find them, they must have been at planet five
表示下一步會移動到四號
or seven,
或六號。
meaning they'll next move to four
現在,我們檢查四號,
or six.
如果他們不在那,表示剛剛在六號
Let's now search planet four.
並且能逃到三號
If they're not there, they must have gone to the sixth planet
或七號。
and can only flee to three
如果下一步檢查三號而沒有找到,
or seven.
我們就能確定他們在七號, 而且被困住了,
If we next scour planet three and don't find them,
他們接著只能到六號,而我們能在那 逮到他們;此時是第五次搜尋。
we know they went to planet seven and are now cornered.
當然,計畫成功的前提是
They can only move to planet six, where we'll apprehend them on our fifth search.
假設叛軍是從偶數星球出發,
Of course, this plan only works
而如果假設是錯的呢?
assuming that the rebels were on an even-numbered planet in the first hour.
這種情況下,他們從奇數星球開始,
But what if that assumption was wrong?
因為他們每小時會去鄰近星球,
In that case, they must've started on an odd-numbered planet.
他們的位置一定是在 奇數和偶數星球間交換,
And because they move to an adjacent planet every hour,
這表示,從偶數星球出發時,
their location must alternate between odd and even-numbered planets.
五步之後,他們會到偶數星球上,
This means that if they were on an odd-numbered planet to start,
因此如果前五步沒找到,
after five moves, they'd be on an even-numbered planet.
表示叛軍在偶數星球的假設是錯的,
So if our first five searches missed them
那現在該做的,就是重複一遍。
because our assumption that they started on an even-numbered planet was wrong,
依下列順序檢查:
all we have to do now is repeat the sequence!
二號、
Searching the planets in order
三號、
two,
四號、
three,
三號、
four,
六號、
three,
二號、
six,
三號、
two,
四號、
three,
三號、
four,
六號,
three,
這樣子會讓叛軍無路可逃。
six,
感謝你的推理,銀河恢復了秩序。
leaves the rebels nowhere to run.
Thanks to your deductive reasoning, order is restored to the galaxy.