From 8b691ff03ed12f1152677d08bd98cdadb2168ba8 Mon Sep 17 00:00:00 2001 From: Sudip Tiwari Date: Wed, 11 Oct 2023 22:56:46 +0545 Subject: [PATCH 1/9] add binary addition for n-bits --- bit_manipulation/binary_addition.py | 84 +++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 bit_manipulation/binary_addition.py diff --git a/bit_manipulation/binary_addition.py b/bit_manipulation/binary_addition.py new file mode 100644 index 000000000000..fc0b9cae7ca6 --- /dev/null +++ b/bit_manipulation/binary_addition.py @@ -0,0 +1,84 @@ +def AND(input1, input2): + if(input1 == '1' and input2 == '1'): + return '1' + else: + return '0' + +def OR(input1, input2): + if(input1 == '1' or input2 == '1'): + return '1' + else: + return '0' + +def XOR(input1, input2): + if(input1 == input2): + return '0' + else: + return '1' + +def addition(number_1: str, number_2: str, number_of_bits:int): + """ + return tuple with ('sum','carry') + The length of (number of bits in) 'sum' is same as the value of integer argument number_of_bits passed to the function. (i.e, if number_of_bits = 5, the length of 'sum' will also be 5 irrespective of the number of bits of number_1 and number_2). + + Explanation: The formula of sum and carry for each bit in binary operations are: + carry: C5 C4 C3 C2 C1 C0 + number_1: A4 A3 A2 A1 A0 + number_2: + B4 B3 B2 B1 B0 + ---------------------------- + answer: C5 S4 S3 S2 S1 S0 + + The formula for sum is: + S0 = A0 XOR B0 XOR C0 + S1 = A1 XOR B1 XOR C1 + . + . + and so on. + + The formula for carry is: + C1 = A0 AND B0 OR ((A0 XOR B0) AND C0) + C2 = A1 AND B1 OR ((A1 XOR B1) AND C1) + . + . + and so on. + + The numbers are reversed before operation so that the individual bits are traversed from right to left(using for loop) as we perform in addition by hand. Finally, the resultant sum is reversed again to retain the original format. + + >>> addition('1010','1101', 4) + ('0111', '1') + >>> addition('11111','00000', 5) + ('11111', '0') + >>> addition('0011','1111', 5) + ('10010', '0') + >>> addition('10011','110001', 6) + ('000100', '1') + >>> addition('10011','110001', 7) + ('1000100', '0') + >>> addition('1001','111', 4) + ('0000', '1') + >>> addition('1001','111', 5) + ('10000', '0') + >>> addition('101','10', 3) + ('111', '0') + + Do not perform an operation as this >>> addition('101','10', 2) since adding 3-bit number with any other number results to atleast 3 bit number but you are expecting a 2 bit number which is not possible. + """ + number_1 = number_1.zfill(number_of_bits) #zero padding at front + number_2 = number_2.zfill(number_of_bits) #zero padding at front + reversed_number_1 = number_1[::-1] # reverse for right to left traversal of bits using for loop + reversed_number_2 = number_2[::-1] # reverse for right to left traversal of bits using for loop + carry = '0' # initial carry in (C0) = 0 + sum = '' + for i in range(number_of_bits): + sum = sum + XOR(XOR(reversed_number_1[i],reversed_number_2[i]),carry) + intermediate_xor = XOR(reversed_number_1[i], reversed_number_2[i]) + intermediate_and = AND(reversed_number_1[i], reversed_number_2[i]) + carry = OR(intermediate_and, AND(intermediate_xor,carry)) + sum = sum[::-1] + return sum, carry + + +if __name__ == "__main__": + import doctest + + doctest.testmod() \ No newline at end of file From 2a954b6c4ee001506eb05ff8771f6ed9bde5ec35 Mon Sep 17 00:00:00 2001 From: Sudip Tiwari Date: Wed, 11 Oct 2023 23:08:30 +0545 Subject: [PATCH 2/9] update return types for binary addition of n-bits --- bit_manipulation/binary_addition.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bit_manipulation/binary_addition.py b/bit_manipulation/binary_addition.py index fc0b9cae7ca6..49714446301f 100644 --- a/bit_manipulation/binary_addition.py +++ b/bit_manipulation/binary_addition.py @@ -1,22 +1,22 @@ -def AND(input1, input2): +def AND(input1, input2) -> str: if(input1 == '1' and input2 == '1'): return '1' else: return '0' -def OR(input1, input2): +def OR(input1, input2) -> str: if(input1 == '1' or input2 == '1'): return '1' else: return '0' -def XOR(input1, input2): +def XOR(input1, input2) -> str: if(input1 == input2): return '0' else: return '1' -def addition(number_1: str, number_2: str, number_of_bits:int): +def addition(number_1: str, number_2: str, number_of_bits:int) -> (str,str): """ return tuple with ('sum','carry') The length of (number of bits in) 'sum' is same as the value of integer argument number_of_bits passed to the function. (i.e, if number_of_bits = 5, the length of 'sum' will also be 5 irrespective of the number of bits of number_1 and number_2). From 9aa760a763df8c328fb7427447153912260366d7 Mon Sep 17 00:00:00 2001 From: Sudip Tiwari Date: Wed, 11 Oct 2023 23:11:00 +0545 Subject: [PATCH 3/9] annotate function parameters with type hints --- bit_manipulation/binary_addition.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bit_manipulation/binary_addition.py b/bit_manipulation/binary_addition.py index 49714446301f..36f1e8569fa4 100644 --- a/bit_manipulation/binary_addition.py +++ b/bit_manipulation/binary_addition.py @@ -1,16 +1,16 @@ -def AND(input1, input2) -> str: +def AND(input1: str, input2: str) -> str: if(input1 == '1' and input2 == '1'): return '1' else: return '0' -def OR(input1, input2) -> str: +def OR(input1: str, input2: str) -> str: if(input1 == '1' or input2 == '1'): return '1' else: return '0' -def XOR(input1, input2) -> str: +def XOR(input1: str, input2: str) -> str: if(input1 == input2): return '0' else: From 4a1382891dae15e52c081897bbdc608fc4073b7a Mon Sep 17 00:00:00 2001 From: Sudip Tiwari Date: Wed, 11 Oct 2023 23:16:47 +0545 Subject: [PATCH 4/9] add doctests to all function --- bit_manipulation/binary_addition.py | 33 +++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/bit_manipulation/binary_addition.py b/bit_manipulation/binary_addition.py index 36f1e8569fa4..65bc250c55d7 100644 --- a/bit_manipulation/binary_addition.py +++ b/bit_manipulation/binary_addition.py @@ -1,16 +1,49 @@ def AND(input1: str, input2: str) -> str: + """ + AND gate logic. + >>> AND('0','1') + '0' + >>> AND('0','0') + '0' + >>> AND('1','1') + '1' + >>> AND('1','0') + '0' + """ if(input1 == '1' and input2 == '1'): return '1' else: return '0' def OR(input1: str, input2: str) -> str: + """ + OR gate logic. + >>> OR('0','1') + '1' + >>> OR('0','0') + '0' + >>> OR('1','1') + '1' + >>> OR('1','0') + '1' + """ if(input1 == '1' or input2 == '1'): return '1' else: return '0' def XOR(input1: str, input2: str) -> str: + """ + XOR gate logic. + >>> XOR('0','1') + '1' + >>> XOR('0','0') + '0' + >>> XOR('1','1') + '0' + >>> XOR('1','0') + '1' + """ if(input1 == input2): return '0' else: From 0a0a33557a4e6e77875806b6dcfcc1dec8178015 Mon Sep 17 00:00:00 2001 From: Sudip Tiwari Date: Wed, 11 Oct 2023 23:20:24 +0545 Subject: [PATCH 5/9] add website reference and format code --- bit_manipulation/binary_addition.py | 53 +++++++++++++++++------------ 1 file changed, 31 insertions(+), 22 deletions(-) diff --git a/bit_manipulation/binary_addition.py b/bit_manipulation/binary_addition.py index 65bc250c55d7..86bb7fd2dd44 100644 --- a/bit_manipulation/binary_addition.py +++ b/bit_manipulation/binary_addition.py @@ -1,3 +1,5 @@ +# Information on Binary Addition: +# https://www.tutorialspoint.com/addition-of-two-n-bit-binary-numbers def AND(input1: str, input2: str) -> str: """ AND gate logic. @@ -10,11 +12,12 @@ def AND(input1: str, input2: str) -> str: >>> AND('1','0') '0' """ - if(input1 == '1' and input2 == '1'): - return '1' + if input1 == "1" and input2 == "1": + return "1" else: - return '0' - + return "0" + + def OR(input1: str, input2: str) -> str: """ OR gate logic. @@ -27,11 +30,12 @@ def OR(input1: str, input2: str) -> str: >>> OR('1','0') '1' """ - if(input1 == '1' or input2 == '1'): - return '1' + if input1 == "1" or input2 == "1": + return "1" else: - return '0' - + return "0" + + def XOR(input1: str, input2: str) -> str: """ XOR gate logic. @@ -44,12 +48,13 @@ def XOR(input1: str, input2: str) -> str: >>> XOR('1','0') '1' """ - if(input1 == input2): - return '0' + if input1 == input2: + return "0" else: - return '1' - -def addition(number_1: str, number_2: str, number_of_bits:int) -> (str,str): + return "1" + + +def addition(number_1: str, number_2: str, number_of_bits: int) -> (str, str): """ return tuple with ('sum','carry') The length of (number of bits in) 'sum' is same as the value of integer argument number_of_bits passed to the function. (i.e, if number_of_bits = 5, the length of 'sum' will also be 5 irrespective of the number of bits of number_1 and number_2). @@ -96,17 +101,21 @@ def addition(number_1: str, number_2: str, number_of_bits:int) -> (str,str): Do not perform an operation as this >>> addition('101','10', 2) since adding 3-bit number with any other number results to atleast 3 bit number but you are expecting a 2 bit number which is not possible. """ - number_1 = number_1.zfill(number_of_bits) #zero padding at front - number_2 = number_2.zfill(number_of_bits) #zero padding at front - reversed_number_1 = number_1[::-1] # reverse for right to left traversal of bits using for loop - reversed_number_2 = number_2[::-1] # reverse for right to left traversal of bits using for loop - carry = '0' # initial carry in (C0) = 0 - sum = '' + number_1 = number_1.zfill(number_of_bits) # zero padding at front + number_2 = number_2.zfill(number_of_bits) # zero padding at front + reversed_number_1 = number_1[ + ::-1 + ] # reverse for right to left traversal of bits using for loop + reversed_number_2 = number_2[ + ::-1 + ] # reverse for right to left traversal of bits using for loop + carry = "0" # initial carry in (C0) = 0 + sum = "" for i in range(number_of_bits): - sum = sum + XOR(XOR(reversed_number_1[i],reversed_number_2[i]),carry) + sum = sum + XOR(XOR(reversed_number_1[i], reversed_number_2[i]), carry) intermediate_xor = XOR(reversed_number_1[i], reversed_number_2[i]) intermediate_and = AND(reversed_number_1[i], reversed_number_2[i]) - carry = OR(intermediate_and, AND(intermediate_xor,carry)) + carry = OR(intermediate_and, AND(intermediate_xor, carry)) sum = sum[::-1] return sum, carry @@ -114,4 +123,4 @@ def addition(number_1: str, number_2: str, number_of_bits:int) -> (str,str): if __name__ == "__main__": import doctest - doctest.testmod() \ No newline at end of file + doctest.testmod() From fa7aebb1a4658109cef5fea56e3ad3bffaea18fb Mon Sep 17 00:00:00 2001 From: Sudip Tiwari Date: Wed, 11 Oct 2023 23:42:04 +0545 Subject: [PATCH 6/9] format to lowercase function name --- bit_manipulation/binary_addition.py | 56 ++++++++++++++++------------- 1 file changed, 31 insertions(+), 25 deletions(-) diff --git a/bit_manipulation/binary_addition.py b/bit_manipulation/binary_addition.py index 86bb7fd2dd44..197e05f129e9 100644 --- a/bit_manipulation/binary_addition.py +++ b/bit_manipulation/binary_addition.py @@ -1,15 +1,15 @@ # Information on Binary Addition: # https://www.tutorialspoint.com/addition-of-two-n-bit-binary-numbers -def AND(input1: str, input2: str) -> str: +def binary_and(input1: str, input2: str) -> str: """ AND gate logic. - >>> AND('0','1') + >>> binary_and('0','1') '0' - >>> AND('0','0') + >>> binary_and('0','0') '0' - >>> AND('1','1') + >>> binary_and('1','1') '1' - >>> AND('1','0') + >>> binary_and('1','0') '0' """ if input1 == "1" and input2 == "1": @@ -18,16 +18,16 @@ def AND(input1: str, input2: str) -> str: return "0" -def OR(input1: str, input2: str) -> str: +def binary_or(input1: str, input2: str) -> str: """ OR gate logic. - >>> OR('0','1') + >>> binary_or('0','1') '1' - >>> OR('0','0') + >>> binary_or('0','0') '0' - >>> OR('1','1') + >>> binary_or('1','1') '1' - >>> OR('1','0') + >>> binary_or('1','0') '1' """ if input1 == "1" or input2 == "1": @@ -36,16 +36,16 @@ def OR(input1: str, input2: str) -> str: return "0" -def XOR(input1: str, input2: str) -> str: +def binary_xor(input1: str, input2: str) -> str: """ XOR gate logic. - >>> XOR('0','1') + >>> binary_xor('0','1') '1' - >>> XOR('0','0') + >>> binary_xor('0','0') '0' - >>> XOR('1','1') + >>> binary_xor('1','1') '0' - >>> XOR('1','0') + >>> binary_xor('1','0') '1' """ if input1 == input2: @@ -57,7 +57,8 @@ def XOR(input1: str, input2: str) -> str: def addition(number_1: str, number_2: str, number_of_bits: int) -> (str, str): """ return tuple with ('sum','carry') - The length of (number of bits in) 'sum' is same as the value of integer argument number_of_bits passed to the function. (i.e, if number_of_bits = 5, the length of 'sum' will also be 5 irrespective of the number of bits of number_1 and number_2). + The number of bits in 'sum' is same as the value of integer argument number_of_bits passed to the function. + (i.e, if number_of_bits = 5, the length of 'sum' will also be 5). Explanation: The formula of sum and carry for each bit in binary operations are: carry: C5 C4 C3 C2 C1 C0 @@ -80,7 +81,8 @@ def addition(number_1: str, number_2: str, number_of_bits: int) -> (str, str): . and so on. - The numbers are reversed before operation so that the individual bits are traversed from right to left(using for loop) as we perform in addition by hand. Finally, the resultant sum is reversed again to retain the original format. + The numbers are reversed before operation so that the individual bits are traversed from right to left. + Finally, the resultant sum is reversed again to retain the original format. >>> addition('1010','1101', 4) ('0111', '1') @@ -99,7 +101,9 @@ def addition(number_1: str, number_2: str, number_of_bits: int) -> (str, str): >>> addition('101','10', 3) ('111', '0') - Do not perform an operation as this >>> addition('101','10', 2) since adding 3-bit number with any other number results to atleast 3 bit number but you are expecting a 2 bit number which is not possible. + Do not perform an operation as this >>> addition('101','10', 2). + Since adding 3-bit number with any other number results to atleast 3 bit number + but you are expecting a 2 bit number which is not possible. """ number_1 = number_1.zfill(number_of_bits) # zero padding at front number_2 = number_2.zfill(number_of_bits) # zero padding at front @@ -110,14 +114,16 @@ def addition(number_1: str, number_2: str, number_of_bits: int) -> (str, str): ::-1 ] # reverse for right to left traversal of bits using for loop carry = "0" # initial carry in (C0) = 0 - sum = "" + binary_sum = "" for i in range(number_of_bits): - sum = sum + XOR(XOR(reversed_number_1[i], reversed_number_2[i]), carry) - intermediate_xor = XOR(reversed_number_1[i], reversed_number_2[i]) - intermediate_and = AND(reversed_number_1[i], reversed_number_2[i]) - carry = OR(intermediate_and, AND(intermediate_xor, carry)) - sum = sum[::-1] - return sum, carry + binary_sum = binary_sum + binary_xor( + binary_xor(reversed_number_1[i], reversed_number_2[i]), carry + ) + intermediate_xor = binary_xor(reversed_number_1[i], reversed_number_2[i]) + intermediate_and = binary_and(reversed_number_1[i], reversed_number_2[i]) + carry = binary_or(intermediate_and, binary_and(intermediate_xor, carry)) + binary_sum = binary_sum[::-1] + return binary_sum, carry if __name__ == "__main__": From d27ce138a564d0a6ed0fb7694bc908a2562121f1 Mon Sep 17 00:00:00 2001 From: Sudip Tiwari Date: Wed, 11 Oct 2023 23:55:18 +0545 Subject: [PATCH 7/9] format the code and comments --- bit_manipulation/binary_addition.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bit_manipulation/binary_addition.py b/bit_manipulation/binary_addition.py index 197e05f129e9..79747638e4c3 100644 --- a/bit_manipulation/binary_addition.py +++ b/bit_manipulation/binary_addition.py @@ -54,10 +54,10 @@ def binary_xor(input1: str, input2: str) -> str: return "1" -def addition(number_1: str, number_2: str, number_of_bits: int) -> (str, str): +def addition(number_1: str, number_2: str, number_of_bits: int) -> tuple[str, str]: """ return tuple with ('sum','carry') - The number of bits in 'sum' is same as the value of integer argument number_of_bits passed to the function. + The number of bits in 'sum' is same as the value of number_of_bits passed to the function. (i.e, if number_of_bits = 5, the length of 'sum' will also be 5). Explanation: The formula of sum and carry for each bit in binary operations are: @@ -81,7 +81,7 @@ def addition(number_1: str, number_2: str, number_of_bits: int) -> (str, str): . and so on. - The numbers are reversed before operation so that the individual bits are traversed from right to left. + The numbers are reversed so that the individual bits are traversed from right to left. Finally, the resultant sum is reversed again to retain the original format. >>> addition('1010','1101', 4) @@ -102,7 +102,7 @@ def addition(number_1: str, number_2: str, number_of_bits: int) -> (str, str): ('111', '0') Do not perform an operation as this >>> addition('101','10', 2). - Since adding 3-bit number with any other number results to atleast 3 bit number + Since adding 3-bit number with any other number results to at least 3 bit number but you are expecting a 2 bit number which is not possible. """ number_1 = number_1.zfill(number_of_bits) # zero padding at front From 1fcfc0a45cbcecbe56dfd781b5f97bd8f651ca65 Mon Sep 17 00:00:00 2001 From: Sudip Tiwari Date: Thu, 12 Oct 2023 00:25:40 +0545 Subject: [PATCH 8/9] format the code and comments --- bit_manipulation/binary_addition.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bit_manipulation/binary_addition.py b/bit_manipulation/binary_addition.py index 79747638e4c3..99b4eaa58378 100644 --- a/bit_manipulation/binary_addition.py +++ b/bit_manipulation/binary_addition.py @@ -57,10 +57,11 @@ def binary_xor(input1: str, input2: str) -> str: def addition(number_1: str, number_2: str, number_of_bits: int) -> tuple[str, str]: """ return tuple with ('sum','carry') - The number of bits in 'sum' is same as the value of number_of_bits passed to the function. + The number of bits in 'sum' = number_of_bits passed to the function. (i.e, if number_of_bits = 5, the length of 'sum' will also be 5). - Explanation: The formula of sum and carry for each bit in binary operations are: + Explanation: + The formula of sum and carry for each bit in binary operations are: carry: C5 C4 C3 C2 C1 C0 number_1: A4 A3 A2 A1 A0 number_2: + B4 B3 B2 B1 B0 @@ -81,7 +82,7 @@ def addition(number_1: str, number_2: str, number_of_bits: int) -> tuple[str, st . and so on. - The numbers are reversed so that the individual bits are traversed from right to left. + The numbers are reversed so that individual bits are traversed from R to L. Finally, the resultant sum is reversed again to retain the original format. >>> addition('1010','1101', 4) From 6d1b5b8e6c7876b11c496ab0366aa05f212f2308 Mon Sep 17 00:00:00 2001 From: cclauss Date: Tue, 15 Sep 2026 12:01:36 +0000 Subject: [PATCH 9/9] updating DIRECTORY.md --- DIRECTORY.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/DIRECTORY.md b/DIRECTORY.md index d6ceb04a62eb..f76c0ee88c63 100644 --- a/DIRECTORY.md +++ b/DIRECTORY.md @@ -62,6 +62,7 @@ * [Generate Parentheses Iterative](backtracking/generate_parentheses_iterative.py) * [Hamiltonian Cycle](backtracking/hamiltonian_cycle.py) * [Knight Tour](backtracking/knight_tour.py) + * [M Coloring Problem](backtracking/m_coloring_problem.py) * [Match Word Pattern](backtracking/match_word_pattern.py) * [Minimax](backtracking/minimax.py) * [N Queens](backtracking/n_queens.py) @@ -75,6 +76,7 @@ * [Word Search](backtracking/word_search.py) ## [Bit Manipulation](bit_manipulation) + * [Binary Addition](bit_manipulation/binary_addition.py) * [Binary And Operator](bit_manipulation/binary_and_operator.py) * [Binary Coded Decimal](bit_manipulation/binary_coded_decimal.py) * [Binary Count Setbits](bit_manipulation/binary_count_setbits.py) @@ -108,6 +110,9 @@ ## [Blockchain](blockchain) * [Diophantine Equation](blockchain/diophantine_equation.py) + * [Merkle Tree](blockchain/merkle_tree.py) + * [Simple Blockchain](blockchain/simple_blockchain.py) + * [Simple Proof Of Work](blockchain/simple_proof_of_work.py) ## [Boolean Algebra](boolean_algebra) * [And Gate](boolean_algebra/and_gate.py) @@ -166,6 +171,7 @@ * [Porta Cipher](ciphers/porta_cipher.py) * [Rabin Miller](ciphers/rabin_miller.py) * [Rail Fence Cipher](ciphers/rail_fence_cipher.py) + * [Rc4](ciphers/rc4.py) * [Rot13](ciphers/rot13.py) * [Rsa Cipher](ciphers/rsa_cipher.py) * [Rsa Factorization](ciphers/rsa_factorization.py) @@ -180,6 +186,7 @@ * [Vernam Cipher](ciphers/vernam_cipher.py) * [Vigenere Cipher](ciphers/vigenere_cipher.py) * [Xor Cipher](ciphers/xor_cipher.py) + * [Xtea](ciphers/xtea.py) ## [Computer Vision](computer_vision) * [Cnn Classification](computer_vision/cnn_classification.py) @@ -198,6 +205,9 @@ ## [Conversions](conversions) * [Astronomical Length Scale Conversion](conversions/astronomical_length_scale_conversion.py) * [Binary To Decimal](conversions/binary_to_decimal.py) + * [Binary To Excess3](conversions/binary_to_excess3.py) + * [Binary To Gray](conversions/binary_to_gray.py) + * [Binary To Gray Code](conversions/binary_to_gray_code.py) * [Binary To Hexadecimal](conversions/binary_to_hexadecimal.py) * [Binary To Octal](conversions/binary_to_octal.py) * [Convert Number To Words](conversions/convert_number_to_words.py) @@ -205,6 +215,7 @@ * [Decimal To Binary](conversions/decimal_to_binary.py) * [Decimal To Hexadecimal](conversions/decimal_to_hexadecimal.py) * [Decimal To Octal](conversions/decimal_to_octal.py) + * [Endianness](conversions/endianness.py) * [Energy Conversions](conversions/energy_conversions.py) * [Excel Title To Column](conversions/excel_title_to_column.py) * [Hex To Bin](conversions/hex_to_bin.py) @@ -689,6 +700,7 @@ * [Astar](machine_learning/astar.py) * [Automatic Differentiation](machine_learning/automatic_differentiation.py) * [Data Transformations](machine_learning/data_transformations.py) + * [Dbscan](machine_learning/dbscan.py) * [Decision Tree](machine_learning/decision_tree.py) * [Dimensionality Reduction](machine_learning/dimensionality_reduction.py) * [Federated Averaging](machine_learning/federated_averaging.py) @@ -712,15 +724,18 @@ * [Loss Functions](machine_learning/loss_functions.py) * Lstm * [Lstm Prediction](machine_learning/lstm/lstm_prediction.py) + * [Mean Shift](machine_learning/mean_shift.py) * [Mfcc](machine_learning/mfcc.py) * [Mini Batch Gradient Descent](machine_learning/mini_batch_gradient_descent.py) * [Multilayer Perceptron Classifier](machine_learning/multilayer_perceptron_classifier.py) + * [Naive Bayes Text Classification](machine_learning/naive_bayes_text_classification.py) * [Ordinary Least Squares Regression](machine_learning/ordinary_least_squares_regression.py) * [Polynomial Regression](machine_learning/polynomial_regression.py) * [Principle Component Analysis](machine_learning/principle_component_analysis.py) * [Q Learning](machine_learning/q_learning.py) * [Random Forest Classifier](machine_learning/random_forest_classifier.py) * [Random Forest Regressor](machine_learning/random_forest_regressor.py) + * [Rmsprop](machine_learning/rmsprop.py) * [Scoring Functions](machine_learning/scoring_functions.py) * [Self Organizing Map](machine_learning/self_organizing_map.py) * [Sequential Minimum Optimization](machine_learning/sequential_minimum_optimization.py) @@ -737,6 +752,7 @@ * [Arc Length](maths/arc_length.py) * [Area](maths/area.py) * [Area Under Curve](maths/area_under_curve.py) + * [Autocorrelation](maths/autocorrelation.py) * [Average Absolute Deviation](maths/average_absolute_deviation.py) * [Average Mean](maths/average_mean.py) * [Average Median](maths/average_median.py) @@ -782,6 +798,7 @@ * [Fibonacci](maths/fibonacci.py) * [Find Max](maths/find_max.py) * [Find Min](maths/find_min.py) + * [First Fundamental Form](maths/first_fundamental_form.py) * [Floor](maths/floor.py) * [Gamma](maths/gamma.py) * [Gaussian](maths/gaussian.py) @@ -844,6 +861,7 @@ * [Square Root](maths/numerical_analysis/square_root.py) * [Weierstrass Method](maths/numerical_analysis/weierstrass_method.py) * [Odd Sieve](maths/odd_sieve.py) + * [Padovan Sequence](maths/padovan_sequence.py) * [Pell Number](maths/pell_number.py) * [Perfect Cube](maths/perfect_cube.py) * [Perfect Number](maths/perfect_number.py) @@ -873,6 +891,8 @@ * [Reverse Factorial Recursive](maths/reverse_factorial_recursive.py) * [Segmented Sieve](maths/segmented_sieve.py) * Series + * [Alternate Harmonic Series](maths/series/alternate_harmonic_series.py) + * [Alternating Harmonic Series](maths/series/alternating_harmonic_series.py) * [Arithmetic](maths/series/arithmetic.py) * [Geometric](maths/series/geometric.py) * [Geometric Series](maths/series/geometric_series.py) @@ -912,6 +932,7 @@ * [Polygonal Numbers](maths/special_numbers/polygonal_numbers.py) * [Pronic Number](maths/special_numbers/pronic_number.py) * [Proth Number](maths/special_numbers/proth_number.py) + * [Spy Number](maths/special_numbers/spy_number.py) * [Triangular Numbers](maths/special_numbers/triangular_numbers.py) * [Trimorphic Number](maths/special_numbers/trimorphic_number.py) * [Ugly Numbers](maths/special_numbers/ugly_numbers.py)