Martin Krzywinski / Genome Sciences Center / mkweb.bcgsc.ca Martin Krzywinski / Genome Sciences Center / mkweb.bcgsc.ca - contact me Martin Krzywinski / Genome Sciences Center / mkweb.bcgsc.ca on Twitter Martin Krzywinski / Genome Sciences Center / mkweb.bcgsc.ca - Lumondo Photography Martin Krzywinski / Genome Sciences Center / mkweb.bcgsc.ca - Pi Art Martin Krzywinski / Genome Sciences Center / mkweb.bcgsc.ca - Hilbertonians - Creatures on the Hilbert Curve
This love loves love. It's a strange love, strange love.Liz Fraserfind a way to love

circles: beautiful


Workshop at Brain and Mind Symposium, LĂ„ngvik Congress Center, Kirkkonummi, Sep 17–18 2015.


visualization + design

Typography geek? If you like the geometry and mathematics of these posters, you may enjoy something more lettered. Visions of type: Type Peep Show: The Private Curves of Letters posters.

The art of Pi (`pi`), Phi (`phi`) and `e`

Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca
Support Ellie Balk's Kickstarter community math mural project in which Brooklyn students learn math and art to visualize `pi`.

Pi Art Posters
 / Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca
2013 `pi` day

Pi Art Posters
 / Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca
2014 `pi` day

Pi Art Posters
 / Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca
2015 `pi` day

Pi Art Posters
 / Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca
2014 `pi` approx day

Pi Art Posters
 / Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca
Circular `pi` art

Numbers are a lot of fun. They can start conversations—the interesting number paradox is a party favourite: every number must be interesting because the first number that wasn't would be very interesting! Of course, in the wrong company they can just as easily end conversations.

The art here is my attempt at transforming famous numbers in mathematics into pretty visual forms, start some of these conversations and awaken emotions for mathematics—other than dislike and confusion

Numerology is bogus, but art based on numbers can be beautiful. Proclus got it right when he said (as quoted by M. Kline in Mathematical Thought from Ancient to Modern Times)

Wherever there is number, there is beauty.


Pi Art Posters
 / Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca
2,258 digits of `phi`, 3,855 digits of `e` and 3,628 digits of `pi` in 6 level treemaps. Uniform line thickness. Bauhaus prime colors in Piet Mondrian style. (2015 `pi` day posters)

the numbers π, φ and e

The consequence of the interesting number paradox is that all numbers are interesting. But some are more interesting than others—how Orwellian!

All animals are equal, but some animals are more equal than others.
—George Orwell (Animal Farm)

Numbers such as `pi` (or `tau` if you're a revolutionary), `phi`, `e`, `i = \sqrt{-1}`, and `0` have captivated imagination. Chances are at least one of them appears in the next physics equation you come across.

π 
φ
e 
= 3.14159 26535 89793 23846 26433 83279 50288 41971 69399 ...
= 1.61803 39887 49894 84820 45868 34365 63811 77203 09179 ...
= 2.71828 18284 59045 23536 02874 71352 66249 77572 47093 ...

Of these three transcendental numbers, `\pi` (3.14159265...) is the most well known. It is the ratio of a circle's circumference to its diameter (`d = \pi r`) and appears in the formula for the area of the circle (`a = \pi r^2`).

The Golden Ratio (`\phi`, 1.61803398...) is the attractive proportion of values `a > b` that satisfy `{a+b}/2 = a/b`, which solves to `a/b = {1 + \sqrt{5}}/2`.

Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca
The numbers `\pi`, `\phi` and `e` nearly form a right-angled triangle.

The last of the three numbers, `e` (2.71828182...) is Euler's number and also known as the base of the natural logarithm. It, too, can be defined geometrically—it is the unique real number, `e`, for which the function `f(x) = e^x` has a tangent of slope 1 at `x=0`. Like `\pi`, `e` appears throughout mathematics. For example, `e` is central in the expression for the normal distribution as well as the definition of entropy. And if you've ever heard of someone talking about log plots ... well, there's `e` again!

Two of these numbers can be seen together in mathematics' most beautiful equation, the Euler identity: `e^{i pi} = -1`. The tau-oists would argue that this is even prettier: `e^{i tau} = 1`.

did you see something special?

These three numbers have the curious property that they are almost Pythagorean. In other words, if they are made into sides of a triangle, the triangle is nearly a right-angled triangle (89.1°).

Did you notice how the 13th digit of all three numbers is the same (9)? This accidental similarity generates its own number—the Accidental Similarity Number (ASN).

Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca
Like music with numbers? Try Angels at My Door (Una), Pt vs Ys (Yoshinori Sunahara), 2wicky (Hooverphonic), One (Aimee Mann), Straight to Number One (Touch and Go), 99 luftbaloons (Nena).

is π normal?

It is not yet known whether the digits of π are normal—determining this is an important problem in mathematics. In other words, is the distribution of digit frequencies in π uniform? Do each of the digits 0–9 appear exactly 1/10th of the time, does every two-digit string appear exactly 1/100th of the time and so on for every finite-length string1?

1 One interesting finite-length string is the 6-digit Fenyman Point (...999999...) which appears at digit 762 in π. The Feynman Point was the subject of 2014 `pi` Day art.

This question can be posed for different representations of π—in different bases. The distribution frequencies of 1/10, 1/100, and so on above refer to the representation of π in base 10. This is the way we're used to seeing numbers. However, if π is encoded as binary (base 2), would all the digits in 11.00100100001111... be normal? The table below shows the first several digits of π in each base from 2 to 16, as well as the natural logarithm base, `e`.

base, `b``pi_b`base, `b``pi_b`
211.00100100001111 103.14159265358979
310.01021101222201 113.16150702865A48
43.02100333122220 123.184809493B9186
53.03232214303343 133.1AC1049052A2C7
63.05033005141512 143.1DA75CDA813752
73.06636514320361 153.21CD1DC46C2B7A
83.11037552421026 163.243F6A8885A300
`e`10.10100202000211
source: virtuescience.com

Because the digits in the numbers are essentially random (this is a conjecture), the essence of the art is based on randomness.

A vexing consequence of π being normal is that, because it is non-terminating, π would contain all patterns. Any word you might think of, encoded into numbers in any way, would appear infinitely many times. The entire works of Shakespeare, too. As well, all his plays in which each sentence is reversed, or has one spelling mistake, or two! In fact, you would eventually find π within π, but only if you have infinite patience.

This is why any attempts to use the digits of `pi` to infer meaning about anything is ridiculous. The exact opposite of what you find is also in `pi`.

Stoneham's constant

A number can be normal in one base, but another. For example, Stoneham's constant,

`\alpha_{2,3} = 1/2 + 1/(2^{3^1} 3^1) + 1/(2^{3^2} 3^2) + 1/(2^{3^3} 3^3) + ... + 1/(2^{3^k} 3^k) + ... `

is 0.54188368083150298507... in base 10 and 0.100010101011100011100011100... in base 2.

Stoneham's constant is provably normal in base 2. In some other bases, such 6, Stoneham's constant is provably not normal.

Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca
All art posters are available for purchase.
I take custom requests.

patterns in the art

Some of the numerical art reveals interesting and unexpected observations. For example, the sequence 999999 in π at digit 762 called the Feynman Point. Or that if you calculate π to 13,099,586 digits you will find love.

news + thoughts

Bayesian statistics

Thu 30-04-2015

Building on last month's column about Bayes' Theorem, we introduce Bayesian inference and contrast it to frequentist inference.

Given a hypothesis and a model, the frequentist calculates the probability of different data generated by the model, P(data|model). When this probability to obtain the observed data from the model is small (e.g. `alpha` = 0.05), the frequentist rejects the hypothesis.

Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca
Nature Methods Points of Significance column: Bayesian Statistics. (read)

In contrast, the Bayesian makes direct probability statements about the model by calculating P(model|data). In other words, given the observed data, the probability that the model is correct. With this approach it is possible to relate the probability of different models to identify one that is most compatible with the data.

The Bayesian approach is actually more intuitive. From the frequentist point of view, the probability used to assess the veracity of a hypothesis, P(data|model), commonly referred to as the P value, does not help us determine the probability that the model is correct. In fact, the P value is commonly misinterpreted as the probability that the hypothesis is right. This is the so-called "prosecutor's fallacy", which confuses the two conditional probabilities P(data|model) for P(model|data). It is the latter quantity that is more directly useful and calculated by the Bayesian.

Puga, J.L, Krzywinski, M. & Altman, N. (2015) Points of Significance: Bayes' Theorem Nature Methods 12:277-278.

Background reading

Puga, J.L, Krzywinski, M. & Altman, N. (2015) Points of Significance: Bayes' Theorem Nature Methods 12:277-278.

...more about the Points of Significance column

Bayes' Theorem

Wed 22-04-2015

In our first column on Bayesian statistics, we introduce conditional probabilities and Bayes' theorem

P(B|A) = P(A|B) × P(B) / P(A)

This relationship between conditional probabilities P(B|A) and P(A|B) is central in Bayesian statistics. We illustrate how Bayes' theorem can be used to quickly calculate useful probabilities that are more difficult to conceptualize within a frequentist framework.

Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca
Nature Methods Points of Significance column: Bayes' Theorem. (read)

Using Bayes' theorem, we can incorporate our beliefs and prior experience about a system and update it when data are collected.

Puga, J.L, Krzywinski, M. & Altman, N. (2015) Points of Significance: Bayes' Theorem Nature Methods 12:277-278.

Background reading

Oldford, R.W. & Cherry, W.H. Picturing probability: the poverty of Venn diagrams, the richness of eikosograms. (University of Waterloo, 2006)

...more about the Points of Significance column

Happy 2015 Pi Day—can you see `pi` through the treemap?

Sat 14-03-2015

Celebrate `pi` Day (March 14th) with splitting its digit endlessly. This year I use a treemap approach to encode the digits in the style of Piet Mondrian.

Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca
Digits of `pi`, `phi` and `e`. (details)

The art has been featured in Ana Swanson's Wonkblog article at the Washington Post—10 Stunning Images Show The Beauty Hidden in `pi`.

I also have art from 2013 `pi` Day and 2014 `pi` Day.

Split Plot Design

Tue 03-03-2015

The split plot design originated in agriculture, where applying some factors on a small scale is more difficult than others. For example, it's harder to cost-effectively irrigate a small piece of land than a large one. These differences are also present in biological experiments. For example, temperature and housing conditions are easier to vary for groups of animals than for individuals.

Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca
Nature Methods Points of Significance column: Split plot design. (read)

The split plot design is an expansion on the concept of blocking—all split plot designs include at least one randomized complete block design. The split plot design is also useful for cases where one wants to increase the sensitivity in one factor (sub-plot) more than another (whole plot).

Altman, N. & Krzywinski, M. (2015) Points of Significance: Split Plot Design Nature Methods 12:165-166.

Background reading

1. Krzywinski, M. & Altman, N. (2014) Points of Significance: Designing Comparative Experiments Nature Methods 11:597-598.

2. Krzywinski, M. & Altman, N. (2014) Points of Significance: Analysis of variance (ANOVA) and blocking Nature Methods 11:699-700.

3. Blainey, P., Krzywinski, M. & Altman, N. (2014) Points of Significance: Replication Nature Methods 11:879-880.

...more about the Points of Significance column

Color palettes for color blindness

Tue 03-03-2015

In an audience of 8 men and 8 women, chances are 50% that at least one has some degree of color blindness1. When encoding information or designing content, use colors that is color-blind safe.

Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca
A 12-color palette safe for color blindness

Points of Significance Column Now Open Access

Tue 10-02-2015

Nature Methods has announced the launch of a new statistics collection for biologists.

Martin Krzywinski @MKrzywinski mkweb.bcgsc.ca
Nature Methods Points of Significance column is now open access. (column archive)

As part of that collection, announced that the entire Points of Significance collection is now open access.

This is great news for educators—the column can now be freely distributed in classrooms.

...more about the Points of Significance column