atlas news
    
John D. Cook
15  octobre     13h44
Preprocessing text to make it more compressible
John    Repetitive text compresses efficiently. Text like the lyrics to Jingle Bells ought to compress more efficiently than ordinary prose, assuming the compression algorithm can exploit the repetition. The idea of the Burrows Wheeler transform is to permute text in before compressing it. The hope is that...
13  octobre     21h12
Why does FM sound better than AM?
John    The original form of radio broadcast was amplitude modulation AM . With AM radio, the changes in the amplitude of the carrier wave carries the signal you want to broadcast. Frequency modulation FM came later. With FM radio, changes to the frequency of the carrier wave carry the signal. I go into...
    19h39
Shifted reciprocal
John    It’s interesting to visualize functions of a complex variable, even very simple functions like f z z. The previous post looked at what happens to triangles under the reciprocal map w z. This post will look at the same map applied to a polar grid, then look at the effect a shift has,...
11  octobre     14h04
Triangles to Triangles
John    The set of functions of the form f z az b cz d with ad bc are called bilinear transformations or Möbius transformations. These functions have three degrees of freedom there are four parameters, but multiplying all parameters by a constant defines the same function and so you can...
10  octobre     11h18
Golden ellipse
John    A golden ellipse is an ellipse whose axes are in golden proportion. That is, the ratio of the major axis length to the minor axis length is the golden ratio Ï s . Draw a golden ellipse and its inscribed and circumscribed circles. In other words draw the largest circle that can fit The...
    00h11
Areal coordinates and ellipse area
John    Barycentric coordinates are sometimes called area coordinates or areal coordinates in the context of triangle geometry. This is because the barycentric coordinates of a point P inside a triangle ABC correspond to areas of the three triangles PBC, PCA and PAB. This assumes ABC has unit area....
09  octobre     13h04
Average number of divisors
John    Let d n be the number of divisors of an integer n. For example, d because is divisible by,,,,, and . The function d varies erratically as the following plot shows. But if you take the running average of d f n d d d The post Average number of divisors...
08  octobre     12h09
Lucas numbers and Lucas pseudoprimes
John    Lucas numbers are sometimes called the companions to the Fibonacci numbers. This sequence of numbers satisfies the same recurrence relation as the Fibonacci numbers, Ln Ln Ln but with different initial conditions: L and L . Lucas numbers are analogous to Fibonacci numbers in...
30  septembre     12h23
Identifying hash algorithms
John    Given a hash value, can you determine what algorithm produced it Or what algorithm probably produced it Obviously if a hash value is bits long, then a bit algorithm produced it. Such a hash value might have been produced by MD , but not by SHA, because the former produces bit hashes...
28  septembre     21h08
Testing random number generators
John    Random number generators are subtle. Unless the generator is some physical device, random number generators RNGs are usually technically pseudorandom number generators PRNGs , deterministic algorithms designed to mimic randomness. Suppose you have a PRNG that produces the digits through . How...
    16h09
Limitations on Venn diagrams
John    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 limit...
27  septembre     15h56
Edit distance
John    I was just talking to a colleague about edit distance because it came up in a project we’re working on. Technically, we were discussing Levenshtein distance. It sounds more impressive to say Levenshtein distance, but it’s basically how much editing effort it would take to turn one block of text...
    13h15
Birthday problem approximation
John    The birthday problem is a party trick with serious practical applications. It’s well known to people who have studied probability, but the general public is often amazed by it. If you have a group of people, there’s a chance that at least two people have the same birthday. With a larger...
26  septembre     15h10
1’ z) (1 z)
John    I keep running into the function f z ’ z z . I wrote this three years ago and it’s still true. This function came up implicitly in the previous post. Ramanujan’s excellent approximation for the perimeter of an ellipse with semi axes a and b begins by introducing Î a’ b a The...
22  septembre     18h33
Error in Ramanujan’s approximation for ellipse perimeter
John    Ramanujan discovered an incredibly accurate approximation for the perimeter of an ellipse. This post will illustrate how accurate the approximation is and push its limits. As with all computations involving ellipses, the error of Ramanujan’s approximation increases as eccentricity increases. But...
19  septembre     12h00
The Cauchy distribution’s counter-intuitive behavior
John    Someone with no exposure to probability or statistics likely has an intuitive sense that averaging random variables reduces variance, though they wouldn’t state it in those terms. They might, for example, agree that the average of several test grades gives a better assessment of a student than a...
17  septembre     13h27
Arithmetic, Geometry, Harmony, and Gold
John    I recently ran across a theorem connecting the arithmetic mean, geometric mean, harmonic mean, and the golden ratio. Each of these comes fairly often, and there are elegant connections between them, but I don’t recall seeing all four together in one theorem before. Here’s the theorem : The...
14  septembre     18h30
Ceva, cevians, and Routh’s theorem
John    I keep running into Edward John Routh . He is best known for the Routh Hurwitz stability criterion but he pops up occasionally elsewhere. The previous post discussed Routh’s mnemonic for moments of inertia and his stretch theorem. This post will discuss his triangle theorem. Before...
    16h08
Moments of inertia mnemonic
John    Edward John Routh came up with a mnemonic for summarizing many formulas for moment of inertia of a solid rotating about an axis through its center of mass. Routh’s mnemonic is I MS k where M is the mass of an object, S is the sum of the squares of the semi axes, The post Moments...
13  septembre     14h29
Binomial bound
John    I recently came across an upper bound I hadn’t seen before . Given a binomial coefficient C r, k , let n min k, r’ k and m r’ n. Then for any Î , C n m, n Î n m Î n. The proof follows quickly from applying The post Binomial bound first appeared on John D. Cook.
10  septembre     14h41
Separable functions in different contexts
John    I was skimming through the book Mathematical Reflections recently. He was discussing a set of generalizations of the Star of David theorem from combinatorics. The theorem is so named because if you draw a Star of David by connecting points in Pascal’s triangle then each side corresponds to...
08  septembre     01h12
Body roundness index
John    Body Roundness Index BRI is a proposed replacement for Body Mass Index BMI . Some studies have found that BRI is a better measure of obesity and a more effective predictor of some of the things BMI is supposed to predict . BMI is based on body mass and height, and so it cannot distinguish...
07  septembre     22h32
A couple more variations on an ancient theme
John    I’ve written a couple posts on the approximation by the Indian astronomer Aryabhata . The approximation is accurate for x in â ’Ï , Ï . The first post collected a Twitter thread about the approximation into a post. The second looked at how far the coefficients in Aryabhata’s...
    19h00
Finding pi in the alphabet
John    Write the letters of the alphabet around a circle, then strike out the letters that are symmetrical about a vertical line. The remaining letters are grouped in clumps of,,,, and letters. I’ve heard that this observation is due to Martin Gardner, but I don’t have a specific reference. In...
03  septembre     12h33
Optimal rational approximation
John    A few days ago I wrote about the approximation for cosine due to the Indian astronomer Aryabhata and gave this plot of the error. I said that Aryabhata’s approximation is not quite optimal since the ripples in the error function are not of equal height. This was an allusion to the...
02  septembre     01h32
Pell is to silver as Fibonacci is to gold
John    As mentioned in the previous post, the ratio of consecutive Fibonacci numbers converges to the golden ratio. Is there a sequence whose ratios converge to the silver ratio the way ratios of Fibonacci numbers converge to the golden ratio If you’re not familiar with the silver ratio, you can read...
01  septembre     11h41
Miles to kilometers
John    The number of kilometers in a mile is k . which is close to the golden ratio Ï . . The ratio of consecutive Fibonacci numbers converges to Ï , and so you can approximately convert miles to kilometers by multiplying by a Fibonacci number and dividing by the previous Fibonacci...
31  août     17h33
Ancient accurate approximation for sine
John    This post started out as a Twitter thread. The text below is the same as that of the thread after correcting an error in the first part of the thread. I also added a footnote on a theorem the thread alluded to. The following approximation for sin x is remarkably accurate for x The post...
    12h16
Mentally multiply by Ï
John    This post will give three ways to multiply by Ï taken from . Simplest approach Here’s a very simple observation about Ï : Ï . . . So if you need to multiply by Ï , you need to multiply by and by . Once you’ve multiplied by once, you can The post Mentally multiply by Ï...
    11h45
A better integral for the normal distribution
John    For a standard normal random variable Z, the probability that Z exceeds some cutoff z is given by If you wanted to compute this probability numerically, you could obviously evaluate its defining integral numerically. But as is often the case in numerical analysis, the most obvious approach is not...