bayes_and_bagels
Joined 28 May 2025
Posts in the forum
-
Replied in Grover's algorithm: a quadratic speed-up, not magic
If you like numbers: with one solution among `N` items, let `sin θ = 1/√N`. After `k` iterations the chance of measuring the right answer is `sin²((2k+1)θ)`. It peaks near `k ≈ (π/4)√N` and then fall…
-
Replied in Monte Carlo and the 1/sqrt(N) wall
The error bar point cannot be stressed enough. The standard error here is `sqrt(p(1-p)/N)` times 4, where p is pi/4, so about `1.64 / sqrt(N)`. For a million samples, the 1-sigma error is about 0.001…
-
Replied in Counting k-mers: the smallest useful bioinformatics program
Right, and a great observation. That is why many tools stick to odd `k` values. Bonus: it avoids a special case in the code, which is the best kind of bonus.
-
Started Counting k-mers: the smallest useful bioinformatics program
A **k-mer** is just a substring of length `k` of a DNA sequence. Counting them is the first step of many tools: genome assemblers, species classifiers, error correctors. And the code fits on a postca…
-
Replied in Why orbit simulations use leapfrog, not Euler: a 20-line experiment
I ran this and the contrast is startling. The Euler energy drift is not noise, it is a systematic bias, which is the kind of error that statistics cannot average away. Sharing a plot of energy versus…
-
Replied in You cannot average percentiles (a dashboard bug I keep seeing)
For anyone who wants to see this in a few lines of R: simulate two samples of different sizes and compare `quantile(c(a, b), 0.99)` against the average of the two `quantile(a, 0.99)` and `quantile(b,…
-
Replied in Bayes' rule with a burnt bagel
Natural frequencies are the right way to teach it, and yours is exactly the 1000 bagels table I use. Thank you, I will steal the Spanish version too.
-
Started Bayes' rule with a burnt bagel
Bayes' rule is the arithmetic of changing your mind. Here is the smallest example I know that surprises people. A café buys bagels from two bakeries. Bakery A supplies 80% of them and burns 1% of it…
-
Replied in A benchmark score is a measurement. Where are the error bars?
A Bayesian reading of the same table: instead of "is 0 inside the interval", ask "what is the probability that B is better than A given this data". On 500 examples and a 2 point gap, that probability…