Skip to content

Instantly share code, notes, and snippets.

View ArminGh02's full-sized avatar

Armin Gh ArminGh02

View GitHub Profile
@ArminGh02
ArminGh02 / gaussian_elimination.py
Created July 7, 2022 00:16
Implementation of Gaussian elimination algorithm in linear algebra using NumPy
import numpy
SEPARATOR = '-' * 80
class GaussianEliminationCalculator:
def __init__(self, augmented_matrix: numpy.matrix) -> None:
if augmented_matrix.shape[0] != augmented_matrix.shape[1] - 1:
raise ValueError('coefficient matrix should be nxn')
@ArminGh02
ArminGh02 / factorial_turing_machine.cpp
Last active July 6, 2022 13:55
Simulation of a Turing Machine to compute factorial
#include <algorithm>
#include <iostream>
#include <string>
constexpr char BLANK = 'B';
constexpr char IGNORED = 'I';
constexpr char VISITED = 'V';
constexpr char DELIM1 = 'Z';
constexpr char DELIM2 = 'X';
constexpr char DELIM3 = '0';