From db5d5519084aaf928e8076e7238d9a042674aa54 Mon Sep 17 00:00:00 2001 From: Souvik Deb <62352386+Souvikdeb2612@users.noreply.github.com> Date: Thu, 22 Oct 2020 00:29:53 +0530 Subject: [PATCH 01/15] Create minutesToHoursFunc.py --- mathgenerator/funcs/minutesToHoursFunc.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 mathgenerator/funcs/minutesToHoursFunc.py diff --git a/mathgenerator/funcs/minutesToHoursFunc.py b/mathgenerator/funcs/minutesToHoursFunc.py new file mode 100644 index 0000000..1ca1b89 --- /dev/null +++ b/mathgenerator/funcs/minutesToHoursFunc.py @@ -0,0 +1,12 @@ +from .__init__ import * + + +def minutesToHoursFunc(maxMinutes=999): + minutes = random.randint(1, maxMinutes) + hours1 = int(minutes/60) + hours2 = minutes%60 + problem = f"Convert {minutes} minutes to Hours & Minutes" + solution = f"minutes_to_hours(230) = {hours1}h:{hours2}m" + return problem, solution + + minutesToHours = Generator("Minute to Hour conversion", 96 , "Convert minutes to Hours & Minutes", "hours:minutes", minutesToHoursFunc) From 48aace1282d04541b6864719e4647f4e5c104881 Mon Sep 17 00:00:00 2001 From: Souvik Deb <62352386+Souvikdeb2612@users.noreply.github.com> Date: Thu, 22 Oct 2020 00:30:48 +0530 Subject: [PATCH 02/15] Update __init__.py --- mathgenerator/funcs/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/mathgenerator/funcs/__init__.py b/mathgenerator/funcs/__init__.py index 034322b..19b52cc 100644 --- a/mathgenerator/funcs/__init__.py +++ b/mathgenerator/funcs/__init__.py @@ -100,3 +100,4 @@ from .complex_to_polar import * from .set_operation import * from .base_conversion import * from .curved_surface_area_cylinder import * +from .minutesToHours import * From 2885073aa2580bf68b1dfa5361a1a15af4fa75bb Mon Sep 17 00:00:00 2001 From: Souvik Deb <62352386+Souvikdeb2612@users.noreply.github.com> Date: Thu, 22 Oct 2020 00:32:00 +0530 Subject: [PATCH 03/15] Update minutesToHoursFunc.py --- mathgenerator/funcs/minutesToHoursFunc.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mathgenerator/funcs/minutesToHoursFunc.py b/mathgenerator/funcs/minutesToHoursFunc.py index 1ca1b89..7a21816 100644 --- a/mathgenerator/funcs/minutesToHoursFunc.py +++ b/mathgenerator/funcs/minutesToHoursFunc.py @@ -9,4 +9,5 @@ def minutesToHoursFunc(maxMinutes=999): solution = f"minutes_to_hours(230) = {hours1}h:{hours2}m" return problem, solution - minutesToHours = Generator("Minute to Hour conversion", 96 , "Convert minutes to Hours & Minutes", "hours:minutes", minutesToHoursFunc) + +minutesToHours = Generator("Minute to Hour conversion", 96 , "Convert minutes to Hours & Minutes", "hours:minutes", minutesToHoursFunc) From f7549873064114a35d1e35d67dd8643e8adf0987 Mon Sep 17 00:00:00 2001 From: Yogesh Patil Date: Thu, 22 Oct 2020 09:15:07 +0530 Subject: [PATCH 04/15] Added Decimal To BCD Function File --- mathgenerator/funcs/decimal_to_bcd.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 mathgenerator/funcs/decimal_to_bcd.py diff --git a/mathgenerator/funcs/decimal_to_bcd.py b/mathgenerator/funcs/decimal_to_bcd.py new file mode 100644 index 0000000..f9b235c --- /dev/null +++ b/mathgenerator/funcs/decimal_to_bcd.py @@ -0,0 +1,22 @@ +from .__init__ import * + + +def DecimalToBCDFunc(maxNumber=10000): + n = random.randint(1000, maxNumber) + x=n + binstring = '' + bcdstring = '' + while x > 0: + nibble = x % 16 + bcdstring = str(nibble) + bcdstring + x >>= 4 + + problem = "BCD of Decimal Number " + str(n) + " is = " + solution = int(bcdstring) + return problem, solution + +decimal_to_bcd = Generator("Decimal to Binary Coded Decimal", 101, + "Binary Coded Decimal of Decimal n is ", "b", + DecimalToBCDFunc) + +##for readme ## | 101 | Decimal to Binary Coded Decimal | Binary Coded Decimal of Decimal 34 is = | 22 | decimal_to_bcd | From 7e4c1c5dfa06dfc720e5000ebd7b03d4d963faa7 Mon Sep 17 00:00:00 2001 From: Yogesh Patil Date: Thu, 22 Oct 2020 09:52:32 +0530 Subject: [PATCH 05/15] Added is Leap Year Function File --- mathgenerator/funcs/is_leap_year.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 mathgenerator/funcs/is_leap_year.py diff --git a/mathgenerator/funcs/is_leap_year.py b/mathgenerator/funcs/is_leap_year.py new file mode 100644 index 0000000..1f79c2b --- /dev/null +++ b/mathgenerator/funcs/is_leap_year.py @@ -0,0 +1,24 @@ +from .__init__ import * + + +def IsLeapYear(minNumber=1900, maxNumber=2099): + year = random.randint(minNumber, maxNumber) + problem = "Year " + str(year) + " " + solution = "" + if (year % 4) == 0: + if (year % 100) == 0: + if (year % 400) == 0: + solution = "is a leap year" + else: + solution = "is not a leap year" + else: + solution = "is a leap year" + else: + solution = "is not a leap year" + + return problem, solution + +is_leap_year = Generator("Leap Year or Not", 102, + "Year y ", "is/not a leap year", + IsLeapYear) +##for readme ## | 102 | Leap Year or Not | Year 1964 | is a leap year | is_leap_year | From 9cb16282e1ed9f403b88a38e9cf7a3f5c4f5c041 Mon Sep 17 00:00:00 2001 From: Raghav Aggarwal <38751567+AggRag@users.noreply.github.com> Date: Fri, 23 Oct 2020 13:06:42 +0530 Subject: [PATCH 06/15] Add files via upload --- mathgenerator/funcs/circumference.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 mathgenerator/funcs/circumference.py diff --git a/mathgenerator/funcs/circumference.py b/mathgenerator/funcs/circumference.py new file mode 100644 index 0000000..30c5fae --- /dev/null +++ b/mathgenerator/funcs/circumference.py @@ -0,0 +1,14 @@ + +from .__init__ import * + + +def circumferenceCircle(maxRadius=100): + r = random.randint(0, maxRadius) + pi = 22/7 + circumference = 2*pi*r + problem = f"Circumference of circle with radius {r}" + solution = circumference + return problem, solution + + +circumferenceCircle = Generator("Circumference", 62, "2*pi*r=", "circumference", circumferenceCircle) From 07419e6a0f5399450c442fc5c2378a2b99adad96 Mon Sep 17 00:00:00 2001 From: shyambhu Date: Fri, 23 Oct 2020 18:47:11 +0530 Subject: [PATCH 07/15] added combine like terms for #39. --- mathgenerator/funcs/likeTermCombineFunc.py | 51 ++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 mathgenerator/funcs/likeTermCombineFunc.py diff --git a/mathgenerator/funcs/likeTermCombineFunc.py b/mathgenerator/funcs/likeTermCombineFunc.py new file mode 100644 index 0000000..aa146ca --- /dev/null +++ b/mathgenerator/funcs/likeTermCombineFunc.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +""" +Created on Fri Oct 23 15:44:50 2020 + +@author: shyambhu.mukherjee +""" + +from .__init__ import * + + +def likeTermCombineFunc(maxCoef=10, maxExp=20, maxTerms=10): + numTerms = random.randint(1, maxTerms) + problem = "" + solution = "" + + for i in range(numTerms): + if i > 0: + problem += " + " + solution += " + " + coefficient = random.randint(1, maxCoef) + exponent = random.randint(1, max(numTerms-1,2)) + + problem += str(coefficient) + "x^" + str(exponent) + + solution = combineTerms(problem) + return problem, solution + + +def combineTerms(string): + each_terms = string.split("+") + dict_power_wise_terms = {} + for i in range(11): dict_power_wise_terms[i] = [] + for term in each_terms: + term = term.split("^") + appendee = term[0].split("x")[0] + if len(term) == 1: + dict_power_wise_terms[1].append(int(appendee)) + else: + dict_power_wise_terms[int(term[1])].append(int(appendee)) + #print(dict_power_wise_terms) + final_string = '' + for i in range(11): + if len(dict_power_wise_terms[i]) != 0: + total = sum(dict_power_wise_terms[i]) + final_string += str(total)+"x^"+str(i) + " + " + final_string = '+'.join(final_string.split("+")[:-1]) + return final_string + +power_rule_integration = Generator("Power Rule Integration", 48, "nx^m=", + "(n/m)x^(m+1)", powerRuleIntegrationFunc) From d4bf6e523d69386dd577453445ad37340da2ce0e Mon Sep 17 00:00:00 2001 From: shyambhu Date: Fri, 23 Oct 2020 19:00:19 +0530 Subject: [PATCH 08/15] added lint fix for liketerm file. --- mathgenerator/funcs/likeTermCombineFunc.py | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/mathgenerator/funcs/likeTermCombineFunc.py b/mathgenerator/funcs/likeTermCombineFunc.py index aa146ca..21e1b6f 100644 --- a/mathgenerator/funcs/likeTermCombineFunc.py +++ b/mathgenerator/funcs/likeTermCombineFunc.py @@ -1,11 +1,3 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -""" -Created on Fri Oct 23 15:44:50 2020 - -@author: shyambhu.mukherjee -""" - from .__init__ import * @@ -19,7 +11,7 @@ def likeTermCombineFunc(maxCoef=10, maxExp=20, maxTerms=10): problem += " + " solution += " + " coefficient = random.randint(1, maxCoef) - exponent = random.randint(1, max(numTerms-1,2)) + exponent = random.randint(1, max(numTerms - 1, 2)) problem += str(coefficient) + "x^" + str(exponent) @@ -30,7 +22,8 @@ def likeTermCombineFunc(maxCoef=10, maxExp=20, maxTerms=10): def combineTerms(string): each_terms = string.split("+") dict_power_wise_terms = {} - for i in range(11): dict_power_wise_terms[i] = [] + for i in range(11): + dict_power_wise_terms[i] = [] for term in each_terms: term = term.split("^") appendee = term[0].split("x")[0] @@ -38,14 +31,15 @@ def combineTerms(string): dict_power_wise_terms[1].append(int(appendee)) else: dict_power_wise_terms[int(term[1])].append(int(appendee)) - #print(dict_power_wise_terms) + final_string = '' for i in range(11): if len(dict_power_wise_terms[i]) != 0: total = sum(dict_power_wise_terms[i]) - final_string += str(total)+"x^"+str(i) + " + " + final_string += str(total)+"x^" + str(i) + " + " final_string = '+'.join(final_string.split("+")[:-1]) return final_string -power_rule_integration = Generator("Power Rule Integration", 48, "nx^m=", - "(n/m)x^(m+1)", powerRuleIntegrationFunc) + +combineLikeTerm = Generator("Combine Like terms", 102, "nx^m+lx^k+bx^m", + "(n+b)x^m+lx^k", likeTermCombineFunc) From ae8700576a2045be06d91cf28dea01388eac94d4 Mon Sep 17 00:00:00 2001 From: shyambhu Date: Fri, 23 Oct 2020 19:05:35 +0530 Subject: [PATCH 09/15] trying to pass test. --- mathgenerator/funcs/likeTermCombineFunc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mathgenerator/funcs/likeTermCombineFunc.py b/mathgenerator/funcs/likeTermCombineFunc.py index 21e1b6f..904b6ce 100644 --- a/mathgenerator/funcs/likeTermCombineFunc.py +++ b/mathgenerator/funcs/likeTermCombineFunc.py @@ -22,7 +22,7 @@ def likeTermCombineFunc(maxCoef=10, maxExp=20, maxTerms=10): def combineTerms(string): each_terms = string.split("+") dict_power_wise_terms = {} - for i in range(11): + for i in range(11): dict_power_wise_terms[i] = [] for term in each_terms: term = term.split("^") @@ -36,7 +36,7 @@ def combineTerms(string): for i in range(11): if len(dict_power_wise_terms[i]) != 0: total = sum(dict_power_wise_terms[i]) - final_string += str(total)+"x^" + str(i) + " + " + final_string += str(total) + "x^" + str(i) + " + " final_string = '+'.join(final_string.split("+")[:-1]) return final_string From 72e88ac2d923a10dc7cdb24819b1530f20ed5b71 Mon Sep 17 00:00:00 2001 From: lukew3 Date: Fri, 23 Oct 2020 13:33:37 -0400 Subject: [PATCH 10/15] leap year fixes --- README.md | 196 ++++++++++++++-------------- mathgenerator/funcs/__init__.py | 1 + mathgenerator/funcs/is_leap_year.py | 11 +- test.py | 3 +- 4 files changed, 107 insertions(+), 104 deletions(-) diff --git a/README.md b/README.md index f215bfe..4fe1e18 100644 --- a/README.md +++ b/README.md @@ -31,104 +31,104 @@ problem, solution = mathgen.genById(0) | Id | Skill | Example problem | Example Solution | Function Name | |------|-----------------------------------|--------------------|-----------------------|--------------------------| [//]: # list start -| 0 | Addition | 20+38= | 58 | addition | -| 1 | Subtraction | 2-0= | 2 | subtraction | -| 2 | Multiplication | 31*1= | 31 | multiplication | -| 3 | Division | 53/7= | 7.571428571428571 | division | -| 4 | Binary Complement 1s | 111= | 000 | binary_complement_1s | -| 5 | Modulo Division | 90%6= | 0 | modulo_division | +| 0 | Addition | 20+9= | 29 | addition | +| 1 | Subtraction | 52-50= | 2 | subtraction | +| 2 | Multiplication | 53*1= | 53 | multiplication | +| 3 | Division | 35/79= | 0.4430379746835443 | division | +| 4 | Binary Complement 1s | 011011= | 100100 | binary_complement_1s | +| 5 | Modulo Division | 27%39= | 27 | modulo_division | | 6 | Square Root | sqrt(16)= | 4 | square_root | -| 7 | Power Rule Differentiation | 7x^5 + 8x^10 + 4x^1 + 4x^5 + 7x^3 | 35x^4 + 80x^9 + 4x^0 + 20x^4 + 21x^2 | power_rule_differentiation | -| 8 | Square | 9^2= | 81 | square | -| 9 | LCM (Least Common Multiple) | LCM of 20 and 5 = | 20 | lcm | -| 10 | GCD (Greatest Common Denominator) | GCD of 11 and 2 = | 1 | gcd | -| 11 | Basic Algebra | 10x + 4 = 8 | 2/5 | basic_algebra | -| 12 | Logarithm | log3(2187) | 7 | log | -| 13 | Easy Division | 247/19 = | 13 | int_division | -| 14 | Decimal to Binary | Binary of 13= | 1101 | decimal_to_binary | -| 15 | Binary to Decimal | 001 | 1 | binary_to_decimal | -| 16 | Fraction Division | (6/9)/(4/2) | 1/3 | divide_fractions | -| 17 | Integer Multiplication with 2x2 Matrix | 11 * [[5, 2], [0, 8]] = | [[55,22],[0,88]] | multiply_int_to_22_matrix | -| 18 | Area of Triangle | Area of triangle with side lengths: 10 2 11 = | 9.051933495115836 | area_of_triangle | -| 19 | Triangle exists check | Does triangle with sides 35, 7 and 11 exist? | No | valid_triangle | -| 20 | Midpoint of the two point | (12,-4),(-4,9)= | (4.0,2.5) | midpoint_of_two_points | -| 21 | Factoring Quadratic | x^2-3x-28 | (x-7)(x+4) | factoring | -| 22 | Third Angle of Triangle | Third angle of triangle with angles 50 and 19 = | 111 | third_angle_of_triangle | -| 23 | Solve a System of Equations in R^2 | -6x - 4y = -2, x + 10y = 47 | x = -3, y = 5 | system_of_equations | -| 24 | Distance between 2 points | Find the distance between (16, 20) and (-9, 14) | sqrt(661) | distance_two_points | -| 25 | Pythagorean Theorem | The hypotenuse of a right triangle given the other two lengths 7 and 3 = | 7.62 | pythagorean_theorem | -| 26 | Linear Equations | 14x + -10y = -26, 15x + -11y = -29 | x = 1, y = 4 | linear_equations | -| 27 | Prime Factorisation | Find prime factors of 29 | [29] | prime_factors | -| 28 | Fraction Multiplication | (3/7)*(10/3) | 10/7 | fraction_multiplication | -| 29 | Angle of a Regular Polygon | Find the angle of a regular polygon with 18 sides | 160.0 | angle_regular_polygon | -| 30 | Combinations of Objects | Number of combinations from 12 objects picked 5 at a time | 792 | combinations | +| 7 | Power Rule Differentiation | 7x^5 | 35x^4 | power_rule_differentiation | +| 8 | Square | 10^2= | 100 | square | +| 9 | LCM (Least Common Multiple) | LCM of 14 and 14 = | 14 | lcm | +| 10 | GCD (Greatest Common Denominator) | GCD of 17 and 7 = | 1 | gcd | +| 11 | Basic Algebra | 6x + 5 = 5 | 0 | basic_algebra | +| 12 | Logarithm | log2(64) | 6 | log | +| 13 | Easy Division | 252/12 = | 21 | int_division | +| 14 | Decimal to Binary | Binary of 19= | 10011 | decimal_to_binary | +| 15 | Binary to Decimal | 1000010100 | 532 | binary_to_decimal | +| 16 | Fraction Division | (10/9)/(10/8) | 8/9 | divide_fractions | +| 17 | Integer Multiplication with 2x2 Matrix | 15 * [[5, 3], [3, 2]] = | [[75,45],[45,30]] | multiply_int_to_22_matrix | +| 18 | Area of Triangle | Area of triangle with side lengths: 3 17 2 = | (4.221036154550547e-15+68.93475175845634j) | area_of_triangle | +| 19 | Triangle exists check | Does triangle with sides 24, 20 and 17 exist? | Yes | valid_triangle | +| 20 | Midpoint of the two point | (4,-10),(2,4)= | (3.0,-3.0) | midpoint_of_two_points | +| 21 | Factoring Quadratic | x^2-3x-54 | (x+6)(x-9) | factoring | +| 22 | Third Angle of Triangle | Third angle of triangle with angles 6 and 29 = | 145 | third_angle_of_triangle | +| 23 | Solve a System of Equations in R^2 | - 5y = -20, 3x + 9y = 9 | x = -9, y = 4 | system_of_equations | +| 24 | Distance between 2 points | Find the distance between (-2, -4) and (21, -13) | sqrt(610) | distance_two_points | +| 25 | Pythagorean Theorem | The hypotenuse of a right triangle given the other two lengths 16 and 11 = | 19.42 | pythagorean_theorem | +| 26 | Linear Equations | 11x + 4y = -72, 17x + -18y = -208 | x = -8, y = 4 | linear_equations | +| 27 | Prime Factorisation | Find prime factors of 88 | [2, 2, 2, 11] | prime_factors | +| 28 | Fraction Multiplication | (7/3)*(2/10) | 7/15 | fraction_multiplication | +| 29 | Angle of a Regular Polygon | Find the angle of a regular polygon with 9 sides | 140.0 | angle_regular_polygon | +| 30 | Combinations of Objects | Number of combinations from 16 objects picked 6 at a time | 8008 | combinations | | 31 | Factorial | 2! = | 2 | factorial | -| 32 | Surface Area of Cube | Surface area of cube with side = 9m is | 486 m^2 | surface_area_cube | -| 33 | Surface Area of Cuboid | Surface area of cuboid with sides = 19m, 9m, 6m is | 678 m^2 | surface_area_cuboid | -| 34 | Surface Area of Cylinder | Surface area of cylinder with height = 39m and radius = 6m is | 1696 m^2 | surface_area_cylinder | -| 35 | Volum of Cube | Volume of cube with side = 14m is | 2744 m^3 | volume_cube | -| 36 | Volume of Cuboid | Volume of cuboid with sides = 4m, 19m, 20m is | 1520 m^3 | volume_cuboid | -| 37 | Volume of cylinder | Volume of cylinder with height = 27m and radius = 4m is | 1357 m^3 | volume_cylinder | -| 38 | Surface Area of cone | Surface area of cone with height = 47m and radius = 15m is | 3031 m^2 | surface_area_cone | -| 39 | Volume of cone | Volume of cone with height = 46m and radius = 1m is | 48 m^3 | volume_cone | -| 40 | Common Factors | Common Factors of 5 and 89 = | [1] | common_factors | -| 41 | Intersection of Two Lines | Find the point of intersection of the two lines: y = -10x - 3 and y = -10/5x - 4 | (1/8, -17/4) | intersection_of_two_lines | -| 42 | Permutations | Number of Permutations from 17 objects picked 6 at a time = | 8910720 | permutation | -| 43 | Cross Product of 2 Vectors | [14, -7, -18] X [3, -16, 12] = | [-372, -222, -203] | vector_cross | -| 44 | Compare Fractions | Which symbol represents the comparison between 6/7 and 2/1? | < | compare_fractions | -| 45 | Simple Interest | Simple interest for a principle amount of 1752 dollars, 10% rate of interest and for a time period of 5 years is = | 876.0 | simple_interest | -| 46 | Multiplication of two matrices | Multiply
-27-10
0-4-9
21010
and
6-6
-53
610
|
-107-67
-34-102
22118
| matrix_multiplication | -| 47 | Cube Root | cuberoot of 212 upto 2 decimal places is: | 5.96 | cube_root | -| 48 | Power Rule Integration | 4x^4 | (4/4)x^5 + c | power_rule_integration | -| 49 | Fourth Angle of Quadrilateral | Fourth angle of quadrilateral with angles 81 , 131, 8 = | 140 | fourth_angle_of_quadrilateral | -| 50 | Quadratic Equation | Zeros of the Quadratic Equation 66x^2+177x+45=0 | [-0.28, -2.4] | quadratic_equation | -| 51 | HCF (Highest Common Factor) | HCF of 8 and 10 = | 2 | hcf | -| 52 | Probability of a certain sum appearing on faces of dice | If 2 dice are rolled at the same time, the probability of getting a sum of 7 = | 6/36 | dice_sum_probability | -| 53 | Exponentiation | 16^3 = | 4096 | exponentiation | -| 54 | Confidence interval For sample S | The confidence interval for sample [240, 211, 206, 296, 223, 220, 264, 251, 245, 248, 207, 215, 277, 274, 297, 243, 278, 292, 256, 233, 266, 236, 270, 227, 209, 258, 298] with 99% confidence is | (263.9293815733304, 235.32987768592884) | confidence_interval | -| 55 | Comparing surds | Fill in the blanks 63^(1/2) _ 37^(1/4) | > | surds_comparison | -| 56 | Fibonacci Series | The Fibonacci Series of the first 12 numbers is ? | [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] | fibonacci_series | -| 57 | Trigonometric Values | What is sin(0)? | 0 | basic_trigonometry | -| 58 | Sum of Angles of Polygon | Sum of angles of polygon with 7 sides = | 900 | sum_of_polygon_angles | -| 59 | Mean,Standard Deviation,Variance | Find the mean,standard deviation and variance for the data[30, 21, 26, 36, 34, 7, 46, 21, 15, 29, 9, 33, 16, 28, 43] | The Mean is 26.266666666666666 , Standard Deviation is 123.39555555555556, Variance is 11.108355213781902 | data_summary | -| 60 | Surface Area of Sphere | Surface area of Sphere with radius = 6m is | 452.3893421169302 m^2 | surface_area_sphere | -| 61 | Volume of Sphere | Volume of sphere with radius 10 m = | 4188.790204786391 m^3 | volume_sphere | -| 62 | nth Fibonacci number | What is the 41th Fibonacci number? | 165580141 | nth_fibonacci_number | -| 63 | Profit or Loss Percent | Profit percent when CP = 411 and SP = 499 is: | 21.41119221411192 | profit_loss_percent | -| 64 | Binary to Hexidecimal | 00010 | 0x2 | binary_to_hex | -| 65 | Multiplication of 2 complex numbers | (-2-6j) * (-10+2j) = | (32+56j) | multiply_complex_numbers | -| 66 | Geometric Progression | For the given GP [7, 77, 847, 9317, 102487, 1127357] ,Find the value of a,common ratio,8th term value, sum upto 7th term | The value of a is 7, common ratio is 11 , 8th term is 136410197 , sum upto 7th term is 13641019.0 | geometric_progression | -| 67 | Geometric Mean of N Numbers | Geometric mean of 4 numbers 76 , 98 , 2 , 58 = | (76*98*2*58)^(1/4) = 30.487682589384825 | geometric_mean | -| 68 | Harmonic Mean of N Numbers | Harmonic mean of 3 numbers 77 , 98 and 69 = | 3/((1/77) + (1/98) + (1/69)) = 79.60970388869067 | harmonic_mean | -| 69 | Euclidian norm or L2 norm of a vector | Euclidian norm or L2 norm of the vector[229.4364953887822, 570.6032154600009, 199.52328312454694, 658.3975413255898, 605.9566521345233, 616.6627240713517, 572.9546490919761, 508.8683987353998, 666.172347641998, 865.2735159823208, 594.8620516188639, 418.8436115273115, 69.46437421671337, 385.84806581739593] is: | 2015.3622923166513 | euclidian_norm | -| 70 | Angle between 2 vectors | angle between the vectors [954.08, 488.66, 694.46, 127.67, 912.65, 462.11, 713.4, 179.41, 728.87, 811.04, 760.22, 688.68, 444.93, 237.29, 485.89, 565.71, 520.56, 44.1, 684.62, 665.12] and [736.88, 60.8, 240.61, 677.58, 887.06, 73.3, 470.5, 884.06, 453.97, 168.97, 921.73, 538.36, 967.82, 236.94, 51.62, 402.46, 57.88, 166.91, 676.47, 708.47] is: | 0.63 radians | angle_btw_vectors | -| 71 | Absolute difference between two numbers | Absolute difference between numbers -87 and 69 = | 156 | absolute_difference | -| 72 | Dot Product of 2 Vectors | [14, -1, 7] . [-12, 15, -9] = | -246 | vector_dot | -| 73 | Binary 2's Complement | 2's complement of 11010 = | 110 | binary_2s_complement | -| 74 | Inverse of a Matrix | Inverse of Matrix Matrix([[17, 31, 76], [3, 65, 91], [42, 2, 28]]) is: | Matrix([[-273/10550, 179/15825, 2119/63300], [-623/10550, 679/15825, 1319/63300], [227/5275, -317/15825, -253/15825]]) | invert_matrix | -| 75 | Area of a Sector | Given radius, 4 and angle, 2. Find the area of the sector. | Area of sector = 0.27925 | sector_area | -| 76 | Mean and Median | Given the series of numbers [87, 97, 75, 27, 91, 31, 15, 40, 73, 74]. find the arithmatic mean and mdian of the series | Arithmetic mean of the series is 61.0 and Arithmetic median of this series is 73.5 | mean_median | -| 77 | Determinant to 2x2 Matrix | Det([[83, 41], [15, 13]]) = | 464 | int_matrix_22_determinant | -| 78 | Compound Interest | Compound interest for a principle amount of 2702 dollars, 7% rate of interest and for a time period of 2 year is = | 3093.52 | compound_interest | -| 79 | Decimal to Hexadecimal | Binary of 386= | 0x182 | decimal_to_hexadeci | -| 80 | Percentage of a number | What is 64% of 8? | Required percentage = 5.12% | percentage | -| 81 | Celsius To Fahrenheit | Convert 50 degrees Celsius to degrees Fahrenheit = | 122.0 | celsius_to_fahrenheit | -| 82 | AP Term Calculation | Find the term number 89 of the AP series: -35, -98, -161 ... | -5579 | arithmetic_progression_term | -| 83 | AP Sum Calculation | Find the sum of first 63 terms of the AP series: 7, 100, 193 ... | 182070.0 | arithmetic_progression_sum | -| 84 | Converts decimal to octal | The decimal number 265 in Octal is: | 0o411 | decimal_to_octal | -| 85 | Converts decimal to Roman Numerals | The number 1439 in Roman Numerals is: | MCDXXXIX | decimal_to_roman_numerals | -| 86 | Degrees to Radians | Angle 68 in radians is = | 1.19 | degree_to_rad | +| 32 | Surface Area of Cube | Surface area of cube with side = 3m is | 54 m^2 | surface_area_cube | +| 33 | Surface Area of Cuboid | Surface area of cuboid with sides = 9m, 1m, 14m is | 298 m^2 | surface_area_cuboid | +| 34 | Surface Area of Cylinder | Surface area of cylinder with height = 30m and radius = 3m is | 622 m^2 | surface_area_cylinder | +| 35 | Volum of Cube | Volume of cube with side = 16m is | 4096 m^3 | volume_cube | +| 36 | Volume of Cuboid | Volume of cuboid with sides = 4m, 12m, 11m is | 528 m^3 | volume_cuboid | +| 37 | Volume of cylinder | Volume of cylinder with height = 32m and radius = 17m is | 29053 m^3 | volume_cylinder | +| 38 | Surface Area of cone | Surface area of cone with height = 18m and radius = 16m is | 2014 m^2 | surface_area_cone | +| 39 | Volume of cone | Volume of cone with height = 24m and radius = 6m is | 904 m^3 | volume_cone | +| 40 | Common Factors | Common Factors of 73 and 75 = | [1] | common_factors | +| 41 | Intersection of Two Lines | Find the point of intersection of the two lines: y = -10/4x - 6 and y = -2/5x + 2 | (-80/21, 74/21) | intersection_of_two_lines | +| 42 | Permutations | Number of Permutations from 18 objects picked 5 at a time = | 1028160 | permutation | +| 43 | Cross Product of 2 Vectors | [-19, -17, 16] X [-3, -10, 19] = | [-163, 313, 139] | vector_cross | +| 44 | Compare Fractions | Which symbol represents the comparison between 10/8 and 4/7? | > | compare_fractions | +| 45 | Simple Interest | Simple interest for a principle amount of 8277 dollars, 8% rate of interest and for a time period of 8 years is = | 5297.28 | simple_interest | +| 46 | Multiplication of two matrices | Multiply
5-36
67-2
55-2
and
-64
-5-2
-51
|
-4532
-618
-458
| matrix_multiplication | +| 47 | Cube Root | cuberoot of 725 upto 2 decimal places is: | 8.98 | cube_root | +| 48 | Power Rule Integration | 6x^8 + 10x^3 + 2x^8 + 8x^8 + 6x^9 | (6/8)x^9 + (10/3)x^4 + (2/8)x^9 + (8/8)x^9 + (6/9)x^10 + c | power_rule_integration | +| 49 | Fourth Angle of Quadrilateral | Fourth angle of quadrilateral with angles 34 , 200, 57 = | 69 | fourth_angle_of_quadrilateral | +| 50 | Quadratic Equation | Zeros of the Quadratic Equation 28x^2+105x+65=0 | [-0.78, -2.97] | quadratic_equation | +| 51 | HCF (Highest Common Factor) | HCF of 14 and 7 = | 7 | hcf | +| 52 | Probability of a certain sum appearing on faces of dice | If 1 dice are rolled at the same time, the probability of getting a sum of 3 = | 1/6 | dice_sum_probability | +| 53 | Exponentiation | 2^2 = | 4 | exponentiation | +| 54 | Confidence interval For sample S | The confidence interval for sample [271, 209, 205, 219, 291, 221, 226, 217, 230, 272, 276, 293, 237, 252, 283, 253, 266, 240, 234, 207, 279] with 80% confidence is | (254.68568495447266, 238.74288647409878) | confidence_interval | +| 55 | Comparing surds | Fill in the blanks 8^(1/2) _ 55^(1/6) | > | surds_comparison | +| 56 | Fibonacci Series | The Fibonacci Series of the first 19 numbers is ? | [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584] | fibonacci_series | +| 57 | Trigonometric Values | What is cos(45)? | 1/√2 | basic_trigonometry | +| 58 | Sum of Angles of Polygon | Sum of angles of polygon with 6 sides = | 720 | sum_of_polygon_angles | +| 59 | Mean,Standard Deviation,Variance | Find the mean,standard deviation and variance for the data[25, 45, 11, 49, 43, 21, 18, 22, 46, 41, 48, 45, 47, 46, 22] | The Mean is 35.266666666666666 , Standard Deviation is 169.9288888888889, Variance is 13.035677538543553 | data_summary | +| 60 | Surface Area of Sphere | Surface area of Sphere with radius = 20m is | 5026.548245743669 m^2 | surface_area_sphere | +| 61 | Volume of Sphere | Volume of sphere with radius 6 m = | 904.7786842338604 m^3 | volume_sphere | +| 62 | nth Fibonacci number | What is the 98th Fibonacci number? | 135301852344707186688 | nth_fibonacci_number | +| 63 | Profit or Loss Percent | Profit percent when CP = 88 and SP = 155 is: | 76.13636363636364 | profit_loss_percent | +| 64 | Binary to Hexidecimal | 0111100 | 0x3c | binary_to_hex | +| 65 | Multiplication of 2 complex numbers | (6+15j) * (-11+14j) = | (-276-81j) | multiply_complex_numbers | +| 66 | Geometric Progression | For the given GP [4, 8, 16, 32, 64, 128] ,Find the value of a,common ratio,10th term value, sum upto 7th term | The value of a is 4, common ratio is 2 , 10th term is 2048 , sum upto 7th term is 508.0 | geometric_progression | +| 67 | Geometric Mean of N Numbers | Geometric mean of 2 numbers 15 and 89 = | (15*89)^(1/2) = 36.53765181289022 | geometric_mean | +| 68 | Harmonic Mean of N Numbers | Harmonic mean of 4 numbers 57 , 38 , 60 , 25 = | 4/((1/57) + (1/38) + (1/60) + (1/25)) = 39.79057591623037 | harmonic_mean | +| 69 | Euclidian norm or L2 norm of a vector | Euclidian norm or L2 norm of the vector[987.2988424731678, 717.1306649026507, 239.90848831697863, 979.8627407501484, 102.29066104606976, 458.7906478877879, 275.5546983244834, 225.6916602424589, 26.12527792643693, 366.7028959774343, 752.5264100654856] is: | 1885.7336411802055 | euclidian_norm | +| 70 | Angle between 2 vectors | angle between the vectors [204.34, 989.9, 769.23, 587.22, 313.6, 598.75, 907.67, 221.31, 7.76, 716.11, 697.58, 26.04, 416.61, 562.5, 818.67, 197.06, 492.85, 507.85, 609.86, 475.4] and [877.86, 605.89, 409.16, 650.41, 32.59, 244.04, 903.77, 499.35, 438.81, 709.82, 656.49, 745.17, 497.04, 832.24, 195.85, 37.89, 851.83, 608.87, 119.84, 17.96] is: | 0.66 radians | angle_btw_vectors | +| 71 | Absolute difference between two numbers | Absolute difference between numbers -40 and -6 = | 34 | absolute_difference | +| 72 | Dot Product of 2 Vectors | [-17, 12, 6] . [-2, -9, 9] = | -20 | vector_dot | +| 73 | Binary 2's Complement | 2's complement of 10100110 = | 1011010 | binary_2s_complement | +| 74 | Inverse of a Matrix | Inverse of Matrix Matrix([[54, 47, 44], [59, 41, 7], [86, 33, 5]]) is: | Matrix([[26/56451, -1217/56451, 1475/56451], [-307/56451, 3514/56451, -2218/56451], [1579/56451, -2260/56451, 559/56451]]) | invert_matrix | +| 75 | Area of a Sector | Given radius, 23 and angle, 4. Find the area of the sector. | Area of sector = 18.46558 | sector_area | +| 76 | Mean and Median | Given the series of numbers [19, 93, 45, 37, 39, 8, 48, 44, 12, 10]. find the arithmatic mean and mdian of the series | Arithmetic mean of the series is 35.5 and Arithmetic median of this series is 38.0 | mean_median | +| 77 | Determinant to 2x2 Matrix | Det([[73, 67], [64, 58]]) = | -54 | int_matrix_22_determinant | +| 78 | Compound Interest | Compound interest for a principle amount of 2095 dollars, 6% rate of interest and for a time period of 3 year is = | 2495.18 | compound_interest | +| 79 | Decimal to Hexadecimal | Binary of 494= | 0x1ee | decimal_to_hexadeci | +| 80 | Percentage of a number | What is 14% of 51? | Required percentage = 7.14% | percentage | +| 81 | Celsius To Fahrenheit | Convert -22 degrees Celsius to degrees Fahrenheit = | -7.600000000000001 | celsius_to_fahrenheit | +| 82 | AP Term Calculation | Find the term number 39 of the AP series: -42, -102, -162 ... | -2322 | arithmetic_progression_term | +| 83 | AP Sum Calculation | Find the sum of first 49 terms of the AP series: 18, -50, -118 ... | -79086.0 | arithmetic_progression_sum | +| 84 | Converts decimal to octal | The decimal number 3746 in Octal is: | 0o7242 | decimal_to_octal | +| 85 | Converts decimal to Roman Numerals | The number 2967 in Roman Numerals is: | MMCMLXVII | decimal_to_roman_numerals | +| 86 | Degrees to Radians | Angle 109 in radians is = | 1.9 | degree_to_rad | | 87 | Radians to Degrees | Angle 3 in degrees is = | 171.89 | radian_to_deg | -| 88 | Differentiation | differentiate w.r.t x : d(ln(x)+2*x^3)/dx | 6*x^2 + 1/x | differentiation | -| 89 | Definite Integral of Quadratic Equation | The definite integral within limits 0 to 1 of the equation 74x^2 + 55x + 86 is = | 138.1667 | definite_integral | -| 90 | isprime | 32 | False | is_prime | -| 91 | Binary Coded Decimal to Integer | Integer of Binary Coded Decimal 1 is = | 5461 | bcd_to_decimal | -| 92 | Complex To Polar Form | rexp(itheta) = | 27.59exp(i-2.38) | complex_to_polar | -| 93 | Union,Intersection,Difference of Two Sets | Given the two sets a={1, 2, 3, 5, 6, 8} ,b={1, 10, 2, 9}.Find the Union,intersection,a-b,b-a and symmetric difference | Union is {1, 2, 3, 5, 6, 8, 9, 10},Intersection is {1, 2}, a-b is {8, 3, 5, 6},b-a is {9, 10}, Symmetric difference is {3, 5, 6, 8, 9, 10} | set_operation | -| 94 | Base Conversion | Convert 131222 from base 6 to base 2. | 10111010111110 | base_conversion | -| 95 | Curved surface area of a cylinder | What is the curved surface area of a cylinder of radius, 27 and height, 94? | CSA of cylinder = 15946.72 | curved_surface_area_cylinder | -| 96 | Perimeter of Polygons | The perimeter of a 9 sided polygon with lengths of [48, 30, 110, 95, 10, 33, 87, 70, 78]cm is: | 561 | perimeter_of_polygons | -| 97 | Power of Powers | The 24^1^3 = 24^(1*3) = 24^3 | 13824 | power_of_powers | -| 98 | Quotient of Powers with Same Base | The Quotient of 41^2 and 41^3 = 41^(2-3) = 41^-1 | 0.024390243902439025 | quotient_of_power_same_base | -| 99 | Quotient of Powers with Same Power | The Quotient of 30^5 and 35^5 = (30/35)^5 = 0.8571428571428571^5 | 0.46266436603796024 | quotient_of_power_same_power | -| 100 | complex Quadratic Equation | Find the roots of given Quadratic Equation 5x^2 + 8x + 2 = 0 | simplified solution : ((-0.31, -1.29)), generalized solution : ((-8 + sqrt(24))/2*5, (-8 - sqrt(24))/2*5) | complex_quadratic | +| 88 | Differentiation | differentiate w.r.t x : d(sin(x)+9*x^3)/dx | 27*x^2 + cos(x) | differentiation | +| 89 | Definite Integral of Quadratic Equation | The definite integral within limits 0 to 1 of the equation 50x^2 + 38x + 41 is = | 76.6667 | definite_integral | +| 90 | isprime | 11 | True | is_prime | +| 91 | Binary Coded Decimal to Integer | Integer of Binary Coded Decimal 7 is = | 29331 | bcd_to_decimal | +| 92 | Complex To Polar Form | rexp(itheta) = | 14.42exp(i-2.55) | complex_to_polar | +| 93 | Union,Intersection,Difference of Two Sets | Given the two sets a={2, 3, 4, 5, 6, 8, 10} ,b={4, 5, 6, 7}.Find the Union,intersection,a-b,b-a and symmetric difference | Union is {2, 3, 4, 5, 6, 7, 8, 10},Intersection is {4, 5, 6}, a-b is {8, 10, 2, 3},b-a is {7}, Symmetric difference is {2, 3, 7, 8, 10} | set_operation | +| 94 | Base Conversion | Convert 33210 from base 10 to base 11. | 22A51 | base_conversion | +| 95 | Curved surface area of a cylinder | What is the curved surface area of a cylinder of radius, 3 and height, 21? | CSA of cylinder = 395.84 | curved_surface_area_cylinder | +| 96 | Perimeter of Polygons | The perimeter of a 10 sided polygon with lengths of [11, 117, 72, 120, 46, 96, 40, 76, 15, 19]cm is: | 612 | perimeter_of_polygons | +| 97 | Power of Powers | The 41^3^4 = 41^(3*4) = 41^12 | 22563490300366186081 | power_of_powers | +| 98 | Quotient of Powers with Same Base | The Quotient of 19^2 and 19^2 = 19^(2-2) = 19^0 | 1 | quotient_of_power_same_base | +| 99 | Quotient of Powers with Same Power | The Quotient of 29^3 and 22^3 = (29/22)^3 = 1.3181818181818181^3 | 2.2904770848985723 | quotient_of_power_same_power | +| 100 | complex Quadratic Equation | Find the roots of given Quadratic Equation 9x^2 + 9x + 2 = 0 | simplified solution : ((-0.333, -0.667)), generalized solution : ((-9 + 3)/2*9, (-9 - 3)/2*9) | complex_quadratic | diff --git a/mathgenerator/funcs/__init__.py b/mathgenerator/funcs/__init__.py index c48f9d8..77a2db3 100644 --- a/mathgenerator/funcs/__init__.py +++ b/mathgenerator/funcs/__init__.py @@ -105,3 +105,4 @@ from .power_of_powers import * from .quotient_of_power_same_base import * from .quotient_of_power_same_power import * from .complex_quadratic import * +from .is_leap_year import * diff --git a/mathgenerator/funcs/is_leap_year.py b/mathgenerator/funcs/is_leap_year.py index 1f79c2b..3f9c351 100644 --- a/mathgenerator/funcs/is_leap_year.py +++ b/mathgenerator/funcs/is_leap_year.py @@ -1,4 +1,4 @@ -from .__init__ import * +from .__init__ import * def IsLeapYear(minNumber=1900, maxNumber=2099): @@ -15,10 +15,11 @@ def IsLeapYear(minNumber=1900, maxNumber=2099): solution = "is a leap year" else: solution = "is not a leap year" - + return problem, solution -is_leap_year = Generator("Leap Year or Not", 102, + +is_leap_year = Generator("Leap Year or Not", 101, "Year y ", "is/not a leap year", - IsLeapYear) -##for readme ## | 102 | Leap Year or Not | Year 1964 | is a leap year | is_leap_year | + IsLeapYear) +# for readme ## | 102 | Leap Year or Not | Year 1964 | is a leap year | is_leap_year | diff --git a/test.py b/test.py index 8f1bf49..0b24009 100644 --- a/test.py +++ b/test.py @@ -10,4 +10,5 @@ for item in list: print(item[2]) # print(mathgen.getGenList()) -print(mathgen.genById(100)) +print(mathgen.decimal_to_roman_numerals()) +print(mathgen.genById(101)) From 81b1f2824f298598a103652ebdb3666bf809f850 Mon Sep 17 00:00:00 2001 From: lukew3 Date: Fri, 23 Oct 2020 13:38:16 -0400 Subject: [PATCH 11/15] minutes to hours fix --- README.md | 200 +++++++++++----------- mathgenerator/funcs/__init__.py | 2 +- mathgenerator/funcs/minutesToHoursFunc.py | 13 -- mathgenerator/funcs/minutes_to_hours.py | 14 ++ test.py | 2 +- 5 files changed, 117 insertions(+), 114 deletions(-) delete mode 100644 mathgenerator/funcs/minutesToHoursFunc.py create mode 100644 mathgenerator/funcs/minutes_to_hours.py diff --git a/README.md b/README.md index 4fe1e18..8c2e7f0 100644 --- a/README.md +++ b/README.md @@ -31,104 +31,106 @@ problem, solution = mathgen.genById(0) | Id | Skill | Example problem | Example Solution | Function Name | |------|-----------------------------------|--------------------|-----------------------|--------------------------| [//]: # list start -| 0 | Addition | 20+9= | 29 | addition | -| 1 | Subtraction | 52-50= | 2 | subtraction | -| 2 | Multiplication | 53*1= | 53 | multiplication | -| 3 | Division | 35/79= | 0.4430379746835443 | division | -| 4 | Binary Complement 1s | 011011= | 100100 | binary_complement_1s | -| 5 | Modulo Division | 27%39= | 27 | modulo_division | +| 0 | Addition | 16+2= | 18 | addition | +| 1 | Subtraction | 9-6= | 3 | subtraction | +| 2 | Multiplication | 3*0= | 0 | multiplication | +| 3 | Division | 80/88= | 0.9090909090909091 | division | +| 4 | Binary Complement 1s | 0000100= | 1111011 | binary_complement_1s | +| 5 | Modulo Division | 99%94= | 5 | modulo_division | | 6 | Square Root | sqrt(16)= | 4 | square_root | -| 7 | Power Rule Differentiation | 7x^5 | 35x^4 | power_rule_differentiation | -| 8 | Square | 10^2= | 100 | square | -| 9 | LCM (Least Common Multiple) | LCM of 14 and 14 = | 14 | lcm | -| 10 | GCD (Greatest Common Denominator) | GCD of 17 and 7 = | 1 | gcd | -| 11 | Basic Algebra | 6x + 5 = 5 | 0 | basic_algebra | -| 12 | Logarithm | log2(64) | 6 | log | -| 13 | Easy Division | 252/12 = | 21 | int_division | -| 14 | Decimal to Binary | Binary of 19= | 10011 | decimal_to_binary | -| 15 | Binary to Decimal | 1000010100 | 532 | binary_to_decimal | -| 16 | Fraction Division | (10/9)/(10/8) | 8/9 | divide_fractions | -| 17 | Integer Multiplication with 2x2 Matrix | 15 * [[5, 3], [3, 2]] = | [[75,45],[45,30]] | multiply_int_to_22_matrix | -| 18 | Area of Triangle | Area of triangle with side lengths: 3 17 2 = | (4.221036154550547e-15+68.93475175845634j) | area_of_triangle | -| 19 | Triangle exists check | Does triangle with sides 24, 20 and 17 exist? | Yes | valid_triangle | -| 20 | Midpoint of the two point | (4,-10),(2,4)= | (3.0,-3.0) | midpoint_of_two_points | -| 21 | Factoring Quadratic | x^2-3x-54 | (x+6)(x-9) | factoring | -| 22 | Third Angle of Triangle | Third angle of triangle with angles 6 and 29 = | 145 | third_angle_of_triangle | -| 23 | Solve a System of Equations in R^2 | - 5y = -20, 3x + 9y = 9 | x = -9, y = 4 | system_of_equations | -| 24 | Distance between 2 points | Find the distance between (-2, -4) and (21, -13) | sqrt(610) | distance_two_points | -| 25 | Pythagorean Theorem | The hypotenuse of a right triangle given the other two lengths 16 and 11 = | 19.42 | pythagorean_theorem | -| 26 | Linear Equations | 11x + 4y = -72, 17x + -18y = -208 | x = -8, y = 4 | linear_equations | -| 27 | Prime Factorisation | Find prime factors of 88 | [2, 2, 2, 11] | prime_factors | -| 28 | Fraction Multiplication | (7/3)*(2/10) | 7/15 | fraction_multiplication | -| 29 | Angle of a Regular Polygon | Find the angle of a regular polygon with 9 sides | 140.0 | angle_regular_polygon | -| 30 | Combinations of Objects | Number of combinations from 16 objects picked 6 at a time | 8008 | combinations | -| 31 | Factorial | 2! = | 2 | factorial | -| 32 | Surface Area of Cube | Surface area of cube with side = 3m is | 54 m^2 | surface_area_cube | -| 33 | Surface Area of Cuboid | Surface area of cuboid with sides = 9m, 1m, 14m is | 298 m^2 | surface_area_cuboid | -| 34 | Surface Area of Cylinder | Surface area of cylinder with height = 30m and radius = 3m is | 622 m^2 | surface_area_cylinder | +| 7 | Power Rule Differentiation | 7x^8 + 4x^10 + 9x^9 + 4x^10 | 56x^7 + 40x^9 + 81x^8 + 40x^9 | power_rule_differentiation | +| 8 | Square | 17^2= | 289 | square | +| 9 | LCM (Least Common Multiple) | LCM of 1 and 8 = | 8 | lcm | +| 10 | GCD (Greatest Common Denominator) | GCD of 11 and 7 = | 1 | gcd | +| 11 | Basic Algebra | 8x + 4 = 4 | 0 | basic_algebra | +| 12 | Logarithm | log3(729) | 6 | log | +| 13 | Easy Division | 575/25 = | 23 | int_division | +| 14 | Decimal to Binary | Binary of 55= | 110111 | decimal_to_binary | +| 15 | Binary to Decimal | 01101001 | 105 | binary_to_decimal | +| 16 | Fraction Division | (1/2)/(7/10) | 5/7 | divide_fractions | +| 17 | Integer Multiplication with 2x2 Matrix | 7 * [[4, 2], [5, 0]] = | [[28,14],[35,0]] | multiply_int_to_22_matrix | +| 18 | Area of Triangle | Area of triangle with side lengths: 15 12 8 = | 47.811478747263195 | area_of_triangle | +| 19 | Triangle exists check | Does triangle with sides 23, 29 and 35 exist? | Yes | valid_triangle | +| 20 | Midpoint of the two point | (8,-2),(-11,-1)= | (-1.5,-1.5) | midpoint_of_two_points | +| 21 | Factoring Quadratic | x^2+6x+5 | (x+5)(x+1) | factoring | +| 22 | Third Angle of Triangle | Third angle of triangle with angles 39 and 12 = | 129 | third_angle_of_triangle | +| 23 | Solve a System of Equations in R^2 | 9x + 7y = 14, -6x - 2y = -28 | x = 7, y = -7 | system_of_equations | +| 24 | Distance between 2 points | Find the distance between (3, -6) and (3, -5) | sqrt(1) | distance_two_points | +| 25 | Pythagorean Theorem | The hypotenuse of a right triangle given the other two lengths 7 and 8 = | 10.63 | pythagorean_theorem | +| 26 | Linear Equations | -5x + -5y = 90, -7x + 4y = 137 | x = -19, y = 1 | linear_equations | +| 27 | Prime Factorisation | Find prime factors of 10 | [2, 5] | prime_factors | +| 28 | Fraction Multiplication | (2/9)*(8/10) | 8/45 | fraction_multiplication | +| 29 | Angle of a Regular Polygon | Find the angle of a regular polygon with 14 sides | 154.29 | angle_regular_polygon | +| 30 | Combinations of Objects | Number of combinations from 18 objects picked 6 at a time | 18564 | combinations | +| 31 | Factorial | 3! = | 6 | factorial | +| 32 | Surface Area of Cube | Surface area of cube with side = 18m is | 1944 m^2 | surface_area_cube | +| 33 | Surface Area of Cuboid | Surface area of cuboid with sides = 12m, 13m, 1m is | 362 m^2 | surface_area_cuboid | +| 34 | Surface Area of Cylinder | Surface area of cylinder with height = 17m and radius = 17m is | 3631 m^2 | surface_area_cylinder | | 35 | Volum of Cube | Volume of cube with side = 16m is | 4096 m^3 | volume_cube | -| 36 | Volume of Cuboid | Volume of cuboid with sides = 4m, 12m, 11m is | 528 m^3 | volume_cuboid | -| 37 | Volume of cylinder | Volume of cylinder with height = 32m and radius = 17m is | 29053 m^3 | volume_cylinder | -| 38 | Surface Area of cone | Surface area of cone with height = 18m and radius = 16m is | 2014 m^2 | surface_area_cone | -| 39 | Volume of cone | Volume of cone with height = 24m and radius = 6m is | 904 m^3 | volume_cone | -| 40 | Common Factors | Common Factors of 73 and 75 = | [1] | common_factors | -| 41 | Intersection of Two Lines | Find the point of intersection of the two lines: y = -10/4x - 6 and y = -2/5x + 2 | (-80/21, 74/21) | intersection_of_two_lines | -| 42 | Permutations | Number of Permutations from 18 objects picked 5 at a time = | 1028160 | permutation | -| 43 | Cross Product of 2 Vectors | [-19, -17, 16] X [-3, -10, 19] = | [-163, 313, 139] | vector_cross | -| 44 | Compare Fractions | Which symbol represents the comparison between 10/8 and 4/7? | > | compare_fractions | -| 45 | Simple Interest | Simple interest for a principle amount of 8277 dollars, 8% rate of interest and for a time period of 8 years is = | 5297.28 | simple_interest | -| 46 | Multiplication of two matrices | Multiply
5-36
67-2
55-2
and
-64
-5-2
-51
|
-4532
-618
-458
| matrix_multiplication | -| 47 | Cube Root | cuberoot of 725 upto 2 decimal places is: | 8.98 | cube_root | -| 48 | Power Rule Integration | 6x^8 + 10x^3 + 2x^8 + 8x^8 + 6x^9 | (6/8)x^9 + (10/3)x^4 + (2/8)x^9 + (8/8)x^9 + (6/9)x^10 + c | power_rule_integration | -| 49 | Fourth Angle of Quadrilateral | Fourth angle of quadrilateral with angles 34 , 200, 57 = | 69 | fourth_angle_of_quadrilateral | -| 50 | Quadratic Equation | Zeros of the Quadratic Equation 28x^2+105x+65=0 | [-0.78, -2.97] | quadratic_equation | -| 51 | HCF (Highest Common Factor) | HCF of 14 and 7 = | 7 | hcf | -| 52 | Probability of a certain sum appearing on faces of dice | If 1 dice are rolled at the same time, the probability of getting a sum of 3 = | 1/6 | dice_sum_probability | -| 53 | Exponentiation | 2^2 = | 4 | exponentiation | -| 54 | Confidence interval For sample S | The confidence interval for sample [271, 209, 205, 219, 291, 221, 226, 217, 230, 272, 276, 293, 237, 252, 283, 253, 266, 240, 234, 207, 279] with 80% confidence is | (254.68568495447266, 238.74288647409878) | confidence_interval | -| 55 | Comparing surds | Fill in the blanks 8^(1/2) _ 55^(1/6) | > | surds_comparison | -| 56 | Fibonacci Series | The Fibonacci Series of the first 19 numbers is ? | [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584] | fibonacci_series | -| 57 | Trigonometric Values | What is cos(45)? | 1/√2 | basic_trigonometry | -| 58 | Sum of Angles of Polygon | Sum of angles of polygon with 6 sides = | 720 | sum_of_polygon_angles | -| 59 | Mean,Standard Deviation,Variance | Find the mean,standard deviation and variance for the data[25, 45, 11, 49, 43, 21, 18, 22, 46, 41, 48, 45, 47, 46, 22] | The Mean is 35.266666666666666 , Standard Deviation is 169.9288888888889, Variance is 13.035677538543553 | data_summary | -| 60 | Surface Area of Sphere | Surface area of Sphere with radius = 20m is | 5026.548245743669 m^2 | surface_area_sphere | -| 61 | Volume of Sphere | Volume of sphere with radius 6 m = | 904.7786842338604 m^3 | volume_sphere | -| 62 | nth Fibonacci number | What is the 98th Fibonacci number? | 135301852344707186688 | nth_fibonacci_number | -| 63 | Profit or Loss Percent | Profit percent when CP = 88 and SP = 155 is: | 76.13636363636364 | profit_loss_percent | -| 64 | Binary to Hexidecimal | 0111100 | 0x3c | binary_to_hex | -| 65 | Multiplication of 2 complex numbers | (6+15j) * (-11+14j) = | (-276-81j) | multiply_complex_numbers | -| 66 | Geometric Progression | For the given GP [4, 8, 16, 32, 64, 128] ,Find the value of a,common ratio,10th term value, sum upto 7th term | The value of a is 4, common ratio is 2 , 10th term is 2048 , sum upto 7th term is 508.0 | geometric_progression | -| 67 | Geometric Mean of N Numbers | Geometric mean of 2 numbers 15 and 89 = | (15*89)^(1/2) = 36.53765181289022 | geometric_mean | -| 68 | Harmonic Mean of N Numbers | Harmonic mean of 4 numbers 57 , 38 , 60 , 25 = | 4/((1/57) + (1/38) + (1/60) + (1/25)) = 39.79057591623037 | harmonic_mean | -| 69 | Euclidian norm or L2 norm of a vector | Euclidian norm or L2 norm of the vector[987.2988424731678, 717.1306649026507, 239.90848831697863, 979.8627407501484, 102.29066104606976, 458.7906478877879, 275.5546983244834, 225.6916602424589, 26.12527792643693, 366.7028959774343, 752.5264100654856] is: | 1885.7336411802055 | euclidian_norm | -| 70 | Angle between 2 vectors | angle between the vectors [204.34, 989.9, 769.23, 587.22, 313.6, 598.75, 907.67, 221.31, 7.76, 716.11, 697.58, 26.04, 416.61, 562.5, 818.67, 197.06, 492.85, 507.85, 609.86, 475.4] and [877.86, 605.89, 409.16, 650.41, 32.59, 244.04, 903.77, 499.35, 438.81, 709.82, 656.49, 745.17, 497.04, 832.24, 195.85, 37.89, 851.83, 608.87, 119.84, 17.96] is: | 0.66 radians | angle_btw_vectors | -| 71 | Absolute difference between two numbers | Absolute difference between numbers -40 and -6 = | 34 | absolute_difference | -| 72 | Dot Product of 2 Vectors | [-17, 12, 6] . [-2, -9, 9] = | -20 | vector_dot | -| 73 | Binary 2's Complement | 2's complement of 10100110 = | 1011010 | binary_2s_complement | -| 74 | Inverse of a Matrix | Inverse of Matrix Matrix([[54, 47, 44], [59, 41, 7], [86, 33, 5]]) is: | Matrix([[26/56451, -1217/56451, 1475/56451], [-307/56451, 3514/56451, -2218/56451], [1579/56451, -2260/56451, 559/56451]]) | invert_matrix | -| 75 | Area of a Sector | Given radius, 23 and angle, 4. Find the area of the sector. | Area of sector = 18.46558 | sector_area | -| 76 | Mean and Median | Given the series of numbers [19, 93, 45, 37, 39, 8, 48, 44, 12, 10]. find the arithmatic mean and mdian of the series | Arithmetic mean of the series is 35.5 and Arithmetic median of this series is 38.0 | mean_median | -| 77 | Determinant to 2x2 Matrix | Det([[73, 67], [64, 58]]) = | -54 | int_matrix_22_determinant | -| 78 | Compound Interest | Compound interest for a principle amount of 2095 dollars, 6% rate of interest and for a time period of 3 year is = | 2495.18 | compound_interest | -| 79 | Decimal to Hexadecimal | Binary of 494= | 0x1ee | decimal_to_hexadeci | -| 80 | Percentage of a number | What is 14% of 51? | Required percentage = 7.14% | percentage | -| 81 | Celsius To Fahrenheit | Convert -22 degrees Celsius to degrees Fahrenheit = | -7.600000000000001 | celsius_to_fahrenheit | -| 82 | AP Term Calculation | Find the term number 39 of the AP series: -42, -102, -162 ... | -2322 | arithmetic_progression_term | -| 83 | AP Sum Calculation | Find the sum of first 49 terms of the AP series: 18, -50, -118 ... | -79086.0 | arithmetic_progression_sum | -| 84 | Converts decimal to octal | The decimal number 3746 in Octal is: | 0o7242 | decimal_to_octal | -| 85 | Converts decimal to Roman Numerals | The number 2967 in Roman Numerals is: | MMCMLXVII | decimal_to_roman_numerals | -| 86 | Degrees to Radians | Angle 109 in radians is = | 1.9 | degree_to_rad | -| 87 | Radians to Degrees | Angle 3 in degrees is = | 171.89 | radian_to_deg | -| 88 | Differentiation | differentiate w.r.t x : d(sin(x)+9*x^3)/dx | 27*x^2 + cos(x) | differentiation | -| 89 | Definite Integral of Quadratic Equation | The definite integral within limits 0 to 1 of the equation 50x^2 + 38x + 41 is = | 76.6667 | definite_integral | -| 90 | isprime | 11 | True | is_prime | -| 91 | Binary Coded Decimal to Integer | Integer of Binary Coded Decimal 7 is = | 29331 | bcd_to_decimal | -| 92 | Complex To Polar Form | rexp(itheta) = | 14.42exp(i-2.55) | complex_to_polar | -| 93 | Union,Intersection,Difference of Two Sets | Given the two sets a={2, 3, 4, 5, 6, 8, 10} ,b={4, 5, 6, 7}.Find the Union,intersection,a-b,b-a and symmetric difference | Union is {2, 3, 4, 5, 6, 7, 8, 10},Intersection is {4, 5, 6}, a-b is {8, 10, 2, 3},b-a is {7}, Symmetric difference is {2, 3, 7, 8, 10} | set_operation | -| 94 | Base Conversion | Convert 33210 from base 10 to base 11. | 22A51 | base_conversion | -| 95 | Curved surface area of a cylinder | What is the curved surface area of a cylinder of radius, 3 and height, 21? | CSA of cylinder = 395.84 | curved_surface_area_cylinder | -| 96 | Perimeter of Polygons | The perimeter of a 10 sided polygon with lengths of [11, 117, 72, 120, 46, 96, 40, 76, 15, 19]cm is: | 612 | perimeter_of_polygons | -| 97 | Power of Powers | The 41^3^4 = 41^(3*4) = 41^12 | 22563490300366186081 | power_of_powers | -| 98 | Quotient of Powers with Same Base | The Quotient of 19^2 and 19^2 = 19^(2-2) = 19^0 | 1 | quotient_of_power_same_base | -| 99 | Quotient of Powers with Same Power | The Quotient of 29^3 and 22^3 = (29/22)^3 = 1.3181818181818181^3 | 2.2904770848985723 | quotient_of_power_same_power | -| 100 | complex Quadratic Equation | Find the roots of given Quadratic Equation 9x^2 + 9x + 2 = 0 | simplified solution : ((-0.333, -0.667)), generalized solution : ((-9 + 3)/2*9, (-9 - 3)/2*9) | complex_quadratic | +| 36 | Volume of Cuboid | Volume of cuboid with sides = 7m, 13m, 14m is | 1274 m^3 | volume_cuboid | +| 37 | Volume of cylinder | Volume of cylinder with height = 2m and radius = 1m is | 6 m^3 | volume_cylinder | +| 38 | Surface Area of cone | Surface area of cone with height = 4m and radius = 6m is | 249 m^2 | surface_area_cone | +| 39 | Volume of cone | Volume of cone with height = 39m and radius = 15m is | 9189 m^3 | volume_cone | +| 40 | Common Factors | Common Factors of 30 and 61 = | [1] | common_factors | +| 41 | Intersection of Two Lines | Find the point of intersection of the two lines: y = 6/6x + 7 and y = 4x + 9 | (-2/3, 19/3) | intersection_of_two_lines | +| 42 | Permutations | Number of Permutations from 15 objects picked 9 at a time = | 1816214400 | permutation | +| 43 | Cross Product of 2 Vectors | [-10, 6, 12] X [-6, 4, 1] = | [-42, -62, -4] | vector_cross | +| 44 | Compare Fractions | Which symbol represents the comparison between 10/1 and 4/6? | > | compare_fractions | +| 45 | Simple Interest | Simple interest for a principle amount of 9743 dollars, 1% rate of interest and for a time period of 5 years is = | 487.15 | simple_interest | +| 46 | Multiplication of two matrices | Multiply
-4-8
-4-10
and
-59
7-6
|
-3612
-5024
| matrix_multiplication | +| 47 | Cube Root | cuberoot of 439 upto 2 decimal places is: | 7.6 | cube_root | +| 48 | Power Rule Integration | 2x^1 + 7x^4 + 10x^9 + 6x^10 | (2/1)x^2 + (7/4)x^5 + (10/9)x^10 + (6/10)x^11 + c | power_rule_integration | +| 49 | Fourth Angle of Quadrilateral | Fourth angle of quadrilateral with angles 148 , 57, 12 = | 143 | fourth_angle_of_quadrilateral | +| 50 | Quadratic Equation | Zeros of the Quadratic Equation 72x^2+137x+32=0 | [-0.27, -1.63] | quadratic_equation | +| 51 | HCF (Highest Common Factor) | HCF of 17 and 1 = | 1 | hcf | +| 52 | Probability of a certain sum appearing on faces of dice | If 2 dice are rolled at the same time, the probability of getting a sum of 2 = | 1/36 | dice_sum_probability | +| 53 | Exponentiation | 18^1 = | 18 | exponentiation | +| 54 | Confidence interval For sample S | The confidence interval for sample [268, 237, 275, 264, 256, 215, 225, 294, 286, 283, 239, 219, 287, 262, 241, 223, 273, 279, 206, 274, 228, 236, 252, 285, 212, 229, 254, 295, 244, 232, 211, 213, 210, 227, 255, 280] with 95% confidence is | (258.07181132546515, 240.20596645231262) | confidence_interval | +| 55 | Comparing surds | Fill in the blanks 95^(1/2) _ 45^(1/5) | > | surds_comparison | +| 56 | Fibonacci Series | The Fibonacci Series of the first 2 numbers is ? | [0, 1] | fibonacci_series | +| 57 | Trigonometric Values | What is cos(90)? | 0 | basic_trigonometry | +| 58 | Sum of Angles of Polygon | Sum of angles of polygon with 4 sides = | 360 | sum_of_polygon_angles | +| 59 | Mean,Standard Deviation,Variance | Find the mean,standard deviation and variance for the data[30, 16, 18, 10, 10, 21, 8, 27, 37, 8, 12, 25, 20, 9, 24] | The Mean is 18.333333333333332 , Standard Deviation is 75.42222222222222, Variance is 8.684596837057102 | data_summary | +| 60 | Surface Area of Sphere | Surface area of Sphere with radius = 8m is | 804.247719318987 m^2 | surface_area_sphere | +| 61 | Volume of Sphere | Volume of sphere with radius 42 m = | 310339.08869221417 m^3 | volume_sphere | +| 62 | nth Fibonacci number | What is the 92th Fibonacci number? | 7540113804746369024 | nth_fibonacci_number | +| 63 | Profit or Loss Percent | Profit percent when CP = 923 and SP = 973 is: | 5.417118093174431 | profit_loss_percent | +| 64 | Binary to Hexidecimal | 011010110 | 0xd6 | binary_to_hex | +| 65 | Multiplication of 2 complex numbers | (7+3j) * (9-10j) = | (93-43j) | multiply_complex_numbers | +| 66 | Geometric Progression | For the given GP [9, 36, 144, 576, 2304, 9216] ,Find the value of a,common ratio,8th term value, sum upto 7th term | The value of a is 9, common ratio is 4 , 8th term is 147456 , sum upto 7th term is 49149.0 | geometric_progression | +| 67 | Geometric Mean of N Numbers | Geometric mean of 3 numbers 96 , 22 and 75 = | (96*22*75)^(1/3) = 54.1067845799048 | geometric_mean | +| 68 | Harmonic Mean of N Numbers | Harmonic mean of 2 numbers 14 and 99 = | 2/((1/14) + (1/99)) = 24.530973451327437 | harmonic_mean | +| 69 | Euclidian norm or L2 norm of a vector | Euclidian norm or L2 norm of the vector[13.74350761660692, 579.8164944254971, 343.9004348023842, 447.91085049813904, 242.73436069826982, 677.824056340719, 908.0309446289546, 143.65153181819267, 268.05852693335817, 63.42979841101859] is: | 1447.2967158340782 | euclidian_norm | +| 70 | Angle between 2 vectors | angle between the vectors [554.45, 891.65, 845.2, 235.2, 741.43, 734.84, 92.76, 941.97, 885.6, 436.2, 476.49, 836.42, 743.03, 728.97, 963.3, 802.39] and [980.7, 745.14, 384.18, 452.88, 815.24, 725.39, 887.21, 828.72, 786.58, 990.6, 496.01, 439.13, 947.39, 737.59, 293.98, 880.62] is: | 0.5 radians | angle_btw_vectors | +| 71 | Absolute difference between two numbers | Absolute difference between numbers 88 and -73 = | 161 | absolute_difference | +| 72 | Dot Product of 2 Vectors | [-14, -2, 13] . [0, -18, -2] = | 10 | vector_dot | +| 73 | Binary 2's Complement | 2's complement of = | | binary_2s_complement | +| 74 | Inverse of a Matrix | Inverse of Matrix Matrix([[53, 17, 67], [59, 72, 87], [2, 51, 61]]) is: | Matrix([[-9/26269, 476/26269, -669/26269], [-685/26269, 3099/131345, -658/131345], [573/26269, -2669/131345, 2813/131345]]) | invert_matrix | +| 75 | Area of a Sector | Given radius, 44 and angle, 279. Find the area of the sector. | Area of sector = 4713.64562 | sector_area | +| 76 | Mean and Median | Given the series of numbers [67, 20, 53, 42, 74, 89, 54, 4, 37, 49]. find the arithmatic mean and mdian of the series | Arithmetic mean of the series is 48.9 and Arithmetic median of this series is 51.0 | mean_median | +| 77 | Determinant to 2x2 Matrix | Det([[44, 92], [88, 57]]) = | -5588 | int_matrix_22_determinant | +| 78 | Compound Interest | Compound interest for a principle amount of 3765 dollars, 5% rate of interest and for a time period of 1 year is = | 3953.25 | compound_interest | +| 79 | Decimal to Hexadecimal | Binary of 324= | 0x144 | decimal_to_hexadeci | +| 80 | Percentage of a number | What is 45% of 71? | Required percentage = 31.95% | percentage | +| 81 | Celsius To Fahrenheit | Convert 0 degrees Celsius to degrees Fahrenheit = | 32.0 | celsius_to_fahrenheit | +| 82 | AP Term Calculation | Find the term number 6 of the AP series: 29, -38, -105 ... | -306 | arithmetic_progression_term | +| 83 | AP Sum Calculation | Find the sum of first 50 terms of the AP series: -90, -141, -192 ... | -66975.0 | arithmetic_progression_sum | +| 84 | Converts decimal to octal | The decimal number 84 in Octal is: | 0o124 | decimal_to_octal | +| 85 | Converts decimal to Roman Numerals | The number 1646 in Roman Numerals is: | MDCXLVI | decimal_to_roman_numerals | +| 86 | Degrees to Radians | Angle 294 in radians is = | 5.13 | degree_to_rad | +| 87 | Radians to Degrees | Angle 0 in degrees is = | 0.0 | radian_to_deg | +| 88 | Differentiation | differentiate w.r.t x : d(exp(x)+2*x^(-4))/dx | exp(x) - 8/x^5 | differentiation | +| 89 | Definite Integral of Quadratic Equation | The definite integral within limits 0 to 1 of the equation 100x^2 + 44x + 23 is = | 78.3333 | definite_integral | +| 90 | isprime | 99 | False | is_prime | +| 91 | Binary Coded Decimal to Integer | Integer of Binary Coded Decimal 7 is = | 29969 | bcd_to_decimal | +| 92 | Complex To Polar Form | rexp(itheta) = | 22.67exp(i2.42) | complex_to_polar | +| 93 | Union,Intersection,Difference of Two Sets | Given the two sets a={8, 1, 4, 7} ,b={1, 2, 4, 7}.Find the Union,intersection,a-b,b-a and symmetric difference | Union is {1, 2, 4, 7, 8},Intersection is {1, 4, 7}, a-b is {8},b-a is {2}, Symmetric difference is {2, 8} | set_operation | +| 94 | Base Conversion | Convert 344333 from base 6 to base 4. | 13031001 | base_conversion | +| 95 | Curved surface area of a cylinder | What is the curved surface area of a cylinder of radius, 1 and height, 69? | CSA of cylinder = 433.54 | curved_surface_area_cylinder | +| 96 | Perimeter of Polygons | The perimeter of a 8 sided polygon with lengths of [88, 89, 103, 89, 98, 88, 114, 70]cm is: | 739 | perimeter_of_polygons | +| 97 | Power of Powers | The 44^6^10 = 44^(6*10) = 44^60 | 404725519480944371837890113388236472786198610068547182641046982530192155481830472108593384496562176 | power_of_powers | +| 98 | Quotient of Powers with Same Base | The Quotient of 26^7 and 26^10 = 26^(7-10) = 26^-3 | 5.689576695493855e-05 | quotient_of_power_same_base | +| 99 | Quotient of Powers with Same Power | The Quotient of 3^10 and 5^10 = (3/5)^10 = 0.6^10 | 0.006046617599999997 | quotient_of_power_same_power | +| 100 | complex Quadratic Equation | Find the roots of given Quadratic Equation x^2 + 8x + 1 = 0 | simplified solution : ((-0.127, -7.873)), generalized solution : ((-8 + sqrt(60))/2*1, (-8 - sqrt(60))/2*1) | complex_quadratic | +| 101 | Leap Year or Not | Year 1932 | is a leap year | is_leap_year | +| 102 | Minute to Hour conversion | Convert 751 minutes to Hours & Minutes | 12 hours and 31 minutes | minutes_to_hours | diff --git a/mathgenerator/funcs/__init__.py b/mathgenerator/funcs/__init__.py index 2b8fe33..117150d 100644 --- a/mathgenerator/funcs/__init__.py +++ b/mathgenerator/funcs/__init__.py @@ -106,4 +106,4 @@ from .quotient_of_power_same_base import * from .quotient_of_power_same_power import * from .complex_quadratic import * from .is_leap_year import * -from .minutesToHours import * \ No newline at end of file +from .minutes_to_hours import * diff --git a/mathgenerator/funcs/minutesToHoursFunc.py b/mathgenerator/funcs/minutesToHoursFunc.py deleted file mode 100644 index 7a21816..0000000 --- a/mathgenerator/funcs/minutesToHoursFunc.py +++ /dev/null @@ -1,13 +0,0 @@ -from .__init__ import * - - -def minutesToHoursFunc(maxMinutes=999): - minutes = random.randint(1, maxMinutes) - hours1 = int(minutes/60) - hours2 = minutes%60 - problem = f"Convert {minutes} minutes to Hours & Minutes" - solution = f"minutes_to_hours(230) = {hours1}h:{hours2}m" - return problem, solution - - -minutesToHours = Generator("Minute to Hour conversion", 96 , "Convert minutes to Hours & Minutes", "hours:minutes", minutesToHoursFunc) diff --git a/mathgenerator/funcs/minutes_to_hours.py b/mathgenerator/funcs/minutes_to_hours.py new file mode 100644 index 0000000..7b52b82 --- /dev/null +++ b/mathgenerator/funcs/minutes_to_hours.py @@ -0,0 +1,14 @@ +from .__init__ import * + + +def minutesToHoursFunc(maxMinutes=999): + minutes = random.randint(1, maxMinutes) + hours1 = int(minutes / 60) + hours2 = minutes % 60 + problem = f"Convert {minutes} minutes to Hours & Minutes" + solution = f"{hours1} hours and {hours2} minutes" + return problem, solution + + +minutes_to_hours = Generator("Minute to Hour conversion", 102, + "Convert minutes to Hours & Minutes", "hours:minutes", minutesToHoursFunc) diff --git a/test.py b/test.py index 0b24009..69574e0 100644 --- a/test.py +++ b/test.py @@ -11,4 +11,4 @@ for item in list: # print(mathgen.getGenList()) print(mathgen.decimal_to_roman_numerals()) -print(mathgen.genById(101)) +print(mathgen.genById(102)) From c8815aec75083ca3daf50a1520e834f73bbf0be8 Mon Sep 17 00:00:00 2001 From: lukew3 Date: Fri, 23 Oct 2020 13:40:42 -0400 Subject: [PATCH 12/15] decimal to bcd fix --- README.md | 205 +++++++++++++------------- mathgenerator/funcs/__init__.py | 1 + mathgenerator/funcs/decimal_to_bcd.py | 11 +- test.py | 2 +- 4 files changed, 111 insertions(+), 108 deletions(-) diff --git a/README.md b/README.md index 8c2e7f0..402815d 100644 --- a/README.md +++ b/README.md @@ -31,106 +31,107 @@ problem, solution = mathgen.genById(0) | Id | Skill | Example problem | Example Solution | Function Name | |------|-----------------------------------|--------------------|-----------------------|--------------------------| [//]: # list start -| 0 | Addition | 16+2= | 18 | addition | -| 1 | Subtraction | 9-6= | 3 | subtraction | -| 2 | Multiplication | 3*0= | 0 | multiplication | -| 3 | Division | 80/88= | 0.9090909090909091 | division | -| 4 | Binary Complement 1s | 0000100= | 1111011 | binary_complement_1s | -| 5 | Modulo Division | 99%94= | 5 | modulo_division | -| 6 | Square Root | sqrt(16)= | 4 | square_root | -| 7 | Power Rule Differentiation | 7x^8 + 4x^10 + 9x^9 + 4x^10 | 56x^7 + 40x^9 + 81x^8 + 40x^9 | power_rule_differentiation | -| 8 | Square | 17^2= | 289 | square | -| 9 | LCM (Least Common Multiple) | LCM of 1 and 8 = | 8 | lcm | -| 10 | GCD (Greatest Common Denominator) | GCD of 11 and 7 = | 1 | gcd | -| 11 | Basic Algebra | 8x + 4 = 4 | 0 | basic_algebra | -| 12 | Logarithm | log3(729) | 6 | log | -| 13 | Easy Division | 575/25 = | 23 | int_division | -| 14 | Decimal to Binary | Binary of 55= | 110111 | decimal_to_binary | -| 15 | Binary to Decimal | 01101001 | 105 | binary_to_decimal | -| 16 | Fraction Division | (1/2)/(7/10) | 5/7 | divide_fractions | -| 17 | Integer Multiplication with 2x2 Matrix | 7 * [[4, 2], [5, 0]] = | [[28,14],[35,0]] | multiply_int_to_22_matrix | -| 18 | Area of Triangle | Area of triangle with side lengths: 15 12 8 = | 47.811478747263195 | area_of_triangle | -| 19 | Triangle exists check | Does triangle with sides 23, 29 and 35 exist? | Yes | valid_triangle | -| 20 | Midpoint of the two point | (8,-2),(-11,-1)= | (-1.5,-1.5) | midpoint_of_two_points | -| 21 | Factoring Quadratic | x^2+6x+5 | (x+5)(x+1) | factoring | -| 22 | Third Angle of Triangle | Third angle of triangle with angles 39 and 12 = | 129 | third_angle_of_triangle | -| 23 | Solve a System of Equations in R^2 | 9x + 7y = 14, -6x - 2y = -28 | x = 7, y = -7 | system_of_equations | -| 24 | Distance between 2 points | Find the distance between (3, -6) and (3, -5) | sqrt(1) | distance_two_points | -| 25 | Pythagorean Theorem | The hypotenuse of a right triangle given the other two lengths 7 and 8 = | 10.63 | pythagorean_theorem | -| 26 | Linear Equations | -5x + -5y = 90, -7x + 4y = 137 | x = -19, y = 1 | linear_equations | -| 27 | Prime Factorisation | Find prime factors of 10 | [2, 5] | prime_factors | -| 28 | Fraction Multiplication | (2/9)*(8/10) | 8/45 | fraction_multiplication | -| 29 | Angle of a Regular Polygon | Find the angle of a regular polygon with 14 sides | 154.29 | angle_regular_polygon | -| 30 | Combinations of Objects | Number of combinations from 18 objects picked 6 at a time | 18564 | combinations | -| 31 | Factorial | 3! = | 6 | factorial | -| 32 | Surface Area of Cube | Surface area of cube with side = 18m is | 1944 m^2 | surface_area_cube | -| 33 | Surface Area of Cuboid | Surface area of cuboid with sides = 12m, 13m, 1m is | 362 m^2 | surface_area_cuboid | -| 34 | Surface Area of Cylinder | Surface area of cylinder with height = 17m and radius = 17m is | 3631 m^2 | surface_area_cylinder | -| 35 | Volum of Cube | Volume of cube with side = 16m is | 4096 m^3 | volume_cube | -| 36 | Volume of Cuboid | Volume of cuboid with sides = 7m, 13m, 14m is | 1274 m^3 | volume_cuboid | -| 37 | Volume of cylinder | Volume of cylinder with height = 2m and radius = 1m is | 6 m^3 | volume_cylinder | -| 38 | Surface Area of cone | Surface area of cone with height = 4m and radius = 6m is | 249 m^2 | surface_area_cone | -| 39 | Volume of cone | Volume of cone with height = 39m and radius = 15m is | 9189 m^3 | volume_cone | -| 40 | Common Factors | Common Factors of 30 and 61 = | [1] | common_factors | -| 41 | Intersection of Two Lines | Find the point of intersection of the two lines: y = 6/6x + 7 and y = 4x + 9 | (-2/3, 19/3) | intersection_of_two_lines | -| 42 | Permutations | Number of Permutations from 15 objects picked 9 at a time = | 1816214400 | permutation | -| 43 | Cross Product of 2 Vectors | [-10, 6, 12] X [-6, 4, 1] = | [-42, -62, -4] | vector_cross | -| 44 | Compare Fractions | Which symbol represents the comparison between 10/1 and 4/6? | > | compare_fractions | -| 45 | Simple Interest | Simple interest for a principle amount of 9743 dollars, 1% rate of interest and for a time period of 5 years is = | 487.15 | simple_interest | -| 46 | Multiplication of two matrices | Multiply
-4-8
-4-10
and
-59
7-6
|
-3612
-5024
| matrix_multiplication | -| 47 | Cube Root | cuberoot of 439 upto 2 decimal places is: | 7.6 | cube_root | -| 48 | Power Rule Integration | 2x^1 + 7x^4 + 10x^9 + 6x^10 | (2/1)x^2 + (7/4)x^5 + (10/9)x^10 + (6/10)x^11 + c | power_rule_integration | -| 49 | Fourth Angle of Quadrilateral | Fourth angle of quadrilateral with angles 148 , 57, 12 = | 143 | fourth_angle_of_quadrilateral | -| 50 | Quadratic Equation | Zeros of the Quadratic Equation 72x^2+137x+32=0 | [-0.27, -1.63] | quadratic_equation | -| 51 | HCF (Highest Common Factor) | HCF of 17 and 1 = | 1 | hcf | -| 52 | Probability of a certain sum appearing on faces of dice | If 2 dice are rolled at the same time, the probability of getting a sum of 2 = | 1/36 | dice_sum_probability | -| 53 | Exponentiation | 18^1 = | 18 | exponentiation | -| 54 | Confidence interval For sample S | The confidence interval for sample [268, 237, 275, 264, 256, 215, 225, 294, 286, 283, 239, 219, 287, 262, 241, 223, 273, 279, 206, 274, 228, 236, 252, 285, 212, 229, 254, 295, 244, 232, 211, 213, 210, 227, 255, 280] with 95% confidence is | (258.07181132546515, 240.20596645231262) | confidence_interval | -| 55 | Comparing surds | Fill in the blanks 95^(1/2) _ 45^(1/5) | > | surds_comparison | -| 56 | Fibonacci Series | The Fibonacci Series of the first 2 numbers is ? | [0, 1] | fibonacci_series | -| 57 | Trigonometric Values | What is cos(90)? | 0 | basic_trigonometry | -| 58 | Sum of Angles of Polygon | Sum of angles of polygon with 4 sides = | 360 | sum_of_polygon_angles | -| 59 | Mean,Standard Deviation,Variance | Find the mean,standard deviation and variance for the data[30, 16, 18, 10, 10, 21, 8, 27, 37, 8, 12, 25, 20, 9, 24] | The Mean is 18.333333333333332 , Standard Deviation is 75.42222222222222, Variance is 8.684596837057102 | data_summary | -| 60 | Surface Area of Sphere | Surface area of Sphere with radius = 8m is | 804.247719318987 m^2 | surface_area_sphere | -| 61 | Volume of Sphere | Volume of sphere with radius 42 m = | 310339.08869221417 m^3 | volume_sphere | -| 62 | nth Fibonacci number | What is the 92th Fibonacci number? | 7540113804746369024 | nth_fibonacci_number | -| 63 | Profit or Loss Percent | Profit percent when CP = 923 and SP = 973 is: | 5.417118093174431 | profit_loss_percent | -| 64 | Binary to Hexidecimal | 011010110 | 0xd6 | binary_to_hex | -| 65 | Multiplication of 2 complex numbers | (7+3j) * (9-10j) = | (93-43j) | multiply_complex_numbers | -| 66 | Geometric Progression | For the given GP [9, 36, 144, 576, 2304, 9216] ,Find the value of a,common ratio,8th term value, sum upto 7th term | The value of a is 9, common ratio is 4 , 8th term is 147456 , sum upto 7th term is 49149.0 | geometric_progression | -| 67 | Geometric Mean of N Numbers | Geometric mean of 3 numbers 96 , 22 and 75 = | (96*22*75)^(1/3) = 54.1067845799048 | geometric_mean | -| 68 | Harmonic Mean of N Numbers | Harmonic mean of 2 numbers 14 and 99 = | 2/((1/14) + (1/99)) = 24.530973451327437 | harmonic_mean | -| 69 | Euclidian norm or L2 norm of a vector | Euclidian norm or L2 norm of the vector[13.74350761660692, 579.8164944254971, 343.9004348023842, 447.91085049813904, 242.73436069826982, 677.824056340719, 908.0309446289546, 143.65153181819267, 268.05852693335817, 63.42979841101859] is: | 1447.2967158340782 | euclidian_norm | -| 70 | Angle between 2 vectors | angle between the vectors [554.45, 891.65, 845.2, 235.2, 741.43, 734.84, 92.76, 941.97, 885.6, 436.2, 476.49, 836.42, 743.03, 728.97, 963.3, 802.39] and [980.7, 745.14, 384.18, 452.88, 815.24, 725.39, 887.21, 828.72, 786.58, 990.6, 496.01, 439.13, 947.39, 737.59, 293.98, 880.62] is: | 0.5 radians | angle_btw_vectors | -| 71 | Absolute difference between two numbers | Absolute difference between numbers 88 and -73 = | 161 | absolute_difference | -| 72 | Dot Product of 2 Vectors | [-14, -2, 13] . [0, -18, -2] = | 10 | vector_dot | -| 73 | Binary 2's Complement | 2's complement of = | | binary_2s_complement | -| 74 | Inverse of a Matrix | Inverse of Matrix Matrix([[53, 17, 67], [59, 72, 87], [2, 51, 61]]) is: | Matrix([[-9/26269, 476/26269, -669/26269], [-685/26269, 3099/131345, -658/131345], [573/26269, -2669/131345, 2813/131345]]) | invert_matrix | -| 75 | Area of a Sector | Given radius, 44 and angle, 279. Find the area of the sector. | Area of sector = 4713.64562 | sector_area | -| 76 | Mean and Median | Given the series of numbers [67, 20, 53, 42, 74, 89, 54, 4, 37, 49]. find the arithmatic mean and mdian of the series | Arithmetic mean of the series is 48.9 and Arithmetic median of this series is 51.0 | mean_median | -| 77 | Determinant to 2x2 Matrix | Det([[44, 92], [88, 57]]) = | -5588 | int_matrix_22_determinant | -| 78 | Compound Interest | Compound interest for a principle amount of 3765 dollars, 5% rate of interest and for a time period of 1 year is = | 3953.25 | compound_interest | -| 79 | Decimal to Hexadecimal | Binary of 324= | 0x144 | decimal_to_hexadeci | -| 80 | Percentage of a number | What is 45% of 71? | Required percentage = 31.95% | percentage | -| 81 | Celsius To Fahrenheit | Convert 0 degrees Celsius to degrees Fahrenheit = | 32.0 | celsius_to_fahrenheit | -| 82 | AP Term Calculation | Find the term number 6 of the AP series: 29, -38, -105 ... | -306 | arithmetic_progression_term | -| 83 | AP Sum Calculation | Find the sum of first 50 terms of the AP series: -90, -141, -192 ... | -66975.0 | arithmetic_progression_sum | -| 84 | Converts decimal to octal | The decimal number 84 in Octal is: | 0o124 | decimal_to_octal | -| 85 | Converts decimal to Roman Numerals | The number 1646 in Roman Numerals is: | MDCXLVI | decimal_to_roman_numerals | -| 86 | Degrees to Radians | Angle 294 in radians is = | 5.13 | degree_to_rad | +| 0 | Addition | 7+40= | 47 | addition | +| 1 | Subtraction | 52-51= | 1 | subtraction | +| 2 | Multiplication | 3*21= | 63 | multiplication | +| 3 | Division | 46/50= | 0.92 | division | +| 4 | Binary Complement 1s | 1011= | 0100 | binary_complement_1s | +| 5 | Modulo Division | 17%78= | 17 | modulo_division | +| 6 | Square Root | sqrt(36)= | 6 | square_root | +| 7 | Power Rule Differentiation | 8x^8 + 1x^4 | 64x^7 + 4x^3 | power_rule_differentiation | +| 8 | Square | 14^2= | 196 | square | +| 9 | LCM (Least Common Multiple) | LCM of 10 and 17 = | 170 | lcm | +| 10 | GCD (Greatest Common Denominator) | GCD of 8 and 8 = | 8 | gcd | +| 11 | Basic Algebra | 1x + 2 = 3 | 1 | basic_algebra | +| 12 | Logarithm | log3(9) | 2 | log | +| 13 | Easy Division | 17/1 = | 17 | int_division | +| 14 | Decimal to Binary | Binary of 23= | 10111 | decimal_to_binary | +| 15 | Binary to Decimal | 100 | 4 | binary_to_decimal | +| 16 | Fraction Division | (10/1)/(2/7) | 35 | divide_fractions | +| 17 | Integer Multiplication with 2x2 Matrix | 1 * [[8, 4], [9, 3]] = | [[8,4],[9,3]] | multiply_int_to_22_matrix | +| 18 | Area of Triangle | Area of triangle with side lengths: 16 5 7 = | (2.5717582782094417e-15+42j) | area_of_triangle | +| 19 | Triangle exists check | Does triangle with sides 13, 45 and 45 exist? | Yes | valid_triangle | +| 20 | Midpoint of the two point | (17,11),(7,9)= | (12.0,10.0) | midpoint_of_two_points | +| 21 | Factoring Quadratic | x^2-1x-6 | (x+2)(x-3) | factoring | +| 22 | Third Angle of Triangle | Third angle of triangle with angles 20 and 30 = | 130 | third_angle_of_triangle | +| 23 | Solve a System of Equations in R^2 | 9x - 9y = -54, 4x + 9y = -11 | x = -5, y = 1 | system_of_equations | +| 24 | Distance between 2 points | Find the distance between (21, 19) and (16, -5) | sqrt(601) | distance_two_points | +| 25 | Pythagorean Theorem | The hypotenuse of a right triangle given the other two lengths 20 and 19 = | 27.59 | pythagorean_theorem | +| 26 | Linear Equations | -3x + -4y = -23, 20x + -8y = -540 | x = -19, y = 20 | linear_equations | +| 27 | Prime Factorisation | Find prime factors of 77 | [7, 11] | prime_factors | +| 28 | Fraction Multiplication | (10/6)*(1/8) | 5/24 | fraction_multiplication | +| 29 | Angle of a Regular Polygon | Find the angle of a regular polygon with 15 sides | 156.0 | angle_regular_polygon | +| 30 | Combinations of Objects | Number of combinations from 11 objects picked 8 at a time | 165 | combinations | +| 31 | Factorial | 4! = | 24 | factorial | +| 32 | Surface Area of Cube | Surface area of cube with side = 8m is | 384 m^2 | surface_area_cube | +| 33 | Surface Area of Cuboid | Surface area of cuboid with sides = 4m, 4m, 3m is | 80 m^2 | surface_area_cuboid | +| 34 | Surface Area of Cylinder | Surface area of cylinder with height = 47m and radius = 3m is | 942 m^2 | surface_area_cylinder | +| 35 | Volum of Cube | Volume of cube with side = 10m is | 1000 m^3 | volume_cube | +| 36 | Volume of Cuboid | Volume of cuboid with sides = 6m, 7m, 11m is | 462 m^3 | volume_cuboid | +| 37 | Volume of cylinder | Volume of cylinder with height = 41m and radius = 12m is | 18547 m^3 | volume_cylinder | +| 38 | Surface Area of cone | Surface area of cone with height = 11m and radius = 9m is | 656 m^2 | surface_area_cone | +| 39 | Volume of cone | Volume of cone with height = 50m and radius = 18m is | 16964 m^3 | volume_cone | +| 40 | Common Factors | Common Factors of 6 and 51 = | [1, 3] | common_factors | +| 41 | Intersection of Two Lines | Find the point of intersection of the two lines: y = 2x + 7 and y = -8/2x - 1 | (-4/3, 13/3) | intersection_of_two_lines | +| 42 | Permutations | Number of Permutations from 18 objects picked 3 at a time = | 4896 | permutation | +| 43 | Cross Product of 2 Vectors | [-18, 10, 2] X [-13, 16, 16] = | [128, 262, -158] | vector_cross | +| 44 | Compare Fractions | Which symbol represents the comparison between 9/5 and 10/7? | > | compare_fractions | +| 45 | Simple Interest | Simple interest for a principle amount of 7207 dollars, 3% rate of interest and for a time period of 7 years is = | 1513.47 | simple_interest | +| 46 | Multiplication of two matrices | Multiply
-1-3
84
-90
-5-7
and
4-9107
-85-3-5
|
20-6-18
0-526836
-3681-90-63
3610-290
| matrix_multiplication | +| 47 | Cube Root | cuberoot of 388 upto 2 decimal places is: | 7.29 | cube_root | +| 48 | Power Rule Integration | 7x^5 + 2x^8 | (7/5)x^6 + (2/8)x^9 + c | power_rule_integration | +| 49 | Fourth Angle of Quadrilateral | Fourth angle of quadrilateral with angles 133 , 16, 122 = | 89 | fourth_angle_of_quadrilateral | +| 50 | Quadratic Equation | Zeros of the Quadratic Equation 14x^2+149x+5=0 | [-0.03, -10.61] | quadratic_equation | +| 51 | HCF (Highest Common Factor) | HCF of 15 and 3 = | 3 | hcf | +| 52 | Probability of a certain sum appearing on faces of dice | If 3 dice are rolled at the same time, the probability of getting a sum of 7 = | 15/216 | dice_sum_probability | +| 53 | Exponentiation | 13^3 = | 2197 | exponentiation | +| 54 | Confidence interval For sample S | The confidence interval for sample [205, 274, 277, 258, 211, 242, 213, 228, 253, 294, 276, 210, 247, 229, 206, 204, 290, 231, 208, 264, 243, 267, 215, 282, 216, 233, 251, 203, 292, 278, 226] with 99% confidence is | (256.4847632648058, 229.06362383196844) | confidence_interval | +| 55 | Comparing surds | Fill in the blanks 9^(1/9) _ 85^(1/2) | < | surds_comparison | +| 56 | Fibonacci Series | The Fibonacci Series of the first 20 numbers is ? | [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181] | fibonacci_series | +| 57 | Trigonometric Values | What is sin(45)? | 1/√2 | basic_trigonometry | +| 58 | Sum of Angles of Polygon | Sum of angles of polygon with 9 sides = | 1260 | sum_of_polygon_angles | +| 59 | Mean,Standard Deviation,Variance | Find the mean,standard deviation and variance for the data[27, 42, 37, 26, 30, 22, 32, 7, 36, 15, 6, 10, 17, 16, 12] | The Mean is 22.333333333333332 , Standard Deviation is 123.95555555555556, Variance is 11.133532932342526 | data_summary | +| 60 | Surface Area of Sphere | Surface area of Sphere with radius = 13m is | 2123.7166338267 m^2 | surface_area_sphere | +| 61 | Volume of Sphere | Volume of sphere with radius 4 m = | 268.082573106329 m^3 | volume_sphere | +| 62 | nth Fibonacci number | What is the 15th Fibonacci number? | 610 | nth_fibonacci_number | +| 63 | Profit or Loss Percent | Profit percent when CP = 291 and SP = 468 is: | 60.824742268041234 | profit_loss_percent | +| 64 | Binary to Hexidecimal | 0010 | 0x2 | binary_to_hex | +| 65 | Multiplication of 2 complex numbers | (19+1j) * (10+19j) = | (171+371j) | multiply_complex_numbers | +| 66 | Geometric Progression | For the given GP [4, 12, 36, 108, 324, 972] ,Find the value of a,common ratio,7th term value, sum upto 6th term | The value of a is 4, common ratio is 3 , 7th term is 2916 , sum upto 6th term is 1456.0 | geometric_progression | +| 67 | Geometric Mean of N Numbers | Geometric mean of 4 numbers 38 , 66 , 80 , 24 = | (38*66*80*24)^(1/4) = 46.84434709254888 | geometric_mean | +| 68 | Harmonic Mean of N Numbers | Harmonic mean of 4 numbers 19 , 3 , 94 , 47 = | 4/((1/19) + (1/3) + (1/94) + (1/47)) = 9.572130415364002 | harmonic_mean | +| 69 | Euclidian norm or L2 norm of a vector | Euclidian norm or L2 norm of the vector[88.65597674656611, 513.1160127304324] is: | 520.7186617870201 | euclidian_norm | +| 70 | Angle between 2 vectors | angle between the vectors [247.81, 715.31, 324.88, 189.51, 331.72, 625.64, 723.42] and [393.64, 599.63, 109.53, 333.49, 979.47, 489.72, 878.62] is: | 0.48 radians | angle_btw_vectors | +| 71 | Absolute difference between two numbers | Absolute difference between numbers 30 and 30 = | 0 | absolute_difference | +| 72 | Dot Product of 2 Vectors | [10, -6, 8] . [12, 4, 18] = | 240 | vector_dot | +| 73 | Binary 2's Complement | 2's complement of 1101100 = | 10100 | binary_2s_complement | +| 74 | Inverse of a Matrix | Inverse of Matrix Matrix([[56, 89, 27], [19, 5, 14], [3, 80, 35]]) is: | Matrix([[135/9676, 955/67732, -1111/67732], [89/9676, -1879/67732, 271/67732], [-215/9676, 4213/67732, 1411/67732]]) | invert_matrix | +| 75 | Area of a Sector | Given radius, 22 and angle, 249. Find the area of the sector. | Area of sector = 1051.70050 | sector_area | +| 76 | Mean and Median | Given the series of numbers [3, 97, 58, 14, 19, 54, 29, 24, 25, 91]. find the arithmatic mean and mdian of the series | Arithmetic mean of the series is 41.4 and Arithmetic median of this series is 27.0 | mean_median | +| 77 | Determinant to 2x2 Matrix | Det([[19, 45], [76, 73]]) = | -2033 | int_matrix_22_determinant | +| 78 | Compound Interest | Compound interest for a principle amount of 4831 dollars, 4% rate of interest and for a time period of 9 year is = | 6876.02 | compound_interest | +| 79 | Decimal to Hexadecimal | Binary of 180= | 0xb4 | decimal_to_hexadeci | +| 80 | Percentage of a number | What is 11% of 69? | Required percentage = 7.59% | percentage | +| 81 | Celsius To Fahrenheit | Convert 95 degrees Celsius to degrees Fahrenheit = | 203.0 | celsius_to_fahrenheit | +| 82 | AP Term Calculation | Find the term number 40 of the AP series: 79, 113, 147 ... | 1405 | arithmetic_progression_term | +| 83 | AP Sum Calculation | Find the sum of first 81 terms of the AP series: 68, -9, -86 ... | -243972.0 | arithmetic_progression_sum | +| 84 | Converts decimal to octal | The decimal number 2985 in Octal is: | 0o5651 | decimal_to_octal | +| 85 | Converts decimal to Roman Numerals | The number 1752 in Roman Numerals is: | MDCCLII | decimal_to_roman_numerals | +| 86 | Degrees to Radians | Angle 206 in radians is = | 3.6 | degree_to_rad | | 87 | Radians to Degrees | Angle 0 in degrees is = | 0.0 | radian_to_deg | -| 88 | Differentiation | differentiate w.r.t x : d(exp(x)+2*x^(-4))/dx | exp(x) - 8/x^5 | differentiation | -| 89 | Definite Integral of Quadratic Equation | The definite integral within limits 0 to 1 of the equation 100x^2 + 44x + 23 is = | 78.3333 | definite_integral | -| 90 | isprime | 99 | False | is_prime | -| 91 | Binary Coded Decimal to Integer | Integer of Binary Coded Decimal 7 is = | 29969 | bcd_to_decimal | -| 92 | Complex To Polar Form | rexp(itheta) = | 22.67exp(i2.42) | complex_to_polar | -| 93 | Union,Intersection,Difference of Two Sets | Given the two sets a={8, 1, 4, 7} ,b={1, 2, 4, 7}.Find the Union,intersection,a-b,b-a and symmetric difference | Union is {1, 2, 4, 7, 8},Intersection is {1, 4, 7}, a-b is {8},b-a is {2}, Symmetric difference is {2, 8} | set_operation | -| 94 | Base Conversion | Convert 344333 from base 6 to base 4. | 13031001 | base_conversion | -| 95 | Curved surface area of a cylinder | What is the curved surface area of a cylinder of radius, 1 and height, 69? | CSA of cylinder = 433.54 | curved_surface_area_cylinder | -| 96 | Perimeter of Polygons | The perimeter of a 8 sided polygon with lengths of [88, 89, 103, 89, 98, 88, 114, 70]cm is: | 739 | perimeter_of_polygons | -| 97 | Power of Powers | The 44^6^10 = 44^(6*10) = 44^60 | 404725519480944371837890113388236472786198610068547182641046982530192155481830472108593384496562176 | power_of_powers | -| 98 | Quotient of Powers with Same Base | The Quotient of 26^7 and 26^10 = 26^(7-10) = 26^-3 | 5.689576695493855e-05 | quotient_of_power_same_base | -| 99 | Quotient of Powers with Same Power | The Quotient of 3^10 and 5^10 = (3/5)^10 = 0.6^10 | 0.006046617599999997 | quotient_of_power_same_power | -| 100 | complex Quadratic Equation | Find the roots of given Quadratic Equation x^2 + 8x + 1 = 0 | simplified solution : ((-0.127, -7.873)), generalized solution : ((-8 + sqrt(60))/2*1, (-8 - sqrt(60))/2*1) | complex_quadratic | -| 101 | Leap Year or Not | Year 1932 | is a leap year | is_leap_year | -| 102 | Minute to Hour conversion | Convert 751 minutes to Hours & Minutes | 12 hours and 31 minutes | minutes_to_hours | +| 88 | Differentiation | differentiate w.r.t x : d(cot(x)+4*x^(-3))/dx | -cot(x)^2 - 1 - 12/x^4 | differentiation | +| 89 | Definite Integral of Quadratic Equation | The definite integral within limits 0 to 1 of the equation 43x^2 + 13x + 29 is = | 49.8333 | definite_integral | +| 90 | isprime | 86 | False | is_prime | +| 91 | Binary Coded Decimal to Integer | Integer of Binary Coded Decimal 5 is = | 21620 | bcd_to_decimal | +| 92 | Complex To Polar Form | rexp(itheta) = | 22.47exp(i-2.58) | complex_to_polar | +| 93 | Union,Intersection,Difference of Two Sets | Given the two sets a={9, 3, 1, 6} ,b={2, 4, 5, 9, 10}.Find the Union,intersection,a-b,b-a and symmetric difference | Union is {1, 2, 3, 4, 5, 6, 9, 10},Intersection is {9}, a-b is {1, 3, 6},b-a is {2, 10, 4, 5}, Symmetric difference is {1, 2, 3, 4, 5, 6, 10} | set_operation | +| 94 | Base Conversion | Convert 111122000 from base 3 to base 16. | 26D0 | base_conversion | +| 95 | Curved surface area of a cylinder | What is the curved surface area of a cylinder of radius, 9 and height, 34? | CSA of cylinder = 1922.65 | curved_surface_area_cylinder | +| 96 | Perimeter of Polygons | The perimeter of a 3 sided polygon with lengths of [4, 30, 88]cm is: | 122 | perimeter_of_polygons | +| 97 | Power of Powers | The 20^3^7 = 20^(3*7) = 20^21 | 2097152000000000000000000000 | power_of_powers | +| 98 | Quotient of Powers with Same Base | The Quotient of 10^7 and 10^3 = 10^(7-3) = 10^4 | 10000 | quotient_of_power_same_base | +| 99 | Quotient of Powers with Same Power | The Quotient of 30^1 and 40^1 = (30/40)^1 = 0.75^1 | 0.75 | quotient_of_power_same_power | +| 100 | complex Quadratic Equation | Find the roots of given Quadratic Equation 2x^2 + 7x + 1 = 0 | simplified solution : ((-0.149, -3.351)), generalized solution : ((-7 + sqrt(41))/2*2, (-7 - sqrt(41))/2*2) | complex_quadratic | +| 101 | Leap Year or Not | Year 1972 | is a leap year | is_leap_year | +| 102 | Minute to Hour conversion | Convert 908 minutes to Hours & Minutes | 15 hours and 8 minutes | minutes_to_hours | +| 103 | Decimal to Binary Coded Decimal | BCD of Decimal Number 3603 is = | 1413 | decimal_to_bcd | diff --git a/mathgenerator/funcs/__init__.py b/mathgenerator/funcs/__init__.py index 117150d..62135f9 100644 --- a/mathgenerator/funcs/__init__.py +++ b/mathgenerator/funcs/__init__.py @@ -107,3 +107,4 @@ from .quotient_of_power_same_power import * from .complex_quadratic import * from .is_leap_year import * from .minutes_to_hours import * +from .decimal_to_bcd import * diff --git a/mathgenerator/funcs/decimal_to_bcd.py b/mathgenerator/funcs/decimal_to_bcd.py index f9b235c..2f5eb79 100644 --- a/mathgenerator/funcs/decimal_to_bcd.py +++ b/mathgenerator/funcs/decimal_to_bcd.py @@ -1,22 +1,23 @@ -from .__init__ import * +from .__init__ import * def DecimalToBCDFunc(maxNumber=10000): n = random.randint(1000, maxNumber) - x=n + x = n binstring = '' bcdstring = '' while x > 0: nibble = x % 16 bcdstring = str(nibble) + bcdstring x >>= 4 - + problem = "BCD of Decimal Number " + str(n) + " is = " solution = int(bcdstring) return problem, solution -decimal_to_bcd = Generator("Decimal to Binary Coded Decimal", 101, + +decimal_to_bcd = Generator("Decimal to Binary Coded Decimal", 103, "Binary Coded Decimal of Decimal n is ", "b", DecimalToBCDFunc) -##for readme ## | 101 | Decimal to Binary Coded Decimal | Binary Coded Decimal of Decimal 34 is = | 22 | decimal_to_bcd | +# for readme ## | 101 | Decimal to Binary Coded Decimal | Binary Coded Decimal of Decimal 34 is = | 22 | decimal_to_bcd | diff --git a/test.py b/test.py index 69574e0..0fe349b 100644 --- a/test.py +++ b/test.py @@ -11,4 +11,4 @@ for item in list: # print(mathgen.getGenList()) print(mathgen.decimal_to_roman_numerals()) -print(mathgen.genById(102)) +print(mathgen.genById(103)) From 817f4a557e3935dc357ddc8ec71f042009debf72 Mon Sep 17 00:00:00 2001 From: lukew3 Date: Fri, 23 Oct 2020 13:43:36 -0400 Subject: [PATCH 13/15] remove binstring decimal to bcd --- mathgenerator/funcs/decimal_to_bcd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mathgenerator/funcs/decimal_to_bcd.py b/mathgenerator/funcs/decimal_to_bcd.py index 2f5eb79..5805987 100644 --- a/mathgenerator/funcs/decimal_to_bcd.py +++ b/mathgenerator/funcs/decimal_to_bcd.py @@ -4,7 +4,7 @@ from .__init__ import * def DecimalToBCDFunc(maxNumber=10000): n = random.randint(1000, maxNumber) x = n - binstring = '' + # binstring = '' bcdstring = '' while x > 0: nibble = x % 16 From de75ea20732cc737411a5ebda922ba63af88246b Mon Sep 17 00:00:00 2001 From: lukew3 Date: Fri, 23 Oct 2020 13:45:51 -0400 Subject: [PATCH 14/15] circumference of circle fixes --- README.md | 205 +++++++++++++------------- mathgenerator/funcs/__init__.py | 1 + mathgenerator/funcs/circumference.py | 5 +- mathgenerator/funcs/decimal_to_bcd.py | 2 - test.py | 2 +- 5 files changed, 107 insertions(+), 108 deletions(-) diff --git a/README.md b/README.md index 402815d..4f6ab56 100644 --- a/README.md +++ b/README.md @@ -31,107 +31,108 @@ problem, solution = mathgen.genById(0) | Id | Skill | Example problem | Example Solution | Function Name | |------|-----------------------------------|--------------------|-----------------------|--------------------------| [//]: # list start -| 0 | Addition | 7+40= | 47 | addition | -| 1 | Subtraction | 52-51= | 1 | subtraction | -| 2 | Multiplication | 3*21= | 63 | multiplication | -| 3 | Division | 46/50= | 0.92 | division | -| 4 | Binary Complement 1s | 1011= | 0100 | binary_complement_1s | -| 5 | Modulo Division | 17%78= | 17 | modulo_division | +| 0 | Addition | 15+24= | 39 | addition | +| 1 | Subtraction | 25-1= | 24 | subtraction | +| 2 | Multiplication | 1*88= | 88 | multiplication | +| 3 | Division | 42/80= | 0.525 | division | +| 4 | Binary Complement 1s | 00100011= | 11011100 | binary_complement_1s | +| 5 | Modulo Division | 27%18= | 9 | modulo_division | | 6 | Square Root | sqrt(36)= | 6 | square_root | -| 7 | Power Rule Differentiation | 8x^8 + 1x^4 | 64x^7 + 4x^3 | power_rule_differentiation | -| 8 | Square | 14^2= | 196 | square | -| 9 | LCM (Least Common Multiple) | LCM of 10 and 17 = | 170 | lcm | -| 10 | GCD (Greatest Common Denominator) | GCD of 8 and 8 = | 8 | gcd | -| 11 | Basic Algebra | 1x + 2 = 3 | 1 | basic_algebra | -| 12 | Logarithm | log3(9) | 2 | log | -| 13 | Easy Division | 17/1 = | 17 | int_division | -| 14 | Decimal to Binary | Binary of 23= | 10111 | decimal_to_binary | -| 15 | Binary to Decimal | 100 | 4 | binary_to_decimal | -| 16 | Fraction Division | (10/1)/(2/7) | 35 | divide_fractions | -| 17 | Integer Multiplication with 2x2 Matrix | 1 * [[8, 4], [9, 3]] = | [[8,4],[9,3]] | multiply_int_to_22_matrix | -| 18 | Area of Triangle | Area of triangle with side lengths: 16 5 7 = | (2.5717582782094417e-15+42j) | area_of_triangle | -| 19 | Triangle exists check | Does triangle with sides 13, 45 and 45 exist? | Yes | valid_triangle | -| 20 | Midpoint of the two point | (17,11),(7,9)= | (12.0,10.0) | midpoint_of_two_points | -| 21 | Factoring Quadratic | x^2-1x-6 | (x+2)(x-3) | factoring | -| 22 | Third Angle of Triangle | Third angle of triangle with angles 20 and 30 = | 130 | third_angle_of_triangle | -| 23 | Solve a System of Equations in R^2 | 9x - 9y = -54, 4x + 9y = -11 | x = -5, y = 1 | system_of_equations | -| 24 | Distance between 2 points | Find the distance between (21, 19) and (16, -5) | sqrt(601) | distance_two_points | -| 25 | Pythagorean Theorem | The hypotenuse of a right triangle given the other two lengths 20 and 19 = | 27.59 | pythagorean_theorem | -| 26 | Linear Equations | -3x + -4y = -23, 20x + -8y = -540 | x = -19, y = 20 | linear_equations | -| 27 | Prime Factorisation | Find prime factors of 77 | [7, 11] | prime_factors | -| 28 | Fraction Multiplication | (10/6)*(1/8) | 5/24 | fraction_multiplication | -| 29 | Angle of a Regular Polygon | Find the angle of a regular polygon with 15 sides | 156.0 | angle_regular_polygon | -| 30 | Combinations of Objects | Number of combinations from 11 objects picked 8 at a time | 165 | combinations | -| 31 | Factorial | 4! = | 24 | factorial | -| 32 | Surface Area of Cube | Surface area of cube with side = 8m is | 384 m^2 | surface_area_cube | -| 33 | Surface Area of Cuboid | Surface area of cuboid with sides = 4m, 4m, 3m is | 80 m^2 | surface_area_cuboid | -| 34 | Surface Area of Cylinder | Surface area of cylinder with height = 47m and radius = 3m is | 942 m^2 | surface_area_cylinder | -| 35 | Volum of Cube | Volume of cube with side = 10m is | 1000 m^3 | volume_cube | -| 36 | Volume of Cuboid | Volume of cuboid with sides = 6m, 7m, 11m is | 462 m^3 | volume_cuboid | -| 37 | Volume of cylinder | Volume of cylinder with height = 41m and radius = 12m is | 18547 m^3 | volume_cylinder | -| 38 | Surface Area of cone | Surface area of cone with height = 11m and radius = 9m is | 656 m^2 | surface_area_cone | -| 39 | Volume of cone | Volume of cone with height = 50m and radius = 18m is | 16964 m^3 | volume_cone | -| 40 | Common Factors | Common Factors of 6 and 51 = | [1, 3] | common_factors | -| 41 | Intersection of Two Lines | Find the point of intersection of the two lines: y = 2x + 7 and y = -8/2x - 1 | (-4/3, 13/3) | intersection_of_two_lines | -| 42 | Permutations | Number of Permutations from 18 objects picked 3 at a time = | 4896 | permutation | -| 43 | Cross Product of 2 Vectors | [-18, 10, 2] X [-13, 16, 16] = | [128, 262, -158] | vector_cross | -| 44 | Compare Fractions | Which symbol represents the comparison between 9/5 and 10/7? | > | compare_fractions | -| 45 | Simple Interest | Simple interest for a principle amount of 7207 dollars, 3% rate of interest and for a time period of 7 years is = | 1513.47 | simple_interest | -| 46 | Multiplication of two matrices | Multiply
-1-3
84
-90
-5-7
and
4-9107
-85-3-5
|
20-6-18
0-526836
-3681-90-63
3610-290
| matrix_multiplication | -| 47 | Cube Root | cuberoot of 388 upto 2 decimal places is: | 7.29 | cube_root | -| 48 | Power Rule Integration | 7x^5 + 2x^8 | (7/5)x^6 + (2/8)x^9 + c | power_rule_integration | -| 49 | Fourth Angle of Quadrilateral | Fourth angle of quadrilateral with angles 133 , 16, 122 = | 89 | fourth_angle_of_quadrilateral | -| 50 | Quadratic Equation | Zeros of the Quadratic Equation 14x^2+149x+5=0 | [-0.03, -10.61] | quadratic_equation | -| 51 | HCF (Highest Common Factor) | HCF of 15 and 3 = | 3 | hcf | -| 52 | Probability of a certain sum appearing on faces of dice | If 3 dice are rolled at the same time, the probability of getting a sum of 7 = | 15/216 | dice_sum_probability | -| 53 | Exponentiation | 13^3 = | 2197 | exponentiation | -| 54 | Confidence interval For sample S | The confidence interval for sample [205, 274, 277, 258, 211, 242, 213, 228, 253, 294, 276, 210, 247, 229, 206, 204, 290, 231, 208, 264, 243, 267, 215, 282, 216, 233, 251, 203, 292, 278, 226] with 99% confidence is | (256.4847632648058, 229.06362383196844) | confidence_interval | -| 55 | Comparing surds | Fill in the blanks 9^(1/9) _ 85^(1/2) | < | surds_comparison | -| 56 | Fibonacci Series | The Fibonacci Series of the first 20 numbers is ? | [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181] | fibonacci_series | -| 57 | Trigonometric Values | What is sin(45)? | 1/√2 | basic_trigonometry | -| 58 | Sum of Angles of Polygon | Sum of angles of polygon with 9 sides = | 1260 | sum_of_polygon_angles | -| 59 | Mean,Standard Deviation,Variance | Find the mean,standard deviation and variance for the data[27, 42, 37, 26, 30, 22, 32, 7, 36, 15, 6, 10, 17, 16, 12] | The Mean is 22.333333333333332 , Standard Deviation is 123.95555555555556, Variance is 11.133532932342526 | data_summary | -| 60 | Surface Area of Sphere | Surface area of Sphere with radius = 13m is | 2123.7166338267 m^2 | surface_area_sphere | -| 61 | Volume of Sphere | Volume of sphere with radius 4 m = | 268.082573106329 m^3 | volume_sphere | -| 62 | nth Fibonacci number | What is the 15th Fibonacci number? | 610 | nth_fibonacci_number | -| 63 | Profit or Loss Percent | Profit percent when CP = 291 and SP = 468 is: | 60.824742268041234 | profit_loss_percent | -| 64 | Binary to Hexidecimal | 0010 | 0x2 | binary_to_hex | -| 65 | Multiplication of 2 complex numbers | (19+1j) * (10+19j) = | (171+371j) | multiply_complex_numbers | -| 66 | Geometric Progression | For the given GP [4, 12, 36, 108, 324, 972] ,Find the value of a,common ratio,7th term value, sum upto 6th term | The value of a is 4, common ratio is 3 , 7th term is 2916 , sum upto 6th term is 1456.0 | geometric_progression | -| 67 | Geometric Mean of N Numbers | Geometric mean of 4 numbers 38 , 66 , 80 , 24 = | (38*66*80*24)^(1/4) = 46.84434709254888 | geometric_mean | -| 68 | Harmonic Mean of N Numbers | Harmonic mean of 4 numbers 19 , 3 , 94 , 47 = | 4/((1/19) + (1/3) + (1/94) + (1/47)) = 9.572130415364002 | harmonic_mean | -| 69 | Euclidian norm or L2 norm of a vector | Euclidian norm or L2 norm of the vector[88.65597674656611, 513.1160127304324] is: | 520.7186617870201 | euclidian_norm | -| 70 | Angle between 2 vectors | angle between the vectors [247.81, 715.31, 324.88, 189.51, 331.72, 625.64, 723.42] and [393.64, 599.63, 109.53, 333.49, 979.47, 489.72, 878.62] is: | 0.48 radians | angle_btw_vectors | -| 71 | Absolute difference between two numbers | Absolute difference between numbers 30 and 30 = | 0 | absolute_difference | -| 72 | Dot Product of 2 Vectors | [10, -6, 8] . [12, 4, 18] = | 240 | vector_dot | -| 73 | Binary 2's Complement | 2's complement of 1101100 = | 10100 | binary_2s_complement | -| 74 | Inverse of a Matrix | Inverse of Matrix Matrix([[56, 89, 27], [19, 5, 14], [3, 80, 35]]) is: | Matrix([[135/9676, 955/67732, -1111/67732], [89/9676, -1879/67732, 271/67732], [-215/9676, 4213/67732, 1411/67732]]) | invert_matrix | -| 75 | Area of a Sector | Given radius, 22 and angle, 249. Find the area of the sector. | Area of sector = 1051.70050 | sector_area | -| 76 | Mean and Median | Given the series of numbers [3, 97, 58, 14, 19, 54, 29, 24, 25, 91]. find the arithmatic mean and mdian of the series | Arithmetic mean of the series is 41.4 and Arithmetic median of this series is 27.0 | mean_median | -| 77 | Determinant to 2x2 Matrix | Det([[19, 45], [76, 73]]) = | -2033 | int_matrix_22_determinant | -| 78 | Compound Interest | Compound interest for a principle amount of 4831 dollars, 4% rate of interest and for a time period of 9 year is = | 6876.02 | compound_interest | -| 79 | Decimal to Hexadecimal | Binary of 180= | 0xb4 | decimal_to_hexadeci | -| 80 | Percentage of a number | What is 11% of 69? | Required percentage = 7.59% | percentage | -| 81 | Celsius To Fahrenheit | Convert 95 degrees Celsius to degrees Fahrenheit = | 203.0 | celsius_to_fahrenheit | -| 82 | AP Term Calculation | Find the term number 40 of the AP series: 79, 113, 147 ... | 1405 | arithmetic_progression_term | -| 83 | AP Sum Calculation | Find the sum of first 81 terms of the AP series: 68, -9, -86 ... | -243972.0 | arithmetic_progression_sum | -| 84 | Converts decimal to octal | The decimal number 2985 in Octal is: | 0o5651 | decimal_to_octal | -| 85 | Converts decimal to Roman Numerals | The number 1752 in Roman Numerals is: | MDCCLII | decimal_to_roman_numerals | -| 86 | Degrees to Radians | Angle 206 in radians is = | 3.6 | degree_to_rad | +| 7 | Power Rule Differentiation | 1x^7 | 7x^6 | power_rule_differentiation | +| 8 | Square | 15^2= | 225 | square | +| 9 | LCM (Least Common Multiple) | LCM of 19 and 6 = | 114 | lcm | +| 10 | GCD (Greatest Common Denominator) | GCD of 14 and 17 = | 1 | gcd | +| 11 | Basic Algebra | 8x + 10 = 10 | 0 | basic_algebra | +| 12 | Logarithm | log3(3) | 1 | log | +| 13 | Easy Division | 169/13 = | 13 | int_division | +| 14 | Decimal to Binary | Binary of 55= | 110111 | decimal_to_binary | +| 15 | Binary to Decimal | 0 | 0 | binary_to_decimal | +| 16 | Fraction Division | (1/3)/(8/4) | 1/6 | divide_fractions | +| 17 | Integer Multiplication with 2x2 Matrix | 2 * [[6, 1], [9, 2]] = | [[12,2],[18,4]] | multiply_int_to_22_matrix | +| 18 | Area of Triangle | Area of triangle with side lengths: 10 12 1 = | (5.827134701491688e-16+9.51643315533714j) | area_of_triangle | +| 19 | Triangle exists check | Does triangle with sides 24, 11 and 22 exist? | Yes | valid_triangle | +| 20 | Midpoint of the two point | (-1,6),(4,13)= | (1.5,9.5) | midpoint_of_two_points | +| 21 | Factoring Quadratic | x^2-15x+54 | (x-6)(x-9) | factoring | +| 22 | Third Angle of Triangle | Third angle of triangle with angles 30 and 49 = | 101 | third_angle_of_triangle | +| 23 | Solve a System of Equations in R^2 | -x + 3y = 23, 2x + 6y = 74 | x = 7, y = 10 | system_of_equations | +| 24 | Distance between 2 points | Find the distance between (-2, -1) and (9, 21) | sqrt(605) | distance_two_points | +| 25 | Pythagorean Theorem | The hypotenuse of a right triangle given the other two lengths 1 and 2 = | 2.24 | pythagorean_theorem | +| 26 | Linear Equations | -3x + 5y = 47, -2x + 5y = 63 | x = 16, y = 19 | linear_equations | +| 27 | Prime Factorisation | Find prime factors of 58 | [2, 29] | prime_factors | +| 28 | Fraction Multiplication | (3/5)*(5/9) | 1/3 | fraction_multiplication | +| 29 | Angle of a Regular Polygon | Find the angle of a regular polygon with 6 sides | 120.0 | angle_regular_polygon | +| 30 | Combinations of Objects | Number of combinations from 14 objects picked 8 at a time | 3003 | combinations | +| 31 | Factorial | 1! = | 1 | factorial | +| 32 | Surface Area of Cube | Surface area of cube with side = 10m is | 600 m^2 | surface_area_cube | +| 33 | Surface Area of Cuboid | Surface area of cuboid with sides = 7m, 20m, 12m is | 928 m^2 | surface_area_cuboid | +| 34 | Surface Area of Cylinder | Surface area of cylinder with height = 33m and radius = 6m is | 1470 m^2 | surface_area_cylinder | +| 35 | Volum of Cube | Volume of cube with side = 18m is | 5832 m^3 | volume_cube | +| 36 | Volume of Cuboid | Volume of cuboid with sides = 3m, 20m, 20m is | 1200 m^3 | volume_cuboid | +| 37 | Volume of cylinder | Volume of cylinder with height = 14m and radius = 10m is | 4398 m^3 | volume_cylinder | +| 38 | Surface Area of cone | Surface area of cone with height = 19m and radius = 1m is | 62 m^2 | surface_area_cone | +| 39 | Volume of cone | Volume of cone with height = 17m and radius = 13m is | 3008 m^3 | volume_cone | +| 40 | Common Factors | Common Factors of 81 and 74 = | [1] | common_factors | +| 41 | Intersection of Two Lines | Find the point of intersection of the two lines: y = -7/2x - 5 and y = -10/4x + 6 | (-11, 67/2) | intersection_of_two_lines | +| 42 | Permutations | Number of Permutations from 17 objects picked 8 at a time = | 980179200 | permutation | +| 43 | Cross Product of 2 Vectors | [3, -10, 2] X [8, 8, -9] = | [74, 43, 104] | vector_cross | +| 44 | Compare Fractions | Which symbol represents the comparison between 5/6 and 10/7? | < | compare_fractions | +| 45 | Simple Interest | Simple interest for a principle amount of 1332 dollars, 7% rate of interest and for a time period of 8 years is = | 745.92 | simple_interest | +| 46 | Multiplication of two matrices | Multiply
2-10-8
-1060
00-2
6-1-2
and
-17-3
-10-810
773
|
4238-130
-50-11890
-14-14-6
-1036-34
| matrix_multiplication | +| 47 | Cube Root | cuberoot of 845 upto 2 decimal places is: | 9.45 | cube_root | +| 48 | Power Rule Integration | 10x^7 + 7x^2 + 1x^10 + 9x^10 + 6x^1 | (10/7)x^8 + (7/2)x^3 + (1/10)x^11 + (9/10)x^11 + (6/1)x^2 + c | power_rule_integration | +| 49 | Fourth Angle of Quadrilateral | Fourth angle of quadrilateral with angles 24 , 205, 108 = | 23 | fourth_angle_of_quadrilateral | +| 50 | Quadratic Equation | Zeros of the Quadratic Equation 4x^2+38x+53=0 | [-1.7, -7.8] | quadratic_equation | +| 51 | HCF (Highest Common Factor) | HCF of 3 and 5 = | 1 | hcf | +| 52 | Probability of a certain sum appearing on faces of dice | If 1 dice are rolled at the same time, the probability of getting a sum of 6 = | 1/6 | dice_sum_probability | +| 53 | Exponentiation | 13^7 = | 62748517 | exponentiation | +| 54 | Confidence interval For sample S | The confidence interval for sample [246, 234, 252, 233, 250, 229, 272, 299, 214, 287, 263, 237, 209, 279, 230, 244, 265, 284, 266, 260] with 90% confidence is | (261.450577042693, 243.849422957307) | confidence_interval | +| 55 | Comparing surds | Fill in the blanks 61^(1/3) _ 54^(1/6) | > | surds_comparison | +| 56 | Fibonacci Series | The Fibonacci Series of the first 12 numbers is ? | [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] | fibonacci_series | +| 57 | Trigonometric Values | What is tan(60)? | √3 | basic_trigonometry | +| 58 | Sum of Angles of Polygon | Sum of angles of polygon with 10 sides = | 1440 | sum_of_polygon_angles | +| 59 | Mean,Standard Deviation,Variance | Find the mean,standard deviation and variance for the data[48, 15, 20, 21, 30, 17, 8, 13, 27, 7, 41, 34, 50, 18, 19] | The Mean is 24.533333333333335 , Standard Deviation is 170.91555555555558, Variance is 13.073467617872298 | data_summary | +| 60 | Surface Area of Sphere | Surface area of Sphere with radius = 18m is | 4071.5040790523717 m^2 | surface_area_sphere | +| 61 | Volume of Sphere | Volume of sphere with radius 32 m = | 137258.27743044044 m^3 | volume_sphere | +| 62 | nth Fibonacci number | What is the 67th Fibonacci number? | 44945570212853 | nth_fibonacci_number | +| 63 | Profit or Loss Percent | Profit percent when CP = 15 and SP = 981 is: | 6440.000000000001 | profit_loss_percent | +| 64 | Binary to Hexidecimal | 1011 | 0xb | binary_to_hex | +| 65 | Multiplication of 2 complex numbers | (-13-6j) * (-13-17j) = | (67+299j) | multiply_complex_numbers | +| 66 | Geometric Progression | For the given GP [7, 49, 343, 2401, 16807, 117649] ,Find the value of a,common ratio,6th term value, sum upto 9th term | The value of a is 7, common ratio is 7 , 6th term is 117649 , sum upto 9th term is 47079207.0 | geometric_progression | +| 67 | Geometric Mean of N Numbers | Geometric mean of 3 numbers 67 , 39 and 61 = | (67*39*61)^(1/3) = 54.2196131865444 | geometric_mean | +| 68 | Harmonic Mean of N Numbers | Harmonic mean of 2 numbers 51 and 18 = | 2/((1/51) + (1/18)) = 26.608695652173914 | harmonic_mean | +| 69 | Euclidian norm or L2 norm of a vector | Euclidian norm or L2 norm of the vector[475.73215854843386, 666.5961230551579, 318.8322922614731, 347.0393782548222, 132.48630879767597, 29.71776575489249, 241.27251126475247, 183.2591565913506, 829.9340763816024, 450.0454983692942, 227.01770730801584, 543.7951344512942, 704.1995480202837, 416.40405265214866] is: | 1706.1257272861317 | euclidian_norm | +| 70 | Angle between 2 vectors | angle between the vectors [520.47, 629.68, 925.7, 911.2, 727.7, 843.94, 808.55, 80.4, 157.49, 661.37, 877.4, 196.54, 283.16, 69.83] and [840.19, 459.69, 241.22, 334.45, 5.59, 696.72, 776.19, 223.28, 414.7, 875.6, 837.18, 68.45, 863.78, 961.51] is: | 0.72 radians | angle_btw_vectors | +| 71 | Absolute difference between two numbers | Absolute difference between numbers 6 and -66 = | 72 | absolute_difference | +| 72 | Dot Product of 2 Vectors | [-7, -13, -11] . [0, -3, -17] = | 226 | vector_dot | +| 73 | Binary 2's Complement | 2's complement of 10110 = | 1010 | binary_2s_complement | +| 74 | Inverse of a Matrix | Inverse of Matrix Matrix([[1, 94, 7], [25, 90, 5], [73, 43, 60]]) is: | Matrix([[-1037/27994, 5339/139970, 16/13997], [227/27994, 451/139970, -17/13997], [1099/27994, -6819/139970, 226/13997]]) | invert_matrix | +| 75 | Area of a Sector | Given radius, 21 and angle, 2. Find the area of the sector. | Area of sector = 7.69690 | sector_area | +| 76 | Mean and Median | Given the series of numbers [96, 45, 60, 15, 20, 4, 29, 36, 69, 47]. find the arithmatic mean and mdian of the series | Arithmetic mean of the series is 42.1 and Arithmetic median of this series is 40.5 | mean_median | +| 77 | Determinant to 2x2 Matrix | Det([[59, 81], [33, 79]]) = | 1988 | int_matrix_22_determinant | +| 78 | Compound Interest | Compound interest for a principle amount of 8179 dollars, 7% rate of interest and for a time period of 1 year is = | 8751.53 | compound_interest | +| 79 | Decimal to Hexadecimal | Binary of 106= | 0x6a | decimal_to_hexadeci | +| 80 | Percentage of a number | What is 5% of 98? | Required percentage = 4.90% | percentage | +| 81 | Celsius To Fahrenheit | Convert 67 degrees Celsius to degrees Fahrenheit = | 152.60000000000002 | celsius_to_fahrenheit | +| 82 | AP Term Calculation | Find the term number 56 of the AP series: -55, -142, -229 ... | -4840 | arithmetic_progression_term | +| 83 | AP Sum Calculation | Find the sum of first 46 terms of the AP series: 96, 169, 242 ... | 79971.0 | arithmetic_progression_sum | +| 84 | Converts decimal to octal | The decimal number 7 in Octal is: | 0o7 | decimal_to_octal | +| 85 | Converts decimal to Roman Numerals | The number 2558 in Roman Numerals is: | MMDLVIII | decimal_to_roman_numerals | +| 86 | Degrees to Radians | Angle 313 in radians is = | 5.46 | degree_to_rad | | 87 | Radians to Degrees | Angle 0 in degrees is = | 0.0 | radian_to_deg | -| 88 | Differentiation | differentiate w.r.t x : d(cot(x)+4*x^(-3))/dx | -cot(x)^2 - 1 - 12/x^4 | differentiation | -| 89 | Definite Integral of Quadratic Equation | The definite integral within limits 0 to 1 of the equation 43x^2 + 13x + 29 is = | 49.8333 | definite_integral | -| 90 | isprime | 86 | False | is_prime | -| 91 | Binary Coded Decimal to Integer | Integer of Binary Coded Decimal 5 is = | 21620 | bcd_to_decimal | -| 92 | Complex To Polar Form | rexp(itheta) = | 22.47exp(i-2.58) | complex_to_polar | -| 93 | Union,Intersection,Difference of Two Sets | Given the two sets a={9, 3, 1, 6} ,b={2, 4, 5, 9, 10}.Find the Union,intersection,a-b,b-a and symmetric difference | Union is {1, 2, 3, 4, 5, 6, 9, 10},Intersection is {9}, a-b is {1, 3, 6},b-a is {2, 10, 4, 5}, Symmetric difference is {1, 2, 3, 4, 5, 6, 10} | set_operation | -| 94 | Base Conversion | Convert 111122000 from base 3 to base 16. | 26D0 | base_conversion | -| 95 | Curved surface area of a cylinder | What is the curved surface area of a cylinder of radius, 9 and height, 34? | CSA of cylinder = 1922.65 | curved_surface_area_cylinder | -| 96 | Perimeter of Polygons | The perimeter of a 3 sided polygon with lengths of [4, 30, 88]cm is: | 122 | perimeter_of_polygons | -| 97 | Power of Powers | The 20^3^7 = 20^(3*7) = 20^21 | 2097152000000000000000000000 | power_of_powers | -| 98 | Quotient of Powers with Same Base | The Quotient of 10^7 and 10^3 = 10^(7-3) = 10^4 | 10000 | quotient_of_power_same_base | -| 99 | Quotient of Powers with Same Power | The Quotient of 30^1 and 40^1 = (30/40)^1 = 0.75^1 | 0.75 | quotient_of_power_same_power | -| 100 | complex Quadratic Equation | Find the roots of given Quadratic Equation 2x^2 + 7x + 1 = 0 | simplified solution : ((-0.149, -3.351)), generalized solution : ((-7 + sqrt(41))/2*2, (-7 - sqrt(41))/2*2) | complex_quadratic | -| 101 | Leap Year or Not | Year 1972 | is a leap year | is_leap_year | -| 102 | Minute to Hour conversion | Convert 908 minutes to Hours & Minutes | 15 hours and 8 minutes | minutes_to_hours | -| 103 | Decimal to Binary Coded Decimal | BCD of Decimal Number 3603 is = | 1413 | decimal_to_bcd | +| 88 | Differentiation | differentiate w.r.t x : d(sin(x)+2*x^(-3))/dx | cos(x) - 6/x^4 | differentiation | +| 89 | Definite Integral of Quadratic Equation | The definite integral within limits 0 to 1 of the equation 22x^2 + 32x + 88 is = | 111.3333 | definite_integral | +| 90 | isprime | 28 | False | is_prime | +| 91 | Binary Coded Decimal to Integer | Integer of Binary Coded Decimal 6 is = | 25632 | bcd_to_decimal | +| 92 | Complex To Polar Form | rexp(itheta) = | 23.85exp(i-2.15) | complex_to_polar | +| 93 | Union,Intersection,Difference of Two Sets | Given the two sets a={1, 2, 5, 6, 7, 9} ,b={9, 3, 6, 7}.Find the Union,intersection,a-b,b-a and symmetric difference | Union is {1, 2, 3, 5, 6, 7, 9},Intersection is {9, 6, 7}, a-b is {1, 2, 5},b-a is {3}, Symmetric difference is {1, 2, 3, 5} | set_operation | +| 94 | Base Conversion | Convert 215 from base 16 to base 2. | 1000010101 | base_conversion | +| 95 | Curved surface area of a cylinder | What is the curved surface area of a cylinder of radius, 3 and height, 33? | CSA of cylinder = 622.04 | curved_surface_area_cylinder | +| 96 | Perimeter of Polygons | The perimeter of a 5 sided polygon with lengths of [21, 36, 107, 101, 15]cm is: | 280 | perimeter_of_polygons | +| 97 | Power of Powers | The 47^10^9 = 47^(10*9) = 47^90 | 3081819609348702575993710664086973378213775077494296491025662508716527867059742510518129558368670228609205866092648641076825215755720847840202232380449 | power_of_powers | +| 98 | Quotient of Powers with Same Base | The Quotient of 21^2 and 21^9 = 21^(2-9) = 21^-7 | 5.552197891641574e-10 | quotient_of_power_same_base | +| 99 | Quotient of Powers with Same Power | The Quotient of 25^1 and 3^1 = (25/3)^1 = 8.333333333333334^1 | 8.333333333333334 | quotient_of_power_same_power | +| 100 | complex Quadratic Equation | Find the roots of given Quadratic Equation 3x^2 + 5x + 2 = 0 | simplified solution : ((-0.667, -1.0)), generalized solution : ((-5 + 1)/2*3, (-5 - 1)/2*3) | complex_quadratic | +| 101 | Leap Year or Not | Year 2049 | is not a leap year | is_leap_year | +| 102 | Minute to Hour conversion | Convert 960 minutes to Hours & Minutes | 16 hours and 0 minutes | minutes_to_hours | +| 103 | Decimal to Binary Coded Decimal | BCD of Decimal Number 6561 is = | 19101 | decimal_to_bcd | +| 104 | Circumference | Circumference of circle with radius 11 | 69.14285714285714 | circumference | diff --git a/mathgenerator/funcs/__init__.py b/mathgenerator/funcs/__init__.py index 62135f9..70b9d89 100644 --- a/mathgenerator/funcs/__init__.py +++ b/mathgenerator/funcs/__init__.py @@ -108,3 +108,4 @@ from .complex_quadratic import * from .is_leap_year import * from .minutes_to_hours import * from .decimal_to_bcd import * +from .circumference import * diff --git a/mathgenerator/funcs/circumference.py b/mathgenerator/funcs/circumference.py index 30c5fae..6c05a60 100644 --- a/mathgenerator/funcs/circumference.py +++ b/mathgenerator/funcs/circumference.py @@ -1,14 +1,13 @@ - from .__init__ import * def circumferenceCircle(maxRadius=100): r = random.randint(0, maxRadius) pi = 22/7 - circumference = 2*pi*r + circumference = 2*pi*r problem = f"Circumference of circle with radius {r}" solution = circumference return problem, solution -circumferenceCircle = Generator("Circumference", 62, "2*pi*r=", "circumference", circumferenceCircle) +circumference = Generator("Circumference", 104, "2*pi*r=", "circumference", circumferenceCircle) diff --git a/mathgenerator/funcs/decimal_to_bcd.py b/mathgenerator/funcs/decimal_to_bcd.py index 5805987..5075ce0 100644 --- a/mathgenerator/funcs/decimal_to_bcd.py +++ b/mathgenerator/funcs/decimal_to_bcd.py @@ -19,5 +19,3 @@ def DecimalToBCDFunc(maxNumber=10000): decimal_to_bcd = Generator("Decimal to Binary Coded Decimal", 103, "Binary Coded Decimal of Decimal n is ", "b", DecimalToBCDFunc) - -# for readme ## | 101 | Decimal to Binary Coded Decimal | Binary Coded Decimal of Decimal 34 is = | 22 | decimal_to_bcd | diff --git a/test.py b/test.py index 0fe349b..98953c9 100644 --- a/test.py +++ b/test.py @@ -11,4 +11,4 @@ for item in list: # print(mathgen.getGenList()) print(mathgen.decimal_to_roman_numerals()) -print(mathgen.genById(103)) +print(mathgen.genById(104)) From 8b220c8421079117ffc0b31ea6280a609801bef7 Mon Sep 17 00:00:00 2001 From: lukew3 Date: Fri, 23 Oct 2020 13:50:32 -0400 Subject: [PATCH 15/15] combine_like_terms fixes --- mathgenerator/funcs/__init__.py | 1 + .../funcs/{likeTermCombineFunc.py => combine_like_terms.py} | 4 ++-- test.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) rename mathgenerator/funcs/{likeTermCombineFunc.py => combine_like_terms.py} (89%) diff --git a/mathgenerator/funcs/__init__.py b/mathgenerator/funcs/__init__.py index 70b9d89..de8ff5c 100644 --- a/mathgenerator/funcs/__init__.py +++ b/mathgenerator/funcs/__init__.py @@ -109,3 +109,4 @@ from .is_leap_year import * from .minutes_to_hours import * from .decimal_to_bcd import * from .circumference import * +from .combine_like_terms import * diff --git a/mathgenerator/funcs/likeTermCombineFunc.py b/mathgenerator/funcs/combine_like_terms.py similarity index 89% rename from mathgenerator/funcs/likeTermCombineFunc.py rename to mathgenerator/funcs/combine_like_terms.py index 904b6ce..c6b3412 100644 --- a/mathgenerator/funcs/likeTermCombineFunc.py +++ b/mathgenerator/funcs/combine_like_terms.py @@ -41,5 +41,5 @@ def combineTerms(string): return final_string -combineLikeTerm = Generator("Combine Like terms", 102, "nx^m+lx^k+bx^m", - "(n+b)x^m+lx^k", likeTermCombineFunc) +combine_like_terms = Generator("Combine Like terms", 105, "nx^m+lx^k+bx^m", + "(n+b)x^m+lx^k", likeTermCombineFunc) diff --git a/test.py b/test.py index 98953c9..9377b5d 100644 --- a/test.py +++ b/test.py @@ -11,4 +11,4 @@ for item in list: # print(mathgen.getGenList()) print(mathgen.decimal_to_roman_numerals()) -print(mathgen.genById(104)) +print(mathgen.genById(105))