I'VE GOT THE BYTE ON MY SIDE

57005 or alive

How many coffee sleeves make a circle?

Feb 29, 2012 coffee math

When you get a coffee or tea in a paper cup, often you will get one of those cardboard sleeves along with it that helps keep the grippable surface of the cup at a reasonable temperature.  When those sleeves are on the cup, their top and bottom appear flat, parallel to the top and bottom of the cup.  When you take the sleeve off and flatten it, however, you notice that the top and bottom actually have a slight curve to them, and that the flat sleeve is in the shape of a small arc.

This would indicate that placing a bunch of flattened sleeves end-to-end with their edges flush would eventually result in a big circle (assuming the sleeve-arc has uniform width).  How many sleeves would that take, and how big would the circle be?

Calculating e with Powershell

Feb 21, 2012 math powershell

Well, I missed posting this for \(e\) day (Feb 7), but better late than never, right?

Everyone’s favorite mathematical constant, \(e = 2.71828\ldots\) , can be expressed in a wide variety of ways.  One of the easier-to-implement and faster-converging representations is the basic reciprocal factorial series representation:

$$e = \sum_{k=0}^{\infty}\frac{1}{k!} = \frac{1}{0!} +\frac{1}{1!} + \frac{1}{2!} + \ldots$$

How can we calculate this in Powershell?  Let’s start with a straightforward implementation, utilizing a Factorial function.