Love itself became the object of her love.count sadnessesmore quotes

DNA on 10th — street art, wayfinding and font

visualization + design

The 2019 Pi Day art celebrates digits of $\pi$ with hundreds of languages and alphabets. If you're a kid at heart—rejoice—there's a special edition for you!

$\pi$ Approximation Day Art Posters

2019 $\pi$ has hundreds of digits, hundreds of languages and a special kids' edition.
2018 $\pi$ day
2017 $\pi$ day
2016 $\pi$ approximation day
2016 $\pi$ day
2015 $\pi$ day
2014 $\pi$ approx day
2014 $\pi$ day
2013 $\pi$ day
Circular $\pi$ art

The never-repeating digits of $\pi$ can be approximated by $22/7 = 3.142857$ to within 0.04%. These pages artistically and mathematically explore rational approximations to $\pi$. This 22/7 ratio is celebrated each year on July 22nd. If you like hand waving or back-of-envelope mathematics, this day is for you: $\pi$ approximation day!

Want more math + art? Discover the Accidental Similarity Number. Find humor in my poster of the first 2,000 4s of $\pi$.

There are two kinds of $\pi$ Approximation Day posters.

The first uses the Archimedean spiral for its design, which I've used before for other numerical art. The second packs warped circles, whose ratio of circumference to average diameter is $22/7$ into what I call $\pi$-approximate circular packing.

As you probably know, the ratio of the circumference of a circle to its diameter is $\pi$. $$C / d = \pi$$

For $\pi$ approximation day, let's ask what would happen if $$C / d = 22/7$$

where now $C$ is the circumference of some shape other than a circle. What could this shape be?

A good place to start is to think about an ellipse. I've done this before in the 22/7 Universe article, in which I considered an ellipse with a major axis of $r+\delta$ and a minor axis of $r$ and solved for $\delta$ such that the circumference of the ellipse divided by $2 r$ would be $22/7$. Doing so means numerically solving the equation $$\frac{C(r,r+\delta)}{2r} = 22/7$$

where $r + \delta$ is the major axis, $r$ is the minor axis and $C(r,r+\delta)$ is the circumference of the ellipse. Substituting the expression for the circumference, $$4(r+\delta) \int_0^{\pi/2} \sqrt { 1 - \left(1-\frac{r}{(r+\delta)^2}\right)\sin^2 \theta } d \theta = 2 r \frac{22}{7}$$

If we set $r=1$ and solve it turns out that only a very minor deformation is required and $\delta = 0.0008$. You can verify this at Wolfram Alpha.

I wanted to make some art based on the shape of the this ellipse, but a deformation of 0.08% is not perceptible. So I came up with a slightly different approach to how I define the original circumference-to-diameter ratio.

Instead of treating the diameter as $r$ and using $r + \delta$ as the major axis, I now define the diameter as twice the average radius, or $2r + \delta$. This means that the equation to solve is $$\frac{C(r,r+\delta)}{2r+\delta} = 22/7$$

As before, setting $r=1$ and substituting the expression for the circumference of an ellipse, we get $$4(1+\delta) \int_0^{\pi/2} \sqrt { 1 - \left(1-\frac{1}{(1+\delta)^2}\right)\sin^2 \theta } d \theta = (2+\delta) \frac{22}{7}$$

and solving this for $\delta$ find $$\delta = 0.083599769...$$

You can verify this at Wolfram Alpha.

This is a more useable approach since an 8% warping of a circle can be easily perceived.

The ratio of the circumference of a circle, $C(r)$, to its dimameter, $2r$, is $\pi$. If we warp the circle by 8%, the corresponding ratio, if we use twice the average radius as the diameter, is 22/7. This deformation can be easily identified.

Below is matrix of perfect circles along side the 8% deformed circles.

A matrix of perfect circles and ones which have been stretched by 8% along one axis and then randomly rotated. The deformed circles embody the $\pi$ approximation of 22/7.

The art posters are based on a packing of these deformed circles.

Warped circles, packed.
Even more warped circles, packed.

By superimposing perfect circles on the warped circles, fun patterns appear.

Superposition of perfect and warped circles, packed.

perfect vs approximate packing

If you pack perfect circles perfectly, the area occupied by the circles is $\pi/4 = 78.5%$.

What is the area occupied by perfect packing of warped and randomly rotated (like in the posters) circles?

color scheme

To motivate choice of colors, I chose images with a 1970's feel.

Images used for color schemes. The colors of each image were grouped into clusters—8 for the first two images and 6 for the third—to obtain proportions of representative colors.

Using my color summarizer, I analyzed each image for its representative colors. Using these colors and their proportions, I colored the perfect and warped circles.

Packed warped circles colored in proportion to color schemes derived from the images above.

For each poster of these color schemes, two poster versions are available. In one, the perfect cirlces are shown with warped circles as a clip mask. In the other, warped circles are shown, clipped by perfect circles.

VIEW ALL

Analyzing outliers: Robust methods to the rescue

Sat 30-03-2019
Robust regression generates more reliable estimates by detecting and downweighting outliers.

Outliers can degrade the fit of linear regression models when the estimation is performed using the ordinary least squares. The impact of outliers can be mitigated with methods that provide robust inference and greater reliability in the presence of anomalous values.

Nature Methods Points of Significance column: Analyzing outliers: Robust methods to the rescue. (read)

We discuss MM-estimation and show how it can be used to keep your fitting sane and reliable.

Greco, L., Luta, G., Krzywinski, M. & Altman, N. (2019) Points of significance: Analyzing outliers: Robust methods to the rescue. Nature Methods 16:275–276.

Altman, N. & Krzywinski, M. (2016) Points of significance: Analyzing outliers: Influential or nuisance. Nature Methods 13:281–282.

Two-level factorial experiments

Fri 22-03-2019
To find which experimental factors have an effect, simultaneously examine the difference between the high and low levels of each.

Two-level factorial experiments, in which all combinations of multiple factor levels are used, efficiently estimate factor effects and detect interactions—desirable statistical qualities that can provide deep insight into a system.

They offer two benefits over the widely used one-factor-at-a-time (OFAT) experiments: efficiency and ability to detect interactions.

Nature Methods Points of Significance column: Two-level factorial experiments. (read)

Since the number of factor combinations can quickly increase, one approach is to model only some of the factorial effects using empirically-validated assumptions of effect sparsity and effect hierarchy. Effect sparsity tells us that in factorial experiments most of the factorial terms are likely to be unimportant. Effect hierarchy tells us that low-order terms (e.g. main effects) tend to be larger than higher-order terms (e.g. two-factor or three-factor interactions).

Smucker, B., Krzywinski, M. & Altman, N. (2019) Points of significance: Two-level factorial experiments Nature Methods 16:211–212.

Krzywinski, M. & Altman, N. (2014) Points of significance: Designing comparative experiments.. Nature Methods 11:597–598.

Happy 2019 $\pi$ Day—Digits, internationally

Tue 12-03-2019

Celebrate $\pi$ Day (March 14th) and set out on an exploration explore accents unknown (to you)!

This year is purely typographical, with something for everyone. Hundreds of digits and hundreds of languages.

A special kids' edition merges math with color and fat fonts.

116 digits in 64 languages. (details)
223 digits in 102 languages. (details)

Check out art from previous years: 2013 $\pi$ Day and 2014 $\pi$ Day, 2015 $\pi$ Day, 2016 $\pi$ Day, 2017 $\pi$ Day and 2018 $\pi$ Day.

Tree of Emotional Life

Sun 17-02-2019

One moment you're $:)$ and the next you're $:-.$

Make sense of it all with my Tree of Emotional life—a hierarchical account of how we feel.

A section of the Tree of Emotional Life.

Find and snap to colors in an image

Sat 29-12-2018

One of my color tools, the $colorsnap$ application snaps colors in an image to a set of reference colors and reports their proportion.

Below is Times Square rendered using the colors of the MTA subway lines.

Colors used by the New York MTA subway lines.

Times Square in New York City.
Times Square in New York City rendered using colors of the MTA subway lines.
Granger rainbow snapped to subway lines colors from four cities. (zoom)