Geoff Mulberry

Ph.D. in Electrical Engineering

Mar 13, 2025 - 6 minute read

Pi Is Rational?

Approximations

It is almost Pi Day, the celebration of everyone’s favorite irrational number, as well as my birthday. To celebrate, I was messing around with some code that would generate closer and closer rational approximations of pi. I originally set the while loop to run forever just to watch more results come in until I felt like stopping it, but noticed something interesting. Once it got to the 180th approximation, the error dropped to 0.0. This means that according to python, there is absolutely no difference between $\frac{245850922}{78256779}$ and pi itself. Pi is rational after all! Of course, this isn’t true. What is actually happening is that the value of pi that I am comparing my approximation to: math.pi from python’s math library, is only an approximation itself. It is represented by an IEEE 754 double-precision binary floating-point number, AKA a double. Doubles are only capable of storing about 15 or so decimal digits, which my approximation achieves. When including math.pi in the standard library, they get as close as possible within the limits of an IEEE 754 double to the true value with the approximation 3.141592653589793.

Jul 28, 2023 - 19 minute read

Inside a Vacuum Tube

Introduction

A Sovtek EL84 power pentode tube A Sovtek EL84 power pentode tube I was working on my Vox AC30 clone that I built in high school, around 2009-2010, trying to figure out why I always had an oscillation issue when I turned the master volume up too far. Investigating the power amp side of the circuit revealed that I had incorrectly connected some of the grid-stopper resistors. I removed the tubes from the sockets so I could solder on the socket terminals without risking any damage to the tubes while they were in place, only to realize that the tubes were so stuck in their sockets that 2 of the 4 tubes cracked in their base. This caused a fatal problem for a vacuum tube: air ingress. So realizing that the tubes were ruined, I ordered a new matched quad, sockets, and got to work rewiring the power amp. While I was doing this, I thought that it would be interesting to take apart one of the tubes and document the process.