* added other possible cases
* added test for correct output of truth table
* few fibonacci tests added
* updating DIRECTORY.md
* Update nor_gate.py
* updating DIRECTORY.md
* Update fibonacci.py
removed whitespace
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: = <=>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* added runge kutta gills method
* added adams-bashforth method of order 2, 3, 4, 5
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update adams_bashforth.py
* Deleted extraneous file, maths/numerical_analysis/runge_kutta_gills.py
* Added doctests to each function adams_bashforth.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update adams_bashforth.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>
* Add error tests in doctest and fix error message
* Change AssertationError to ValueError
* [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>
* Tried new TESTS for the binomial_coefficient
* Fix the tests request
* Update binomial_coefficient.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update binomial_coefficient.py
---------
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Add New Algorithm: Triangular Numbers
* Calculate nth triangular number instead of generating a list
* Handle 0th position and update function name and docstring
* Remove eval from arithmetic_analysis/newton_raphson.py
* Relocate contents of arithmetic_analysis/
Delete the arithmetic_analysis/ directory and relocate its files because
the purpose of the directory was always ill-defined. "Arithmetic
analysis" isn't a field of math, and the directory's files contained
algorithms for linear algebra, numerical analysis, and physics.
Relocated the directory's linear algebra algorithms to linear_algebra/,
its numerical analysis algorithms to a new subdirectory called
maths/numerical_analysis/, and its single physics algorithm to physics/.
* updating DIRECTORY.md
---------
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Add perfect cube binary search algorithm
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Add support for testing negative perfect cubes
* Add TypeError check for invalid inputs
* [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>
* Contributes to #9943
Added doctest to largest_of_very_large_numbers.py
Added doctest to word_patterns.py
Added doctest to onepad_cipher.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Contributes to #9943
Added doctest to maths/largest_of_very_large_numbers.py
Added doctest to strings/word_patterns.py
Added doctest to ciphers/onepad_cipher.py
* Add tests without modifying code #10740
Added test to maths/largest_of_very_large_numbers
Added test to strings/word_patterns.py
Added test to ciphers/onepad_cipher.py
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* avg and mps speed formulae added
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* avg and mps speed formulae added
* fixed_spacing
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* spacing
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* ws
* added amicable numbers
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* added amicable numbers
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* spacing
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* removed
* changed name of file and added code improvements
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* issues fixed due to pi
* requested changes added
* Created doppler_effect_of_sound.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Updated doppler_effect_of_sound.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* added desc names
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fixed spacing
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* renamed doppler_effect_of_sound.py to doppler_frequency.py
* used expection handling rather than print statements
* fixed spacing for ruff
* Update doppler_frequency.py
This is super slick! Well done.
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
* Added new tests!
* [ADD]: Inproved Tests
* fixed
* Removed spaces
* Changed the file name
* Added Changes
* changed the code and kept the test cases
* changed the code and kept the test cases
* missed the line
* removed spaces
* Update power_using_recursion.py
* Added new tests in Signum
* Few things added
* Removed few stuff and added few changes
* Fixed few things
* Reverted the function
* Update maths/signum.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Added few things
* Update maths/signum.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Added the type hint back
* Update signum.py
* Added NEW tests for Perfect_Number
* Update maths/special_numbers/perfect_number.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Added the line back
* Update maths/special_numbers/perfect_number.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Fixed a space
* Updated
* Reverted changes
* Added the old code and FIXED few LINES
* Fixed few things
* Changed Test CASES
* Update perfect_number.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Added new tests!
* [ADD]: Inproved Tests
* fixed
* Removed spaces
* Changed the file name
* Added Changes
* changed the code and kept the test cases
* changed the code and kept the test cases
* missed the line
* removed spaces
* Update power_using_recursion.py
* Added new tests in Signum
* Few things added
* Removed few stuff and added few changes
* Fixed few things
* Reverted the function
* Update maths/signum.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Added few things
* Update maths/signum.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Added the type hint back
* Update signum.py
---------
Co-authored-by: Christian Clauss <cclauss@me.com>
* Added new tests!
* [ADD]: Inproved Tests
* fixed
* Removed spaces
* Changed the file name
* Added Changes
* changed the code and kept the test cases
* changed the code and kept the test cases
* missed the line
* removed spaces
* Update power_using_recursion.py
---------
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update binary_exponentiation.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>
* 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>
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
* Minimization of while loop in Armstrong Numbers
The while loop is removed and simple length calculation is used so the task of minimization of while loop is achieved
* [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>
* Update volume.py with volume of Icosahedron
Added function to find volume of a regular Icosahedron
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Apply suggestions from code review
* Update volume.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>
* Create joint_probability_distribution.py
* Update joint_probability_distribution.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update joint_probability_distribution.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update joint_probability_distribution.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update joint_probability_distribution.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update joint_probability_distribution.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update joint_probability_distribution.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update joint_probability_distribution.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update joint_probability_distribution.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update joint_probability_distribution.py
* Update joint_probability_distribution.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update joint_probability_distribution.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update joint_probability_distribution.py
* Update joint_probability_distribution.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update maclaurin_series.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Revert changes to maclaurin_series.py
* Revert changes to maclaurin_series.py
* Update joint_probability_distribution.py
* Update joint_probability_distribution.py
* Update joint_probability_distribution.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>
* Corrected typo in function name and doctests. rkf45.py
There was a mistake in name of function (runge_futta_fehlberg instead of runge_kutta_fehlberg) . I have corrected this in function name and also doctest.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Rename rkf45.py to runge_kutta_fehlberg_45.py
* Update runge_kutta_fehlberg_45.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>
* 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>