Twenty million cards,
found in 25 flips
2000 万张卡片,
25 次就能翻到

No maths background needed. One card a second, twenty million takes over seven months; halving takes 25. 不需要数学基础。一秒一张地翻,2000 万张要看七个多月;对半砍只要 25 次。

一刀,这半边出局 one cut, this half is out 2000 万张卡片 twenty million cards
The cards are kept in number order. Pull up the middle one: wrong number, and the left half is out. One a second, 20,000,000 cards take 231 days — over seven months. Halving gets there in 25. 这抽屉卡片是按号码排好的。把中间那一张翻起来:号码不对,左边一半就出局了。一秒一张地翻,2000 万张要 231 天多,也就是七个多月。对半砍只要 25 次。

What is halving like? 对半砍像什么?

二分查找 binary searchbinary search turn over only the middle one, then drop a whole half 每次只翻中间那一张,然后扔掉一半

In a guessing game you don't count up from one. You say the middle number — a wrong guess still drops half. 猜数字游戏里,你不会从 1 开始一个个报。你每次报中间那个数——报错了也砍掉一半。

It's like…就像……

Guess a number from 1 to 100: start at 50. Too high, try 25; too low, try 75 — seven guesses always get there. 猜 1 到 100 的数:先猜 50。高了猜 25,低了猜 75——七次之内一定中。

一张一张翻 one at a time 一秒一张,要七个多月 one a second: over seven months 每次翻中间那一张 turn the middle one 一刀之后还剩 1000 万 one cut later: ten million left
Violet is what you still have to look at. Up top, the first card comes out and violet barely moves. One a second, 20,000,000 cards take 231 days — over seven months. Below, the middle card comes out. Half the range goes hollow at once: 20,000,000 down to 10,000,000. Both drawers gave up one card; the difference is what is left. The card on the lip is drawn far wider than one card, or it would be invisible. 紫色是你还得看的那些。上面翻的是第一张,紫色几乎没动。一秒一张,2000 万张要 231 天多,也就是七个多月。下面翻的是中间那一张。一半当场变空心,2000 万变成 1000 万。两次都只翻出一张卡片,差别是剩下多少。抽屉沿上那张画得比一张卡片宽得多,不然看不见。

After each cut, how much is left? 每砍一刀,还剩多少?

1

Turn the middle card 翻开中间那一张

2

Compare the numbers 和你要的号码比大小

3

Drop the impossible half 扔掉不可能的那一半

0 20 000 000 1 10 000 000 2 5 000 000 3 2 500 000 4 1 250 000 砍了几刀 → 范围还剩多少 cuts so far → range still in play
All five rows are the same cards on one axis. Each cut halves the range still in play: 20,000,000 → 10,000,000 → 5,000,000 → 2,500,000 → 1,250,000. Row 0 is the start, so five rows hold four cuts. No ruled-out card left the row; they are drawn hollow. The answer is under the yellow line; 21 more cuts leave just it. 2 to the 20th is 1,048,576, too small; 2 to the 21st is 2,097,152, enough. 4 + 21 = 25. 五行是同一根横轴上的同一排卡片。砍一刀,还要看的范围就少一半:2000 万 → 1000 万 → 500 万 → 250 万 → 125 万。第 0 行是起点,五行之间只有四刀。被排除的卡片没走,只是画成了空心。答案就在黄线那一小段里,再砍 21 刀就只剩它。2 的 20 次方是 1 048 576,不到 125 万;2 的 21 次方是 2 097 152,够了。4 + 21 = 25。

Why is 25 enough? 为什么 25 次就够?

Halving is doubling run backwards. Start at one card, double 25 times, and you reach 33,554,432 — past twenty million. 对半砍的反面是翻倍。从 1 张开始翻 25 次,到 33 554 432 张——比 2000 万多。

翻倍 25 次 · 33 554 432 张 · 3355 米 25 doublings · 33 554 432 cards · 3355 m 2000 万张卡片 · 2000 米 twenty million cards · 2000 m 世界上最高的那栋楼 · 828 米 the tallest building there is · 828 m
At 0.1 mm a sheet — printer paper — 20,000,000 cards stack 2000 m. That is 2,000,000 mm; the violet pile is it, and the yellow line is its top. Twenty-five doublings reach 33,554,432 sheets, 3,355,443 mm, 3355 m — clear of the line. 2 to the 24th is 16,777,216, short of twenty million, so 24 cuts fall short. Those 3355 m beat four of the tallest building stacked: 828 × 4 = 3312 m. Same for 1 to 100: 2 to the 6th is 64, 2 to the 7th is 128. So seven guesses. Every rung of the ruler is 500 m; heights follow that scale, widths do not. 按一张纸 0.1 毫米算(打印纸的厚度):2000 万张摞起来 2000 米。也就是 2 000 000 毫米。紫色那一摞就是它,黄线是它的顶。翻倍 25 次到 33 554 432 张,3 355 443 毫米,也就是 3355 米,越过了黄线。2 的 24 次方是 16 777 216,还不到 2000 万——24 次不够。3355 米比世界上最高的那栋楼叠四座还高:828 × 4 = 3312 米。猜 1 到 100 也一样:2 的 6 次方是 64,2 的 7 次方是 128,所以七次。右边刻度每一格 500 米;高度按这个刻度画,粗细没按比例。

Why must it already be in order? 为什么必须先排好序?

索引 indexindex a copy something keeps in order for you, all the time 有人一直替你保持着顺序的那份副本

Out of order, the middle card tells you nothing. 没排好序,翻中间那一张什么也说明不了

没排好序 not in order 这一刀什么也没砍掉 this cut rules nothing out 按号码排好序 in order by number 左边整半边都比它小 everything left of it is smaller
A card's height is the number on it. Out of order, smaller numbers sit both sides of the middle card. Nothing is ruled out; every card but the turned one stays violet. In order, everything left of the middle is shorter, so a bigger target empties that half. Both rows hold the same 17 cards. The order must be by the number you search on. Nothing sorts when you ask: a database keeps its index that way all along. 卡片的高度就是它上面的号码。上面一排没排好序,中间那张的两边都有更小的号码。什么也砍不掉,除了翻开的那张,别的全还是紫的。下面一排排好了序,中间那张左边的全都更矮。你要的号码更大,左边整半边就变空心。两排是同样的 17 张卡片。顺序必须按你要查的那个号码排。顺序不是你来查的时候排的,是数据库让索引一直保持着的。