Feynman vs. Computer

https://news.ycombinator.com/rss Hits: 10
Summary

What’s neat is we can still split up the computation like we did before, if we believe it will make the error smaller and the confidence interval narrower. Let’s use the following integral as an example. \[\int_0^\infty \frac{\sin{x}}{x} \mathrm{d}x\] This oscillates up and down quite a bit for small \(x\), and then decays but still provides significant contributions for larger \(x\). A naive evaluation would have a confidence interval of In[7]: Ic(10_000, 0, 100, x => Math.sin(x)/x) Out[5]: Object { p05: 1.461 p95: 1.884 } and while this is certainly correct2 The actual value of the integral is half \(\pi\) or approximatey 1.571., we can do better. We’ll estimate the region of 0–6 separately from 6–100, using half the samples for each3 Why put the break point at 6? The period of sin is a full turn, which is roughly 6 radians. This ensures we get roughly symmetric contributions from both integrals. That’s not necessary for the technique to work, but it makes the illustration a little cleaner.: In[8]: Ic(5_000, 0, 6, x => Math.sin(x)/x) Out[6]: Object { p05: 1.236 p95: 1.468 } This contains the bulk of the value of the integral, it seems. Let’s see what remains in the rest of it. In[9]: Ic(5_000, 6, 100, x => Math.sin(x)/x) Out[7]: Object { p05: 0.080 p95: 0.198 } We can work backwards to what the standard errors must have been to produce these confidence intervals.4 The midpoint is the point estimation for each region, and the standard error is 1/1.645 times the distance between the 5 % point and the midpoint. Region Value Standard error 0–6 1.4067 0.0372 6–100 0.1390 0.0359 The estimation of the total area would be the values summed, i.e. 1.5457. The estimation of the standard error of this we get through Pythagorean addition and it is approximately 0.05143. We convert it back to a confidence interval and compare with when we did not break it up into multiple components. Method 5 % 95 % Range Single operation (10,000 samples) 1.461 1.884 0.423 Two operations (5,000...

First seen: 2025-12-04 17:13

Last seen: 2025-12-05 02:14