* added rkf45 method
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Updated rkf45.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Updated rkf45.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update rkf45.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update rkf45.py with suggestions
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Improved Code Quality rkf45.py
* Added more test cases and exception rkf45.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update rkf45.py
* corrected some spellings. rkf45.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update rkf45.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update rkf45.py
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
* Adding doctests in simpson_rule.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update maths/simpson_rule.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update maths/simpson_rule.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Adding doctests in simpson_rule.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Adding doctests in simpson_rule.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Adding doctests in simpson_rule.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Adding doctests in simpson_rule.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Adding doctests in simpson_rule.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update simpson_rule.py
* Adding doctests in simpson_rule.py
* Adding doctests in simpson_rule.py
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update the doctest of primelib.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Correct errors for the doctest of primelib.py
* last error for the doctest of primelib.py
* last error for the doctest of primelib.py
* [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: Christian Clauss <cclauss@me.com>
* Update primelib.py
* [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>
* Replacing the generator with numpy vector operations from lu_decomposition.
* Revert "Replacing the generator with numpy vector operations from lu_decomposition."
This reverts commit ad217c6616.
* Added doctests
* Update carmichael_number.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update carmichael_number.py
I make an empty commit to reset:
tests are failing.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update carmichael_number.py
Made changes taking into account the addition:
from maths.greatest_common_divisor import greatest_common_divisor.
Now instead of gcd it is used: greatest_common_divisor.
* Update carmichael_number.py
* Update carmichael_number.py
* Update carmichael_number.py
I added a check for 0 and negative numbers in the tests and the code itself. Simplified obtaining the final result.
* Update carmichael_number.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update maths/carmichael_number.py
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
* Update carmichael_number.py
* Update carmichael_number.py
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
* type error check
* remove str input
* [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>
* Deleted greatest_common_divisor def from many files and instead imported the method from Maths folder
* Deleted greatest_common_divisor def from many files and instead imported the method from Maths folder, also fixed comments
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Deleted greatest_common_divisor def from many files and instead imported the method from Maths folder, also fixed comments
* Imports organized
* recursive gcd function implementation rolledback
* more gcd duplicates removed
* more gcd duplicates removed
* Update maths/carmichael_number.py
* updated files
* moved a file to another location
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
* In place of calculating the factorial several times we can run a loop k times to calculate the combination
for example:
5 C 3 = 5! / (3! * (5-3)! )
= (5*4*3*2*1)/[(3*2*1)*(2*1)]
=(5*4*3)/(3*2*1)
so running a loop k times will reduce the time complexity to O(k)
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update maths/combinations.py
* [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>
* Replacing the generator with numpy vector operations from lu_decomposition.
* Revert "Replacing the generator with numpy vector operations from lu_decomposition."
This reverts commit ad217c6616.
* Added doctests.
* Update segmented_sieve.py
Removed unnecessary check.
* Update segmented_sieve.py
Added checks for 0 and negative numbers.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update segmented_sieve.py
* Update segmented_sieve.py
Added float number check.
* Update segmented_sieve.py
* Update segmented_sieve.py
simplified verification
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update segmented_sieve.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update segmented_sieve.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* ValueError: Number 22.2 must instead be a positive integer
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
* Replacing the generator with numpy vector operations from lu_decomposition.
* Revert "Replacing the generator with numpy vector operations from lu_decomposition."
This reverts commit ad217c6616.
* Added type annotation.
* Fix: Issue 9588
* Fix: Issue 9588
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fix: Issue 9588
* Fix: Issue #9588
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fix: Issue #9588
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fix: Issue #9588
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix: issue #9793
* fix: issue #9793
* fix: issue #9588
* [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>
* Replacing the generator with numpy vector operations from lu_decomposition.
* Revert "Replacing the generator with numpy vector operations from lu_decomposition."
This reverts commit ad217c6616.
* Added type annotation.
* Replacing the generator with numpy vector operations from lu_decomposition.
* Revert "Replacing the generator with numpy vector operations from lu_decomposition."
This reverts commit ad217c6616.
* Added type annotation.
* Update fermat_little_theorem.py
Used other syntax.
* Update fermat_little_theorem.py
* Update maths/fermat_little_theorem.py
---------
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
* Moved file relu.py from maths/ to neural_network/activation_functions
* Renamed relu.py to rectified_linear_unit.py
* Renamed relu.py to rectified_linear_unit.py in DIRECTORY.md
* Adding doctests and changing file name
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update binary_multiplication.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update binary_multiplication.py
* Changing comment and changing name function
* Changing comment and changing name function
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update binary_multiplication.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update binary_multiplication.py
* Update binary_multiplication.py
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
* DRAFT: GitHub Actions: Test on Python 3.12
Repeats #8777
* #8777
Some of our dependencies will not be ready yet.
* Python 3.12: Disable qiskit and tensorflow algorithms
* updating DIRECTORY.md
---------
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Removed ciphers/rabin_miller.py as it is already there maths/miller_rabin.py
* Renamed miller_rabin.py to rabain_miller.py
* Restore ciphers/rabin_miller.py and removed maths/rabin_miller.py
* add Three sum
* add Three sum
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* update
* update
* update
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* update
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* add documention
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* feat(maths): add function to perform calculation
- Add single function to calculate sum of two positive numbers
using bitwise operator
* docs: add wikipedia url as explanation
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Apply suggestions from code review
Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
* Update sum_of_two_positive_numbers_bitwise.py
* Update sum_of_two_positive_numbers_bitwise.py
* Update sum_of_two_positive_numbers_bitwise.py
---------
Co-authored-by: Okza Pradhana <okzapradhana@azko-macbook.local>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
* Update arc_length.py
Wrote the output of testcase
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update arc_length.py
Added the requested changes
* Update arc_length.py
followed the change request
* Update arc_length.py
followed suggestions
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Add doctests to continued_fraction.py for 0 and neg nums
* Fix continued_fraction.py to work for negative nums
Fix continued_fraction.py to work for negative nums by replacing int() call with floor()
* Move comment in doctest