From johndcook.com
2 4
Buggy simulation code is biased code because you're more likely to discover bugs that contradict your expectations than bugs that confirm your expectations.
on Sat, 6PM
From johndcook.com
Using find utility on file names | binary output
2 3
Resolving a problem when the find utility produces binary output when you expect text
on Tue, 7PM
From johndcook.com
The mathematics of GPS | Global Positioning Problem
0 1
Overview of the mathematics of determining your position by observing several satellites.
on Sat, 10PM
From johndcook.com
0 1
All GPS satellites are in circular orbits at the same altitude. Why is that? How were their orbits chosen?
on Fri, 2PM
From johndcook.com
0 1
The theorem that Ramanujan used to prove some of his remarkable identities.
on Thu, 12PM
From johndcook.com
Linear combination of sine and cosine as phase shift
0 1
Here's a simple calculation that I've done often enough that I'd like to save the result for my future reference and for the benefit of anyone searching on this. A linear combination of sines and cosines a sin(x) + b cos(x) can be written as a sine with a phase shift A sin(x + φ).
on Tue, 9PM
From johndcook.com
Calling trigonometric functions across programming languages
0 1
Unfortunately programming languages are inconsistent in how the support trig functions and their inverses. We present a table summarizing the differences.
on Tue, 9PM
From johndcook.com
0 1
I recently stumbled upon the Postage Stamp Problem. Given two relatively prime positive numbers a and b, show that any sufficiently large number N, there exists positive integers x and y such that ax + by = N. I initially missed the constraint that x and y must be positive, in which result is well
on Nov 10
From johndcook.com
Impersonating an Edwardian math professor
0 0
What would it be like if a time machine deposited a contemporary mathematician in a math department from 100 years ago?
on Nov 10
From johndcook.com
Trigonometric interpolation using the FFT
0 0
Fitting a sum of sines and cosines to data points using the fast Fourier transform FFT.
on Nov 5
From johndcook.com
0 0
Relationship between moments of a function and the Laplace transform of a function.
on Nov 5
From johndcook.com
0 0
We construct the hardest jigsaw puzzle imaginable: as far as we know, it is unsolvable by any possible intelligence or computational power in the universe.
on Nov 4
From johndcook.com
When do moments determine a function?
0 0
When is a function determined by its moments? Given a set of moments, when is there a function that has these moments? Hausdorff, Stieltjes, and Hamburger problems.
on Nov 4
From johndcook.com
Floating point: Everything old is new again
0 0
Large neural networks have created interest in low-precision arithmetic, fitting more numbers in memory. But low-precision memory brings back old problems.
on Nov 1
From johndcook.com
How hard is constraint programming?
0 0
Writing code using the Z3 SMT solver is different from typical programming, due to mixed programming models--not unlike CUDA for GPUs. Here's what to expect.
on Oct 31
From johndcook.com
Band-limited expansion and approximation | sinc expansion
0 0
The band-limited expansion of a function, also known as sinc function expansion, has a lot of nice mathematical properties and is useful in numerical computing.
on Oct 28
From johndcook.com
Laplace transform inversion theorems
0 0
College classes can give a wrong impression of the Laplace transform, implying that it is either always east to invert or that it is useless. Both are false.
on Oct 26
From johndcook.com
Mellin transform and Riemann zeta
0 0
A relationship between the Mellin transform and the Riemann zeta function that is easy to prove.
on Oct 25
From johndcook.com
0 0
A diagram showing how various mathematical special functions relate to each other
on Oct 24
From johndcook.com
0 0
A quick and easy theorem about squares, triangular numbers, and base 8.
on Oct 20
From johndcook.com
Channel capacity of a telegraph
0 0
Claude Shannon's famous paper A Mathematical Theory of Communication [1] includes an example saying that the channel capacity of a telegraph is log2 W where W is the largest real root of the determinant equation Where in the world did that come from? I'll sketch where the equation above came...
on Oct 20
From johndcook.com
RNG, PRNG, CSPRNG | cryptographically secure pseudorandom
0 0
A pseudorandom number generator may have good statistical properties but be insecure. But a physical RNG with good statistical properties is probably secure.
on Oct 18
From johndcook.com
Relating six properties of a triangle in one equation
0 0
An equation relating the sides of a triangle to the inradius, circumradius, and perimeter.
on Oct 18
From johndcook.com
Why does FM sound better than AM?
0 0
Frequency modulation (FM) is more robust to noise than amplitude modulation (AM) because static itself is primarily a form of amplitude modulation.
on Oct 17
From johndcook.com
Burrows-Wheeler transform to make a string compressible
0 0
A reversible permutation of text that makes it more efficient to compress, a preprocessing step for compression algorithms.
on Oct 17
From johndcook.com
0 0
In a golden golden ellipse the ratio of the major and minor axes is the golden ratio. Characterization in terms of area of inscribed and circumscribed circles.
on Oct 10
From johndcook.com
Areal coordinates and ellipse area
0 0
Areal coordinates simplify some geometric problems, Example: area of an ellipse inscribed in a triangle.
on Oct 10
From johndcook.com
0 0
Divisor count varies erratically but running average divisor count is much smoother and converges to log(n).
on Oct 9
From johndcook.com
Expert consulting in applied mathematics & data privacy
0 0
Companies come to us for help data analysis and data privacy. Clients have included Amazon, Google, Microsoft, law firms, start-ups, and smaller businesses.
on Oct 9
From johndcook.com
Lucas numbers and Lucas pseudoprimes
0 0
Lucas numbers are analogous to Fibonacci numbers. Some ways in which they are and are not unique.
on Oct 9
From johndcook.com
0 0
Given a hash value, an you determine what algorithm produced it? Or what algorithm PROBABLY produced it? Sorta. Depends on what you mean by "probably."
on Sep 30
From johndcook.com
0 0
Why do Venn diagrams almost always show the intersections of three sets and not more? Can Venn diagrams be generalized to show all intersections of more sets? That depends on the rules you give yourself for generalization. If you require that your diagram consist of circles, then three is the...
on Sep 28
From johndcook.com
Levenshtein edit distance applications
0 0
Edit distance, more formally known as Levenshtein distance, is a practical way to measure how different two blocks of text are.
on Sep 27
From johndcook.com
Useful approximation for the birthday problem approximation
0 0
The generalized birthday problem comes up frequently in applications. Explaining the square root heuristic and a better approximation.
on Sep 27
From johndcook.com
A simple function that comes up surprisingly often
0 0
The function f(z) = (1 − z)/(1 + z) comes up frequently in applications. This post gives several examples.
on Sep 26
From johndcook.com
Where has all the productivity gone?
0 0
Why hasn't new technology made us more productive than it has?
on Sep 24
From johndcook.com
Elliptic curves secp256k1 and secp256r1
0 0
The NIST recommends two elliptic curves based on 256-bit primes, the "k" and the "r" versions. What's the difference?
on Sep 23
From johndcook.com
How futurist Alvin Toffler predicted Internet (non) Privacy
0 0
Science fiction authors set stories in the future, but they don't necessarily try to predict the future.
on Sep 23
From johndcook.com
Error in Ramanujan’s approximation for ellipse perimeter
0 0
The amazing accuracy of Ramanujan's approximation for the perimeter of a list. Bounded as a function of eccentricity.
on Sep 22
From johndcook.com
Cauchy distribution non-intuitive behavior
0 0
Averaging normal random variables reduces the scale (standard deviation). Not with Cauchy random variables, because the scale is NOT standard deviation.
on Sep 19
From johndcook.com
Arithmetic, Geometry, Harmony, and Gold
0 0
A theorem connecting the arithmetic mean, geometric mean, harmonic mean, and the golden ratio.
on Sep 17
From johndcook.com
Ceva, cevians, and Routh’s theorem
0 0
Routh's theorem generalizes Ceva's theorem. It find the area of a triangle formed inside another triangle by connecting vertices to opposite sides.
on Sep 14
From johndcook.com
Routh's Moment of Inertia mnemonic
0 0
Routh's mnemonic for remembering the moments of inertia for rectangular prisms, (circular) cylinders, elliptical cylinders, spheres and ellipsoids.
on Sep 14
From johndcook.com
0 0
Exploring an upper bound on binomial coefficients with a variable parameter epsilon.
on Sep 13
From johndcook.com
Separable functions in combinatorics and PDEs
0 0
A generalization of the Star of David theorem generalizes from binomial coefficients fo separable functions. Separation of variables and separable coordinates.
on Sep 10
From johndcook.com
Mentally compute scientific calculator functions
0 0
How to mentally approximate logs base 2, e, and 10; trig functions; square roots; 10^x and e^x; and the gamma function.
on Sep 9
From johndcook.com
Body Roundness Index BRI | ellipse model
0 0
Body Roundness Index (BRI) quantifies obesity more effectively than BMI, at least in some circumstances. The geometrical model behind BRI.
on Sep 8
From johndcook.com
A couple more variations on an ancient theme
0 0
An ancient approximation for cosine depends on pi. How does the accuracy of the approximation depend on the approximation of pi?
on Sep 7
From johndcook.com
0 0
An observation from Martin Gardner for finding the digits of pi in the English alphabet.
on Sep 7