# The Printing Of Pi

It really isn’t necessary, but there is some geek cred to learning pi to some bizarre number of digits. One way to do that is via a piem — a mnemonic device that is easy to remember and gives you the digits. Don’t know any? [Roni Bandini] has you covered with the PiemPi machine. It prints a random piem on a thermal printer and calculates each digit on the fly. You can watch the machine in action in the video below.

Unfortunately, the Raspberry Pi Zero inside doesn’t have enough language skills to ensure the thing makes sense, so you get word salad that may or may not have any real meaning. For example, [Roni] quotes astronomer [Sir James Jeans’] phrase: “How I want a drink, alcoholic, of course, after the heavy lectures involving quantum mechanics.” Before the advent of calculators, we always used: “May I have a large container of coffee today?” In each case, you count the number of letters in each word to get the digits. However, some of the piems you can see from the machine start off with phrases like: “# leon a yahoo execution im actual total pit eagle detector christmas…”

Since the machine can generate many digits, there is a problem that starts at digit 33. There are several zeros in the number. In this case, the printer prints a blank line. We might not have used symbols in the output, but since the phrases don’t really make sense anyway, it probably doesn’t matter much. Of course, there’s also little point in computing the digits for each print. You could compute them once, store them, and never have to do it again. Pi doesn’t change value. However, as a fun project, it doesn’t matter, and it does illustrate how a computer can find pi. In this case, the system uses the Chudnovsky algorithm.

If you don’t want to wait for the little Raspberry Pi, the 10, trillionth digit of pi is, by all accounts, 5. The problem with printing this is you need a lot of paper if you want to get up into the trillions. But you could use a Mobius printer (although full disclosure: that device grabs digits from the pi-as-a-service server; try `curl "https://api.pi.delivery/v1/pi?start=0&numberOfDigits=100"`).

## 15 thoughts on “The Printing Of Pi”

1. The Commenter Formerly Known As Ren says:

How I wish I could calculate pi

1. Cuagn says:

Que j’aime à faire apprendre un nombre utile aux sages

1. come2 says:

Immortel Archimède, artiste ingénieur, Qui de ton jugement peut priser la valeur ?
Pour moi, ton problème eut de pareils avantages.

“It really isn’t necessary”

Actually it very much is necessary. Competition and the promise of bragging rights are important motivational tools for inventors and engineers. Every scientific and engineering discipline regularly engages in competitions, and it is through these competitions that many important breakthroughs are made.

In this particular case, calculating the digits of pi is a simple way to track the increases of computing power over each new generation of hardware. Like the developers that love to test new hardware against the question, “Can it run Doom?”, it may seem like a pointless exercise because it’s not a frequent or necessary use case for the real world. But if you view it as just another benchmark, then it makes perfect sense.

3. Sooner Boomer says:

“Wow, I need a drink, alcoholic of course”.

4. Garth Bock says:

As it calculates Pi it should play the audio of the entity in the Enterprise computer screaming No No Noooo….

(Wolf In The Fold)

1. Al Williams says:

5. Piotrsko says:

Need to ask a stupid question: how do we know that a circle is actually a pi function. A hundred places exceeds our ability to create such a circle accurately, much less measure the result

1. robertrapplean says:

It isn’t a measuring thing, it’s a mathematical derivation of all points a fixed distance from a center point.

2. Hirudinea says:

Well we may not know now but we will get around to it.

3. Rezer says:

Because pi isn’t measured using a ruler, at least not in the past several thousand years. It’s derived using (multiple) rigorous mathematical methods, which individually need not involve a circle directly, but all of which use a common definition of pi. Since that definition is π = C / d, it’s impossible for the circumference of a circle to not be a “pi function” unless every single method for calculating pi is incorrect. Even assuming they were (they’re not), that wouldn’t change the fact that a circle is π * d in circumference, it still would be; we’d just have miscalculated it and it would need to be corrected. A definition needs no proof, it just is.

6. robertrapplean says:

Sir, I bear a rhyme excellingIn mystic words and magic spelling, Celestial cherubs elucidate, For my own striving can’t relate.

1. Al Williams says:

We require a mnemonic to remember e whenever we scribble math. (that’s not pi, but…)

1. Andrew Klein says: