Python/maths
ARNAV RAJ 9a572dec2b
feat: Implemented Matrix Exponentiation Method (#11747)
* feat: add Matrix Exponentiation method
docs: updated the header documentation and added new documentation for
the new function.

* feat: added new function matrix exponetiation method

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* feat: This function uses the tail-recursive form of the Euclidean algorithm to calculate

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* reduced the number of characters per line in the comments

* removed unwanted code

* feat: Implemented a new function to swaap numbers without dummy variable

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* removed previos code

* Done with the required changes

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Done with the required changes

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Done with the required changes

* Done with the required changes

* Done with the required changes

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update maths/fibonacci.py

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Done with the required changes

* Done with the required changes

* Done with the required changes

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
2024-10-04 09:29:39 -07:00
..
images Add __init__.py files in all the directories (#2503) 2020-09-28 19:42:36 +02:00
numerical_analysis Upgrade to Python 3.13 (#11588) 2024-09-30 23:01:15 +02:00
polynomials Fix ruff errors (#8936) 2023-08-09 13:25:30 +05:30
series [pre-commit.ci] pre-commit autoupdate (#11322) 2024-03-13 07:52:41 +01:00
special_numbers Fix ruff (#11527) 2024-08-25 17:33:11 +02:00
__init__.py pyupgrade --py37-plus **/*.py (#1654) 2020-01-03 22:25:36 +08:00
abs.py Make some ruff fixes (#8154) 2023-03-01 17:23:33 +01:00
addition_without_arithmetic.py addition_without_arithmetic (#6830) 2022-10-30 13:52:37 +01:00
aliquot_sum.py Optimization and fix bug (#2342) 2020-08-21 14:39:03 +08:00
allocation_number.py [pre-commit.ci] pre-commit autoupdate (#11322) 2024-03-13 07:52:41 +01:00
arc_length.py Update arc_length.py (#8964) 2023-08-20 16:39:29 -07:00
area_under_curve.py [pre-commit.ci] pre-commit autoupdate (#11322) 2024-03-13 07:52:41 +01:00
area.py [pre-commit.ci] pre-commit autoupdate (#11322) 2024-03-13 07:52:41 +01:00
average_absolute_deviation.py Added average absolute deviation (#5951) 2022-02-13 18:20:19 +01:00
average_mean.py Pyupgrade to Python 3.9 (#4718) 2021-09-07 13:37:03 +02:00
average_median.py Fix minor typing errors in maths/ (#8959) 2023-08-15 14:27:41 -07:00
average_mode.py [mypy] Fix type annotations for maths directory (#5782) 2021-11-07 16:13:58 +01:00
bailey_borwein_plouffe.py Add flake8-builtins to pre-commit and fix errors (#7105) 2022-10-13 19:53:59 +05:30
base_neg2_conversion.py convert to the base minus 2 of a number (#9748) 2023-10-05 14:39:14 +02:00
basic_maths.py [pre-commit.ci] pre-commit autoupdate (#11322) 2024-03-13 07:52:41 +01:00
binary_exponentiation.py Consolidate binary exponentiation files (#10742) 2023-10-21 13:27:36 -04:00
binary_multiplication.py Changing Name of file and adding doctests in file. (#9513) 2023-10-03 11:40:11 -04:00
binomial_coefficient.py Tried new TESTS for the binomial_coefficient (#10822) 2023-10-24 15:46:00 +02:00
binomial_distribution.py [pre-commit.ci] pre-commit autoupdate (#11322) 2024-03-13 07:52:41 +01:00
ceil.py Add typing to maths/ceil.py (#7057) 2022-10-12 20:41:52 +02:00
chebyshev_distance.py Added the Chebyshev distance function (#10144) 2023-10-09 17:21:46 -04:00
check_polygon.py [mypy] check polygon and corrections (#5419) 2021-10-21 21:13:42 +08:00
chinese_remainder_theorem.py [pre-commit.ci] pre-commit autoupdate (#11322) 2024-03-13 07:52:41 +01:00
chudnovsky_algorithm.py Enable ruff RUF002 rule (#11377) 2024-04-22 21:51:47 +02:00
collatz_sequence.py Fix merge conflicts to merge change from #5080 (#8911) 2023-07-31 07:23:23 +02:00
combinations.py In place of calculating the factorial several times we can run a loop k times to calculate the combination (#10051) 2023-10-08 15:17:02 -04:00
continued_fraction.py [pre-commit.ci] pre-commit autoupdate (#11322) 2024-03-13 07:52:41 +01:00
decimal_isolate.py pre-commit: Upgrade psf/black for stable style 2023 (#8110) 2023-02-01 18:44:54 +05:30
decimal_to_fraction.py Fix ruff errors (#8936) 2023-08-09 13:25:30 +05:30
dodecahedron.py Dodecahedron surface area and volume (#6606) 2022-10-31 18:15:37 +01:00
double_factorial.py merge double_factorial (#9431) 2023-10-03 09:53:27 -04:00
dual_number_automatic_differentiation.py Add more ruff rules (#8767) 2023-05-26 09:34:17 +02:00
entropy.py Enable ruff RUF002 rule (#11377) 2024-04-22 21:51:47 +02:00
euclidean_distance.py Upgrade to Python 3.13 (#11588) 2024-09-30 23:01:15 +02:00
euler_method.py Upgrade to Python 3.13 (#11588) 2024-09-30 23:01:15 +02:00
euler_modified.py Upgrade to Python 3.13 (#11588) 2024-09-30 23:01:15 +02:00
eulers_totient.py [pre-commit.ci] pre-commit autoupdate (#9013) 2023-08-29 15:18:10 +02:00
extended_euclidean_algorithm.py Misc fixes across multiple algorithms (#6912) 2022-10-16 10:55:38 +05:30
factorial.py seperation between description and docstrings (#9687) 2023-10-10 01:13:32 -04:00
factors.py Reduced Time Complexity to O(sqrt(n)) (#7429) 2022-10-23 17:56:40 +05:30
fast_inverse_sqrt.py Added Fast Inverse Square Root (#11054) 2023-10-29 21:57:37 +01:00
fermat_little_theorem.py Fermat_little_theorem type annotation (#9794) 2023-10-05 07:30:39 -04:00
fibonacci.py feat: Implemented Matrix Exponentiation Method (#11747) 2024-10-04 09:29:39 -07:00
find_max.py Fix ruff (#11527) 2024-08-25 17:33:11 +02:00
find_min.py Consolidate find_min and find_min recursive and find_max and find_max_recursive (#8960) 2023-08-14 04:17:27 -07:00
floor.py Add typing to maths/floor.py (#7056) 2022-10-12 20:42:30 +02:00
gamma.py [pre-commit.ci] pre-commit autoupdate (#11322) 2024-03-13 07:52:41 +01:00
gaussian.py Upgrade to Python 3.13 (#11588) 2024-09-30 23:01:15 +02:00
gcd_of_n_numbers.py gcd_of_n_numbers (#8057) 2023-01-10 23:47:02 +01:00
germain_primes.py Added Germain primes algorithm to the maths folder (#10120) 2023-10-08 17:33:50 -04:00
greatest_common_divisor.py math/greatest_common_divisor: add support for negative numbers (#2628) 2020-10-29 12:47:26 +05:30
hardy_ramanujanalgo.py hardy_ramanujanalgo type annotation (#9799) 2023-10-05 08:39:29 -04:00
integer_square_root.py Add Integer Square Root Algorithm (#10949) 2023-10-29 11:58:28 +01:00
interquartile_range.py [pre-commit.ci] pre-commit autoupdate (#11322) 2024-03-13 07:52:41 +01:00
is_int_palindrome.py Rename is_palindrome.py to is_int_palindrome.py (#8768) 2023-05-26 12:20:33 +05:30
is_ip_v4_address_valid.py Update and rename check_valid_ip_address.py to is_ip_v4_address_valid.py (#4665) 2021-09-23 02:03:11 +08:00
is_square_free.py [pre-commit.ci] pre-commit autoupdate (#11322) 2024-03-13 07:52:41 +01:00
jaccard_similarity.py Fix minor typing errors in maths/ (#8959) 2023-08-15 14:27:41 -07:00
joint_probability_distribution.py [ADD] : maths joint probabilty distribution (#10508) 2023-10-15 17:03:03 +02:00
josephus_problem.py Add Josephus Problem (#10928) 2023-10-29 17:42:41 +01:00
juggler_sequence.py Add more ruff rules (#8767) 2023-05-26 09:34:17 +02:00
karatsuba.py [pre-commit.ci] pre-commit autoupdate (#11322) 2024-03-13 07:52:41 +01:00
kth_lexicographic_permutation.py Add pep8-naming to pre-commit hooks and fixes incorrect naming conventions (#7062) 2022-10-13 00:54:20 +02:00
largest_of_very_large_numbers.py Enable ruff PLR5501 rule (#11332) 2024-03-28 18:25:41 +01:00
least_common_multiple.py Ruff pandas vet (#10281) 2023-10-11 14:30:02 -04:00
line_length.py Fix ruff errors (#8936) 2023-08-09 13:25:30 +05:30
liouville_lambda.py Add more ruff rules (#8767) 2023-05-26 09:34:17 +02:00
lucas_lehmer_primality_test.py Enable ruff RUF002 rule (#11377) 2024-04-22 21:51:47 +02:00
lucas_series.py Add flake8 pluin flake8 bugbear to pre-commit (#7132) 2022-10-13 18:03:06 +02:00
maclaurin_series.py [pre-commit.ci] pre-commit autoupdate (#11322) 2024-03-13 07:52:41 +01:00
manhattan_distance.py Add more ruff rules (#8767) 2023-05-26 09:34:17 +02:00
matrix_exponentiation.py Change to https. (#7277) 2022-10-16 09:43:29 +02:00
max_sum_sliding_window.py [pre-commit.ci] pre-commit autoupdate (#11322) 2024-03-13 07:52:41 +01:00
minkowski_distance.py Upgrade to Python 3.13 (#11588) 2024-09-30 23:01:15 +02:00
mobius_function.py Replace flake8 with ruff (#8184) 2023-03-16 13:31:29 +01:00
modular_division.py Enable ruff RUF002 rule (#11377) 2024-04-22 21:51:47 +02:00
modular_exponential.py [pre-commit.ci] pre-commit autoupdate (#11322) 2024-03-13 07:52:41 +01:00
monte_carlo_dice.py Raise error not string (#7945) 2022-11-06 15:54:44 +01:00
monte_carlo.py [pre-commit.ci] pre-commit autoupdate (#11322) 2024-03-13 07:52:41 +01:00
number_of_digits.py TypeError for non-integer input (#9250) 2023-10-10 00:19:40 -04:00
odd_sieve.py Enable ruff RUF005 rule (#11344) 2024-04-02 21:18:47 +02:00
perfect_cube.py Add perfect cube binary search (#10477) 2023-10-23 01:56:59 -04:00
perfect_number.py Add tests for Perfect_Number (#10745) 2023-10-22 00:05:37 +02:00
perfect_square.py The black formatter is no longer beta (#5960) 2022-01-30 20:29:54 +01:00
persistence.py [pre-commit.ci] pre-commit autoupdate (#9013) 2023-08-29 15:18:10 +02:00
pi_generator.py Enable ruff E741 rule (#11370) 2024-04-19 21:30:22 +02:00
pi_monte_carlo_estimation.py Add flake8 pluin flake8 bugbear to pre-commit (#7132) 2022-10-13 18:03:06 +02:00
points_are_collinear_3d.py chore: fix typos (#11467) 2024-06-17 06:27:07 -07:00
pollard_rho.py Enable ruff PLR5501 rule (#11332) 2024-03-28 18:25:41 +01:00
polynomial_evaluation.py Remove useless code in doctests (#7733) 2022-10-27 22:52:00 +02:00
power_using_recursion.py Fix typo power_using_recursion.py (#11083) 2023-10-29 22:22:19 +01:00
prime_check.py Add error tests in doctest and fix error message (#10930) 2023-10-26 01:27:46 -04:00
prime_factors.py [pre-commit.ci] pre-commit autoupdate (#11322) 2024-03-13 07:52:41 +01:00
prime_numbers.py Updated prime_numbers.py testcases. (#9851) 2023-10-05 20:44:55 +02:00
prime_sieve_eratosthenes.py Change prime_sieve_eratosthenes.py to return list (#8062) 2023-01-02 14:10:59 +13:00
primelib.py Add doctest for maths/primelib (#10978) 2023-10-26 14:52:47 +02:00
print_multiplication_table.py Add print_multiplication_table.py (#6607) 2022-10-30 23:55:11 +01:00
pythagoras.py Replace bandit, flake8, isort, and pyupgrade with ruff (#8178) 2023-03-15 13:58:25 +01:00
qr_decomposition.py Fix minor typing errors in maths/ (#8959) 2023-08-15 14:27:41 -07:00
quadratic_equations_complex_numbers.py Change occurrences of str.format to f-strings (#4118) 2021-02-23 11:23:49 +05:30
radians.py [pre-commit.ci] pre-commit autoupdate (#9543) 2023-10-07 21:32:28 +02:00
radix2_fft.py [pre-commit.ci] pre-commit autoupdate (#11473) 2024-07-02 07:02:29 +02:00
remove_digit.py adding the remove digit algorithm (#6708) 2023-05-11 06:55:48 +12:00
segmented_sieve.py Segmented sieve - doctests (#9945) 2023-10-07 05:09:39 -04:00
sieve_of_eratosthenes.py [pre-commit.ci] pre-commit autoupdate (#11322) 2024-03-13 07:52:41 +01:00
sigmoid.py Fix minor typing errors in maths/ (#8959) 2023-08-15 14:27:41 -07:00
signum.py Added New Tests in Signum (#10724) 2023-10-20 13:02:30 +02:00
simultaneous_linear_equation_solver.py Enable ruff RUF002 rule (#11377) 2024-04-22 21:51:47 +02:00
sin.py Add sin function to maths (#5949) 2022-05-16 19:28:30 +08:00
sock_merchant.py sock_merchant.py: Matching socks by color (#5761) 2021-11-03 21:24:50 +01:00
softmax.py Upgrade to Python 3.13 (#11588) 2024-09-30 23:01:15 +02:00
solovay_strassen_primality_test.py [pre-commit.ci] pre-commit autoupdate (#11322) 2024-03-13 07:52:41 +01:00
spearman_rank_correlation_coefficient.py Create Spearman's rank correlation coefficient (#11155) 2023-11-25 15:20:42 +01:00
sum_of_arithmetic_series.py Add flake8-builtins to pre-commit and fix errors (#7105) 2022-10-13 19:53:59 +05:30
sum_of_digits.py maths/sum_of_digits.py: Streamline benchmarks (#7914) 2022-11-01 14:07:11 +01:00
sum_of_geometric_progression.py The black formatter is no longer beta (#5960) 2022-01-30 20:29:54 +01:00
sum_of_harmonic_series.py Created sum_of_harmonic_series.py (#7504) 2022-10-23 06:29:10 +02:00
sumset.py added sumset.py Fixes: #{6563} (#6742) 2022-10-30 11:49:05 +01:00
sylvester_sequence.py Add more ruff rules (#8767) 2023-05-26 09:34:17 +02:00
tanh.py [pre-commit.ci] pre-commit autoupdate (#11322) 2024-03-13 07:52:41 +01:00
test_prime_check.py Change to https. (#7277) 2022-10-16 09:43:29 +02:00
three_sum.py add Three sum (#9177) 2023-10-01 16:46:12 +02:00
trapezoidal_rule.py Create codespell.yml (#1698) 2020-01-18 13:24:33 +01:00
triplet_sum.py [pre-commit.ci] pre-commit autoupdate (#11322) 2024-03-13 07:52:41 +01:00
twin_prime.py Add more ruff rules (#8767) 2023-05-26 09:34:17 +02:00
two_pointer.py [pre-commit.ci] pre-commit autoupdate (#11322) 2024-03-13 07:52:41 +01:00
two_sum.py [pre-commit.ci] pre-commit autoupdate (#11322) 2024-03-13 07:52:41 +01:00
volume.py [pre-commit.ci] pre-commit autoupdate (#11322) 2024-03-13 07:52:41 +01:00
zellers_congruence.py pre-commit: Upgrade psf/black for stable style 2023 (#8110) 2023-02-01 18:44:54 +05:30