All posts in Mathematics
When interested in buying bonds a term that often comes up is the definition of Yield To Maturity (YTM): Yield to maturity (YTM) is the total return anticipated on a bond if the bond is held until the end of its lifetime. Yield to maturity is considered a longterm bond . . . Read more
The Knuth shuffle algorithm is an algorithm for randomly shuffling the elements of an array arr of size given a function that generates a uniformly distributed random number in time. The algorithm produces an unbiased permutation. That is, every permutation is equally likely.

for i in range(n1,0,1): j = integer chosen uniformly randomly from [0,i] swap arr[i] with arr[j] 
Proof that the algorithm is unbiased . . . Read more
In this post I will explain a less intuitive approach of implementing a ceil() function in Java, that is faster than known comparison approaches. A few known facts Fact 1 Dividing two integers and in Java will always floor the result:

int a, b; int ans = a/b; // is the same as Math.floor(a/b) 
well almost. Actually Math.floor(a/b) rounds towards negative infinity, . . . Read more
This is a rather short post. in which I explain how to we can implement a fast pow function to raise a number to the power of . A rather naive approach would be to do the following:

int pow(int x, int n){ int result = 1; while (n > 0){ result *= x; n; } return result; } 
This is ok, but the algorithm has a running time of . . . Read more