An open API service indexing awesome lists of open source software.

https://github.com/leflon/math

Math algorithms
https://github.com/leflon/math

Last synced: 2 months ago
JSON representation

Math algorithms

Awesome Lists containing this project

README

        

# Math algorithms

## How to use
First of all, clone this repository:
```
git clone https://github.com/paulleflon/math.git
```
*or, using GitHub CLI:*
```bash
gh repo clone paulleflon/math
```

Execute the scripts using **`Python`**, by entering the values either as command line arguments or following the instructions.

Inputs for each script are detailed below:

### Extended Euclidean Algorithm
Performs the Extended Euclidean (a.k.a Extended GCD) algorithm for the given numbers
```bash
python3 extended_euclidean.py
```
#### Arguments
- `a`: non-null positive integer
- `b`: non-null positive integer

### Modulo Inverse
Computes the inverse of a number in the given ring.
```bash
python3 modulo_inverse.py
```
#### Arguments
- `number`: the number to find the inverse of, a non-null positive integer, lower than `modulo`
- `modulo`: the modulo to find the inverse to, a non-null positive integer

### Modulo Powers
Computes the power of a number in the given ring.
```bash
python3 modulo_powers.py
```
#### Arguments
- `base`: a non-null positive integer lower than `modulo`
- `exponent`: the exponent of the power to compute, non-null positive integer
- `modulo`: the modulo to compute the power in, a non-null positive integer

### Modulo Linear Equations
Solves a linear equation (`ax = b`) in a ring

```bash
python3 modulo_equations.py

```
#### Arguments
- `a`: a non-null positive integer
- `b`: a non-null positive integer
- `modulo`:a non-null positive integer

### Modulo Inverse List
Gives the list of invertible numbers and their inverses in a ring.
```bash
python3 modulo_inverse_list
```

### Arguments
- `modulo`: a non-null positive integer

### Prime factors
Computes prime factors decomposition of the given number
```bash
python3 prime_decomp.py
```
#### Arguments
- `n`: a non-null positive integer

### Modulo Matrix invertibility
Verifies if a Matrix is invertible in a given ring.
```bash
python3 modulo_matrix_invertible.py
```