Computing pi in binary

This board is to show, discuss and archive useful combinator- and logic-creations.
Smart triggering, counters and sensors, useful circuitry, switching as an art :), computers.
Please provide if possible always a blueprint of your creation.
Post Reply
swni
Long Handed Inserter
Long Handed Inserter
Posts: 91
Joined: Sat Mar 05, 2016 1:54 am
Contact:

Computing pi in binary

Post by swni »

I put this on reddit and forgot to crosspost here in case anyone was interested. I computed the first 455 binary digits of pi in 3 hours and 43 minutes.

Explanation video (I suggest 1.5x speed if you find my typing too slow): https://www.youtube.com/watch?v=67XC8s5fG_g
Reddit thread: https://old.reddit.com/r/factorio/comme ... _factorio/

I don't show what all the combinators do in the video because it was too long already :) If you want the save file or have questions, I am typically more responsive on reddit than here.

Koub
Global Moderator
Global Moderator
Posts: 7200
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: Computing pi in binary

Post by Koub »

You may want to give a look at this :
viewtopic.php?f=193&t=76357
Koub - Please consider English is not my native language.

swni
Long Handed Inserter
Long Handed Inserter
Posts: 91
Joined: Sat Mar 05, 2016 1:54 am
Contact:

Re: Computing pi in binary

Post by swni »

Thanks for the link. It's quite slick, and is a clever combinator creation, but my own goal was to make a computer that computes pi: the relevant distinction here being that a computer (in the sense of computer science) has a fixed size, rather than growing to accommodate the thing being computed.

Of course in Factorio this is not a completely clear distinction, because signals are limited to 32-bit and there is no access to infinitely large memory: my pi computer fails at around 2^16 binary digits because of the 32-bit limitation on signals, but if signals were allowed to be any integer then it could be made to go forever. Technically with the 32-bit limit any computer in Factorio is a finite state machine, and by the pumping lemma can only compute rational numbers, and therefore cannot compute pi exactly.

https://en.wikipedia.org/wiki/Pumping_l ... _languages

swni
Long Handed Inserter
Long Handed Inserter
Posts: 91
Joined: Sat Mar 05, 2016 1:54 am
Contact:

Re: Computing pi in binary

Post by swni »

On second thought, if you relaxed the 32-bit restriction on signals, there are a wide variety of formulas for pi that could be calculated "in place", and it would be a little underwhelming to have a 20 combinator computer spitting out hundreds of digits of pi. The only consolation for the BBP formula is that it only needs O(log(n)) space to compute n digits, whereas the other formulas I am aware of need O(n) space to compute n digits.

Post Reply

Return to “Combinator Creations”