Large Integer Packages by James Pate Williams Jr

Back in the late 1990s I trained myself in number theory and cryptography using the “Handbook of Applied Cryptography” by Alfred J. Menezes and his coeditors and the FreeLIP (Free Large Integer Package) package by Arjen K. Lenstra. FreeLIP is quite an elegant C library, but it is now considered obsolete. I know of MIRACL that was Henri Cohen’s favorite large integer library. I have four books in my personal library that have unsigned or signed multiple precision integer arithmetic code and/or algorithms: “A Numerical Library in C for Scientists and Engineers” by H .T. Lau, “Handbook of Applied Cryptography”, “Prime Numbers and Computer Methods of Factorization Second Edition” by Hans Riesel, and “Semi-numerical Algorithms Second Edition” by Donald Knuth. I also have several number theory and cryptography textbooks.

As an exercise in Python console programming, I translated my C# Visual Studio 2008 large integer code to Python. Back in 2008 Visual Studio C# did not support large integers. I used Riesel’s input and output code which was translated from Pascal code. I also utilized algorithms from the “Handbook of Applied Cryptography”. I included Sieve of Eratosthenes for primes <= 100,000, a trial division factoring algorithm, and programmed the Pollard rho factoring algorithm found in the handbook.

Python Code to Implement the Linear Algebraic Rule by Cramer for a 3 by 3 Set of Linear Equations by James Pate Williams Jr

The algebraic example comes from the website:

Cramers Rule Calculator (ncalculators.com)

Quadratic, Cubic, and Quartic Python Equation Solver by James Pate Williams Jr

Back in 2015 I created a C# application to solve quadratic, cubic, and quartic equations which are of degrees 2, 3, and 4, respectively. Yesterday I successfully translated the C# to the Python console. I bench-marked my computer programs against the online calculators on the following website:

Cubic equation Calculator – High accuracy calculation (casio.com)

Quartic equation Calculator – High accuracy calculation (casio.com)

Here are my resulting Python outputs:

Three Term Recurrence Relations for the Legendre Functions by James Pate Williams, Jr.

bachelorthesis.dvi (uni-ulm.de)

My implementations and additional graphs for the Legendre functions mentioned in the thesis cited in the preceding line and PDF. The Legendre polynomials, functions, and associated functions have many applications in quantum mechanics and other branches of applied and theoretical physics.

Legendre Functions Application
Magnitude Graph for P(z, 8)
Imaginary Part for P(z, 8)
Real Part for P(z, 8)
Magnitudes of Q(z, 8)
Imaginary Part of Q(z, 8)
Real Part of Q(z, 8)
Graph of P(cos x, 8) Real Valued Function
Graph of Q(cos x, 8) Real Valued Function
Graph of P(x, 8) Real Valued Function
Graph of Q(x, 8) Real Valued Function
P(cos x, 30)
Q(cos x, 30)
P(x, 30)
Q(x, 30)

Iterative Deepening A* Search to Solve the 8-Puzzle and 15-Puzzle by James Pate Williams, Jr.

The 8-puzzle is a child’s tiled toy. The toy consists of 8 numbered tiles and a blank space. The object of the game is to get the tiles in the order 1 to 8 going from the top left hand corner for the number 1 tile around the perimeter clockwise and finish with the space in the center of the 3 x 3 board.

A* search is a complete and optimal informed or heuristic search algorithm. A good source for information on uniformed and informed search procedures is the tome “Artificial Intelligence A Modern Approach First and/or Second Edition” by Stuart Russell and Peter Norvig. The second edition has more info on the 8-puzzle and the 15-puzzle. Iterative deepening A* search is also a complete and optimal search algorithm. Below is an instance of the 8-puzzle that requires 10 steps to reach the goal state. I use a different goal state than Russell and Norvig in the second edition of their textbook.

Initial State of a 8-Puzzle Instance
Goal State of a 8-Puzzle Instance
Initial State of a 15-Puzzle Instance
Goal State of a 15-Puzzle Instance

I developed an application in 2015 that uses 5 search algorithms to solve instances of the 15-puzzle.

Best First Search Algorithm
Breadth First Search Algorithm
Failure of Depth First Algorithm
Failure of IDA* Search
Failure of the A* Search
Best First Search
Failure of Breadth First Search
Failure of Depth First Search
IDA* Search Solution
A* Search Solution