Math

Testing for primality

How to test a huge number for primality? Provides an implementation of the famous Miller-Rabin algorithm using the widely available ‘bc’ (basic calculator) tool. Suitable both for Linux and Windows.

Value of Pi

Value of Pi

Wikipedia defines Pi or p as “a mathematical constant which represents the ratio of any circle’s circumference to its diameter in Euclidean geometry”. As a kid I used to be interested in the calculation of Pi. The value of Pi, to 100 places of decimal is: 3.1415 9265 3589 7932 3846 2643 3832 7950 2884 [...]

Continuous Compounding

I feel there is something mathematically wrong with the way compound interest is defined today. We say “5% per annum, semi-annually compounded”. If I have money invested, mathematically speaking, it should get compounded all the time, not just in fixed intervals. I would like to define the term “absolute percentage” – the annual interest rate [...]