Finding a Complex Number to The Power of a Complex Number

This is a very difficult exponent to be evaluated. The imaginary unit is uncountable, so you will be unable to evaluate the exponent like how you did conventionally, multiplying the number by itself for an uncountable number of times.

Continue reading “Finding a Complex Number to The Power of a Complex Number”

Disable Security Manager in Java

This snippet code allows you to disable the Java Security Manager, provided that you have full access to any reflection related operations. It is not as simple as obtaining the security static field within java.lang.System and set the value to null. More information will be given below. Also, this code is licensed under the Unlicense, which nearly gives you all permissions, except for modifying the original snippet code.

Continue reading “Disable Security Manager in Java”

Optimizing the Chudnovsky Algorithm for Implementations

The Chudnovsky Algorithm is a fast method for calculating the digits of \pi. Here is the definition:

\displaystyle\frac{1}{\pi}=12\sum_{k=0}^{\infty}\frac{(-1)^k(6k)!(545140134k+13591409)}{(3k)!(k!)^3640320^{3k+\frac{3}{2}}}

The complexity of the algorithm is very high. It involves multiple factorials, exponents and calculations with large numbers. You should not directly implement the it as its definition, since the program will be pretty slow. Here shows some optimization of the algorithm for computations.

Continue reading “Optimizing the Chudnovsky Algorithm for Implementations”