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

推荐订阅源

V
V2EX
Y
Y Combinator Blog
博客园_首页
V
Visual Studio Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
阮一峰的网络日志
阮一峰的网络日志
Hugging Face - Blog
Hugging Face - Blog
宝玉的分享
宝玉的分享
B
Blog
博客园 - 三生石上(FineUI控件)
小众软件
小众软件
WordPress大学
WordPress大学
L
LangChain Blog
爱范儿
爱范儿
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
P
Proofpoint News Feed
Blog — PlanetScale
Blog — PlanetScale
C
Check Point Blog
博客园 - 聂微东
云风的 BLOG
云风的 BLOG
Microsoft Security Blog
Microsoft Security Blog
博客园 - 叶小钗
酷 壳 – CoolShell
酷 壳 – CoolShell
H
Help Net Security

Hacker News

GitHub - SeanFDZ/macmind: Single-layer transformer in HyperTalk for the classic Macintosh Show HN: Agent-cache – Multi-tier LLM/tool/session caching for Valkey and Redis Bonsai 1-bit WebGPU - a Hugging Face Space by webml-community Moving a large-scale metrics pipeline from StatsD to OpenTelemetry / Prometheus GitHub - Nightmare-Eclipse/RedSun: The Red Sun vulnerability repository GitHub - SethPyle376/hiraeth: Local AWS emulator focused on fast integration testing, with SQS support, SQLite-backed state, and a debug-friendly web UI. GitHub - macOS26/Agent: Any AI, replaces Claude Code, Cursor, OpenClaw. Over 18 LLM providers (Claude, OpenAI, Gemini, Ollama, Zai, HF, Qwen) wired into a native Mac app that writes code, builds Xcode projects, bumps versions, manages git, automates Safari, use AppleScript, JS or Accessibility, extend Agent! w/ MCP Servers, run tasks from your iPhone via Messages. YouTube now lets you turn off Shorts I Made a Terminal Pager Burgers | マクドナルド公式 Commands — HackerNews CLI documentation ChatGPT for Excel PiCore - Raspberry Pi Port of Tiny Core Linux Live Nation illegally monopolized ticketing market, jury finds Google Broke Its Promise to Me. Now ICE Has My Data. Founding Engineer at Adaptional | Y Combinator CRISPR takes important step toward silencing Down syndrome’s extra chromosome GitHub - saffron-health/libretto: The AI toolkit for building reliable browser automations US v. Heppner (S.D.N.Y. 2026) no attorney-client privilege for AI chats [pdf] Retrofitting JIT Compilers into C Interpreters IPv6 – Google The Accursèd Alphabetical Clock Cybersecurity Looks Like Proof of Work Now Fragments: April 14 Cal.com Goes Closed Source: Why AI Security Is Forcing Our Decision | Cal.com - Scheduling Software for Online Bookings Laravel raised money and now injects ads directly into your agent When moving fast, talking is the first thing to break Too much Discussion of the XOR swap trick – Heather Cafe Introduction to Spherical Harmonics for Graphics Programmers The Grand Line
From Buffon's Needle to Buffon's Noodle
2026-05-07 · via Hacker News

Drop a needle of length $L$ onto a hardwood floor with floorboards of width $W$. On average, the needle crosses $2L / \pi W$ lines between floorboards, a classic result of Buffon. But that $\pi$ in the formula means there’s a circle hiding somewhere. The trick to finding it? Bend the needle into a noodle.

The usual approach to Buffon’s problem involves a double integral. Respectable, but this hides the circle at the heart of the solution, and frankly, I don’t love doing integrals. Instead, we’ll derive the result1 by going from a straight needle, to a curvy noodle, to a circle. All we need is some basic geometric reasoning and probability.

Let’s fix some notation. Add ruled lines on $\mathbb{R}^2$ spaced $W > 0$ apart, and choose a line segment of length $L>0$ at random2. Let $X_1$ be the number of ruled lines that this random line segment crosses. We want to compute $\mathbb{E}[X_1] =: f(L)$ as a function of $L$.

Now suppose we drop two needles with lengths $L_1$ and $L_2$, and let $X_1$ and $X_2$ be the number of lines that each needle crosses. By linearity of expectation,

$$ \mathbb{E}[X_1 + X_2] = \mathbb{E}[X_1] + \mathbb{E}[X_2] = f(L_1) + f(L_2). $$

Linearity of expectation requires no independence assumption. In particular, we could weld the two segments together, and the equation would continue to be true. Joining the two segments end-to-end gives $f(L_1 + L_2) = f(L_1) + f(L_2)$, which holds for all lengths $L_1$, $L_2$. Since $f$ is non-negative and increasing with $f(0) = 0$, we deduce that $f(L) = c L$ for some constant $c \ge 0$ that we need to determine3.

We can then “bend” the needle into an arbitrary polygonal line with $N$ segments, each of length $L/N$. With $X_i$ the number of crossings on the $i$th segment, we find

$$ \mathbb{E}[X_1 + \dotsb + X_N] = N f(L/N) = c L, $$

that is, the average number of lines that a polygonal line strikes depends linearly on its length. Taking a limit gives us Buffon’s noodle: throw an arbitrary4 curve onto the plane, and the average number of lines it intersects is proportional only to its length.

The special circle

Only the value of the constant $c$ remains. Consider a circle of radius $W/2$. With probability one, this circle crosses a single ruled line twice; the alternative, being tangent to two lines, occurs with probability zero. (Try it out in the widget above!) This means that

$$ \mathbb{E}[\text{\# intersections with $W/2$-circle}] = 2. $$

This means that $cL = 2$ for this special circle; since $L = \pi W$, we conclude that

$$ c = \frac{2}{\pi W} $$

which completes the proof.

Get new posts by email. No spam, just posts.


  1. See Klain, Daniel A., and Gian-Carlo Rota. Introduction to geometric probability. Cambridge University Press, 1997. ↩︎

  2. To avoid ambiguity and paradoxes, we need to define what “random” means. Here, we’ll assume that the line segment is drawn from the Haar measure, which basically means that our answers must be independent of the orientation of the floorboards. The precise definition of the Haar measure is that it is the unique rotation- and translation-invariant measure on the space of line segments. In practice, one draws a center uniformly over a bounded space (say, $[0,\,1]\times[0,\,1]$) and an angle $\theta$ uniformly over $[0,\,2\pi)$. ↩︎

  3. We elide some of the reasoning here for clarity. In particular, to make this argument rigorous, we must show that $f$ is continuous. ↩︎

  4. The curve must, of course, be finite length and approximated as the limit of polygonal curves. Such curves are called rectifiable↩︎