https://github.com/leflon/math
Math algorithms
https://github.com/leflon/math
Last synced: 2 months ago
JSON representation
Math algorithms
- Host: GitHub
- URL: https://github.com/leflon/math
- Owner: leflon
- Created: 2024-10-06T16:06:34.000Z (8 months ago)
- Default Branch: master
- Last Pushed: 2024-10-29T07:27:49.000Z (7 months ago)
- Last Synced: 2025-03-07T23:27:51.996Z (3 months ago)
- Language: Python
- Homepage:
- Size: 26.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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
```