From 9fd4a23815bafeba69308dfbd3dbbdf3711de06b Mon Sep 17 00:00:00 2001 From: adit098 Date: Mon, 19 Oct 2020 20:20:38 +0530 Subject: [PATCH 01/43] fix #242 --- mathgenerator/funcs/DecimalToHexFunc.py | 11 +++++++++++ mathgenerator/mathgen.py | 2 ++ 2 files changed, 13 insertions(+) create mode 100644 mathgenerator/funcs/DecimalToHexFunc.py diff --git a/mathgenerator/funcs/DecimalToHexFunc.py b/mathgenerator/funcs/DecimalToHexFunc.py new file mode 100644 index 0000000..33945d3 --- /dev/null +++ b/mathgenerator/funcs/DecimalToHexFunc.py @@ -0,0 +1,11 @@ +from .__init__ import * + + +def DecimalToHexFunc(max_dec=99): + a = random.randint(1, max_dec) + b = hex(a).replace("0x", "") + + problem = "Hexadecimal of " + str(a) + "=" + solution = str(b) + + return problem, solution diff --git a/mathgenerator/mathgen.py b/mathgenerator/mathgen.py index 0e813a6..e935df8 100644 --- a/mathgenerator/mathgen.py +++ b/mathgenerator/mathgen.py @@ -156,3 +156,5 @@ complexNumMultiply = Generator("Multiplication of 2 complex numbers", 64, "(x + geometricprogression=Generator("Geometric Progression", 65, "Initial value,Common Ratio,nth Term,Sum till nth term =", "a,r,ar^n-1,sum(ar^n-1", geomProgrFunc) geometricMean=Generator("Geometric Mean of N Numbers",66,"Geometric mean of n numbers A1 , A2 , ... , An = ","(A1*A2*...An)^(1/n) = ans",geometricMeanFunc) harmonicMean=Generator("Harmonic Mean of N Numbers",67,"Harmonic mean of n numbers A1 , A2 , ... , An = "," n/((1/A1) + (1/A2) + ... + (1/An)) = ans",harmonicMeanFunc) +decimalToHexadecimal = Generator("Decimal to Hexadecimal", 68, + "Hexadecimal of a=", "b", DecimalToHexFunc) \ No newline at end of file From 66d5924271bb48a7b5ca6a76dcb540eeeecd851f Mon Sep 17 00:00:00 2001 From: Yogesh Patil Date: Mon, 19 Oct 2020 21:21:05 +0530 Subject: [PATCH 02/43] Added BCD to Decimal --- mathgenerator/funcs/BCDtoDecimalFunc.py | 19 +++++++++++++++++++ mathgenerator/mathgen.py | 1 + 2 files changed, 20 insertions(+) create mode 100644 mathgenerator/funcs/BCDtoDecimalFunc.py diff --git a/mathgenerator/funcs/BCDtoDecimalFunc.py b/mathgenerator/funcs/BCDtoDecimalFunc.py new file mode 100644 index 0000000..7d93a57 --- /dev/null +++ b/mathgenerator/funcs/BCDtoDecimalFunc.py @@ -0,0 +1,19 @@ +from .__init__ import * + +def BCDtoDecimalFunc(maxNumber=10000): + n = random.randint(1000, maxNumber) + binstring = '' + while True: + q, r = divmod(n, 10) + nibble = bin(r).replace('0b', "") + while len(nibble) < 4: + nibble = '0' + nibble + binstring = nibble + binstring + if q == 0: + break + else: + n = q + + problem = "Integer of Binary Coded Decimal " + str(n) + " is = " + solution = int(binstring, 2) + return problem, solution \ No newline at end of file diff --git a/mathgenerator/mathgen.py b/mathgenerator/mathgen.py index 9f570cc..d1f1d48 100644 --- a/mathgenerator/mathgen.py +++ b/mathgenerator/mathgen.py @@ -114,3 +114,4 @@ meanMedian=Generator("Mean and Median", 76,"Mean and median of given set of numb intMatrix22determinant = Generator("Determinant to 2x2 Matrix", 77, "Det([[a,b],[c,d]]) =", " a * d - b * c", determinantToMatrix22) compoundInterest = Generator("Compound Interest", 78, "Compound interest for a principle amount of p dollars, r% rate of interest and for a time period of t years with n times compounded annually is = ", "A dollars", compoundInterestFunc) decimalToHexadeci = Generator("Decimal to Hexadecimal", 79,"Binary of a=", "b", deciToHexaFunc) +BCDtoDecimal = Generator("Binary Coded Decimal to Integer", 80, "Integer of Binary Coded Decimal b is ", "n", BCDtoDecimalFunc) From 9a62fbc6b8e05709e61f1395e2733bb7d82b1643 Mon Sep 17 00:00:00 2001 From: adit098 Date: Mon, 19 Oct 2020 21:33:02 +0530 Subject: [PATCH 03/43] fix #250 --- mathgenerator/funcs/DegreeToRadian.py | 10 ++++++++++ mathgenerator/mathgen.py | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 mathgenerator/funcs/DegreeToRadian.py diff --git a/mathgenerator/funcs/DegreeToRadian.py b/mathgenerator/funcs/DegreeToRadian.py new file mode 100644 index 0000000..ce1389e --- /dev/null +++ b/mathgenerator/funcs/DegreeToRadian.py @@ -0,0 +1,10 @@ +from .__init__ import * + + +def DegreeToRadian(maxAngle=360): + angle = random.randint(1, maxAngle) + radian = round(math.radians(angle), 2) + problem = f"{angle} Degrees is equal to Radian = " + solution = radian + + return problem, solution \ No newline at end of file diff --git a/mathgenerator/mathgen.py b/mathgenerator/mathgen.py index e935df8..4fca697 100644 --- a/mathgenerator/mathgen.py +++ b/mathgenerator/mathgen.py @@ -157,4 +157,5 @@ geometricprogression=Generator("Geometric Progression", 65, "Initial value,Commo geometricMean=Generator("Geometric Mean of N Numbers",66,"Geometric mean of n numbers A1 , A2 , ... , An = ","(A1*A2*...An)^(1/n) = ans",geometricMeanFunc) harmonicMean=Generator("Harmonic Mean of N Numbers",67,"Harmonic mean of n numbers A1 , A2 , ... , An = "," n/((1/A1) + (1/A2) + ... + (1/An)) = ans",harmonicMeanFunc) decimalToHexadecimal = Generator("Decimal to Hexadecimal", 68, - "Hexadecimal of a=", "b", DecimalToHexFunc) \ No newline at end of file + "Hexadecimal of a=", "b", DecimalToHexFunc) +degreeToRadian = Generator("Degree To Radian", 69, "Radian of angle=", "radian", DegreeToRadian) \ No newline at end of file From 57456ca1ad34b3c76acfb8c1efaf1626bd06c70e Mon Sep 17 00:00:00 2001 From: adit098 Date: Mon, 19 Oct 2020 21:44:18 +0530 Subject: [PATCH 04/43] fix #252 --- mathgenerator/funcs/DecimalToOctalFunc.py | 11 +++++++++++ mathgenerator/funcs/__init__.py | 2 ++ mathgenerator/mathgen.py | 4 +++- 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 mathgenerator/funcs/DecimalToOctalFunc.py diff --git a/mathgenerator/funcs/DecimalToOctalFunc.py b/mathgenerator/funcs/DecimalToOctalFunc.py new file mode 100644 index 0000000..703ef45 --- /dev/null +++ b/mathgenerator/funcs/DecimalToOctalFunc.py @@ -0,0 +1,11 @@ +from .__init__ import * + + +def DecimalToHexFunc(max_dec=99): + a = random.randint(1, max_dec) + b = oct(a) + + problem = "Octal of " + str(a) + "=" + solution = str(b) + + return problem, solution diff --git a/mathgenerator/funcs/__init__.py b/mathgenerator/funcs/__init__.py index efb1ce7..d9e880a 100644 --- a/mathgenerator/funcs/__init__.py +++ b/mathgenerator/funcs/__init__.py @@ -71,3 +71,5 @@ from .multiplyComplexNumbersFunc import * from .geomProgrFunc import * from .geometricMeanFunc import * from .harmonicMeanFunc import * +from .DegreeToRadian import * +from .DecimalToOctal import * \ No newline at end of file diff --git a/mathgenerator/mathgen.py b/mathgenerator/mathgen.py index 4fca697..2d2697d 100644 --- a/mathgenerator/mathgen.py +++ b/mathgenerator/mathgen.py @@ -158,4 +158,6 @@ geometricMean=Generator("Geometric Mean of N Numbers",66,"Geometric mean of n nu harmonicMean=Generator("Harmonic Mean of N Numbers",67,"Harmonic mean of n numbers A1 , A2 , ... , An = "," n/((1/A1) + (1/A2) + ... + (1/An)) = ans",harmonicMeanFunc) decimalToHexadecimal = Generator("Decimal to Hexadecimal", 68, "Hexadecimal of a=", "b", DecimalToHexFunc) -degreeToRadian = Generator("Degree To Radian", 69, "Radian of angle=", "radian", DegreeToRadian) \ No newline at end of file +degreeToRadian = Generator("Degree To Radian", 69, "Radian of angle=", "radian", DegreeToRadian) +decimalToOctal = Generator("Decimal to Octal", 70, + "Octal of a=", "b", DecimalToOctalFunc) \ No newline at end of file From b89c9c3178fbb5e3ebadd00c7298a626031a3f63 Mon Sep 17 00:00:00 2001 From: NarayanAdithya Date: Mon, 19 Oct 2020 22:12:24 +0530 Subject: [PATCH 05/43] Added Set operatiosn fucntion, corrected compound interest --- mathgenerator/funcs/compoundInterestFunc.py | 2 +- mathgenerator/funcs/set_operation.py | 18 ++++++++++++++++++ mathgenerator/mathgen.py | 1 + 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 mathgenerator/funcs/set_operation.py diff --git a/mathgenerator/funcs/compoundInterestFunc.py b/mathgenerator/funcs/compoundInterestFunc.py index dec3e54..6f4fba3 100644 --- a/mathgenerator/funcs/compoundInterestFunc.py +++ b/mathgenerator/funcs/compoundInterestFunc.py @@ -1,6 +1,6 @@ from .__init__ import * -def compoundInterestFunc(maxPrinciple = 10000, maxRate = 10, maxTime = 10, maxPeriod = ): +def compoundInterestFunc(maxPrinciple = 10000, maxRate = 10, maxTime = 10, maxPeriod = 10): p = random.randint(100, maxPrinciple) r = random.randint(1, maxRate) t = random.randint(1, maxTime) diff --git a/mathgenerator/funcs/set_operation.py b/mathgenerator/funcs/set_operation.py new file mode 100644 index 0000000..6842efd --- /dev/null +++ b/mathgenerator/funcs/set_operation.py @@ -0,0 +1,18 @@ +from .__init__ import * + + +def set_operation(minval=3,maxval=7,n_a=4,n_b=5): + number_variables_a=random.randint(minval,maxval) + number_variables_b=random.randint(minval,maxval) + a=[] + b=[] + for i in range(number_variables_a): + a.append(random.randint(1,10)) + for i in range(number_variables_b): + b.append(random.randint(1,10)) + + a=set(a) + b=set(b) + problem= "Given the two sets a=" + str(a) + " ,b=" + str(b) + ".Find the Union,intersection,a-b,b-a and symmetric difference" + solution="Union is " + str(a.union(b)) + ",Intersection is " + str(a.intersection(b)) + ", a-b is "+str(a.difference(b)) + ",b-a is " + str(b.difference(a))+ ", Symmetric difference is "+ str(a.symmetric_difference(b)) + return problem,solution diff --git a/mathgenerator/mathgen.py b/mathgenerator/mathgen.py index 9f570cc..57069d8 100644 --- a/mathgenerator/mathgen.py +++ b/mathgenerator/mathgen.py @@ -114,3 +114,4 @@ meanMedian=Generator("Mean and Median", 76,"Mean and median of given set of numb intMatrix22determinant = Generator("Determinant to 2x2 Matrix", 77, "Det([[a,b],[c,d]]) =", " a * d - b * c", determinantToMatrix22) compoundInterest = Generator("Compound Interest", 78, "Compound interest for a principle amount of p dollars, r% rate of interest and for a time period of t years with n times compounded annually is = ", "A dollars", compoundInterestFunc) decimalToHexadeci = Generator("Decimal to Hexadecimal", 79,"Binary of a=", "b", deciToHexaFunc) +setoperations = Generator("Union,Intersection,Difference of Two Sets", 80, "Union,intersection,difference", "aUb,a^b,a-b,b-a,", set_operation) \ No newline at end of file From 98b91030d6bab1899624fe3f3dda9c344aaa95dd Mon Sep 17 00:00:00 2001 From: NarayanAdithya Date: Mon, 19 Oct 2020 22:21:37 +0530 Subject: [PATCH 06/43] lint spacing --- mathgenerator/funcs/set_operation.py | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/mathgenerator/funcs/set_operation.py b/mathgenerator/funcs/set_operation.py index 6842efd..370c827 100644 --- a/mathgenerator/funcs/set_operation.py +++ b/mathgenerator/funcs/set_operation.py @@ -1,18 +1,16 @@ from .__init__ import * - -def set_operation(minval=3,maxval=7,n_a=4,n_b=5): - number_variables_a=random.randint(minval,maxval) - number_variables_b=random.randint(minval,maxval) - a=[] - b=[] +def set_operation(minval = 3, maxval = 7, n_a = 4, n_b = 5): + number_variables_a = random.randint(minval, maxval) + number_variables_b = random.randint(minval, maxval) + a = [] + b = [] for i in range(number_variables_a): - a.append(random.randint(1,10)) + a.append(random.randint(1, 10)) for i in range(number_variables_b): - b.append(random.randint(1,10)) - + b.append(random.randint(1, 10)) a=set(a) b=set(b) - problem= "Given the two sets a=" + str(a) + " ,b=" + str(b) + ".Find the Union,intersection,a-b,b-a and symmetric difference" - solution="Union is " + str(a.union(b)) + ",Intersection is " + str(a.intersection(b)) + ", a-b is "+str(a.difference(b)) + ",b-a is " + str(b.difference(a))+ ", Symmetric difference is "+ str(a.symmetric_difference(b)) - return problem,solution + problem = "Given the two sets a=" + str(a) + " ,b=" + str(b) + ".Find the Union,intersection,a-b,b-a and symmetric difference" + solution ="Union is " + str(a.union(b)) + ",Intersection is " + str(a.intersection(b)) + ", a-b is " + str(a.difference(b)) + ",b-a is " + str(b.difference(a)) + ", Symmetric difference is " + str(a.symmetric_difference(b)) + return problem, solution From 1fea870a39add033bbc50878ca4079495374c34c Mon Sep 17 00:00:00 2001 From: NarayanAdithya <57533346+NarayanAdithya@users.noreply.github.com> Date: Mon, 19 Oct 2020 22:23:54 +0530 Subject: [PATCH 07/43] Update readme for set_operationfucn --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index f2d81dc..c33d765 100644 --- a/README.md +++ b/README.md @@ -104,3 +104,4 @@ problem, solution = mathgen.genById(0) | 65 | Geometric Progression | For the given GP [4, 16, 64, 256, 1024, 4096] ,Find the value of a,common ratio,8th term value, sum upto 7th term | The value of a is 4, common ratio is 4 , 8th term is 65536 , sum upto 7th term is 21844.0 | geometricprogression | | 66 | Geometric Mean of N Numbers | Geometric mean of 3 numbers 81 , 35 and 99 = | (81*35*99)^(1/3) = 65.47307713912309 | geometricMean | | 67 | Harmonic Mean of N Numbers | Harmonic mean of 2 numbers 99 and 25 = | 2/((1/99) + (1/25)) = 39.91935483870967 | harmonicMean | +| 80 | Set Operations | Given sets A,B | A^B,A-B,B-A,A U B, | set_operation| From 090afdd4517ed2108a76eb9caea35dc5bec0d2d4 Mon Sep 17 00:00:00 2001 From: adit098 Date: Mon, 19 Oct 2020 22:29:03 +0530 Subject: [PATCH 08/43] fix #251 --- mathgenerator/funcs/__init__.py | 3 ++- mathgenerator/funcs/complexToPolarFunc.py | 13 +++++++++++++ mathgenerator/mathgen.py | 3 ++- 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 mathgenerator/funcs/complexToPolarFunc.py diff --git a/mathgenerator/funcs/__init__.py b/mathgenerator/funcs/__init__.py index d9e880a..c4aa137 100644 --- a/mathgenerator/funcs/__init__.py +++ b/mathgenerator/funcs/__init__.py @@ -72,4 +72,5 @@ from .geomProgrFunc import * from .geometricMeanFunc import * from .harmonicMeanFunc import * from .DegreeToRadian import * -from .DecimalToOctal import * \ No newline at end of file +from .DecimalToOctal import * +from .complexToPolarFunc import * \ No newline at end of file diff --git a/mathgenerator/funcs/complexToPolarFunc.py b/mathgenerator/funcs/complexToPolarFunc.py new file mode 100644 index 0000000..ddc86ff --- /dev/null +++ b/mathgenerator/funcs/complexToPolarFunc.py @@ -0,0 +1,13 @@ +from .__init__ import * + +def polar(minRealImaginaryNum = -20, maxRealImaginaryNum = 20): + num = complex(random.randint(minRealImaginaryNum, maxRealImaginaryNum), random.randint(minRealImaginaryNum, maxRealImaginaryNum)) + a= num.real + b= num.imag + r = round(math.hypot(a,b), 2) + theta = round(math.atan2(b,a), 2) + plr = str(r) + "exp(i" + str(theta) + ")" + problem = f"rexp(itheta) = " + solution = plr + return problem, solution + \ No newline at end of file diff --git a/mathgenerator/mathgen.py b/mathgenerator/mathgen.py index 2d2697d..5701317 100644 --- a/mathgenerator/mathgen.py +++ b/mathgenerator/mathgen.py @@ -160,4 +160,5 @@ decimalToHexadecimal = Generator("Decimal to Hexadecimal", 68, "Hexadecimal of a=", "b", DecimalToHexFunc) degreeToRadian = Generator("Degree To Radian", 69, "Radian of angle=", "radian", DegreeToRadian) decimalToOctal = Generator("Decimal to Octal", 70, - "Octal of a=", "b", DecimalToOctalFunc) \ No newline at end of file + "Octal of a=", "b", DecimalToOctalFunc) +complexToPolar = Generator("Complex To Polar Form", 71, "rexp(itheta) = ", "plr", complexToPolarFunc) \ No newline at end of file From b0002f68662f1f0624d8c90740b6573eaa65f57a Mon Sep 17 00:00:00 2001 From: LyndonFan Date: Mon, 19 Oct 2020 18:33:07 +0100 Subject: [PATCH 09/43] added baseConversion --- mathgenerator/funcs/baseConversion.py | 42 +++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 mathgenerator/funcs/baseConversion.py diff --git a/mathgenerator/funcs/baseConversion.py b/mathgenerator/funcs/baseConversion.py new file mode 100644 index 0000000..27125ef --- /dev/null +++ b/mathgenerator/funcs/baseConversion.py @@ -0,0 +1,42 @@ +from .__init__ import * + +#base from 2 to 36 +alpha = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" + +def fromBaseTenTo(n,toBase): + assert toBase<=36, "{} should be at most 36" + if toBase==2: + return bin(n)[2:] + elif toBase==8: + return oct(n)[2:] + elif toBase==10: + return str(n) + elif toBase==16: + return hex(n)[2:].upper() + res = alpha[n%toBase] + n = n//toBase + while n>0: + res = alpha[n%toBase] + res + n = n//toBase + return res + +# Useful to check answers, but not needed here +# def toBaseTen(n,fromBase): +# assert fromBase<=36, "{} should be at most 36" +# return int(n,fromBase) + +def baseConversion(maxNum = 60000, maxBase = 16): + assert type(maxNum)==int and maxNum>=100 and maxNum<=65536, "maxNum({}) should be an int between 100 and 65536".format(maxNum) + assert type(maxBase)==int and maxBase>=2 and maxBase<=36, "maxBase({}) sholud be an int between 2 and 36 (inclusive)".format(maxBase) + + n = random.randint(40,maxNum) + dist = [10]*10+[2]*5+[16]*5+[i for i in range(2,maxBase+1)] + # set this way since converting to/from bases 2,10,16 are more common -- can be changed if needed. + bases = random.choices(dist,k=2) + while bases[0]==bases[1]: + bases = random.choices(dist,k=2) + + problem = "Convert {} from base {} to base {}.".format(fromBaseTenTo(n,bases[0]),bases[0],bases[1]) + ans = fromBaseTenTo(n,bases[1]) + return problem, ans + From bda4b732790a11372822392f8f42102a74509aa9 Mon Sep 17 00:00:00 2001 From: LyndonFan Date: Mon, 19 Oct 2020 18:36:54 +0100 Subject: [PATCH 10/43] minor edits --- mathgenerator/funcs/baseConversion.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mathgenerator/funcs/baseConversion.py b/mathgenerator/funcs/baseConversion.py index 27125ef..77eae14 100644 --- a/mathgenerator/funcs/baseConversion.py +++ b/mathgenerator/funcs/baseConversion.py @@ -4,7 +4,8 @@ from .__init__ import * alpha = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" def fromBaseTenTo(n,toBase): - assert toBase<=36, "{} should be at most 36" + assert type(toBase)==int and toBase>=2 and toBase<=36, "toBase({}) must be >=2 and <=36" + # trivial cases if toBase==2: return bin(n)[2:] elif toBase==8: @@ -22,12 +23,11 @@ def fromBaseTenTo(n,toBase): # Useful to check answers, but not needed here # def toBaseTen(n,fromBase): -# assert fromBase<=36, "{} should be at most 36" # return int(n,fromBase) def baseConversion(maxNum = 60000, maxBase = 16): - assert type(maxNum)==int and maxNum>=100 and maxNum<=65536, "maxNum({}) should be an int between 100 and 65536".format(maxNum) - assert type(maxBase)==int and maxBase>=2 and maxBase<=36, "maxBase({}) sholud be an int between 2 and 36 (inclusive)".format(maxBase) + assert type(maxNum)==int and maxNum>=100 and maxNum<=65536, "maxNum({}) must be >=100 and <=65536".format(maxNum) + assert type(maxBase)==int and maxBase>=2 and maxBase<=36, "maxBase({}) must be >= 2 and <=36".format(maxBase) n = random.randint(40,maxNum) dist = [10]*10+[2]*5+[16]*5+[i for i in range(2,maxBase+1)] From 2f359086fa704ad5f578f368819c984d794f8455 Mon Sep 17 00:00:00 2001 From: NarayanAdithya Date: Tue, 20 Oct 2020 10:26:22 +0530 Subject: [PATCH 11/43] Lint Issues --- mathgenerator/funcs/compoundInterestFunc.py | 1 + mathgenerator/funcs/set_operation.py | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mathgenerator/funcs/compoundInterestFunc.py b/mathgenerator/funcs/compoundInterestFunc.py index 6f4fba3..bd3664e 100644 --- a/mathgenerator/funcs/compoundInterestFunc.py +++ b/mathgenerator/funcs/compoundInterestFunc.py @@ -1,5 +1,6 @@ from .__init__ import * + def compoundInterestFunc(maxPrinciple = 10000, maxRate = 10, maxTime = 10, maxPeriod = 10): p = random.randint(100, maxPrinciple) r = random.randint(1, maxRate) diff --git a/mathgenerator/funcs/set_operation.py b/mathgenerator/funcs/set_operation.py index 370c827..4f0a27a 100644 --- a/mathgenerator/funcs/set_operation.py +++ b/mathgenerator/funcs/set_operation.py @@ -1,6 +1,7 @@ from .__init__ import * -def set_operation(minval = 3, maxval = 7, n_a = 4, n_b = 5): + +def set_operation(minval=3, maxval=7, n_a=4, n_b=5): number_variables_a = random.randint(minval, maxval) number_variables_b = random.randint(minval, maxval) a = [] @@ -12,5 +13,5 @@ def set_operation(minval = 3, maxval = 7, n_a = 4, n_b = 5): a=set(a) b=set(b) problem = "Given the two sets a=" + str(a) + " ,b=" + str(b) + ".Find the Union,intersection,a-b,b-a and symmetric difference" - solution ="Union is " + str(a.union(b)) + ",Intersection is " + str(a.intersection(b)) + ", a-b is " + str(a.difference(b)) + ",b-a is " + str(b.difference(a)) + ", Symmetric difference is " + str(a.symmetric_difference(b)) + solution = "Union is " + str(a.union(b)) + ",Intersection is " + str(a.intersection(b)) + ", a-b is " + str(a.difference(b)) + ",b-a is " + str(b.difference(a)) + ", Symmetric difference is " + str(a.symmetric_difference(b)) return problem, solution From 24231cac4ee7e862548664e9f3d963647f4dfb70 Mon Sep 17 00:00:00 2001 From: Souvikdeb2612 <62352386+Souvikdeb2612@users.noreply.github.com> Date: Tue, 20 Oct 2020 22:46:13 +0530 Subject: [PATCH 12/43] Create curvedSurfaceAreaCylinderFunc.py --- mathgenerator/funcs/curvedSurfaceAreaCylinderFunc.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 mathgenerator/funcs/curvedSurfaceAreaCylinderFunc.py diff --git a/mathgenerator/funcs/curvedSurfaceAreaCylinderFunc.py b/mathgenerator/funcs/curvedSurfaceAreaCylinderFunc.py new file mode 100644 index 0000000..38b3be4 --- /dev/null +++ b/mathgenerator/funcs/curvedSurfaceAreaCylinderFunc.py @@ -0,0 +1,10 @@ +from .__init__ import * + +def curvedSurfaceAreaCylinderFunc(maxRadius = 49, maxHeight=99): + r = random.randint(1, maxRadius) + h = random.randint(1, maxHeight) + problem = f"What is Curved surface area of a cylinder of radius, {r} and height, {h}?" + csa = float(2*math.pi*r*h) + formatted_float = "{:.5f}".format(csa) + solution = f"CSA of cylinder = {formatted_float}%" + return problem, solution From 70a470366ea170507ea9b5dac540a739a411507a Mon Sep 17 00:00:00 2001 From: Souvikdeb2612 <62352386+Souvikdeb2612@users.noreply.github.com> Date: Tue, 20 Oct 2020 22:46:40 +0530 Subject: [PATCH 13/43] 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 2d0910f..b76db90 100644 --- a/mathgenerator/funcs/__init__.py +++ b/mathgenerator/funcs/__init__.py @@ -94,3 +94,4 @@ from .degree_to_rad import * from .radian_to_deg import * from .differentiation import * from .definite_integral import * +from .curvedSurfaceAreaCylinderFunc import * From 4c50ad0270a68d6bea6f66b3551dbb9d2df4c4c4 Mon Sep 17 00:00:00 2001 From: Souvikdeb2612 <62352386+Souvikdeb2612@users.noreply.github.com> Date: Tue, 20 Oct 2020 22:56:50 +0530 Subject: [PATCH 14/43] Update curvedSurfaceAreaCylinderFunc.py --- mathgenerator/funcs/curvedSurfaceAreaCylinderFunc.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mathgenerator/funcs/curvedSurfaceAreaCylinderFunc.py b/mathgenerator/funcs/curvedSurfaceAreaCylinderFunc.py index 38b3be4..313692c 100644 --- a/mathgenerator/funcs/curvedSurfaceAreaCylinderFunc.py +++ b/mathgenerator/funcs/curvedSurfaceAreaCylinderFunc.py @@ -8,3 +8,6 @@ def curvedSurfaceAreaCylinderFunc(maxRadius = 49, maxHeight=99): formatted_float = "{:.5f}".format(csa) solution = f"CSA of cylinder = {formatted_float}%" return problem, solution + + +curvedSurfaceAreaCylinder = Generator("Curved surface area of a cylinder",91,"What is CSA of a cylinder of radius, r and height, h?","csa of cylinder",curvedSurfaceAreaCylinderFunc) From 869207bdb521746472e47ac9d9e9d8f555f74176 Mon Sep 17 00:00:00 2001 From: Mo <58116522+Metropass@users.noreply.github.com> Date: Tue, 20 Oct 2020 13:55:21 -0400 Subject: [PATCH 15/43] Fixed Issue #289 Removed the multiplication, added '+' for proper concatenation --- mathgenerator/funcs/decimal_to_roman_numerals.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mathgenerator/funcs/decimal_to_roman_numerals.py b/mathgenerator/funcs/decimal_to_roman_numerals.py index 46a1ebd..63b64f2 100644 --- a/mathgenerator/funcs/decimal_to_roman_numerals.py +++ b/mathgenerator/funcs/decimal_to_roman_numerals.py @@ -15,7 +15,7 @@ def decimalToRomanNumeralsFunc(maxDecimal=4000): if last_value <= 3: solution += (roman_dict[divisor] * last_value) elif last_value == 4: - solution += (roman_dict[divisor] * roman_dict[divisor * 5]) + solution += (roman_dict[divisor] + roman_dict[divisor * 5]) elif 5 <= last_value <= 8: solution += (roman_dict[divisor * 5] + (roman_dict[divisor] * (last_value - 5))) elif last_value == 9: From 46c396bc4fb4e669aa6471502401f297c90f67f5 Mon Sep 17 00:00:00 2001 From: lukew3 Date: Tue, 20 Oct 2020 14:02:16 -0400 Subject: [PATCH 16/43] cache workflow update --- .github/workflows/tests.yaml | 18 ++++++++++++++++++ setup.py | 6 +++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index cc6cf9d..c28d903 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -9,15 +9,33 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Set up Python uses: actions/setup-python@v2 with: python-version: '3.x' + + - name: Cache Primes + id: myCacheStep + uses: actions/cache@v2 + env: + cache-name: cache-pip-modules + with: + path: ~/.pip + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + - name: Install dependencies + if: steps.myCacheStep.outputs.cache-hit != 'true' run: | python -m pip install -U pip python -m pip install -r dev-requirements.txt + - name: Linter run: make lint + - name: Test run: make test diff --git a/setup.py b/setup.py index 4bfbcd0..10f5f36 100644 --- a/setup.py +++ b/setup.py @@ -8,5 +8,9 @@ setup(name='mathgenerator', author_email='lukew25073@gmail.com', license='MIT', packages=find_packages(), - install_requires=[], + install_requires=[ + sympy, + numpy, + scipy + ], entry_points={}) From d3c6d5d988566e552dfe9192328cf0a2b16835b0 Mon Sep 17 00:00:00 2001 From: lukew3 Date: Tue, 20 Oct 2020 14:05:43 -0400 Subject: [PATCH 17/43] fix install requires --- setup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 10f5f36..fbbebfd 100644 --- a/setup.py +++ b/setup.py @@ -9,8 +9,8 @@ setup(name='mathgenerator', license='MIT', packages=find_packages(), install_requires=[ - sympy, - numpy, - scipy + 'sympy', + 'numpy', + 'scipy' ], entry_points={}) From 05711e6bdfda27153b523e095c43c750c66ad2da Mon Sep 17 00:00:00 2001 From: lukew3 Date: Tue, 20 Oct 2020 14:20:54 -0400 Subject: [PATCH 18/43] Change cachestep name --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index c28d903..87ced74 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -15,7 +15,7 @@ jobs: with: python-version: '3.x' - - name: Cache Primes + - name: Cache Dependencies id: myCacheStep uses: actions/cache@v2 env: From c165a176d06db1c1e70a7b5fd046c62d889b6d0e Mon Sep 17 00:00:00 2001 From: lukew3 Date: Tue, 20 Oct 2020 14:32:20 -0400 Subject: [PATCH 19/43] cache test --- test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.py b/test.py index 74d73ce..2fa65b7 100644 --- a/test.py +++ b/test.py @@ -10,4 +10,4 @@ for item in list: print(item[2]) # print(mathgen.getGenList()) -print(mathgen.genById(89)) +print(mathgen.genById(85)) From 0a9b54ab0e2bdfd2f186a06205da8d24a3871122 Mon Sep 17 00:00:00 2001 From: lukew3 Date: Tue, 20 Oct 2020 19:34:23 -0400 Subject: [PATCH 20/43] update cache workflow --- .github/workflows/tests.yaml | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 87ced74..d66144a 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -15,24 +15,17 @@ jobs: with: python-version: '3.x' - - name: Cache Dependencies - id: myCacheStep - uses: actions/cache@v2 - env: - cache-name: cache-pip-modules + - uses: actions/cache@v1 with: - path: ~/.pip - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/dev-requirements.txt') }} restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- + ${{ runner.os }}-pip- - - name: Install dependencies - if: steps.myCacheStep.outputs.cache-hit != 'true' + - name: Install Dependencies + if: steps.cache.outputs.cache-hit != 'true' run: | - python -m pip install -U pip - python -m pip install -r dev-requirements.txt + pip install -r dev-requirements.txt - name: Linter run: make lint From a6f784a5d078edfd170bb727e161bfef97bd2452 Mon Sep 17 00:00:00 2001 From: lukew3 Date: Tue, 20 Oct 2020 19:54:01 -0400 Subject: [PATCH 21/43] test github actions cache --- .github/workflows/python-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 4e1ef42..495e3c3 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -1,5 +1,5 @@ # This workflows will upload a Python Package using Twine when a release is created -# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries +# For more information see https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries name: Upload Python Package From 8cde00c324377d4dfebad9f337b4b23ff96aed17 Mon Sep 17 00:00:00 2001 From: Luke Weiler Date: Tue, 20 Oct 2020 21:16:27 -0400 Subject: [PATCH 22/43] Update setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index fbbebfd..7b022b4 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from setuptools import setup, find_packages setup(name='mathgenerator', - version='1.1.3', + version='1.1.4', description='An open source solution for generating math problems', url='https://github.com/todarith/mathgenerator', author='Luke Weiler', From ca8bafabada286696ba27721779f8552e443af9a Mon Sep 17 00:00:00 2001 From: lukew3 Date: Wed, 21 Oct 2020 13:59:13 -0400 Subject: [PATCH 23/43] fix merge errors --- mathgenerator/funcs/compound_interest.py | 25 +++++++++--------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/mathgenerator/funcs/compound_interest.py b/mathgenerator/funcs/compound_interest.py index 4278d10..8f7d48d 100644 --- a/mathgenerator/funcs/compound_interest.py +++ b/mathgenerator/funcs/compound_interest.py @@ -1,24 +1,17 @@ from .__init__ import * -def compoundInterestFunc(maxPrinciple=10000, - maxRate=10, - maxTime=10, - maxPeriod=10): - p = random.randint(100, maxPrinciple) +def compoundInterestFunc(maxPrinciple=10000, maxRate=10, maxTime=10): + p = random.randint(1000, maxPrinciple) r = random.randint(1, maxRate) - t = random.randint(1, maxTime) - n = random.randint(1, maxPeriod) - A = p * ((1 + (r / (100 * n))**(n * t))) - problem = "Compound Interest for a principle amount of " + str( - p) + " dollars, " + str( - r) + "% rate of interest and for a time period of " + str( - t) + " compounded monthly is = " - solution = round(A, 2) + n = random.randint(1, maxTime) + a = p * (1 + r / 100)**n + problem = "Compound interest for a principle amount of " + \ + str(p) + " dollars, " + str(r) + \ + "% rate of interest and for a time period of " + str(n) + " year is = " + solution = round(a, 2) return problem, solution compound_interest = Generator( - "Compound Interest", 78, - "Compound interest for a principle amount of p dollars, r% rate of interest and for a time period of t years with n times compounded annually is = ", - "A dollars", compoundInterestFunc) + "Compound Interest", 78, "Compound interest for a principle amount of a dollars, b% rate of interest and for a time period of c years is = ", "d dollars", compoundInterestFunc) From 15ba021c21cce766e5769baa08630dd7895ef1f6 Mon Sep 17 00:00:00 2001 From: Luke Weiler Date: Wed, 21 Oct 2020 14:03:06 -0400 Subject: [PATCH 24/43] Update BCDtoDecimalFunc.py --- mathgenerator/funcs/BCDtoDecimalFunc.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mathgenerator/funcs/BCDtoDecimalFunc.py b/mathgenerator/funcs/BCDtoDecimalFunc.py index 7d93a57..33c0737 100644 --- a/mathgenerator/funcs/BCDtoDecimalFunc.py +++ b/mathgenerator/funcs/BCDtoDecimalFunc.py @@ -16,4 +16,6 @@ def BCDtoDecimalFunc(maxNumber=10000): problem = "Integer of Binary Coded Decimal " + str(n) + " is = " solution = int(binstring, 2) - return problem, solution \ No newline at end of file + return problem, solution + +bcd_to_decimal = Generator("Binary Coded Decimal to Integer", 91, "Integer of Binary Coded Decimal b is ", "n", BCDtoDecimalFunc) From 47966623ccba042c89f7f11e874d0dc9abb16298 Mon Sep 17 00:00:00 2001 From: lukew3 Date: Wed, 21 Oct 2020 14:05:56 -0400 Subject: [PATCH 25/43] binary coded decimal fix --- mathgenerator/funcs/__init__.py | 1 + mathgenerator/funcs/{BCDtoDecimalFunc.py => bcd_to_decimal.py} | 0 test.py | 2 +- 3 files changed, 2 insertions(+), 1 deletion(-) rename mathgenerator/funcs/{BCDtoDecimalFunc.py => bcd_to_decimal.py} (100%) diff --git a/mathgenerator/funcs/__init__.py b/mathgenerator/funcs/__init__.py index 56a2fd5..f63ad07 100644 --- a/mathgenerator/funcs/__init__.py +++ b/mathgenerator/funcs/__init__.py @@ -95,3 +95,4 @@ from .radian_to_deg import * from .differentiation import * from .definite_integral import * from .is_prime import * +from .bcd_to_decimal import * diff --git a/mathgenerator/funcs/BCDtoDecimalFunc.py b/mathgenerator/funcs/bcd_to_decimal.py similarity index 100% rename from mathgenerator/funcs/BCDtoDecimalFunc.py rename to mathgenerator/funcs/bcd_to_decimal.py diff --git a/test.py b/test.py index 2fa65b7..c97e32d 100644 --- a/test.py +++ b/test.py @@ -10,4 +10,4 @@ for item in list: print(item[2]) # print(mathgen.getGenList()) -print(mathgen.genById(85)) +print(mathgen.genById(91)) From 9a27fcd700e314a3d6bbe8202891565b7db3a0d4 Mon Sep 17 00:00:00 2001 From: lukew3 Date: Wed, 21 Oct 2020 14:06:31 -0400 Subject: [PATCH 26/43] linter fix --- mathgenerator/funcs/bcd_to_decimal.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mathgenerator/funcs/bcd_to_decimal.py b/mathgenerator/funcs/bcd_to_decimal.py index 33c0737..fc356d0 100644 --- a/mathgenerator/funcs/bcd_to_decimal.py +++ b/mathgenerator/funcs/bcd_to_decimal.py @@ -1,4 +1,5 @@ -from .__init__ import * +from .__init__ import * + def BCDtoDecimalFunc(maxNumber=10000): n = random.randint(1000, maxNumber) @@ -13,9 +14,11 @@ def BCDtoDecimalFunc(maxNumber=10000): break else: n = q - + problem = "Integer of Binary Coded Decimal " + str(n) + " is = " solution = int(binstring, 2) return problem, solution -bcd_to_decimal = Generator("Binary Coded Decimal to Integer", 91, "Integer of Binary Coded Decimal b is ", "n", BCDtoDecimalFunc) + +bcd_to_decimal = Generator("Binary Coded Decimal to Integer", 91, + "Integer of Binary Coded Decimal b is ", "n", BCDtoDecimalFunc) From 85286449a577980bcd2f5595c1f1457754963673 Mon Sep 17 00:00:00 2001 From: Luke Weiler Date: Wed, 21 Oct 2020 14:08:25 -0400 Subject: [PATCH 27/43] Delete DegreeToRadian.py --- mathgenerator/funcs/DegreeToRadian.py | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 mathgenerator/funcs/DegreeToRadian.py diff --git a/mathgenerator/funcs/DegreeToRadian.py b/mathgenerator/funcs/DegreeToRadian.py deleted file mode 100644 index ce1389e..0000000 --- a/mathgenerator/funcs/DegreeToRadian.py +++ /dev/null @@ -1,10 +0,0 @@ -from .__init__ import * - - -def DegreeToRadian(maxAngle=360): - angle = random.randint(1, maxAngle) - radian = round(math.radians(angle), 2) - problem = f"{angle} Degrees is equal to Radian = " - solution = radian - - return problem, solution \ No newline at end of file From 9c8ee7ee6491d2f2c11c8402d8c9b0a8ed719235 Mon Sep 17 00:00:00 2001 From: Luke Weiler Date: Wed, 21 Oct 2020 14:08:32 -0400 Subject: [PATCH 28/43] Delete DecimalToHexFunc.py --- mathgenerator/funcs/DecimalToHexFunc.py | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 mathgenerator/funcs/DecimalToHexFunc.py diff --git a/mathgenerator/funcs/DecimalToHexFunc.py b/mathgenerator/funcs/DecimalToHexFunc.py deleted file mode 100644 index 33945d3..0000000 --- a/mathgenerator/funcs/DecimalToHexFunc.py +++ /dev/null @@ -1,11 +0,0 @@ -from .__init__ import * - - -def DecimalToHexFunc(max_dec=99): - a = random.randint(1, max_dec) - b = hex(a).replace("0x", "") - - problem = "Hexadecimal of " + str(a) + "=" - solution = str(b) - - return problem, solution From 29b2a6467d2f3fde1f800d70cf9eda7b00da0258 Mon Sep 17 00:00:00 2001 From: Luke Weiler Date: Wed, 21 Oct 2020 14:08:40 -0400 Subject: [PATCH 29/43] Delete DecimalToOctalFunc.py --- mathgenerator/funcs/DecimalToOctalFunc.py | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 mathgenerator/funcs/DecimalToOctalFunc.py diff --git a/mathgenerator/funcs/DecimalToOctalFunc.py b/mathgenerator/funcs/DecimalToOctalFunc.py deleted file mode 100644 index 703ef45..0000000 --- a/mathgenerator/funcs/DecimalToOctalFunc.py +++ /dev/null @@ -1,11 +0,0 @@ -from .__init__ import * - - -def DecimalToHexFunc(max_dec=99): - a = random.randint(1, max_dec) - b = oct(a) - - problem = "Octal of " + str(a) + "=" - solution = str(b) - - return problem, solution From 22edff6736a2098346a02501b1add4f5418b94cb Mon Sep 17 00:00:00 2001 From: Luke Weiler Date: Wed, 21 Oct 2020 14:10:45 -0400 Subject: [PATCH 30/43] Update complexToPolarFunc.py --- mathgenerator/funcs/complexToPolarFunc.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mathgenerator/funcs/complexToPolarFunc.py b/mathgenerator/funcs/complexToPolarFunc.py index ddc86ff..2685d9c 100644 --- a/mathgenerator/funcs/complexToPolarFunc.py +++ b/mathgenerator/funcs/complexToPolarFunc.py @@ -1,6 +1,6 @@ from .__init__ import * -def polar(minRealImaginaryNum = -20, maxRealImaginaryNum = 20): +def complexToPolarFunc(minRealImaginaryNum = -20, maxRealImaginaryNum = 20): num = complex(random.randint(minRealImaginaryNum, maxRealImaginaryNum), random.randint(minRealImaginaryNum, maxRealImaginaryNum)) a= num.real b= num.imag @@ -10,4 +10,6 @@ def polar(minRealImaginaryNum = -20, maxRealImaginaryNum = 20): problem = f"rexp(itheta) = " solution = plr return problem, solution - \ No newline at end of file + + +complex_to_polar = Generator("Complex To Polar Form", 92, "rexp(itheta) = ", "plr", complexToPolarFunc) From 6faba3330991756273c7bccdd3ac4d588ec6db5c Mon Sep 17 00:00:00 2001 From: lukew3 Date: Wed, 21 Oct 2020 14:12:48 -0400 Subject: [PATCH 31/43] complex to polar updates --- README.md | 183 +++++++++++----------- mathgenerator/funcs/__init__.py | 1 - mathgenerator/funcs/complexToPolarFunc.py | 15 -- mathgenerator/funcs/complex_to_polar.py | 18 +++ test.py | 2 +- 5 files changed, 112 insertions(+), 107 deletions(-) delete mode 100644 mathgenerator/funcs/complexToPolarFunc.py create mode 100644 mathgenerator/funcs/complex_to_polar.py diff --git a/README.md b/README.md index 2bdc428..932b783 100644 --- a/README.md +++ b/README.md @@ -31,93 +31,96 @@ problem, solution = mathgen.genById(0) | Id | Skill | Example problem | Example Solution | Function Name | |------|-----------------------------------|--------------------|-----------------------|--------------------------| [//]: # list start -| 0 | Addition | 29+29= | 58 | addition | -| 1 | Subtraction | 10-8= | 2 | subtraction | -| 2 | Multiplication | 96*0= | 0 | multiplication | -| 3 | Division | 25/95= | 0.2631578947368421 | division | -| 4 | Binary Complement 1s | 100101100= | 011010011 | binary_complement_1s | -| 5 | Modulo Division | 74%50= | 24 | modulo_division | -| 6 | Square Root | sqrt(49)= | 7 | square_root | -| 7 | Power Rule Differentiation | 10x^7 + 7x^5 + 5x^8 | 70x^6 + 35x^4 + 40x^7 | power_rule_differentiation | -| 8 | Square | 9^2= | 81 | square | -| 9 | LCM (Least Common Multiple) | LCM of 19 and 7 = | 133 | lcm | -| 10 | GCD (Greatest Common Denominator) | GCD of 1 and 7 = | 1 | gcd | -| 11 | Basic Algebra | 3x + 2 = 8 | 6 | basic_algebra | -| 12 | Logarithm | log2(128) | 7 | log | -| 13 | Easy Division | 228/12 = | 19 | int_division | -| 14 | Decimal to Binary | Binary of 37= | 100101 | decimal_to_binary | -| 15 | Binary to Decimal | 10100001 | 161 | binary_to_decimal | -| 16 | Fraction Division | (8/2)/(8/2) | 1 | divide_fractions | -| 17 | Integer Multiplication with 2x2 Matrix | 6 * [[3, 7], [10, 6]] = | [[18,42],[60,36]] | multiply_int_to_22_matrix | -| 18 | Area of Triangle | Area of triangle with side lengths: 2 1 19 = | (5.449334243437888e-15+88.99438184514796j) | area_of_triangle | -| 19 | Triangle exists check | Does triangle with sides 48, 16 and 30 exist? | No | valid_triangle | -| 20 | Midpoint of the two point | (2,-5),(12,-7)= | (7.0,-6.0) | midpoint_of_two_points | -| 21 | Factoring Quadratic | x^2-18x+81 | (x-9)(x-9) | factoring | -| 22 | Third Angle of Triangle | Third angle of triangle with angles 45 and 1 = | 134 | third_angle_of_triangle | -| 23 | Solve a System of Equations in R^2 | -7x - 10y = -133, 7x - 2y = 49 | x = 9, y = 7 | system_of_equations | -| 24 | Distance between 2 points | Find the distance between (-10, 7) and (16, 6) | sqrt(677) | distance_two_points | -| 25 | Pythagorean Theorem | The hypotenuse of a right triangle given the other two lengths 10 and 8 = | 12.81 | pythagorean_theorem | -| 26 | Linear Equations | 18x + -2y = -174, -13x + 6y = 194 | x = -8, y = 15 | linear_equations | -| 27 | Prime Factorisation | Find prime factors of 16 | [2, 2, 2, 2] | prime_factors | -| 28 | Fraction Multiplication | (6/8)*(2/5) | 3/10 | fraction_multiplication | -| 29 | Angle of a Regular Polygon | Find the angle of a regular polygon with 17 sides | 158.82 | angle_regular_polygon | -| 30 | Combinations of Objects | Number of combinations from 17 objects picked 3 at a time | 680 | combinations | -| 31 | Factorial | 1! = | 1 | factorial | -| 32 | Surface Area of Cube | Surface area of cube with side = 17m is | 1734 m^2 | surface_area_cube | -| 33 | Surface Area of Cuboid | Surface area of cuboid with sides = 12m, 11m, 1m is | 310 m^2 | surface_area_cuboid | -| 34 | Surface Area of Cylinder | Surface area of cylinder with height = 38m and radius = 16m is | 5428 m^2 | surface_area_cylinder | -| 35 | Volum of Cube | Volume of cube with side = 11m is | 1331 m^3 | volume_cube | -| 36 | Volume of Cuboid | Volume of cuboid with sides = 17m, 19m, 8m is | 2584 m^3 | volume_cuboid | -| 37 | Volume of cylinder | Volume of cylinder with height = 35m and radius = 19m is | 39694 m^3 | volume_cylinder | -| 38 | Surface Area of cone | Surface area of cone with height = 8m and radius = 19m is | 2364 m^2 | surface_area_cone | -| 39 | Volume of cone | Volume of cone with height = 43m and radius = 13m is | 7609 m^3 | volume_cone | -| 40 | Common Factors | Common Factors of 21 and 65 = | [1] | common_factors | -| 41 | Intersection of Two Lines | Find the point of intersection of the two lines: y = 5/4x - 1 and y = 0/4x - 5 | (-16/5, -5) | intersection_of_two_lines | -| 42 | Permutations | Number of Permutations from 10 objects picked 5 at a time = | 30240 | permutation | -| 43 | Cross Product of 2 Vectors | [12, -16, 4] X [-14, 10, -9] = | [104, 52, -104] | vector_cross | -| 44 | Compare Fractions | Which symbol represents the comparison between 7/10 and 7/5? | < | compare_fractions | -| 45 | Simple Interest | Simple interest for a principle amount of 6138 dollars, 9% rate of interest and for a time period of 8 years is = | 4419.36 | simple_interest | -| 46 | Multiplication of two matrices | Multiply
-8-8
-2-9
and
-10-8
9-9
|
8136
-6197
| matrix_multiplication | -| 47 | Cube Root | cuberoot of 633 upto 2 decimal places is: | 8.59 | cube_root | -| 48 | Power Rule Integration | 2x^5 + 3x^3 + 4x^7 + 9x^1 + 6x^9 | (2/5)x^6 + (3/3)x^4 + (4/7)x^8 + (9/1)x^2 + (6/9)x^10 + c | power_rule_integration | -| 49 | Fourth Angle of Quadrilateral | Fourth angle of quadrilateral with angles 79 , 44, 37 = | 200 | fourth_angle_of_quadrilateral | -| 50 | Quadratic Equation | Zeros of the Quadratic Equation 79x^2+182x+98=0 | [-0.86, -1.45] | quadratic_equation | -| 51 | HCF (Highest Common Factor) | HCF of 1 and 20 = | 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 2 = | 1/6 | dice_sum_probability | -| 53 | Exponentiation | 6^9 = | 10077696 | exponentiation | -| 54 | Confidence interval For sample S | The confidence interval for sample [260, 249, 281, 261, 236, 237, 275, 229, 256, 242, 277, 240, 278, 293, 271, 255, 216, 292, 200, 298, 282, 223] with 99% confidence is | (271.2437114485249, 242.48356127874783) | confidence_interval | -| 55 | Comparing surds | Fill in the blanks 71^(1/5) _ 31^(1/8) | > | 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 10 sides = | 1440 | sum_of_polygon_angles | -| 59 | Mean,Standard Deviation,Variance | Find the mean,standard deviation and variance for the data[13, 22, 36, 17, 9, 39, 50, 14, 32, 40, 37, 48, 47, 28, 47] | The Mean is 31.933333333333334 , Standard Deviation is 182.59555555555553, Variance is 13.51279229306643 | 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 61 m = | 950775.7894726198 m^3 | volume_sphere | -| 62 | nth Fibonacci number | What is the 85th Fibonacci number? | 259695496911123328 | nth_fibonacci_number | -| 63 | Profit or Loss Percent | Profit percent when CP = 353 and SP = 752 is: | 113.03116147308782 | profit_loss_percent | -| 64 | Binary to Hexidecimal | 111101011 | 0x1eb | binary_to_hex | -| 65 | Multiplication of 2 complex numbers | (-19-9j) * (-17-2j) = | (305+191j) | multiply_complex_numbers | -| 66 | Geometric Progression | For the given GP [7, 77, 847, 9317, 102487, 1127357] ,Find the value of a,common ratio,6th term value, sum upto 7th term | The value of a is 7, common ratio is 11 , 6th term is 1127357 , sum upto 7th term is 13641019.0 | geometric_progression | -| 67 | Geometric Mean of N Numbers | Geometric mean of 3 numbers 32 , 5 and 18 = | (32*5*18)^(1/3) = 14.227573217960249 | geometric_mean | -| 68 | Harmonic Mean of N Numbers | Harmonic mean of 3 numbers 48 , 85 and 79 = | 3/((1/48) + (1/85) + (1/79)) = 66.28916158223076 | harmonic_mean | -| 69 | Euclidian norm or L2 norm of a vector | Euclidian norm or L2 norm of the vector[743.1109024649227, 951.2861991520674, 821.2679183199273, 831.5922742303677, 972.3005129207023, 775.1712986008336, 869.5254070360901, 34.05779748860371, 495.5299489221041, 516.2458991121815, 620.0871728488738, 12.438787805084894, 967.8138977993306, 627.6791615554401, 129.81896901435886, 566.4442009627315, 521.5300881726977, 741.5947979192599] is: | 2917.827115551868 | euclidian_norm | -| 70 | Angle between 2 vectors | angle between the vectors [341.1766244080324, 386.90517658729595, 306.3074773969527, 542.1138441520038, 149.80203485453225, 85.6719016065689, 875.0827941729921, 292.0422074695527, 312.8929536855103, 408.95388654647445, 119.81564007869672, 177.5529661884936, 360.30983184002406, 111.71502530193955, 29.528755078141455, 478.2846569662712, 855.8978282979257] and [230.45166329807688, 922.2895458023412, 219.89492715268733, 375.8793126730714, 731.2614314505195, 277.5554009411926, 329.1490487358273, 477.7600322879586, 168.93745868538923, 423.6897582803929, 724.5555882496458, 519.6421532094823, 158.0479000313908, 679.3674240323584, 496.6795371750926, 853.4421897526636, 715.2567898992207] is: | NaN | angle_btw_vectors | -| 71 | Absolute difference between two numbers | Absolute difference between numbers 53 and -70 = | 123 | absolute_difference | -| 72 | Dot Product of 2 Vectors | [-8, -4, -10] . [-9, -6, -9] = | 186 | vector_dot | -| 73 | Binary 2's Complement | 2's complement of = | | binary_2s_complement | -| 74 | Inverse of a Matrix | Inverse of Matrix Matrix([[43, 95, 41], [46, 80, 67], [57, 75, 71]]) is: | Matrix([[131/7038, -367/3519, 617/7038], [553/35190, 358/17595, -199/7038], [-37/1173, 73/1173, -31/1173]]) | invert_matrix | -| 75 | Area of a Sector | Given radius, 40 and angle, 199. Find the area of the sector. | Area of sector = 2778.56417 | sector_area | -| 76 | Mean and Median | Given the series of numbers [44, 64, 22, 37, 63, 56, 27, 62, 98, 72]. find the arithmatic mean and mdian of the series | Arithmetic mean of the series is 54.5 and Arithmetic median of this series is 59.0 | mean_median | -| 77 | Determinant to 2x2 Matrix | Det([[73, 52], [55, 80]]) = | 2980 | int_matrix_22_determinant | -| 78 | Compound Interest | Compound Interest for a principle amount of 8506 dollars, 8% rate of interest and for a time period of 10 compounded monthly is = | 8506.0 | compound_interest | -| 79 | Decimal to Hexadecimal | Binary of 293= | 0x125 | decimal_to_hexadeci | -| 80 | Percentage of a number | What is 57% of 4? | Required percentage = 2.28% | percentage | -| 81 | Celsius To Fahrenheit | Convert 57 degrees Celsius to degrees Fahrenheit = | 134.60000000000002 | celsius_to_fahrenheit | -| 82 | AP Term Calculation | Find the term number 89 of the AP series: 20, 115, 210 ... | 8380 | arithmetic_progression_term | -| 83 | AP Sum Calculation | Find the sum of first 98 terms of the AP series: -58, -106, -154 ... | -233828.0 | arithmetic_progression_sum | -| 84 | Converts decimal to octal | The decimal number 1716 in Octal is: | 0o3264 | decimal_to_octal | -| 85 | Converts decimal to Roman Numerals | The number 587 in Roman Numerals is: | DLXXXVII | decimal_to_roman_numerals | -| 86 | Degrees to Radians | Angle 245 in radians is = | 4.28 | 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)+5*x^(-2))/dx | exp(x) - 10/x^3 | differentiation | -| 89 | Definite Integral of Quadratic Equation | The definite integral within limits 0 to 1 of the equation 39x^2 + 72x + 74 is = | 123.0 | definite_integral | +| 0 | Addition | 42+24= | 66 | addition | +| 1 | Subtraction | 3-0= | 3 | subtraction | +| 2 | Multiplication | 69*0= | 0 | multiplication | +| 3 | Division | 98/90= | 1.0888888888888888 | division | +| 4 | Binary Complement 1s | 100= | 011 | binary_complement_1s | +| 5 | Modulo Division | 37%49= | 37 | modulo_division | +| 6 | Square Root | sqrt(25)= | 5 | square_root | +| 7 | Power Rule Differentiation | 3x^10 + 1x^10 + 3x^9 + 4x^3 + 8x^7 | 30x^9 + 10x^9 + 27x^8 + 12x^2 + 56x^6 | power_rule_differentiation | +| 8 | Square | 6^2= | 36 | square | +| 9 | LCM (Least Common Multiple) | LCM of 8 and 12 = | 24 | lcm | +| 10 | GCD (Greatest Common Denominator) | GCD of 11 and 19 = | 1 | gcd | +| 11 | Basic Algebra | 1x + 4 = 7 | 3 | basic_algebra | +| 12 | Logarithm | log2(64) | 6 | log | +| 13 | Easy Division | 240/15 = | 16 | int_division | +| 14 | Decimal to Binary | Binary of 46= | 101110 | decimal_to_binary | +| 15 | Binary to Decimal | 110101 | 53 | binary_to_decimal | +| 16 | Fraction Division | (3/5)/(6/10) | 1 | divide_fractions | +| 17 | Integer Multiplication with 2x2 Matrix | 7 * [[6, 9], [0, 9]] = | [[42,63],[0,63]] | multiply_int_to_22_matrix | +| 18 | Area of Triangle | Area of triangle with side lengths: 18 12 5 = | (1.5018315853130168e-15+24.526771087935728j) | area_of_triangle | +| 19 | Triangle exists check | Does triangle with sides 43, 37 and 16 exist? | Yes | valid_triangle | +| 20 | Midpoint of the two point | (0,10),(3,-19)= | (1.5,-4.5) | midpoint_of_two_points | +| 21 | Factoring Quadratic | x^2+4x-5 | (x+5)(x-1) | factoring | +| 22 | Third Angle of Triangle | Third angle of triangle with angles 37 and 88 = | 55 | third_angle_of_triangle | +| 23 | Solve a System of Equations in R^2 | -4x - 7y = -63, x - y = 2 | x = 7, y = 5 | system_of_equations | +| 24 | Distance between 2 points | Find the distance between (18, -18) and (14, 0) | sqrt(340) | distance_two_points | +| 25 | Pythagorean Theorem | The hypotenuse of a right triangle given the other two lengths 3 and 14 = | 14.32 | pythagorean_theorem | +| 26 | Linear Equations | -20x + 5y = 200, 3x + -1y = -32 | x = -8, y = 8 | linear_equations | +| 27 | Prime Factorisation | Find prime factors of 70 | [2, 5, 7] | prime_factors | +| 28 | Fraction Multiplication | (8/3)*(8/4) | 16/3 | fraction_multiplication | +| 29 | Angle of a Regular Polygon | Find the angle of a regular polygon with 19 sides | 161.05 | angle_regular_polygon | +| 30 | Combinations of Objects | Number of combinations from 14 objects picked 9 at a time | 2002 | combinations | +| 31 | Factorial | 2! = | 2 | factorial | +| 32 | Surface Area of Cube | Surface area of cube with side = 6m is | 216 m^2 | surface_area_cube | +| 33 | Surface Area of Cuboid | Surface area of cuboid with sides = 6m, 19m, 8m is | 628 m^2 | surface_area_cuboid | +| 34 | Surface Area of Cylinder | Surface area of cylinder with height = 35m and radius = 4m is | 980 m^2 | surface_area_cylinder | +| 35 | Volum of Cube | Volume of cube with side = 6m is | 216 m^3 | volume_cube | +| 36 | Volume of Cuboid | Volume of cuboid with sides = 16m, 8m, 7m is | 896 m^3 | volume_cuboid | +| 37 | Volume of cylinder | Volume of cylinder with height = 37m and radius = 16m is | 29757 m^3 | volume_cylinder | +| 38 | Surface Area of cone | Surface area of cone with height = 5m and radius = 11m is | 797 m^2 | surface_area_cone | +| 39 | Volume of cone | Volume of cone with height = 50m and radius = 13m is | 8848 m^3 | volume_cone | +| 40 | Common Factors | Common Factors of 93 and 71 = | [1] | common_factors | +| 41 | Intersection of Two Lines | Find the point of intersection of the two lines: y = -1/5x - 3 and y = -4/6x - 10 | (-15, 0) | intersection_of_two_lines | +| 42 | Permutations | Number of Permutations from 14 objects picked 4 at a time = | 24024 | permutation | +| 43 | Cross Product of 2 Vectors | [4, 7, -12] X [5, -9, -17] = | [-227, 8, -71] | vector_cross | +| 44 | Compare Fractions | Which symbol represents the comparison between 4/6 and 10/9? | < | compare_fractions | +| 45 | Simple Interest | Simple interest for a principle amount of 9253 dollars, 9% rate of interest and for a time period of 5 years is = | 4163.85 | simple_interest | +| 46 | Multiplication of two matrices | Multiply
20110
5-8-75
31-7-6
6104-1
and
-41-2
-10-29
-4-1-5
-55-8
|
-6251-89
6353-87
36-2286
-135-2366
| matrix_multiplication | +| 47 | Cube Root | cuberoot of 556 upto 2 decimal places is: | 8.22 | cube_root | +| 48 | Power Rule Integration | 2x^3 + 4x^3 | (2/3)x^4 + (4/3)x^4 + c | power_rule_integration | +| 49 | Fourth Angle of Quadrilateral | Fourth angle of quadrilateral with angles 69 , 60, 101 = | 130 | fourth_angle_of_quadrilateral | +| 50 | Quadratic Equation | Zeros of the Quadratic Equation 91x^2+183x+84=0 | [-0.71, -1.3] | quadratic_equation | +| 51 | HCF (Highest Common Factor) | HCF of 4 and 16 = | 4 | 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 11 = | 2/36 | dice_sum_probability | +| 53 | Exponentiation | 7^1 = | 7 | exponentiation | +| 54 | Confidence interval For sample S | The confidence interval for sample [203, 201, 267, 239, 272, 283, 281, 298, 207, 265, 204, 261, 243, 235, 270, 284, 230, 222, 285, 266] with 80% confidence is | (259.5540983014814, 242.04590169851858) | confidence_interval | +| 55 | Comparing surds | Fill in the blanks 73^(1/8) _ 4^(1/5) | > | surds_comparison | +| 56 | Fibonacci Series | The Fibonacci Series of the first 17 numbers is ? | [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987] | fibonacci_series | +| 57 | Trigonometric Values | What is tan(90)? | ∞ | 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[35, 27, 43, 8, 30, 14, 16, 35, 29, 17, 6, 19, 5, 34, 40] | The Mean is 23.866666666666667 , Standard Deviation is 147.18222222222218, Variance is 12.13186804338978 | 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 48 m = | 463246.68632773653 m^3 | volume_sphere | +| 62 | nth Fibonacci number | What is the 59th Fibonacci number? | 956722026041 | nth_fibonacci_number | +| 63 | Profit or Loss Percent | Loss percent when CP = 992 and SP = 888 is: | 10.483870967741936 | profit_loss_percent | +| 64 | Binary to Hexidecimal | 1001 | 0x9 | binary_to_hex | +| 65 | Multiplication of 2 complex numbers | (6+5j) * (19-20j) = | (214-25j) | multiply_complex_numbers | +| 66 | Geometric Progression | For the given GP [10, 70, 490, 3430, 24010, 168070] ,Find the value of a,common ratio,6th term value, sum upto 11th term | The value of a is 10, common ratio is 7 , 6th term is 168070 , sum upto 11th term is 3295544570.0 | geometric_progression | +| 67 | Geometric Mean of N Numbers | Geometric mean of 2 numbers 41 and 89 = | (41*89)^(1/2) = 60.40695324215582 | geometric_mean | +| 68 | Harmonic Mean of N Numbers | Harmonic mean of 4 numbers 69 , 15 , 41 , 67 = | 4/((1/69) + (1/15) + (1/41) + (1/67)) = 33.20189882286996 | harmonic_mean | +| 69 | Euclidian norm or L2 norm of a vector | Euclidian norm or L2 norm of the vector[956.6848004224083, 711.3170367487223, 320.15804509062485, 424.1248983996525, 721.5190124346516, 94.2612318602214, 995.8301076180039, 80.46895520905917, 797.0886057296584, 923.9911613599512, 511.29812416326956, 358.730114740062, 2.3571520022257486, 218.67122157401798, 506.1431432680296, 413.8900730468059] is: | 2363.4212638753684 | euclidian_norm | +| 70 | Angle between 2 vectors | angle between the vectors [232.30943307265463, 306.39298862783016, 623.8368964487579, 808.2182550343807, 837.7902135238608, 194.4689016385932, 369.28549948572345] and [951.1858436627766, 293.2247329611225, 274.2885808744876, 590.5739827721277, 148.45211877240538, 867.5139830165438, 563.3907757868716] is: | NaN | angle_btw_vectors | +| 71 | Absolute difference between two numbers | Absolute difference between numbers 24 and 42 = | 18 | absolute_difference | +| 72 | Dot Product of 2 Vectors | [-8, 10, 0] . [20, 15, -17] = | -10 | vector_dot | +| 73 | Binary 2's Complement | 2's complement of 1110011110 = | 1100010 | binary_2s_complement | +| 74 | Inverse of a Matrix | Inverse of Matrix Matrix([[32, 97, 28], [31, 73, 53], [42, 33, 47]]) is: | Matrix([[1682/71213, -3635/71213, 3097/71213], [769/71213, 328/71213, -828/71213], [-2043/71213, 3018/71213, -671/71213]]) | invert_matrix | +| 75 | Area of a Sector | Given radius, 4 and angle, 17. Find the area of the sector. | Area of sector = 2.37365 | sector_area | +| 76 | Mean and Median | Given the series of numbers [83, 16, 72, 60, 34, 73, 3, 68, 31, 79]. find the arithmatic mean and mdian of the series | Arithmetic mean of the series is 51.9 and Arithmetic median of this series is 64.0 | mean_median | +| 77 | Determinant to 2x2 Matrix | Det([[88, 47], [82, 8]]) = | -3150 | int_matrix_22_determinant | +| 78 | Compound Interest | Compound interest for a principle amount of 2841 dollars, 7% rate of interest and for a time period of 5 year is = | 3984.65 | compound_interest | +| 79 | Decimal to Hexadecimal | Binary of 756= | 0x2f4 | decimal_to_hexadeci | +| 80 | Percentage of a number | What is 32% of 78? | Required percentage = 24.96% | percentage | +| 81 | Celsius To Fahrenheit | Convert 63 degrees Celsius to degrees Fahrenheit = | 145.4 | celsius_to_fahrenheit | +| 82 | AP Term Calculation | Find the term number 41 of the AP series: -52, -109, -166 ... | -2332 | arithmetic_progression_term | +| 83 | AP Sum Calculation | Find the sum of first 21 terms of the AP series: -29, 47, 123 ... | 15351.0 | arithmetic_progression_sum | +| 84 | Converts decimal to octal | The decimal number 4008 in Octal is: | 0o7650 | decimal_to_octal | +| 85 | Converts decimal to Roman Numerals | The number 2529 in Roman Numerals is: | MMDXXIX | decimal_to_roman_numerals | +| 86 | Degrees to Radians | Angle 174 in radians is = | 3.04 | degree_to_rad | +| 87 | Radians to Degrees | Angle 2 in degrees is = | 114.59 | radian_to_deg | +| 88 | Differentiation | differentiate w.r.t x : d(sec(x)+6*x^(-2))/dx | tan(x)*sec(x) - 12/x^3 | differentiation | +| 89 | Definite Integral of Quadratic Equation | The definite integral within limits 0 to 1 of the equation 5x^2 + 58x + 38 is = | 68.6667 | definite_integral | +| 90 | isprime | 83 | True | is_prime | +| 91 | Binary Coded Decimal to Integer | Integer of Binary Coded Decimal 2 is = | 9224 | bcd_to_decimal | +| 92 | Complex To Polar Form | rexp(itheta) = | 27.59exp(i0.81) | complex_to_polar | diff --git a/mathgenerator/funcs/__init__.py b/mathgenerator/funcs/__init__.py index 9ef2fe1..221b641 100644 --- a/mathgenerator/funcs/__init__.py +++ b/mathgenerator/funcs/__init__.py @@ -2,7 +2,6 @@ import random import math import fractions - from ..__init__ import * from .addition import * diff --git a/mathgenerator/funcs/complexToPolarFunc.py b/mathgenerator/funcs/complexToPolarFunc.py deleted file mode 100644 index 2685d9c..0000000 --- a/mathgenerator/funcs/complexToPolarFunc.py +++ /dev/null @@ -1,15 +0,0 @@ -from .__init__ import * - -def complexToPolarFunc(minRealImaginaryNum = -20, maxRealImaginaryNum = 20): - num = complex(random.randint(minRealImaginaryNum, maxRealImaginaryNum), random.randint(minRealImaginaryNum, maxRealImaginaryNum)) - a= num.real - b= num.imag - r = round(math.hypot(a,b), 2) - theta = round(math.atan2(b,a), 2) - plr = str(r) + "exp(i" + str(theta) + ")" - problem = f"rexp(itheta) = " - solution = plr - return problem, solution - - -complex_to_polar = Generator("Complex To Polar Form", 92, "rexp(itheta) = ", "plr", complexToPolarFunc) diff --git a/mathgenerator/funcs/complex_to_polar.py b/mathgenerator/funcs/complex_to_polar.py new file mode 100644 index 0000000..ecab5ec --- /dev/null +++ b/mathgenerator/funcs/complex_to_polar.py @@ -0,0 +1,18 @@ +from .__init__ import * + + +def complexToPolarFunc(minRealImaginaryNum=-20, maxRealImaginaryNum=20): + num = complex(random.randint(minRealImaginaryNum, maxRealImaginaryNum), + random.randint(minRealImaginaryNum, maxRealImaginaryNum)) + a = num.real + b = num.imag + r = round(math.hypot(a, b), 2) + theta = round(math.atan2(b, a), 2) + plr = str(r) + "exp(i" + str(theta) + ")" + problem = f"rexp(itheta) = " + solution = plr + return problem, solution + + +complex_to_polar = Generator("Complex To Polar Form", 92, + "rexp(itheta) = ", "plr", complexToPolarFunc) diff --git a/test.py b/test.py index c97e32d..07b6b87 100644 --- a/test.py +++ b/test.py @@ -10,4 +10,4 @@ for item in list: print(item[2]) # print(mathgen.getGenList()) -print(mathgen.genById(91)) +print(mathgen.genById(92)) From 7139a8aece31009f6f45fd43e928859464252951 Mon Sep 17 00:00:00 2001 From: Luke Weiler Date: Wed, 21 Oct 2020 14:13:49 -0400 Subject: [PATCH 32/43] Update compoundInterestFunc.py --- mathgenerator/funcs/compoundInterestFunc.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/mathgenerator/funcs/compoundInterestFunc.py b/mathgenerator/funcs/compoundInterestFunc.py index 9c9d290..d357bed 100644 --- a/mathgenerator/funcs/compoundInterestFunc.py +++ b/mathgenerator/funcs/compoundInterestFunc.py @@ -2,15 +2,12 @@ from .__init__ import * from ..__init__ import Generator -<<<<<<< HEAD -def compoundInterestFunc(maxPrinciple = 10000, maxRate = 10, maxTime = 10, maxPeriod = 10): -======= + def compoundInterestFunc(maxPrinciple=10000, maxRate=10, maxTime=10, maxPeriod=10): ->>>>>>> cb0cfb4b81966d8bccb88d30dfce099e05c8b4f4 p = random.randint(100, maxPrinciple) r = random.randint(1, maxRate) t = random.randint(1, maxTime) From aff60a3d3cccf04bd9c02ac4999d9f190f4afe63 Mon Sep 17 00:00:00 2001 From: Luke Weiler Date: Wed, 21 Oct 2020 14:14:03 -0400 Subject: [PATCH 33/43] Update compoundInterestFunc.py --- mathgenerator/funcs/compoundInterestFunc.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/mathgenerator/funcs/compoundInterestFunc.py b/mathgenerator/funcs/compoundInterestFunc.py index d357bed..60a3f40 100644 --- a/mathgenerator/funcs/compoundInterestFunc.py +++ b/mathgenerator/funcs/compoundInterestFunc.py @@ -2,8 +2,6 @@ from .__init__ import * from ..__init__ import Generator - - def compoundInterestFunc(maxPrinciple=10000, maxRate=10, maxTime=10, From d745080c0a680f56093ebe327f1b992b9db59477 Mon Sep 17 00:00:00 2001 From: Luke Weiler Date: Wed, 21 Oct 2020 14:14:22 -0400 Subject: [PATCH 34/43] Update README.md --- README.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/README.md b/README.md index dc4cab7..5306ab5 100644 --- a/README.md +++ b/README.md @@ -114,8 +114,3 @@ problem, solution = mathgen.genById(0) | 78 | Compound Interest | Compound Interest for a principle amount of 4156 dollars, 8% rate of interest and for a time period of 7 compounded monthly is = | 4156.0 | surfaceAreaCylinderGen | | 79 | Decimal to Hexadecimal | Binary of 143= | 0x8f | "Surface Area of Cylinder", 34, | | 80 | Percentage of a number | What is 49% of 13? | Required percentage = 6.37% | "Surface area of cylinder with height | -| 81 | Celsius To Fahrenheit | Convert 39 degrees Celsius to degrees Fahrenheit = | 102.2 | "c units^2" | surfaceAreaCylinder) | -| 82 | AP Term Calculation | Find the term number n of the AP series: a1, a2, a3 ... | a-n | arithmeticProgressionTermFunc| -| 83 |"AP Sum Calculation"|"Find the sum of first n terms of the AP series: a1, a2, a3 ..."|"Sum"| arithmeticProgressionSumFunc| -| 84 | Set Operations | Given sets A,B | A^B,A-B,B-A,A U B, | set_operation| - From 51d63a7d656ec5182785f85e6ef53146ab51fdd8 Mon Sep 17 00:00:00 2001 From: Luke Weiler Date: Wed, 21 Oct 2020 14:14:37 -0400 Subject: [PATCH 35/43] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 5306ab5..4f7afde 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,6 @@ problem, solution = mathgen.genById(0) | Id | Skill | Example problem | Example Solution | Function Name | |------|-----------------------------------|--------------------|-----------------------|--------------------------| [//]: # list start - | 0 | Addition | 16+3= | 19 | subtraction | | 1 | Subtraction | 96-17= | 79 | multiplication | | 2 | Multiplication | 48*1= | 48 | multiplicationFunc) | From 616cc613901b6dadf8e1e5996548bbb99c0031a4 Mon Sep 17 00:00:00 2001 From: Luke Weiler Date: Wed, 21 Oct 2020 14:16:11 -0400 Subject: [PATCH 36/43] Update set_operation.py --- mathgenerator/funcs/set_operation.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mathgenerator/funcs/set_operation.py b/mathgenerator/funcs/set_operation.py index 4f0a27a..8d6db07 100644 --- a/mathgenerator/funcs/set_operation.py +++ b/mathgenerator/funcs/set_operation.py @@ -15,3 +15,7 @@ def set_operation(minval=3, maxval=7, n_a=4, n_b=5): problem = "Given the two sets a=" + str(a) + " ,b=" + str(b) + ".Find the Union,intersection,a-b,b-a and symmetric difference" solution = "Union is " + str(a.union(b)) + ",Intersection is " + str(a.intersection(b)) + ", a-b is " + str(a.difference(b)) + ",b-a is " + str(b.difference(a)) + ", Symmetric difference is " + str(a.symmetric_difference(b)) return problem, solution + +setoperations = Generator("Union,Intersection,Difference of Two Sets", 93, + "Union,intersection,difference", + "aUb,a^b,a-b,b-a,", set_operation) From b5b61cd08fb633a9d4a9e7967b7b968f5777503b Mon Sep 17 00:00:00 2001 From: lukew3 Date: Wed, 21 Oct 2020 14:19:16 -0400 Subject: [PATCH 37/43] set operation fixes --- README.md | 181 ++++++++++++++------------- mathgenerator/funcs/__init__.py | 1 + mathgenerator/funcs/set_operation.py | 13 +- 3 files changed, 100 insertions(+), 95 deletions(-) diff --git a/README.md b/README.md index 932b783..b60c4ef 100644 --- a/README.md +++ b/README.md @@ -31,96 +31,97 @@ problem, solution = mathgen.genById(0) | Id | Skill | Example problem | Example Solution | Function Name | |------|-----------------------------------|--------------------|-----------------------|--------------------------| [//]: # list start -| 0 | Addition | 42+24= | 66 | addition | -| 1 | Subtraction | 3-0= | 3 | subtraction | -| 2 | Multiplication | 69*0= | 0 | multiplication | -| 3 | Division | 98/90= | 1.0888888888888888 | division | -| 4 | Binary Complement 1s | 100= | 011 | binary_complement_1s | -| 5 | Modulo Division | 37%49= | 37 | modulo_division | +| 0 | Addition | 38+43= | 81 | addition | +| 1 | Subtraction | 58-47= | 11 | subtraction | +| 2 | Multiplication | 59*0= | 0 | multiplication | +| 3 | Division | 10/27= | 0.37037037037037035 | division | +| 4 | Binary Complement 1s | 0001= | 1110 | binary_complement_1s | +| 5 | Modulo Division | 52%59= | 52 | modulo_division | | 6 | Square Root | sqrt(25)= | 5 | square_root | -| 7 | Power Rule Differentiation | 3x^10 + 1x^10 + 3x^9 + 4x^3 + 8x^7 | 30x^9 + 10x^9 + 27x^8 + 12x^2 + 56x^6 | power_rule_differentiation | -| 8 | Square | 6^2= | 36 | square | -| 9 | LCM (Least Common Multiple) | LCM of 8 and 12 = | 24 | lcm | -| 10 | GCD (Greatest Common Denominator) | GCD of 11 and 19 = | 1 | gcd | -| 11 | Basic Algebra | 1x + 4 = 7 | 3 | basic_algebra | -| 12 | Logarithm | log2(64) | 6 | log | -| 13 | Easy Division | 240/15 = | 16 | int_division | -| 14 | Decimal to Binary | Binary of 46= | 101110 | decimal_to_binary | -| 15 | Binary to Decimal | 110101 | 53 | binary_to_decimal | -| 16 | Fraction Division | (3/5)/(6/10) | 1 | divide_fractions | -| 17 | Integer Multiplication with 2x2 Matrix | 7 * [[6, 9], [0, 9]] = | [[42,63],[0,63]] | multiply_int_to_22_matrix | -| 18 | Area of Triangle | Area of triangle with side lengths: 18 12 5 = | (1.5018315853130168e-15+24.526771087935728j) | area_of_triangle | -| 19 | Triangle exists check | Does triangle with sides 43, 37 and 16 exist? | Yes | valid_triangle | -| 20 | Midpoint of the two point | (0,10),(3,-19)= | (1.5,-4.5) | midpoint_of_two_points | -| 21 | Factoring Quadratic | x^2+4x-5 | (x+5)(x-1) | factoring | -| 22 | Third Angle of Triangle | Third angle of triangle with angles 37 and 88 = | 55 | third_angle_of_triangle | -| 23 | Solve a System of Equations in R^2 | -4x - 7y = -63, x - y = 2 | x = 7, y = 5 | system_of_equations | -| 24 | Distance between 2 points | Find the distance between (18, -18) and (14, 0) | sqrt(340) | distance_two_points | -| 25 | Pythagorean Theorem | The hypotenuse of a right triangle given the other two lengths 3 and 14 = | 14.32 | pythagorean_theorem | -| 26 | Linear Equations | -20x + 5y = 200, 3x + -1y = -32 | x = -8, y = 8 | linear_equations | -| 27 | Prime Factorisation | Find prime factors of 70 | [2, 5, 7] | prime_factors | -| 28 | Fraction Multiplication | (8/3)*(8/4) | 16/3 | fraction_multiplication | -| 29 | Angle of a Regular Polygon | Find the angle of a regular polygon with 19 sides | 161.05 | angle_regular_polygon | -| 30 | Combinations of Objects | Number of combinations from 14 objects picked 9 at a time | 2002 | combinations | +| 7 | Power Rule Differentiation | 5x^9 + 8x^9 + 9x^7 + 1x^7 + 6x^6 | 45x^8 + 72x^8 + 63x^6 + 7x^6 + 36x^5 | power_rule_differentiation | +| 8 | Square | 16^2= | 256 | square | +| 9 | LCM (Least Common Multiple) | LCM of 19 and 11 = | 209 | lcm | +| 10 | GCD (Greatest Common Denominator) | GCD of 13 and 3 = | 1 | gcd | +| 11 | Basic Algebra | 9x + 2 = 2 | 0 | basic_algebra | +| 12 | Logarithm | log3(81) | 4 | log | +| 13 | Easy Division | 525/25 = | 21 | int_division | +| 14 | Decimal to Binary | Binary of 31= | 11111 | decimal_to_binary | +| 15 | Binary to Decimal | 0101100100 | 356 | binary_to_decimal | +| 16 | Fraction Division | (8/1)/(8/5) | 5 | divide_fractions | +| 17 | Integer Multiplication with 2x2 Matrix | 10 * [[5, 6], [0, 3]] = | [[50,60],[0,30]] | multiply_int_to_22_matrix | +| 18 | Area of Triangle | Area of triangle with side lengths: 20 14 20 = | 131.14495796636635 | area_of_triangle | +| 19 | Triangle exists check | Does triangle with sides 46, 37 and 27 exist? | Yes | valid_triangle | +| 20 | Midpoint of the two point | (-12,13),(15,-19)= | (1.5,-3.0) | 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 16 and 76 = | 88 | third_angle_of_triangle | +| 23 | Solve a System of Equations in R^2 | -8x + 7y = -63, 6x - 7y = 49 | x = 7, y = -1 | system_of_equations | +| 24 | Distance between 2 points | Find the distance between (-1, -19) and (16, 19) | sqrt(1733) | distance_two_points | +| 25 | Pythagorean Theorem | The hypotenuse of a right triangle given the other two lengths 17 and 20 = | 26.25 | pythagorean_theorem | +| 26 | Linear Equations | -20x + -2y = -58, -16x + -13y = -149 | x = 2, y = 9 | linear_equations | +| 27 | Prime Factorisation | Find prime factors of 25 | [5, 5] | prime_factors | +| 28 | Fraction Multiplication | (1/5)*(5/2) | 1/2 | 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 13 objects picked 0 at a time | 1 | combinations | | 31 | Factorial | 2! = | 2 | factorial | -| 32 | Surface Area of Cube | Surface area of cube with side = 6m is | 216 m^2 | surface_area_cube | -| 33 | Surface Area of Cuboid | Surface area of cuboid with sides = 6m, 19m, 8m is | 628 m^2 | surface_area_cuboid | -| 34 | Surface Area of Cylinder | Surface area of cylinder with height = 35m and radius = 4m is | 980 m^2 | surface_area_cylinder | -| 35 | Volum of Cube | Volume of cube with side = 6m is | 216 m^3 | volume_cube | -| 36 | Volume of Cuboid | Volume of cuboid with sides = 16m, 8m, 7m is | 896 m^3 | volume_cuboid | -| 37 | Volume of cylinder | Volume of cylinder with height = 37m and radius = 16m is | 29757 m^3 | volume_cylinder | -| 38 | Surface Area of cone | Surface area of cone with height = 5m and radius = 11m is | 797 m^2 | surface_area_cone | -| 39 | Volume of cone | Volume of cone with height = 50m and radius = 13m is | 8848 m^3 | volume_cone | -| 40 | Common Factors | Common Factors of 93 and 71 = | [1] | common_factors | -| 41 | Intersection of Two Lines | Find the point of intersection of the two lines: y = -1/5x - 3 and y = -4/6x - 10 | (-15, 0) | intersection_of_two_lines | -| 42 | Permutations | Number of Permutations from 14 objects picked 4 at a time = | 24024 | permutation | -| 43 | Cross Product of 2 Vectors | [4, 7, -12] X [5, -9, -17] = | [-227, 8, -71] | vector_cross | -| 44 | Compare Fractions | Which symbol represents the comparison between 4/6 and 10/9? | < | compare_fractions | -| 45 | Simple Interest | Simple interest for a principle amount of 9253 dollars, 9% rate of interest and for a time period of 5 years is = | 4163.85 | simple_interest | -| 46 | Multiplication of two matrices | Multiply
20110
5-8-75
31-7-6
6104-1
and
-41-2
-10-29
-4-1-5
-55-8
|
-6251-89
6353-87
36-2286
-135-2366
| matrix_multiplication | -| 47 | Cube Root | cuberoot of 556 upto 2 decimal places is: | 8.22 | cube_root | -| 48 | Power Rule Integration | 2x^3 + 4x^3 | (2/3)x^4 + (4/3)x^4 + c | power_rule_integration | -| 49 | Fourth Angle of Quadrilateral | Fourth angle of quadrilateral with angles 69 , 60, 101 = | 130 | fourth_angle_of_quadrilateral | -| 50 | Quadratic Equation | Zeros of the Quadratic Equation 91x^2+183x+84=0 | [-0.71, -1.3] | quadratic_equation | -| 51 | HCF (Highest Common Factor) | HCF of 4 and 16 = | 4 | 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 11 = | 2/36 | dice_sum_probability | -| 53 | Exponentiation | 7^1 = | 7 | exponentiation | -| 54 | Confidence interval For sample S | The confidence interval for sample [203, 201, 267, 239, 272, 283, 281, 298, 207, 265, 204, 261, 243, 235, 270, 284, 230, 222, 285, 266] with 80% confidence is | (259.5540983014814, 242.04590169851858) | confidence_interval | -| 55 | Comparing surds | Fill in the blanks 73^(1/8) _ 4^(1/5) | > | surds_comparison | -| 56 | Fibonacci Series | The Fibonacci Series of the first 17 numbers is ? | [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987] | fibonacci_series | -| 57 | Trigonometric Values | What is tan(90)? | ∞ | 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[35, 27, 43, 8, 30, 14, 16, 35, 29, 17, 6, 19, 5, 34, 40] | The Mean is 23.866666666666667 , Standard Deviation is 147.18222222222218, Variance is 12.13186804338978 | 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 48 m = | 463246.68632773653 m^3 | volume_sphere | -| 62 | nth Fibonacci number | What is the 59th Fibonacci number? | 956722026041 | nth_fibonacci_number | -| 63 | Profit or Loss Percent | Loss percent when CP = 992 and SP = 888 is: | 10.483870967741936 | profit_loss_percent | -| 64 | Binary to Hexidecimal | 1001 | 0x9 | binary_to_hex | -| 65 | Multiplication of 2 complex numbers | (6+5j) * (19-20j) = | (214-25j) | multiply_complex_numbers | -| 66 | Geometric Progression | For the given GP [10, 70, 490, 3430, 24010, 168070] ,Find the value of a,common ratio,6th term value, sum upto 11th term | The value of a is 10, common ratio is 7 , 6th term is 168070 , sum upto 11th term is 3295544570.0 | geometric_progression | -| 67 | Geometric Mean of N Numbers | Geometric mean of 2 numbers 41 and 89 = | (41*89)^(1/2) = 60.40695324215582 | geometric_mean | -| 68 | Harmonic Mean of N Numbers | Harmonic mean of 4 numbers 69 , 15 , 41 , 67 = | 4/((1/69) + (1/15) + (1/41) + (1/67)) = 33.20189882286996 | harmonic_mean | -| 69 | Euclidian norm or L2 norm of a vector | Euclidian norm or L2 norm of the vector[956.6848004224083, 711.3170367487223, 320.15804509062485, 424.1248983996525, 721.5190124346516, 94.2612318602214, 995.8301076180039, 80.46895520905917, 797.0886057296584, 923.9911613599512, 511.29812416326956, 358.730114740062, 2.3571520022257486, 218.67122157401798, 506.1431432680296, 413.8900730468059] is: | 2363.4212638753684 | euclidian_norm | -| 70 | Angle between 2 vectors | angle between the vectors [232.30943307265463, 306.39298862783016, 623.8368964487579, 808.2182550343807, 837.7902135238608, 194.4689016385932, 369.28549948572345] and [951.1858436627766, 293.2247329611225, 274.2885808744876, 590.5739827721277, 148.45211877240538, 867.5139830165438, 563.3907757868716] is: | NaN | angle_btw_vectors | -| 71 | Absolute difference between two numbers | Absolute difference between numbers 24 and 42 = | 18 | absolute_difference | -| 72 | Dot Product of 2 Vectors | [-8, 10, 0] . [20, 15, -17] = | -10 | vector_dot | -| 73 | Binary 2's Complement | 2's complement of 1110011110 = | 1100010 | binary_2s_complement | -| 74 | Inverse of a Matrix | Inverse of Matrix Matrix([[32, 97, 28], [31, 73, 53], [42, 33, 47]]) is: | Matrix([[1682/71213, -3635/71213, 3097/71213], [769/71213, 328/71213, -828/71213], [-2043/71213, 3018/71213, -671/71213]]) | invert_matrix | -| 75 | Area of a Sector | Given radius, 4 and angle, 17. Find the area of the sector. | Area of sector = 2.37365 | sector_area | -| 76 | Mean and Median | Given the series of numbers [83, 16, 72, 60, 34, 73, 3, 68, 31, 79]. find the arithmatic mean and mdian of the series | Arithmetic mean of the series is 51.9 and Arithmetic median of this series is 64.0 | mean_median | -| 77 | Determinant to 2x2 Matrix | Det([[88, 47], [82, 8]]) = | -3150 | int_matrix_22_determinant | -| 78 | Compound Interest | Compound interest for a principle amount of 2841 dollars, 7% rate of interest and for a time period of 5 year is = | 3984.65 | compound_interest | -| 79 | Decimal to Hexadecimal | Binary of 756= | 0x2f4 | decimal_to_hexadeci | -| 80 | Percentage of a number | What is 32% of 78? | Required percentage = 24.96% | percentage | -| 81 | Celsius To Fahrenheit | Convert 63 degrees Celsius to degrees Fahrenheit = | 145.4 | celsius_to_fahrenheit | -| 82 | AP Term Calculation | Find the term number 41 of the AP series: -52, -109, -166 ... | -2332 | arithmetic_progression_term | -| 83 | AP Sum Calculation | Find the sum of first 21 terms of the AP series: -29, 47, 123 ... | 15351.0 | arithmetic_progression_sum | -| 84 | Converts decimal to octal | The decimal number 4008 in Octal is: | 0o7650 | decimal_to_octal | -| 85 | Converts decimal to Roman Numerals | The number 2529 in Roman Numerals is: | MMDXXIX | decimal_to_roman_numerals | -| 86 | Degrees to Radians | Angle 174 in radians is = | 3.04 | degree_to_rad | +| 32 | Surface Area of Cube | Surface area of cube with side = 15m is | 1350 m^2 | surface_area_cube | +| 33 | Surface Area of Cuboid | Surface area of cuboid with sides = 9m, 7m, 20m is | 766 m^2 | surface_area_cuboid | +| 34 | Surface Area of Cylinder | Surface area of cylinder with height = 41m and radius = 20m is | 7665 m^2 | surface_area_cylinder | +| 35 | Volum of Cube | Volume of cube with side = 2m is | 8 m^3 | volume_cube | +| 36 | Volume of Cuboid | Volume of cuboid with sides = 6m, 8m, 18m is | 864 m^3 | volume_cuboid | +| 37 | Volume of cylinder | Volume of cylinder with height = 24m and radius = 13m is | 12742 m^3 | volume_cylinder | +| 38 | Surface Area of cone | Surface area of cone with height = 33m and radius = 20m is | 3681 m^2 | surface_area_cone | +| 39 | Volume of cone | Volume of cone with height = 9m and radius = 6m is | 339 m^3 | volume_cone | +| 40 | Common Factors | Common Factors of 32 and 64 = | [1, 2, 4, 8, 16, 32] | common_factors | +| 41 | Intersection of Two Lines | Find the point of intersection of the two lines: y = -5/5x - 10 and y = 6x + 5 | (-15/7, -55/7) | intersection_of_two_lines | +| 42 | Permutations | Number of Permutations from 13 objects picked 6 at a time = | 1235520 | permutation | +| 43 | Cross Product of 2 Vectors | [-8, -17, -14] X [18, -14, -16] = | [76, -380, 418] | vector_cross | +| 44 | Compare Fractions | Which symbol represents the comparison between 5/2 and 7/9? | > | compare_fractions | +| 45 | Simple Interest | Simple interest for a principle amount of 3209 dollars, 8% rate of interest and for a time period of 1 years is = | 256.72 | simple_interest | +| 46 | Multiplication of two matrices | Multiply
4-51-10
-4-966
-10-479
10726
and
84
-8-2
-80
-3-2
|
9446
-26-10
-131-50
-1014
| matrix_multiplication | +| 47 | Cube Root | cuberoot of 722 upto 2 decimal places is: | 8.97 | cube_root | +| 48 | Power Rule Integration | 9x^6 + 6x^2 + 1x^6 | (9/6)x^7 + (6/2)x^3 + (1/6)x^7 + c | power_rule_integration | +| 49 | Fourth Angle of Quadrilateral | Fourth angle of quadrilateral with angles 159 , 23, 7 = | 171 | fourth_angle_of_quadrilateral | +| 50 | Quadratic Equation | Zeros of the Quadratic Equation 54x^2+188x+92=0 | [-0.59, -2.89] | quadratic_equation | +| 51 | HCF (Highest Common Factor) | HCF of 7 and 2 = | 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 4 = | 1/6 | dice_sum_probability | +| 53 | Exponentiation | 19^6 = | 47045881 | exponentiation | +| 54 | Confidence interval For sample S | The confidence interval for sample [251, 210, 218, 219, 213, 250, 270, 206, 229, 289, 265, 277, 271, 282, 291, 239, 290, 217, 256, 254, 234, 268] with 90% confidence is | (259.6447431593175, 240.2643477497734) | confidence_interval | +| 55 | Comparing surds | Fill in the blanks 48^(1/9) _ 22^(1/3) | < | surds_comparison | +| 56 | Fibonacci Series | The Fibonacci Series of the first 8 numbers is ? | [0, 1, 1, 2, 3, 5, 8, 13] | fibonacci_series | +| 57 | Trigonometric Values | What is tan(60)? | √3 | basic_trigonometry | +| 58 | Sum of Angles of Polygon | Sum of angles of polygon with 5 sides = | 540 | sum_of_polygon_angles | +| 59 | Mean,Standard Deviation,Variance | Find the mean,standard deviation and variance for the data[31, 24, 39, 33, 38, 19, 25, 27, 44, 42, 41, 46, 42, 23, 40] | The Mean is 34.266666666666666 , Standard Deviation is 72.19555555555556, Variance is 8.496796782055904 | data_summary | +| 60 | Surface Area of Sphere | Surface area of Sphere with radius = 2m is | 50.26548245743669 m^2 | surface_area_sphere | +| 61 | Volume of Sphere | Volume of sphere with radius 15 m = | 14137.166941154068 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 = 265 and SP = 414 is: | 56.22641509433962 | profit_loss_percent | +| 64 | Binary to Hexidecimal | 01011010 | 0x5a | binary_to_hex | +| 65 | Multiplication of 2 complex numbers | (16+6j) * (16-1j) = | (262+80j) | multiply_complex_numbers | +| 66 | Geometric Progression | For the given GP [6, 66, 726, 7986, 87846, 966306] ,Find the value of a,common ratio,7th term value, sum upto 9th term | The value of a is 6, common ratio is 11 , 7th term is 10629366 , sum upto 9th term is 1414768614.0 | geometric_progression | +| 67 | Geometric Mean of N Numbers | Geometric mean of 4 numbers 2 , 89 , 20 , 28 = | (2*89*20*28)^(1/4) = 17.76855076168954 | geometric_mean | +| 68 | Harmonic Mean of N Numbers | Harmonic mean of 4 numbers 87 , 71 , 16 , 70 = | 4/((1/87) + (1/71) + (1/16) + (1/70)) = 39.07605671988274 | harmonic_mean | +| 69 | Euclidian norm or L2 norm of a vector | Euclidian norm or L2 norm of the vector[253.2276484990589, 544.0394196945418, 597.5968973121911, 717.9622962318546, 957.6520745649788, 708.5846670633276, 239.4894009576103, 228.68124684005775, 265.32483186305046, 796.0656747554028, 766.9152459101839, 713.2680222516796, 524.3978484738747] is: | 2199.444531958941 | euclidian_norm | +| 70 | Angle between 2 vectors | angle between the vectors [246.46961093317077, 412.8494069125837, 106.09642846104339, 23.89765614826034, 130.68657183702646, 183.13041820744112] and [225.49849035856806, 61.54856418679755, 699.5445055934789, 611.9211383202619, 482.6151709173074, 938.6436827654591] is: | NaN | angle_btw_vectors | +| 71 | Absolute difference between two numbers | Absolute difference between numbers 2 and -65 = | 67 | absolute_difference | +| 72 | Dot Product of 2 Vectors | [11, 9, 20] . [19, 5, 18] = | 614 | vector_dot | +| 73 | Binary 2's Complement | 2's complement of 10 = | 10 | binary_2s_complement | +| 74 | Inverse of a Matrix | Inverse of Matrix Matrix([[65, 37, 5], [41, 27, 97], [0, 95, 3]]) is: | Matrix([[4567/289393, -14/22261, -1727/289393], [123/578786, -15/44522, 3050/289393], [-3895/578786, 475/44522, -119/289393]]) | invert_matrix | +| 75 | Area of a Sector | Given radius, 19 and angle, 313. Find the area of the sector. | Area of sector = 986.04994 | sector_area | +| 76 | Mean and Median | Given the series of numbers [49, 95, 98, 93, 53, 59, 47, 80, 56, 85]. find the arithmatic mean and mdian of the series | Arithmetic mean of the series is 71.5 and Arithmetic median of this series is 69.5 | mean_median | +| 77 | Determinant to 2x2 Matrix | Det([[91, 9], [56, 75]]) = | 6321 | int_matrix_22_determinant | +| 78 | Compound Interest | Compound interest for a principle amount of 6617 dollars, 1% rate of interest and for a time period of 7 year is = | 7094.32 | compound_interest | +| 79 | Decimal to Hexadecimal | Binary of 908= | 0x38c | decimal_to_hexadeci | +| 80 | Percentage of a number | What is 11% of 98? | Required percentage = 10.78% | percentage | +| 81 | Celsius To Fahrenheit | Convert -16 degrees Celsius to degrees Fahrenheit = | 3.1999999999999993 | celsius_to_fahrenheit | +| 82 | AP Term Calculation | Find the term number 46 of the AP series: -66, -141, -216 ... | -3441 | arithmetic_progression_term | +| 83 | AP Sum Calculation | Find the sum of first 20 terms of the AP series: 25, -30, -85 ... | -9950.0 | arithmetic_progression_sum | +| 84 | Converts decimal to octal | The decimal number 2270 in Octal is: | 0o4336 | decimal_to_octal | +| 85 | Converts decimal to Roman Numerals | The number 766 in Roman Numerals is: | DCCLXVI | decimal_to_roman_numerals | +| 86 | Degrees to Radians | Angle 203 in radians is = | 3.54 | degree_to_rad | | 87 | Radians to Degrees | Angle 2 in degrees is = | 114.59 | radian_to_deg | -| 88 | Differentiation | differentiate w.r.t x : d(sec(x)+6*x^(-2))/dx | tan(x)*sec(x) - 12/x^3 | differentiation | -| 89 | Definite Integral of Quadratic Equation | The definite integral within limits 0 to 1 of the equation 5x^2 + 58x + 38 is = | 68.6667 | definite_integral | -| 90 | isprime | 83 | True | is_prime | -| 91 | Binary Coded Decimal to Integer | Integer of Binary Coded Decimal 2 is = | 9224 | bcd_to_decimal | -| 92 | Complex To Polar Form | rexp(itheta) = | 27.59exp(i0.81) | complex_to_polar | +| 88 | Differentiation | differentiate w.r.t x : d(tan(x)+7*x^3)/dx | 21*x^2 + tan(x)^2 + 1 | differentiation | +| 89 | Definite Integral of Quadratic Equation | The definite integral within limits 0 to 1 of the equation 85x^2 + 48x + 44 is = | 96.3333 | definite_integral | +| 90 | isprime | 93 | False | is_prime | +| 91 | Binary Coded Decimal to Integer | Integer of Binary Coded Decimal 2 is = | 10065 | bcd_to_decimal | +| 92 | Complex To Polar Form | rexp(itheta) = | 7.62exp(i1.17) | complex_to_polar | +| 93 | Union,Intersection,Difference of Two Sets | Given the two sets a={2, 5} ,b={8, 9, 4, 1}.Find the Union,intersection,a-b,b-a and symmetric difference | Union is {1, 2, 4, 5, 8, 9},Intersection is set(), a-b is {2, 5},b-a is {8, 9, 4, 1}, Symmetric difference is {1, 2, 4, 5, 8, 9} | set_operation | diff --git a/mathgenerator/funcs/__init__.py b/mathgenerator/funcs/__init__.py index 221b641..ee7e054 100644 --- a/mathgenerator/funcs/__init__.py +++ b/mathgenerator/funcs/__init__.py @@ -97,3 +97,4 @@ from .definite_integral import * from .is_prime import * from .bcd_to_decimal import * from .complex_to_polar import * +from .set_operation import * diff --git a/mathgenerator/funcs/set_operation.py b/mathgenerator/funcs/set_operation.py index 8d6db07..f328368 100644 --- a/mathgenerator/funcs/set_operation.py +++ b/mathgenerator/funcs/set_operation.py @@ -10,12 +10,15 @@ def set_operation(minval=3, maxval=7, n_a=4, n_b=5): a.append(random.randint(1, 10)) for i in range(number_variables_b): b.append(random.randint(1, 10)) - a=set(a) - b=set(b) - problem = "Given the two sets a=" + str(a) + " ,b=" + str(b) + ".Find the Union,intersection,a-b,b-a and symmetric difference" - solution = "Union is " + str(a.union(b)) + ",Intersection is " + str(a.intersection(b)) + ", a-b is " + str(a.difference(b)) + ",b-a is " + str(b.difference(a)) + ", Symmetric difference is " + str(a.symmetric_difference(b)) + a = set(a) + b = set(b) + problem = "Given the two sets a=" + \ + str(a) + " ,b=" + str(b) + ".Find the Union,intersection,a-b,b-a and symmetric difference" + solution = "Union is " + str(a.union(b)) + ",Intersection is " + str(a.intersection(b)) + ", a-b is " + str( + a.difference(b)) + ",b-a is " + str(b.difference(a)) + ", Symmetric difference is " + str(a.symmetric_difference(b)) return problem, solution -setoperations = Generator("Union,Intersection,Difference of Two Sets", 93, + +set_operation = Generator("Union,Intersection,Difference of Two Sets", 93, "Union,intersection,difference", "aUb,a^b,a-b,b-a,", set_operation) From 1174b5c0de283f494ae412bbdc93c43ef46c8afd Mon Sep 17 00:00:00 2001 From: lukew3 Date: Wed, 21 Oct 2020 14:25:54 -0400 Subject: [PATCH 38/43] base conversion fix --- mathgenerator/funcs/__init__.py | 1 + mathgenerator/funcs/baseConversion.py | 42 ---------------------- mathgenerator/funcs/base_conversion.py | 50 ++++++++++++++++++++++++++ test.py | 2 +- 4 files changed, 52 insertions(+), 43 deletions(-) delete mode 100644 mathgenerator/funcs/baseConversion.py create mode 100644 mathgenerator/funcs/base_conversion.py diff --git a/mathgenerator/funcs/__init__.py b/mathgenerator/funcs/__init__.py index ee7e054..dd0ba11 100644 --- a/mathgenerator/funcs/__init__.py +++ b/mathgenerator/funcs/__init__.py @@ -98,3 +98,4 @@ from .is_prime import * from .bcd_to_decimal import * from .complex_to_polar import * from .set_operation import * +from .base_conversion import * diff --git a/mathgenerator/funcs/baseConversion.py b/mathgenerator/funcs/baseConversion.py deleted file mode 100644 index 77eae14..0000000 --- a/mathgenerator/funcs/baseConversion.py +++ /dev/null @@ -1,42 +0,0 @@ -from .__init__ import * - -#base from 2 to 36 -alpha = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" - -def fromBaseTenTo(n,toBase): - assert type(toBase)==int and toBase>=2 and toBase<=36, "toBase({}) must be >=2 and <=36" - # trivial cases - if toBase==2: - return bin(n)[2:] - elif toBase==8: - return oct(n)[2:] - elif toBase==10: - return str(n) - elif toBase==16: - return hex(n)[2:].upper() - res = alpha[n%toBase] - n = n//toBase - while n>0: - res = alpha[n%toBase] + res - n = n//toBase - return res - -# Useful to check answers, but not needed here -# def toBaseTen(n,fromBase): -# return int(n,fromBase) - -def baseConversion(maxNum = 60000, maxBase = 16): - assert type(maxNum)==int and maxNum>=100 and maxNum<=65536, "maxNum({}) must be >=100 and <=65536".format(maxNum) - assert type(maxBase)==int and maxBase>=2 and maxBase<=36, "maxBase({}) must be >= 2 and <=36".format(maxBase) - - n = random.randint(40,maxNum) - dist = [10]*10+[2]*5+[16]*5+[i for i in range(2,maxBase+1)] - # set this way since converting to/from bases 2,10,16 are more common -- can be changed if needed. - bases = random.choices(dist,k=2) - while bases[0]==bases[1]: - bases = random.choices(dist,k=2) - - problem = "Convert {} from base {} to base {}.".format(fromBaseTenTo(n,bases[0]),bases[0],bases[1]) - ans = fromBaseTenTo(n,bases[1]) - return problem, ans - diff --git a/mathgenerator/funcs/base_conversion.py b/mathgenerator/funcs/base_conversion.py new file mode 100644 index 0000000..c9ef48f --- /dev/null +++ b/mathgenerator/funcs/base_conversion.py @@ -0,0 +1,50 @@ +from .__init__ import * + +# base from 2 to 36 +alpha = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" + + +def fromBaseTenTo(n, toBase): + assert type(toBase) == int and toBase >= 2 and toBase <= 36, "toBase({}) must be >=2 and <=36" + # trivial cases + if toBase == 2: + return bin(n)[2:] + elif toBase == 8: + return oct(n)[2:] + elif toBase == 10: + return str(n) + elif toBase == 16: + return hex(n)[2:].upper() + res = alpha[n % toBase] + n = n//toBase + while n > 0: + res = alpha[n % toBase] + res + n = n//toBase + return res + +# Useful to check answers, but not needed here +# def toBaseTen(n,fromBase): +# return int(n,fromBase) + + +def baseConversionFunc(maxNum=60000, maxBase=16): + assert type( + maxNum) == int and maxNum >= 100 and maxNum <= 65536, "maxNum({}) must be >=100 and <=65536".format(maxNum) + assert type( + maxBase) == int and maxBase >= 2 and maxBase <= 36, "maxBase({}) must be >= 2 and <=36".format(maxBase) + + n = random.randint(40, maxNum) + dist = [10]*10+[2]*5+[16]*5+[i for i in range(2, maxBase+1)] + # set this way since converting to/from bases 2,10,16 are more common -- can be changed if needed. + bases = random.choices(dist, k=2) + while bases[0] == bases[1]: + bases = random.choices(dist, k=2) + + problem = "Convert {} from base {} to base {}.".format( + fromBaseTenTo(n, bases[0]), bases[0], bases[1]) + ans = fromBaseTenTo(n, bases[1]) + return problem, ans + + +base_conversion = Generator("Base Conversion", 94, "Convert 152346 from base 8 to base 10.", "54502", + baseConversionFunc) diff --git a/test.py b/test.py index 07b6b87..cc34a10 100644 --- a/test.py +++ b/test.py @@ -10,4 +10,4 @@ for item in list: print(item[2]) # print(mathgen.getGenList()) -print(mathgen.genById(92)) +print(mathgen.genById(94)) From 6b193dbdcee5190014d4eda5da7ba8e672c4b1a0 Mon Sep 17 00:00:00 2001 From: lukew3 Date: Wed, 21 Oct 2020 14:26:01 -0400 Subject: [PATCH 39/43] readme edit --- README.md | 183 +++++++++++++++++++++++++++--------------------------- 1 file changed, 92 insertions(+), 91 deletions(-) diff --git a/README.md b/README.md index b60c4ef..5c7341a 100644 --- a/README.md +++ b/README.md @@ -31,97 +31,98 @@ problem, solution = mathgen.genById(0) | Id | Skill | Example problem | Example Solution | Function Name | |------|-----------------------------------|--------------------|-----------------------|--------------------------| [//]: # list start -| 0 | Addition | 38+43= | 81 | addition | -| 1 | Subtraction | 58-47= | 11 | subtraction | -| 2 | Multiplication | 59*0= | 0 | multiplication | -| 3 | Division | 10/27= | 0.37037037037037035 | division | -| 4 | Binary Complement 1s | 0001= | 1110 | binary_complement_1s | -| 5 | Modulo Division | 52%59= | 52 | modulo_division | -| 6 | Square Root | sqrt(25)= | 5 | square_root | -| 7 | Power Rule Differentiation | 5x^9 + 8x^9 + 9x^7 + 1x^7 + 6x^6 | 45x^8 + 72x^8 + 63x^6 + 7x^6 + 36x^5 | power_rule_differentiation | -| 8 | Square | 16^2= | 256 | square | -| 9 | LCM (Least Common Multiple) | LCM of 19 and 11 = | 209 | lcm | -| 10 | GCD (Greatest Common Denominator) | GCD of 13 and 3 = | 1 | gcd | -| 11 | Basic Algebra | 9x + 2 = 2 | 0 | basic_algebra | -| 12 | Logarithm | log3(81) | 4 | log | -| 13 | Easy Division | 525/25 = | 21 | int_division | -| 14 | Decimal to Binary | Binary of 31= | 11111 | decimal_to_binary | -| 15 | Binary to Decimal | 0101100100 | 356 | binary_to_decimal | -| 16 | Fraction Division | (8/1)/(8/5) | 5 | divide_fractions | -| 17 | Integer Multiplication with 2x2 Matrix | 10 * [[5, 6], [0, 3]] = | [[50,60],[0,30]] | multiply_int_to_22_matrix | -| 18 | Area of Triangle | Area of triangle with side lengths: 20 14 20 = | 131.14495796636635 | area_of_triangle | -| 19 | Triangle exists check | Does triangle with sides 46, 37 and 27 exist? | Yes | valid_triangle | -| 20 | Midpoint of the two point | (-12,13),(15,-19)= | (1.5,-3.0) | 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 16 and 76 = | 88 | third_angle_of_triangle | -| 23 | Solve a System of Equations in R^2 | -8x + 7y = -63, 6x - 7y = 49 | x = 7, y = -1 | system_of_equations | -| 24 | Distance between 2 points | Find the distance between (-1, -19) and (16, 19) | sqrt(1733) | distance_two_points | -| 25 | Pythagorean Theorem | The hypotenuse of a right triangle given the other two lengths 17 and 20 = | 26.25 | pythagorean_theorem | -| 26 | Linear Equations | -20x + -2y = -58, -16x + -13y = -149 | x = 2, y = 9 | linear_equations | -| 27 | Prime Factorisation | Find prime factors of 25 | [5, 5] | prime_factors | -| 28 | Fraction Multiplication | (1/5)*(5/2) | 1/2 | 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 13 objects picked 0 at a time | 1 | combinations | +| 0 | Addition | 15+31= | 46 | addition | +| 1 | Subtraction | 43-14= | 29 | subtraction | +| 2 | Multiplication | 45*1= | 45 | multiplication | +| 3 | Division | 72/45= | 1.6 | division | +| 4 | Binary Complement 1s | 0011= | 1100 | binary_complement_1s | +| 5 | Modulo Division | 14%68= | 14 | modulo_division | +| 6 | Square Root | sqrt(9)= | 3 | square_root | +| 7 | Power Rule Differentiation | 9x^8 | 72x^7 | power_rule_differentiation | +| 8 | Square | 5^2= | 25 | square | +| 9 | LCM (Least Common Multiple) | LCM of 18 and 10 = | 90 | lcm | +| 10 | GCD (Greatest Common Denominator) | GCD of 5 and 17 = | 1 | gcd | +| 11 | Basic Algebra | 10x + 9 = 10 | 1/10 | basic_algebra | +| 12 | Logarithm | log2(32) | 5 | log | +| 13 | Easy Division | 80/16 = | 5 | int_division | +| 14 | Decimal to Binary | Binary of 66= | 1000010 | decimal_to_binary | +| 15 | Binary to Decimal | 011001010 | 202 | binary_to_decimal | +| 16 | Fraction Division | (3/8)/(10/7) | 21/80 | divide_fractions | +| 17 | Integer Multiplication with 2x2 Matrix | 0 * [[2, 6], [0, 4]] = | [[0,0],[0,0]] | multiply_int_to_22_matrix | +| 18 | Area of Triangle | Area of triangle with side lengths: 13 2 10 = | (7.843059660345589e-16+12.808688457449499j) | area_of_triangle | +| 19 | Triangle exists check | Does triangle with sides 33, 10 and 7 exist? | No | valid_triangle | +| 20 | Midpoint of the two point | (-1,-7),(13,-13)= | (6.0,-10.0) | midpoint_of_two_points | +| 21 | Factoring Quadratic | x^2+8x+7 | (x+1)(x+7) | factoring | +| 22 | Third Angle of Triangle | Third angle of triangle with angles 47 and 37 = | 96 | third_angle_of_triangle | +| 23 | Solve a System of Equations in R^2 | 3x - 5y = -74, -3x + 9y = 114 | x = -8, y = 10 | system_of_equations | +| 24 | Distance between 2 points | Find the distance between (7, 7) and (3, -3) | sqrt(116) | distance_two_points | +| 25 | Pythagorean Theorem | The hypotenuse of a right triangle given the other two lengths 20 and 9 = | 21.93 | pythagorean_theorem | +| 26 | Linear Equations | 5x + -8y = -25, -12x + -1y = -243 | x = 19, y = 15 | linear_equations | +| 27 | Prime Factorisation | Find prime factors of 16 | [2, 2, 2, 2] | prime_factors | +| 28 | Fraction Multiplication | (3/1)*(5/3) | 5 | fraction_multiplication | +| 29 | Angle of a Regular Polygon | Find the angle of a regular polygon with 5 sides | 108.0 | angle_regular_polygon | +| 30 | Combinations of Objects | Number of combinations from 19 objects picked 2 at a time | 171 | combinations | | 31 | Factorial | 2! = | 2 | factorial | -| 32 | Surface Area of Cube | Surface area of cube with side = 15m is | 1350 m^2 | surface_area_cube | -| 33 | Surface Area of Cuboid | Surface area of cuboid with sides = 9m, 7m, 20m is | 766 m^2 | surface_area_cuboid | -| 34 | Surface Area of Cylinder | Surface area of cylinder with height = 41m and radius = 20m is | 7665 m^2 | surface_area_cylinder | -| 35 | Volum of Cube | Volume of cube with side = 2m is | 8 m^3 | volume_cube | -| 36 | Volume of Cuboid | Volume of cuboid with sides = 6m, 8m, 18m is | 864 m^3 | volume_cuboid | -| 37 | Volume of cylinder | Volume of cylinder with height = 24m and radius = 13m is | 12742 m^3 | volume_cylinder | -| 38 | Surface Area of cone | Surface area of cone with height = 33m and radius = 20m is | 3681 m^2 | surface_area_cone | -| 39 | Volume of cone | Volume of cone with height = 9m and radius = 6m is | 339 m^3 | volume_cone | -| 40 | Common Factors | Common Factors of 32 and 64 = | [1, 2, 4, 8, 16, 32] | common_factors | -| 41 | Intersection of Two Lines | Find the point of intersection of the two lines: y = -5/5x - 10 and y = 6x + 5 | (-15/7, -55/7) | intersection_of_two_lines | -| 42 | Permutations | Number of Permutations from 13 objects picked 6 at a time = | 1235520 | permutation | -| 43 | Cross Product of 2 Vectors | [-8, -17, -14] X [18, -14, -16] = | [76, -380, 418] | vector_cross | -| 44 | Compare Fractions | Which symbol represents the comparison between 5/2 and 7/9? | > | compare_fractions | -| 45 | Simple Interest | Simple interest for a principle amount of 3209 dollars, 8% rate of interest and for a time period of 1 years is = | 256.72 | simple_interest | -| 46 | Multiplication of two matrices | Multiply
4-51-10
-4-966
-10-479
10726
and
84
-8-2
-80
-3-2
|
9446
-26-10
-131-50
-1014
| matrix_multiplication | -| 47 | Cube Root | cuberoot of 722 upto 2 decimal places is: | 8.97 | cube_root | -| 48 | Power Rule Integration | 9x^6 + 6x^2 + 1x^6 | (9/6)x^7 + (6/2)x^3 + (1/6)x^7 + c | power_rule_integration | -| 49 | Fourth Angle of Quadrilateral | Fourth angle of quadrilateral with angles 159 , 23, 7 = | 171 | fourth_angle_of_quadrilateral | -| 50 | Quadratic Equation | Zeros of the Quadratic Equation 54x^2+188x+92=0 | [-0.59, -2.89] | quadratic_equation | -| 51 | HCF (Highest Common Factor) | HCF of 7 and 2 = | 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 4 = | 1/6 | dice_sum_probability | -| 53 | Exponentiation | 19^6 = | 47045881 | exponentiation | -| 54 | Confidence interval For sample S | The confidence interval for sample [251, 210, 218, 219, 213, 250, 270, 206, 229, 289, 265, 277, 271, 282, 291, 239, 290, 217, 256, 254, 234, 268] with 90% confidence is | (259.6447431593175, 240.2643477497734) | confidence_interval | -| 55 | Comparing surds | Fill in the blanks 48^(1/9) _ 22^(1/3) | < | surds_comparison | -| 56 | Fibonacci Series | The Fibonacci Series of the first 8 numbers is ? | [0, 1, 1, 2, 3, 5, 8, 13] | fibonacci_series | -| 57 | Trigonometric Values | What is tan(60)? | √3 | basic_trigonometry | +| 32 | Surface Area of Cube | Surface area of cube with side = 1m is | 6 m^2 | surface_area_cube | +| 33 | Surface Area of Cuboid | Surface area of cuboid with sides = 9m, 16m, 20m is | 1288 m^2 | surface_area_cuboid | +| 34 | Surface Area of Cylinder | Surface area of cylinder with height = 7m and radius = 16m is | 2312 m^2 | surface_area_cylinder | +| 35 | Volum of Cube | Volume of cube with side = 12m is | 1728 m^3 | volume_cube | +| 36 | Volume of Cuboid | Volume of cuboid with sides = 11m, 19m, 8m is | 1672 m^3 | volume_cuboid | +| 37 | Volume of cylinder | Volume of cylinder with height = 9m and radius = 15m is | 6361 m^3 | volume_cylinder | +| 38 | Surface Area of cone | Surface area of cone with height = 36m and radius = 1m is | 116 m^2 | surface_area_cone | +| 39 | Volume of cone | Volume of cone with height = 26m and radius = 15m is | 6126 m^3 | volume_cone | +| 40 | Common Factors | Common Factors of 64 and 17 = | [1] | common_factors | +| 41 | Intersection of Two Lines | Find the point of intersection of the two lines: y = 10/6x + 3 and y = -1/3x + 10 | (7/2, 53/6) | intersection_of_two_lines | +| 42 | Permutations | Number of Permutations from 14 objects picked 1 at a time = | 14 | permutation | +| 43 | Cross Product of 2 Vectors | [-16, -17, -11] X [12, -19, 5] = | [-294, -52, 508] | vector_cross | +| 44 | Compare Fractions | Which symbol represents the comparison between 7/2 and 1/7? | > | compare_fractions | +| 45 | Simple Interest | Simple interest for a principle amount of 7256 dollars, 6% rate of interest and for a time period of 2 years is = | 870.72 | simple_interest | +| 46 | Multiplication of two matrices | Multiply
-63104
99-37
and
10-95
2-10-5
6-3-7
21-8
|
14-2-147
104-155-35
| matrix_multiplication | +| 47 | Cube Root | cuberoot of 723 upto 2 decimal places is: | 8.98 | cube_root | +| 48 | Power Rule Integration | 1x^5 + 2x^8 + 1x^5 + 10x^7 + 1x^6 | (1/5)x^6 + (2/8)x^9 + (1/5)x^6 + (10/7)x^8 + (1/6)x^7 + c | power_rule_integration | +| 49 | Fourth Angle of Quadrilateral | Fourth angle of quadrilateral with angles 58 , 157, 113 = | 32 | fourth_angle_of_quadrilateral | +| 50 | Quadratic Equation | Zeros of the Quadratic Equation 14x^2+92x+17=0 | [-0.19, -6.38] | quadratic_equation | +| 51 | HCF (Highest Common Factor) | HCF of 13 and 20 = | 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 5 = | 1/6 | dice_sum_probability | +| 53 | Exponentiation | 5^10 = | 9765625 | exponentiation | +| 54 | Confidence interval For sample S | The confidence interval for sample [266, 244, 292, 288, 230, 251, 211, 272, 260, 257, 231, 234, 254, 277, 202, 206, 258, 298, 243, 213, 214, 239, 247, 232, 203, 296, 238, 282, 222, 283, 261, 253, 252, 278, 215, 267, 212] with 90% confidence is | (255.6152095323176, 240.65506073795265) | confidence_interval | +| 55 | Comparing surds | Fill in the blanks 29^(1/1) _ 37^(1/8) | > | surds_comparison | +| 56 | Fibonacci Series | The Fibonacci Series of the first 10 numbers is ? | [0, 1, 1, 2, 3, 5, 8, 13, 21, 34] | 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 5 sides = | 540 | sum_of_polygon_angles | -| 59 | Mean,Standard Deviation,Variance | Find the mean,standard deviation and variance for the data[31, 24, 39, 33, 38, 19, 25, 27, 44, 42, 41, 46, 42, 23, 40] | The Mean is 34.266666666666666 , Standard Deviation is 72.19555555555556, Variance is 8.496796782055904 | data_summary | -| 60 | Surface Area of Sphere | Surface area of Sphere with radius = 2m is | 50.26548245743669 m^2 | surface_area_sphere | -| 61 | Volume of Sphere | Volume of sphere with radius 15 m = | 14137.166941154068 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 = 265 and SP = 414 is: | 56.22641509433962 | profit_loss_percent | -| 64 | Binary to Hexidecimal | 01011010 | 0x5a | binary_to_hex | -| 65 | Multiplication of 2 complex numbers | (16+6j) * (16-1j) = | (262+80j) | multiply_complex_numbers | -| 66 | Geometric Progression | For the given GP [6, 66, 726, 7986, 87846, 966306] ,Find the value of a,common ratio,7th term value, sum upto 9th term | The value of a is 6, common ratio is 11 , 7th term is 10629366 , sum upto 9th term is 1414768614.0 | geometric_progression | -| 67 | Geometric Mean of N Numbers | Geometric mean of 4 numbers 2 , 89 , 20 , 28 = | (2*89*20*28)^(1/4) = 17.76855076168954 | geometric_mean | -| 68 | Harmonic Mean of N Numbers | Harmonic mean of 4 numbers 87 , 71 , 16 , 70 = | 4/((1/87) + (1/71) + (1/16) + (1/70)) = 39.07605671988274 | harmonic_mean | -| 69 | Euclidian norm or L2 norm of a vector | Euclidian norm or L2 norm of the vector[253.2276484990589, 544.0394196945418, 597.5968973121911, 717.9622962318546, 957.6520745649788, 708.5846670633276, 239.4894009576103, 228.68124684005775, 265.32483186305046, 796.0656747554028, 766.9152459101839, 713.2680222516796, 524.3978484738747] is: | 2199.444531958941 | euclidian_norm | -| 70 | Angle between 2 vectors | angle between the vectors [246.46961093317077, 412.8494069125837, 106.09642846104339, 23.89765614826034, 130.68657183702646, 183.13041820744112] and [225.49849035856806, 61.54856418679755, 699.5445055934789, 611.9211383202619, 482.6151709173074, 938.6436827654591] is: | NaN | angle_btw_vectors | -| 71 | Absolute difference between two numbers | Absolute difference between numbers 2 and -65 = | 67 | absolute_difference | -| 72 | Dot Product of 2 Vectors | [11, 9, 20] . [19, 5, 18] = | 614 | vector_dot | -| 73 | Binary 2's Complement | 2's complement of 10 = | 10 | binary_2s_complement | -| 74 | Inverse of a Matrix | Inverse of Matrix Matrix([[65, 37, 5], [41, 27, 97], [0, 95, 3]]) is: | Matrix([[4567/289393, -14/22261, -1727/289393], [123/578786, -15/44522, 3050/289393], [-3895/578786, 475/44522, -119/289393]]) | invert_matrix | -| 75 | Area of a Sector | Given radius, 19 and angle, 313. Find the area of the sector. | Area of sector = 986.04994 | sector_area | -| 76 | Mean and Median | Given the series of numbers [49, 95, 98, 93, 53, 59, 47, 80, 56, 85]. find the arithmatic mean and mdian of the series | Arithmetic mean of the series is 71.5 and Arithmetic median of this series is 69.5 | mean_median | -| 77 | Determinant to 2x2 Matrix | Det([[91, 9], [56, 75]]) = | 6321 | int_matrix_22_determinant | -| 78 | Compound Interest | Compound interest for a principle amount of 6617 dollars, 1% rate of interest and for a time period of 7 year is = | 7094.32 | compound_interest | -| 79 | Decimal to Hexadecimal | Binary of 908= | 0x38c | decimal_to_hexadeci | -| 80 | Percentage of a number | What is 11% of 98? | Required percentage = 10.78% | percentage | -| 81 | Celsius To Fahrenheit | Convert -16 degrees Celsius to degrees Fahrenheit = | 3.1999999999999993 | celsius_to_fahrenheit | -| 82 | AP Term Calculation | Find the term number 46 of the AP series: -66, -141, -216 ... | -3441 | arithmetic_progression_term | -| 83 | AP Sum Calculation | Find the sum of first 20 terms of the AP series: 25, -30, -85 ... | -9950.0 | arithmetic_progression_sum | -| 84 | Converts decimal to octal | The decimal number 2270 in Octal is: | 0o4336 | decimal_to_octal | -| 85 | Converts decimal to Roman Numerals | The number 766 in Roman Numerals is: | DCCLXVI | decimal_to_roman_numerals | -| 86 | Degrees to Radians | Angle 203 in radians is = | 3.54 | degree_to_rad | +| 59 | Mean,Standard Deviation,Variance | Find the mean,standard deviation and variance for the data[22, 32, 15, 45, 40, 34, 40, 29, 33, 43, 34, 19, 43, 17, 42] | The Mean is 32.53333333333333 , Standard Deviation is 95.71555555555555, Variance is 9.783432708183541 | data_summary | +| 60 | Surface Area of Sphere | Surface area of Sphere with radius = 7m is | 615.7521601035994 m^2 | surface_area_sphere | +| 61 | Volume of Sphere | Volume of sphere with radius 18 m = | 24429.024474314232 m^3 | volume_sphere | +| 62 | nth Fibonacci number | What is the 76th Fibonacci number? | 3416454622906716 | nth_fibonacci_number | +| 63 | Profit or Loss Percent | Profit percent when CP = 300 and SP = 745 is: | 148.33333333333334 | profit_loss_percent | +| 64 | Binary to Hexidecimal | 0011110 | 0x1e | binary_to_hex | +| 65 | Multiplication of 2 complex numbers | (15+4j) * (13+6j) = | (171+142j) | multiply_complex_numbers | +| 66 | Geometric Progression | For the given GP [7, 42, 252, 1512, 9072, 54432] ,Find the value of a,common ratio,9th term value, sum upto 11th term | The value of a is 7, common ratio is 6 , 9th term is 11757312 , sum upto 11th term is 507915877.0 | geometric_progression | +| 67 | Geometric Mean of N Numbers | Geometric mean of 3 numbers 22 , 15 and 25 = | (22*15*25)^(1/3) = 20.206200103110948 | geometric_mean | +| 68 | Harmonic Mean of N Numbers | Harmonic mean of 3 numbers 37 , 33 and 53 = | 3/((1/37) + (1/33) + (1/53)) = 39.371121476373965 | harmonic_mean | +| 69 | Euclidian norm or L2 norm of a vector | Euclidian norm or L2 norm of the vector[492.40786515780576, 983.9467887251965, 631.4868422143192, 867.3371448756883, 563.3456646686222, 708.0397121576655] is: | 1783.3521007855009 | euclidian_norm | +| 70 | Angle between 2 vectors | angle between the vectors [541.0289697890829, 573.3715402714977, 323.21175522813905, 134.3110759527537, 485.181412466299, 734.1757394805238, 632.1836650961008, 874.4930077772807, 392.3682318405426, 198.18533509253734, 259.3024324493266, 692.6808468046293, 983.0594493368139, 246.1431141764312, 169.47055701867663, 179.3769672014288, 653.3731083951614, 608.0069028185225] and [716.8150260194301, 661.3439350537182, 503.6201707807608, 922.7936933135436, 887.4562350809547, 764.2289969841399, 743.9308000789802, 604.6893588822073, 185.60578793368342, 335.83315817451984, 969.7123500771294, 181.4419381940483, 275.5957393468893, 228.41527442819876, 971.7792535281106, 0.79249601650766, 878.4199844485163, 888.9960985572237] is: | NaN | angle_btw_vectors | +| 71 | Absolute difference between two numbers | Absolute difference between numbers -9 and -91 = | 82 | absolute_difference | +| 72 | Dot Product of 2 Vectors | [14, -20, -3] . [-3, -18, 15] = | 273 | vector_dot | +| 73 | Binary 2's Complement | 2's complement of 100 = | 100 | binary_2s_complement | +| 74 | Inverse of a Matrix | Inverse of Matrix Matrix([[77, 3, 65], [46, 99, 23], [31, 83, 47]]) is: | Matrix([[196/18259, 2627/127813, -3183/127813], [-207/36518, 802/127813, 1219/255626], [107/36518, -3149/127813, 7485/255626]]) | invert_matrix | +| 75 | Area of a Sector | Given radius, 15 and angle, 235. Find the area of the sector. | Area of sector = 461.42142 | sector_area | +| 76 | Mean and Median | Given the series of numbers [41, 17, 55, 6, 9, 93, 97, 59, 45, 54]. find the arithmatic mean and mdian of the series | Arithmetic mean of the series is 47.6 and Arithmetic median of this series is 49.5 | mean_median | +| 77 | Determinant to 2x2 Matrix | Det([[55, 32], [27, 54]]) = | 2106 | int_matrix_22_determinant | +| 78 | Compound Interest | Compound interest for a principle amount of 4870 dollars, 3% rate of interest and for a time period of 8 year is = | 6169.17 | compound_interest | +| 79 | Decimal to Hexadecimal | Binary of 35= | 0x23 | decimal_to_hexadeci | +| 80 | Percentage of a number | What is 98% of 63? | Required percentage = 61.74% | percentage | +| 81 | Celsius To Fahrenheit | Convert -6 degrees Celsius to degrees Fahrenheit = | 21.2 | celsius_to_fahrenheit | +| 82 | AP Term Calculation | Find the term number 33 of the AP series: 72, 140, 208 ... | 2248 | arithmetic_progression_term | +| 83 | AP Sum Calculation | Find the sum of first 72 terms of the AP series: 41, 110, 179 ... | 179316.0 | arithmetic_progression_sum | +| 84 | Converts decimal to octal | The decimal number 406 in Octal is: | 0o626 | decimal_to_octal | +| 85 | Converts decimal to Roman Numerals | The number 397 in Roman Numerals is: | CCCXCVII | decimal_to_roman_numerals | +| 86 | Degrees to Radians | Angle 122 in radians is = | 2.13 | degree_to_rad | | 87 | Radians to Degrees | Angle 2 in degrees is = | 114.59 | radian_to_deg | -| 88 | Differentiation | differentiate w.r.t x : d(tan(x)+7*x^3)/dx | 21*x^2 + tan(x)^2 + 1 | differentiation | -| 89 | Definite Integral of Quadratic Equation | The definite integral within limits 0 to 1 of the equation 85x^2 + 48x + 44 is = | 96.3333 | definite_integral | -| 90 | isprime | 93 | False | is_prime | -| 91 | Binary Coded Decimal to Integer | Integer of Binary Coded Decimal 2 is = | 10065 | bcd_to_decimal | -| 92 | Complex To Polar Form | rexp(itheta) = | 7.62exp(i1.17) | complex_to_polar | -| 93 | Union,Intersection,Difference of Two Sets | Given the two sets a={2, 5} ,b={8, 9, 4, 1}.Find the Union,intersection,a-b,b-a and symmetric difference | Union is {1, 2, 4, 5, 8, 9},Intersection is set(), a-b is {2, 5},b-a is {8, 9, 4, 1}, Symmetric difference is {1, 2, 4, 5, 8, 9} | set_operation | +| 88 | Differentiation | differentiate w.r.t x : d(tan(x)+4*x^(-3))/dx | tan(x)^2 + 1 - 12/x^4 | differentiation | +| 89 | Definite Integral of Quadratic Equation | The definite integral within limits 0 to 1 of the equation 54x^2 + 77x + 69 is = | 125.5 | definite_integral | +| 90 | isprime | 95 | False | is_prime | +| 91 | Binary Coded Decimal to Integer | Integer of Binary Coded Decimal 4 is = | 16643 | bcd_to_decimal | +| 92 | Complex To Polar Form | rexp(itheta) = | 1.41exp(i-2.36) | complex_to_polar | +| 93 | Union,Intersection,Difference of Two Sets | Given the two sets a={9, 5, 6} ,b={8, 1, 6}.Find the Union,intersection,a-b,b-a and symmetric difference | Union is {1, 5, 6, 8, 9},Intersection is {6}, a-b is {9, 5},b-a is {8, 1}, Symmetric difference is {1, 5, 8, 9} | set_operation | +| 94 | Base Conversion | Convert 121143 from base 7 to base 8. | 53020 | base_conversion | From 80933c86d885b9083788cf0556cc745904493205 Mon Sep 17 00:00:00 2001 From: Luke Weiler Date: Wed, 21 Oct 2020 14:27:18 -0400 Subject: [PATCH 40/43] Update curvedSurfaceAreaCylinderFunc.py --- mathgenerator/funcs/curvedSurfaceAreaCylinderFunc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mathgenerator/funcs/curvedSurfaceAreaCylinderFunc.py b/mathgenerator/funcs/curvedSurfaceAreaCylinderFunc.py index 313692c..15a254f 100644 --- a/mathgenerator/funcs/curvedSurfaceAreaCylinderFunc.py +++ b/mathgenerator/funcs/curvedSurfaceAreaCylinderFunc.py @@ -10,4 +10,4 @@ def curvedSurfaceAreaCylinderFunc(maxRadius = 49, maxHeight=99): return problem, solution -curvedSurfaceAreaCylinder = Generator("Curved surface area of a cylinder",91,"What is CSA of a cylinder of radius, r and height, h?","csa of cylinder",curvedSurfaceAreaCylinderFunc) +curvedSurfaceAreaCylinder = Generator("Curved surface area of a cylinder", 95,"What is CSA of a cylinder of radius, r and height, h?","csa of cylinder",curvedSurfaceAreaCylinderFunc) From 55fb0a18f6a3d2f4dc25a69602d05dbd0ff126f3 Mon Sep 17 00:00:00 2001 From: lukew3 Date: Wed, 21 Oct 2020 14:31:17 -0400 Subject: [PATCH 41/43] curved surface area cylinder fix --- README.md | 183 +++++++++--------- mathgenerator/funcs/__init__.py | 2 +- .../funcs/curvedSurfaceAreaCylinderFunc.py | 13 -- .../funcs/curved_surface_area_cylinder.py | 15 ++ test.py | 2 +- 5 files changed, 109 insertions(+), 106 deletions(-) delete mode 100644 mathgenerator/funcs/curvedSurfaceAreaCylinderFunc.py create mode 100644 mathgenerator/funcs/curved_surface_area_cylinder.py diff --git a/README.md b/README.md index 5c7341a..bae0d1f 100644 --- a/README.md +++ b/README.md @@ -31,98 +31,99 @@ problem, solution = mathgen.genById(0) | Id | Skill | Example problem | Example Solution | Function Name | |------|-----------------------------------|--------------------|-----------------------|--------------------------| [//]: # list start -| 0 | Addition | 15+31= | 46 | addition | -| 1 | Subtraction | 43-14= | 29 | subtraction | -| 2 | Multiplication | 45*1= | 45 | multiplication | -| 3 | Division | 72/45= | 1.6 | division | -| 4 | Binary Complement 1s | 0011= | 1100 | binary_complement_1s | -| 5 | Modulo Division | 14%68= | 14 | modulo_division | -| 6 | Square Root | sqrt(9)= | 3 | square_root | -| 7 | Power Rule Differentiation | 9x^8 | 72x^7 | power_rule_differentiation | -| 8 | Square | 5^2= | 25 | square | +| 0 | Addition | 48+19= | 67 | addition | +| 1 | Subtraction | 31-0= | 31 | subtraction | +| 2 | Multiplication | 44*1= | 44 | multiplication | +| 3 | Division | 19/73= | 0.2602739726027397 | division | +| 4 | Binary Complement 1s | 001110110= | 110001001 | binary_complement_1s | +| 5 | Modulo Division | 99%80= | 19 | modulo_division | +| 6 | Square Root | sqrt(144)= | 12 | square_root | +| 7 | Power Rule Differentiation | 7x^8 + 9x^3 | 56x^7 + 27x^2 | power_rule_differentiation | +| 8 | Square | 15^2= | 225 | square | | 9 | LCM (Least Common Multiple) | LCM of 18 and 10 = | 90 | lcm | -| 10 | GCD (Greatest Common Denominator) | GCD of 5 and 17 = | 1 | gcd | -| 11 | Basic Algebra | 10x + 9 = 10 | 1/10 | basic_algebra | +| 10 | GCD (Greatest Common Denominator) | GCD of 9 and 8 = | 1 | gcd | +| 11 | Basic Algebra | 9x + 10 = 10 | 0 | basic_algebra | | 12 | Logarithm | log2(32) | 5 | log | -| 13 | Easy Division | 80/16 = | 5 | int_division | -| 14 | Decimal to Binary | Binary of 66= | 1000010 | decimal_to_binary | -| 15 | Binary to Decimal | 011001010 | 202 | binary_to_decimal | -| 16 | Fraction Division | (3/8)/(10/7) | 21/80 | divide_fractions | -| 17 | Integer Multiplication with 2x2 Matrix | 0 * [[2, 6], [0, 4]] = | [[0,0],[0,0]] | multiply_int_to_22_matrix | -| 18 | Area of Triangle | Area of triangle with side lengths: 13 2 10 = | (7.843059660345589e-16+12.808688457449499j) | area_of_triangle | -| 19 | Triangle exists check | Does triangle with sides 33, 10 and 7 exist? | No | valid_triangle | -| 20 | Midpoint of the two point | (-1,-7),(13,-13)= | (6.0,-10.0) | midpoint_of_two_points | -| 21 | Factoring Quadratic | x^2+8x+7 | (x+1)(x+7) | factoring | -| 22 | Third Angle of Triangle | Third angle of triangle with angles 47 and 37 = | 96 | third_angle_of_triangle | -| 23 | Solve a System of Equations in R^2 | 3x - 5y = -74, -3x + 9y = 114 | x = -8, y = 10 | system_of_equations | -| 24 | Distance between 2 points | Find the distance between (7, 7) and (3, -3) | sqrt(116) | distance_two_points | -| 25 | Pythagorean Theorem | The hypotenuse of a right triangle given the other two lengths 20 and 9 = | 21.93 | pythagorean_theorem | -| 26 | Linear Equations | 5x + -8y = -25, -12x + -1y = -243 | x = 19, y = 15 | linear_equations | -| 27 | Prime Factorisation | Find prime factors of 16 | [2, 2, 2, 2] | prime_factors | -| 28 | Fraction Multiplication | (3/1)*(5/3) | 5 | fraction_multiplication | -| 29 | Angle of a Regular Polygon | Find the angle of a regular polygon with 5 sides | 108.0 | angle_regular_polygon | -| 30 | Combinations of Objects | Number of combinations from 19 objects picked 2 at a time | 171 | combinations | -| 31 | Factorial | 2! = | 2 | factorial | -| 32 | Surface Area of Cube | Surface area of cube with side = 1m is | 6 m^2 | surface_area_cube | -| 33 | Surface Area of Cuboid | Surface area of cuboid with sides = 9m, 16m, 20m is | 1288 m^2 | surface_area_cuboid | -| 34 | Surface Area of Cylinder | Surface area of cylinder with height = 7m and radius = 16m is | 2312 m^2 | surface_area_cylinder | -| 35 | Volum of Cube | Volume of cube with side = 12m is | 1728 m^3 | volume_cube | -| 36 | Volume of Cuboid | Volume of cuboid with sides = 11m, 19m, 8m is | 1672 m^3 | volume_cuboid | -| 37 | Volume of cylinder | Volume of cylinder with height = 9m and radius = 15m is | 6361 m^3 | volume_cylinder | +| 13 | Easy Division | 475/19 = | 25 | int_division | +| 14 | Decimal to Binary | Binary of 97= | 1100001 | decimal_to_binary | +| 15 | Binary to Decimal | 0110 | 6 | binary_to_decimal | +| 16 | Fraction Division | (3/6)/(7/1) | 1/14 | divide_fractions | +| 17 | Integer Multiplication with 2x2 Matrix | 12 * [[2, 6], [3, 3]] = | [[24,72],[36,36]] | multiply_int_to_22_matrix | +| 18 | Area of Triangle | Area of triangle with side lengths: 12 2 2 = | (2.0782945349651837e-15+33.94112549695428j) | area_of_triangle | +| 19 | Triangle exists check | Does triangle with sides 40, 5 and 39 exist? | Yes | valid_triangle | +| 20 | Midpoint of the two point | (-14,11),(-2,9)= | (-8.0,10.0) | midpoint_of_two_points | +| 21 | Factoring Quadratic | x^2-5x-14 | (x+2)(x-7) | factoring | +| 22 | Third Angle of Triangle | Third angle of triangle with angles 27 and 88 = | 65 | third_angle_of_triangle | +| 23 | Solve a System of Equations in R^2 | -7x - 7y = -14, -7x - 8y = -18 | x = -2, y = 4 | system_of_equations | +| 24 | Distance between 2 points | Find the distance between (5, 9) and (5, 8) | sqrt(1) | distance_two_points | +| 25 | Pythagorean Theorem | The hypotenuse of a right triangle given the other two lengths 13 and 17 = | 21.40 | pythagorean_theorem | +| 26 | Linear Equations | 2x + -1y = -19, -14x + -9y = 149 | x = -10, y = -1 | linear_equations | +| 27 | Prime Factorisation | Find prime factors of 8 | [2, 2, 2] | prime_factors | +| 28 | Fraction Multiplication | (3/1)*(2/10) | 3/5 | fraction_multiplication | +| 29 | Angle of a Regular Polygon | Find the angle of a regular polygon with 20 sides | 162.0 | angle_regular_polygon | +| 30 | Combinations of Objects | Number of combinations from 16 objects picked 5 at a time | 4368 | combinations | +| 31 | Factorial | 0! = | 1 | factorial | +| 32 | Surface Area of Cube | Surface area of cube with side = 4m is | 96 m^2 | surface_area_cube | +| 33 | Surface Area of Cuboid | Surface area of cuboid with sides = 19m, 10m, 16m is | 1308 m^2 | surface_area_cuboid | +| 34 | Surface Area of Cylinder | Surface area of cylinder with height = 32m and radius = 5m is | 1162 m^2 | surface_area_cylinder | +| 35 | Volum of Cube | Volume of cube with side = 20m is | 8000 m^3 | volume_cube | +| 36 | Volume of Cuboid | Volume of cuboid with sides = 11m, 17m, 1m is | 187 m^3 | volume_cuboid | +| 37 | Volume of cylinder | Volume of cylinder with height = 16m and radius = 17m is | 14526 m^3 | volume_cylinder | | 38 | Surface Area of cone | Surface area of cone with height = 36m and radius = 1m is | 116 m^2 | surface_area_cone | -| 39 | Volume of cone | Volume of cone with height = 26m and radius = 15m is | 6126 m^3 | volume_cone | -| 40 | Common Factors | Common Factors of 64 and 17 = | [1] | common_factors | -| 41 | Intersection of Two Lines | Find the point of intersection of the two lines: y = 10/6x + 3 and y = -1/3x + 10 | (7/2, 53/6) | intersection_of_two_lines | -| 42 | Permutations | Number of Permutations from 14 objects picked 1 at a time = | 14 | permutation | -| 43 | Cross Product of 2 Vectors | [-16, -17, -11] X [12, -19, 5] = | [-294, -52, 508] | vector_cross | -| 44 | Compare Fractions | Which symbol represents the comparison between 7/2 and 1/7? | > | compare_fractions | -| 45 | Simple Interest | Simple interest for a principle amount of 7256 dollars, 6% rate of interest and for a time period of 2 years is = | 870.72 | simple_interest | -| 46 | Multiplication of two matrices | Multiply
-63104
99-37
and
10-95
2-10-5
6-3-7
21-8
|
14-2-147
104-155-35
| matrix_multiplication | -| 47 | Cube Root | cuberoot of 723 upto 2 decimal places is: | 8.98 | cube_root | -| 48 | Power Rule Integration | 1x^5 + 2x^8 + 1x^5 + 10x^7 + 1x^6 | (1/5)x^6 + (2/8)x^9 + (1/5)x^6 + (10/7)x^8 + (1/6)x^7 + c | power_rule_integration | -| 49 | Fourth Angle of Quadrilateral | Fourth angle of quadrilateral with angles 58 , 157, 113 = | 32 | fourth_angle_of_quadrilateral | -| 50 | Quadratic Equation | Zeros of the Quadratic Equation 14x^2+92x+17=0 | [-0.19, -6.38] | quadratic_equation | -| 51 | HCF (Highest Common Factor) | HCF of 13 and 20 = | 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 5 = | 1/6 | dice_sum_probability | -| 53 | Exponentiation | 5^10 = | 9765625 | exponentiation | -| 54 | Confidence interval For sample S | The confidence interval for sample [266, 244, 292, 288, 230, 251, 211, 272, 260, 257, 231, 234, 254, 277, 202, 206, 258, 298, 243, 213, 214, 239, 247, 232, 203, 296, 238, 282, 222, 283, 261, 253, 252, 278, 215, 267, 212] with 90% confidence is | (255.6152095323176, 240.65506073795265) | confidence_interval | -| 55 | Comparing surds | Fill in the blanks 29^(1/1) _ 37^(1/8) | > | surds_comparison | -| 56 | Fibonacci Series | The Fibonacci Series of the first 10 numbers is ? | [0, 1, 1, 2, 3, 5, 8, 13, 21, 34] | 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 5 sides = | 540 | sum_of_polygon_angles | -| 59 | Mean,Standard Deviation,Variance | Find the mean,standard deviation and variance for the data[22, 32, 15, 45, 40, 34, 40, 29, 33, 43, 34, 19, 43, 17, 42] | The Mean is 32.53333333333333 , Standard Deviation is 95.71555555555555, Variance is 9.783432708183541 | data_summary | -| 60 | Surface Area of Sphere | Surface area of Sphere with radius = 7m is | 615.7521601035994 m^2 | surface_area_sphere | -| 61 | Volume of Sphere | Volume of sphere with radius 18 m = | 24429.024474314232 m^3 | volume_sphere | -| 62 | nth Fibonacci number | What is the 76th Fibonacci number? | 3416454622906716 | nth_fibonacci_number | -| 63 | Profit or Loss Percent | Profit percent when CP = 300 and SP = 745 is: | 148.33333333333334 | profit_loss_percent | -| 64 | Binary to Hexidecimal | 0011110 | 0x1e | binary_to_hex | -| 65 | Multiplication of 2 complex numbers | (15+4j) * (13+6j) = | (171+142j) | multiply_complex_numbers | -| 66 | Geometric Progression | For the given GP [7, 42, 252, 1512, 9072, 54432] ,Find the value of a,common ratio,9th term value, sum upto 11th term | The value of a is 7, common ratio is 6 , 9th term is 11757312 , sum upto 11th term is 507915877.0 | geometric_progression | -| 67 | Geometric Mean of N Numbers | Geometric mean of 3 numbers 22 , 15 and 25 = | (22*15*25)^(1/3) = 20.206200103110948 | geometric_mean | -| 68 | Harmonic Mean of N Numbers | Harmonic mean of 3 numbers 37 , 33 and 53 = | 3/((1/37) + (1/33) + (1/53)) = 39.371121476373965 | harmonic_mean | -| 69 | Euclidian norm or L2 norm of a vector | Euclidian norm or L2 norm of the vector[492.40786515780576, 983.9467887251965, 631.4868422143192, 867.3371448756883, 563.3456646686222, 708.0397121576655] is: | 1783.3521007855009 | euclidian_norm | -| 70 | Angle between 2 vectors | angle between the vectors [541.0289697890829, 573.3715402714977, 323.21175522813905, 134.3110759527537, 485.181412466299, 734.1757394805238, 632.1836650961008, 874.4930077772807, 392.3682318405426, 198.18533509253734, 259.3024324493266, 692.6808468046293, 983.0594493368139, 246.1431141764312, 169.47055701867663, 179.3769672014288, 653.3731083951614, 608.0069028185225] and [716.8150260194301, 661.3439350537182, 503.6201707807608, 922.7936933135436, 887.4562350809547, 764.2289969841399, 743.9308000789802, 604.6893588822073, 185.60578793368342, 335.83315817451984, 969.7123500771294, 181.4419381940483, 275.5957393468893, 228.41527442819876, 971.7792535281106, 0.79249601650766, 878.4199844485163, 888.9960985572237] is: | NaN | angle_btw_vectors | -| 71 | Absolute difference between two numbers | Absolute difference between numbers -9 and -91 = | 82 | absolute_difference | -| 72 | Dot Product of 2 Vectors | [14, -20, -3] . [-3, -18, 15] = | 273 | vector_dot | -| 73 | Binary 2's Complement | 2's complement of 100 = | 100 | binary_2s_complement | -| 74 | Inverse of a Matrix | Inverse of Matrix Matrix([[77, 3, 65], [46, 99, 23], [31, 83, 47]]) is: | Matrix([[196/18259, 2627/127813, -3183/127813], [-207/36518, 802/127813, 1219/255626], [107/36518, -3149/127813, 7485/255626]]) | invert_matrix | -| 75 | Area of a Sector | Given radius, 15 and angle, 235. Find the area of the sector. | Area of sector = 461.42142 | sector_area | -| 76 | Mean and Median | Given the series of numbers [41, 17, 55, 6, 9, 93, 97, 59, 45, 54]. find the arithmatic mean and mdian of the series | Arithmetic mean of the series is 47.6 and Arithmetic median of this series is 49.5 | mean_median | -| 77 | Determinant to 2x2 Matrix | Det([[55, 32], [27, 54]]) = | 2106 | int_matrix_22_determinant | -| 78 | Compound Interest | Compound interest for a principle amount of 4870 dollars, 3% rate of interest and for a time period of 8 year is = | 6169.17 | compound_interest | -| 79 | Decimal to Hexadecimal | Binary of 35= | 0x23 | decimal_to_hexadeci | -| 80 | Percentage of a number | What is 98% of 63? | Required percentage = 61.74% | percentage | -| 81 | Celsius To Fahrenheit | Convert -6 degrees Celsius to degrees Fahrenheit = | 21.2 | celsius_to_fahrenheit | -| 82 | AP Term Calculation | Find the term number 33 of the AP series: 72, 140, 208 ... | 2248 | arithmetic_progression_term | -| 83 | AP Sum Calculation | Find the sum of first 72 terms of the AP series: 41, 110, 179 ... | 179316.0 | arithmetic_progression_sum | -| 84 | Converts decimal to octal | The decimal number 406 in Octal is: | 0o626 | decimal_to_octal | -| 85 | Converts decimal to Roman Numerals | The number 397 in Roman Numerals is: | CCCXCVII | decimal_to_roman_numerals | -| 86 | Degrees to Radians | Angle 122 in radians is = | 2.13 | degree_to_rad | +| 39 | Volume of cone | Volume of cone with height = 17m and radius = 17m is | 5144 m^3 | volume_cone | +| 40 | Common Factors | Common Factors of 80 and 59 = | [1] | common_factors | +| 41 | Intersection of Two Lines | Find the point of intersection of the two lines: y = 10/6x + 6 and y = 5x + 7 | (-3/10, 11/2) | intersection_of_two_lines | +| 42 | Permutations | Number of Permutations from 15 objects picked 1 at a time = | 15 | permutation | +| 43 | Cross Product of 2 Vectors | [16, -8, 0] X [11, -6, -13] = | [104, 208, -8] | vector_cross | +| 44 | Compare Fractions | Which symbol represents the comparison between 4/6 and 7/9? | < | compare_fractions | +| 45 | Simple Interest | Simple interest for a principle amount of 1857 dollars, 8% rate of interest and for a time period of 7 years is = | 1039.92 | simple_interest | +| 46 | Multiplication of two matrices | Multiply
5-303
-6-6-98
-4-2-8-2
and
-10-10-210
-6-9-5-9
27-8-8
-26100
|
-38-53577
629919466
40-106242
| matrix_multiplication | +| 47 | Cube Root | cuberoot of 616 upto 2 decimal places is: | 8.51 | cube_root | +| 48 | Power Rule Integration | 4x^1 | (4/1)x^2 + c | power_rule_integration | +| 49 | Fourth Angle of Quadrilateral | Fourth angle of quadrilateral with angles 72 , 42, 103 = | 143 | fourth_angle_of_quadrilateral | +| 50 | Quadratic Equation | Zeros of the Quadratic Equation 88x^2+181x+68=0 | [-0.49, -1.56] | quadratic_equation | +| 51 | HCF (Highest Common Factor) | HCF of 2 and 1 = | 1 | 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 16 = | 6/216 | dice_sum_probability | +| 53 | Exponentiation | 17^10 = | 2015993900449 | exponentiation | +| 54 | Confidence interval For sample S | The confidence interval for sample [289, 211, 294, 290, 264, 258, 229, 265, 272, 228, 257, 262, 210, 259, 246, 224, 266, 283, 273, 222, 250, 241, 225, 237] with 99% confidence is | (265.1917573633045, 239.39157597002884) | confidence_interval | +| 55 | Comparing surds | Fill in the blanks 81^(1/7) _ 54^(1/9) | > | 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 cos(90)? | 0 | 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[43, 23, 43, 13, 16, 40, 36, 19, 17, 39, 45, 26, 12, 17, 12] | The Mean is 26.733333333333334 , Standard Deviation is 151.79555555555555, Variance is 12.3205338989654 | data_summary | +| 60 | Surface Area of Sphere | Surface area of Sphere with radius = 10m is | 1256.6370614359173 m^2 | surface_area_sphere | +| 61 | Volume of Sphere | Volume of sphere with radius 93 m = | 3369282.722751367 m^3 | volume_sphere | +| 62 | nth Fibonacci number | What is the 52th Fibonacci number? | 32951280099 | nth_fibonacci_number | +| 63 | Profit or Loss Percent | Loss percent when CP = 798 and SP = 713 is: | 10.651629072681704 | profit_loss_percent | +| 64 | Binary to Hexidecimal | 0000 | 0x0 | binary_to_hex | +| 65 | Multiplication of 2 complex numbers | (14-1j) * (-15+4j) = | (-206+71j) | multiply_complex_numbers | +| 66 | Geometric Progression | For the given GP [8, 24, 72, 216, 648, 1944] ,Find the value of a,common ratio,11th term value, sum upto 8th term | The value of a is 8, common ratio is 3 , 11th term is 472392 , sum upto 8th term is 26240.0 | geometric_progression | +| 67 | Geometric Mean of N Numbers | Geometric mean of 4 numbers 65 , 75 , 65 , 23 = | (65*75*65*23)^(1/4) = 51.95818275737109 | geometric_mean | +| 68 | Harmonic Mean of N Numbers | Harmonic mean of 2 numbers 2 and 12 = | 2/((1/2) + (1/12)) = 3.4285714285714284 | harmonic_mean | +| 69 | Euclidian norm or L2 norm of a vector | Euclidian norm or L2 norm of the vector[488.10260237588165, 438.9926997215375, 481.4248776631771, 480.58824363943177, 509.73053046857785, 268.09288505668803, 410.3732502610836, 318.6216647891933, 296.4238196042428, 808.0996438115192, 121.7211186065138, 615.1986904309553, 380.29841107431093, 195.23491823519456, 81.69943837555405, 155.69629311805645, 97.46954246782546, 634.0953876946306, 199.72352388042535, 568.2278203619796] is: | 1901.9741243296269 | euclidian_norm | +| 70 | Angle between 2 vectors | angle between the vectors [955.8351549798066, 177.1594811522551, 900.6055058476991, 712.0208070601419, 601.3956854892953, 628.8267644026017, 893.2727217464875, 492.4340309181726] and [668.7008663033757, 138.7169080640255, 515.5875138676224, 230.03917249114247, 51.099523634880015, 894.1460097286858, 313.47733623460283, 837.2412043583688] is: | NaN | angle_btw_vectors | +| 71 | Absolute difference between two numbers | Absolute difference between numbers -63 and 84 = | 147 | absolute_difference | +| 72 | Dot Product of 2 Vectors | [7, -9, 12] . [6, 12, 14] = | 102 | vector_dot | +| 73 | Binary 2's Complement | 2's complement of 11101 = | 11 | binary_2s_complement | +| 74 | Inverse of a Matrix | Inverse of Matrix Matrix([[61, 90, 56], [2, 74, 38], [29, 91, 7]]) is: | Matrix([[735/47851, -2233/95702, 181/47851], [-272/47851, 1197/191404, 1103/95702], [491/47851, 2941/191404, -2167/95702]]) | invert_matrix | +| 75 | Area of a Sector | Given radius, 17 and angle, 98. Find the area of the sector. | Area of sector = 247.15608 | sector_area | +| 76 | Mean and Median | Given the series of numbers [13, 89, 68, 53, 61, 3, 17, 66, 63, 48]. find the arithmatic mean and mdian of the series | Arithmetic mean of the series is 48.1 and Arithmetic median of this series is 57.0 | mean_median | +| 77 | Determinant to 2x2 Matrix | Det([[49, 6], [62, 19]]) = | 559 | int_matrix_22_determinant | +| 78 | Compound Interest | Compound interest for a principle amount of 7750 dollars, 9% rate of interest and for a time period of 7 year is = | 14167.3 | compound_interest | +| 79 | Decimal to Hexadecimal | Binary of 972= | 0x3cc | decimal_to_hexadeci | +| 80 | Percentage of a number | What is 38% of 82? | Required percentage = 31.16% | percentage | +| 81 | Celsius To Fahrenheit | Convert -49 degrees Celsius to degrees Fahrenheit = | -56.2 | celsius_to_fahrenheit | +| 82 | AP Term Calculation | Find the term number 83 of the AP series: -41, -110, -179 ... | -5699 | arithmetic_progression_term | +| 83 | AP Sum Calculation | Find the sum of first 99 terms of the AP series: 20, -59, -138 ... | -381249.0 | arithmetic_progression_sum | +| 84 | Converts decimal to octal | The decimal number 1424 in Octal is: | 0o2620 | decimal_to_octal | +| 85 | Converts decimal to Roman Numerals | The number 3563 in Roman Numerals is: | MMMDLXIII | decimal_to_roman_numerals | +| 86 | Degrees to Radians | Angle 286 in radians is = | 4.99 | degree_to_rad | | 87 | Radians to Degrees | Angle 2 in degrees is = | 114.59 | radian_to_deg | -| 88 | Differentiation | differentiate w.r.t x : d(tan(x)+4*x^(-3))/dx | tan(x)^2 + 1 - 12/x^4 | differentiation | -| 89 | Definite Integral of Quadratic Equation | The definite integral within limits 0 to 1 of the equation 54x^2 + 77x + 69 is = | 125.5 | definite_integral | -| 90 | isprime | 95 | False | is_prime | -| 91 | Binary Coded Decimal to Integer | Integer of Binary Coded Decimal 4 is = | 16643 | bcd_to_decimal | -| 92 | Complex To Polar Form | rexp(itheta) = | 1.41exp(i-2.36) | complex_to_polar | -| 93 | Union,Intersection,Difference of Two Sets | Given the two sets a={9, 5, 6} ,b={8, 1, 6}.Find the Union,intersection,a-b,b-a and symmetric difference | Union is {1, 5, 6, 8, 9},Intersection is {6}, a-b is {9, 5},b-a is {8, 1}, Symmetric difference is {1, 5, 8, 9} | set_operation | -| 94 | Base Conversion | Convert 121143 from base 7 to base 8. | 53020 | base_conversion | +| 88 | Differentiation | differentiate w.r.t x : d(exp(x)+6*x^(-3))/dx | exp(x) - 18/x^4 | differentiation | +| 89 | Definite Integral of Quadratic Equation | The definite integral within limits 0 to 1 of the equation 94x^2 + 86x + 97 is = | 171.3333 | definite_integral | +| 90 | isprime | 28 | False | is_prime | +| 91 | Binary Coded Decimal to Integer | Integer of Binary Coded Decimal 9 is = | 37408 | bcd_to_decimal | +| 92 | Complex To Polar Form | rexp(itheta) = | 15.65exp(i-2.68) | complex_to_polar | +| 93 | Union,Intersection,Difference of Two Sets | Given the two sets a={2, 3, 5} ,b={2, 3, 6, 7}.Find the Union,intersection,a-b,b-a and symmetric difference | Union is {2, 3, 5, 6, 7},Intersection is {2, 3}, a-b is {5},b-a is {6, 7}, Symmetric difference is {5, 6, 7} | set_operation | +| 94 | Base Conversion | Convert E656 from base 16 to base 12. | 2A15A | base_conversion | +| 95 | Curved surface area of a cylinder | What is the curved surface area of a cylinder of radius, 43 and height, 85? | CSA of cylinder = 22965.04 | curved_surface_area_cylinder | diff --git a/mathgenerator/funcs/__init__.py b/mathgenerator/funcs/__init__.py index fdc580f..034322b 100644 --- a/mathgenerator/funcs/__init__.py +++ b/mathgenerator/funcs/__init__.py @@ -99,4 +99,4 @@ from .bcd_to_decimal import * from .complex_to_polar import * from .set_operation import * from .base_conversion import * -from .curvedSurfaceAreaCylinderFunc import * +from .curved_surface_area_cylinder import * diff --git a/mathgenerator/funcs/curvedSurfaceAreaCylinderFunc.py b/mathgenerator/funcs/curvedSurfaceAreaCylinderFunc.py deleted file mode 100644 index 15a254f..0000000 --- a/mathgenerator/funcs/curvedSurfaceAreaCylinderFunc.py +++ /dev/null @@ -1,13 +0,0 @@ -from .__init__ import * - -def curvedSurfaceAreaCylinderFunc(maxRadius = 49, maxHeight=99): - r = random.randint(1, maxRadius) - h = random.randint(1, maxHeight) - problem = f"What is Curved surface area of a cylinder of radius, {r} and height, {h}?" - csa = float(2*math.pi*r*h) - formatted_float = "{:.5f}".format(csa) - solution = f"CSA of cylinder = {formatted_float}%" - return problem, solution - - -curvedSurfaceAreaCylinder = Generator("Curved surface area of a cylinder", 95,"What is CSA of a cylinder of radius, r and height, h?","csa of cylinder",curvedSurfaceAreaCylinderFunc) diff --git a/mathgenerator/funcs/curved_surface_area_cylinder.py b/mathgenerator/funcs/curved_surface_area_cylinder.py new file mode 100644 index 0000000..58f9d83 --- /dev/null +++ b/mathgenerator/funcs/curved_surface_area_cylinder.py @@ -0,0 +1,15 @@ +from .__init__ import * + + +def curvedSurfaceAreaCylinderFunc(maxRadius=49, maxHeight=99): + r = random.randint(1, maxRadius) + h = random.randint(1, maxHeight) + problem = f"What is the curved surface area of a cylinder of radius, {r} and height, {h}?" + csa = float(2*math.pi*r*h) + formatted_float = round(csa, 2) # "{:.5f}".format(csa) + solution = f"CSA of cylinder = {formatted_float}" + return problem, solution + + +curved_surface_area_cylinder = Generator("Curved surface area of a cylinder", 95, + "What is CSA of a cylinder of radius, r and height, h?", "csa of cylinder", curvedSurfaceAreaCylinderFunc) diff --git a/test.py b/test.py index cc34a10..126c9d8 100644 --- a/test.py +++ b/test.py @@ -10,4 +10,4 @@ for item in list: print(item[2]) # print(mathgen.getGenList()) -print(mathgen.genById(94)) +print(mathgen.genById(95)) From d647e9710f014a527149777a4a8e924ce6524632 Mon Sep 17 00:00:00 2001 From: lukew3 Date: Wed, 21 Oct 2020 14:34:42 -0400 Subject: [PATCH 42/43] yapf fix --- mathgenerator/__init__.py | 3 ++- mathgenerator/funcs/angle_btw_vectors.py | 3 ++- .../funcs/arithmetic_progression_sum.py | 10 +++++---- .../funcs/arithmetic_progression_term.py | 10 +++++---- mathgenerator/funcs/base_conversion.py | 22 +++++++++++++------ mathgenerator/funcs/bcd_to_decimal.py | 3 ++- mathgenerator/funcs/binary_to_hex.py | 4 ++-- mathgenerator/funcs/celsius_to_fahrenheit.py | 6 +++-- mathgenerator/funcs/complex_to_polar.py | 4 ++-- mathgenerator/funcs/compound_interest.py | 4 +++- mathgenerator/funcs/cube_root.py | 5 +++-- .../funcs/curved_surface_area_cylinder.py | 8 ++++--- mathgenerator/funcs/data_summary.py | 2 +- mathgenerator/funcs/decimal_to_octal.py | 3 ++- .../funcs/decimal_to_roman_numerals.py | 18 +++++++++++---- mathgenerator/funcs/definite_integral.py | 9 ++++---- mathgenerator/funcs/degree_to_rad.py | 4 ++-- mathgenerator/funcs/differentiation.py | 5 +++-- mathgenerator/funcs/distance_two_points.py | 7 +++--- mathgenerator/funcs/euclidian_norm.py | 11 ++++++---- mathgenerator/funcs/geometric_mean.py | 7 +++--- mathgenerator/funcs/invert_matrix.py | 5 +++-- mathgenerator/funcs/is_prime.py | 4 ++-- mathgenerator/funcs/midpoint_of_two_points.py | 3 ++- mathgenerator/funcs/nth_fibonacci_number.py | 3 ++- .../funcs/power_rule_differentiation.py | 4 ++-- mathgenerator/funcs/radian_to_deg.py | 4 ++-- mathgenerator/funcs/sector_area.py | 4 ++-- mathgenerator/funcs/set_operation.py | 11 ++++++---- mathgenerator/mathgen.py | 1 - setup.py | 6 +---- 31 files changed, 117 insertions(+), 76 deletions(-) diff --git a/mathgenerator/__init__.py b/mathgenerator/__init__.py index 090e18a..45ca62f 100644 --- a/mathgenerator/__init__.py +++ b/mathgenerator/__init__.py @@ -11,7 +11,8 @@ class Generator: self.generalSol = generalSol self.func = func - (filename, line_number, function_name, text) = traceback.extract_stack()[-2] + (filename, line_number, function_name, + text) = traceback.extract_stack()[-2] funcname = filename[filename.rfind('/'):].strip() funcname = funcname[1:-3] # print(funcname) diff --git a/mathgenerator/funcs/angle_btw_vectors.py b/mathgenerator/funcs/angle_btw_vectors.py index f3b8a65..1553435 100644 --- a/mathgenerator/funcs/angle_btw_vectors.py +++ b/mathgenerator/funcs/angle_btw_vectors.py @@ -10,7 +10,8 @@ def angleBtwVectorsFunc(maxEltAmt=20): for j in v2: s += i * j - mags = math.sqrt(sum([i**2 for i in v1])) * math.sqrt(sum([i**2 for i in v2])) + mags = math.sqrt(sum([i**2 + for i in v1])) * math.sqrt(sum([i**2 for i in v2])) problem = f"angle between the vectors {v1} and {v2} is:" solution = '' try: diff --git a/mathgenerator/funcs/arithmetic_progression_sum.py b/mathgenerator/funcs/arithmetic_progression_sum.py index e376c3f..d698354 100644 --- a/mathgenerator/funcs/arithmetic_progression_sum.py +++ b/mathgenerator/funcs/arithmetic_progression_sum.py @@ -8,11 +8,13 @@ def arithmeticProgressionSumFunc(maxd=100, maxa=100, maxn=100): a3 = a2 + d n = random.randint(4, maxn) apString = str(a1) + ', ' + str(a2) + ', ' + str(a3) + ' ... ' - problem = 'Find the sum of first ' + str(n) + ' terms of the AP series: ' + apString + problem = 'Find the sum of first ' + str( + n) + ' terms of the AP series: ' + apString solution = n * ((2 * a1) + ((n - 1) * d)) / 2 return problem, solution -arithmetic_progression_sum = Generator("AP Sum Calculation", 83, - "Find the sum of first n terms of the AP series: a1, a2, a3 ...", - "Sum", arithmeticProgressionSumFunc) +arithmetic_progression_sum = Generator( + "AP Sum Calculation", 83, + "Find the sum of first n terms of the AP series: a1, a2, a3 ...", "Sum", + arithmeticProgressionSumFunc) diff --git a/mathgenerator/funcs/arithmetic_progression_term.py b/mathgenerator/funcs/arithmetic_progression_term.py index 8468921..cdf1f9b 100644 --- a/mathgenerator/funcs/arithmetic_progression_term.py +++ b/mathgenerator/funcs/arithmetic_progression_term.py @@ -8,11 +8,13 @@ def arithmeticProgressionTermFunc(maxd=100, maxa=100, maxn=100): a3 = a2 + d n = random.randint(4, maxn) apString = str(a1) + ', ' + str(a2) + ', ' + str(a3) + ' ... ' - problem = 'Find the term number ' + str(n) + ' of the AP series: ' + apString + problem = 'Find the term number ' + str( + n) + ' of the AP series: ' + apString solution = a1 + ((n - 1) * d) return problem, solution -arithmetic_progression_term = Generator("AP Term Calculation", 82, - "Find the term number n of the AP series: a1, a2, a3 ...", - "a-n", arithmeticProgressionTermFunc) +arithmetic_progression_term = Generator( + "AP Term Calculation", 82, + "Find the term number n of the AP series: a1, a2, a3 ...", "a-n", + arithmeticProgressionTermFunc) diff --git a/mathgenerator/funcs/base_conversion.py b/mathgenerator/funcs/base_conversion.py index c9ef48f..02746ff 100644 --- a/mathgenerator/funcs/base_conversion.py +++ b/mathgenerator/funcs/base_conversion.py @@ -5,7 +5,9 @@ alpha = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" def fromBaseTenTo(n, toBase): - assert type(toBase) == int and toBase >= 2 and toBase <= 36, "toBase({}) must be >=2 and <=36" + assert type( + toBase + ) == int and toBase >= 2 and toBase <= 36, "toBase({}) must be >=2 and <=36" # trivial cases if toBase == 2: return bin(n)[2:] @@ -16,12 +18,13 @@ def fromBaseTenTo(n, toBase): elif toBase == 16: return hex(n)[2:].upper() res = alpha[n % toBase] - n = n//toBase + n = n // toBase while n > 0: res = alpha[n % toBase] + res - n = n//toBase + n = n // toBase return res + # Useful to check answers, but not needed here # def toBaseTen(n,fromBase): # return int(n,fromBase) @@ -29,12 +32,16 @@ def fromBaseTenTo(n, toBase): def baseConversionFunc(maxNum=60000, maxBase=16): assert type( - maxNum) == int and maxNum >= 100 and maxNum <= 65536, "maxNum({}) must be >=100 and <=65536".format(maxNum) + maxNum + ) == int and maxNum >= 100 and maxNum <= 65536, "maxNum({}) must be >=100 and <=65536".format( + maxNum) assert type( - maxBase) == int and maxBase >= 2 and maxBase <= 36, "maxBase({}) must be >= 2 and <=36".format(maxBase) + maxBase + ) == int and maxBase >= 2 and maxBase <= 36, "maxBase({}) must be >= 2 and <=36".format( + maxBase) n = random.randint(40, maxNum) - dist = [10]*10+[2]*5+[16]*5+[i for i in range(2, maxBase+1)] + dist = [10] * 10 + [2] * 5 + [16] * 5 + [i for i in range(2, maxBase + 1)] # set this way since converting to/from bases 2,10,16 are more common -- can be changed if needed. bases = random.choices(dist, k=2) while bases[0] == bases[1]: @@ -46,5 +53,6 @@ def baseConversionFunc(maxNum=60000, maxBase=16): return problem, ans -base_conversion = Generator("Base Conversion", 94, "Convert 152346 from base 8 to base 10.", "54502", +base_conversion = Generator("Base Conversion", 94, + "Convert 152346 from base 8 to base 10.", "54502", baseConversionFunc) diff --git a/mathgenerator/funcs/bcd_to_decimal.py b/mathgenerator/funcs/bcd_to_decimal.py index fc356d0..ec48176 100644 --- a/mathgenerator/funcs/bcd_to_decimal.py +++ b/mathgenerator/funcs/bcd_to_decimal.py @@ -21,4 +21,5 @@ def BCDtoDecimalFunc(maxNumber=10000): bcd_to_decimal = Generator("Binary Coded Decimal to Integer", 91, - "Integer of Binary Coded Decimal b is ", "n", BCDtoDecimalFunc) + "Integer of Binary Coded Decimal b is ", "n", + BCDtoDecimalFunc) diff --git a/mathgenerator/funcs/binary_to_hex.py b/mathgenerator/funcs/binary_to_hex.py index 77b03b1..bb3d993 100644 --- a/mathgenerator/funcs/binary_to_hex.py +++ b/mathgenerator/funcs/binary_to_hex.py @@ -11,5 +11,5 @@ def binaryToHexFunc(max_dig=10): return problem, solution -binary_to_hex = Generator("Binary to Hexidecimal", 64, "Hexidecimal of a=", "b", - binaryToHexFunc) +binary_to_hex = Generator("Binary to Hexidecimal", 64, "Hexidecimal of a=", + "b", binaryToHexFunc) diff --git a/mathgenerator/funcs/celsius_to_fahrenheit.py b/mathgenerator/funcs/celsius_to_fahrenheit.py index 45122d0..f314883 100644 --- a/mathgenerator/funcs/celsius_to_fahrenheit.py +++ b/mathgenerator/funcs/celsius_to_fahrenheit.py @@ -4,10 +4,12 @@ from .__init__ import * def celsiustofahrenheitFunc(maxTemp=100): celsius = random.randint(-50, maxTemp) fahrenheit = (celsius * (9 / 5)) + 32 - problem = "Convert " + str(celsius) + " degrees Celsius to degrees Fahrenheit =" + problem = "Convert " + str( + celsius) + " degrees Celsius to degrees Fahrenheit =" solution = str(fahrenheit) return problem, solution celsius_to_fahrenheit = Generator("Celsius To Fahrenheit", 81, - "(C +(9/5))+32=", "F", celsiustofahrenheitFunc) + "(C +(9/5))+32=", "F", + celsiustofahrenheitFunc) diff --git a/mathgenerator/funcs/complex_to_polar.py b/mathgenerator/funcs/complex_to_polar.py index ecab5ec..90fb72d 100644 --- a/mathgenerator/funcs/complex_to_polar.py +++ b/mathgenerator/funcs/complex_to_polar.py @@ -14,5 +14,5 @@ def complexToPolarFunc(minRealImaginaryNum=-20, maxRealImaginaryNum=20): return problem, solution -complex_to_polar = Generator("Complex To Polar Form", 92, - "rexp(itheta) = ", "plr", complexToPolarFunc) +complex_to_polar = Generator("Complex To Polar Form", 92, "rexp(itheta) = ", + "plr", complexToPolarFunc) diff --git a/mathgenerator/funcs/compound_interest.py b/mathgenerator/funcs/compound_interest.py index 8f7d48d..0ff034c 100644 --- a/mathgenerator/funcs/compound_interest.py +++ b/mathgenerator/funcs/compound_interest.py @@ -14,4 +14,6 @@ def compoundInterestFunc(maxPrinciple=10000, maxRate=10, maxTime=10): compound_interest = Generator( - "Compound Interest", 78, "Compound interest for a principle amount of a dollars, b% rate of interest and for a time period of c years is = ", "d dollars", compoundInterestFunc) + "Compound Interest", 78, + "Compound interest for a principle amount of a dollars, b% rate of interest and for a time period of c years is = ", + "d dollars", compoundInterestFunc) diff --git a/mathgenerator/funcs/cube_root.py b/mathgenerator/funcs/cube_root.py index 041d492..06a6a8d 100644 --- a/mathgenerator/funcs/cube_root.py +++ b/mathgenerator/funcs/cube_root.py @@ -10,5 +10,6 @@ def cubeRootFunc(minNo=1, maxNo=1000): return problem, solution -cube_root = Generator("Cube Root", 47, "Cuberoot of a upto 2 decimal places is", - "b", cubeRootFunc) +cube_root = Generator("Cube Root", 47, + "Cuberoot of a upto 2 decimal places is", "b", + cubeRootFunc) diff --git a/mathgenerator/funcs/curved_surface_area_cylinder.py b/mathgenerator/funcs/curved_surface_area_cylinder.py index 58f9d83..0a02325 100644 --- a/mathgenerator/funcs/curved_surface_area_cylinder.py +++ b/mathgenerator/funcs/curved_surface_area_cylinder.py @@ -5,11 +5,13 @@ def curvedSurfaceAreaCylinderFunc(maxRadius=49, maxHeight=99): r = random.randint(1, maxRadius) h = random.randint(1, maxHeight) problem = f"What is the curved surface area of a cylinder of radius, {r} and height, {h}?" - csa = float(2*math.pi*r*h) + csa = float(2 * math.pi * r * h) formatted_float = round(csa, 2) # "{:.5f}".format(csa) solution = f"CSA of cylinder = {formatted_float}" return problem, solution -curved_surface_area_cylinder = Generator("Curved surface area of a cylinder", 95, - "What is CSA of a cylinder of radius, r and height, h?", "csa of cylinder", curvedSurfaceAreaCylinderFunc) +curved_surface_area_cylinder = Generator( + "Curved surface area of a cylinder", 95, + "What is CSA of a cylinder of radius, r and height, h?", "csa of cylinder", + curvedSurfaceAreaCylinderFunc) diff --git a/mathgenerator/funcs/data_summary.py b/mathgenerator/funcs/data_summary.py index a84a91c..f74bf8e 100644 --- a/mathgenerator/funcs/data_summary.py +++ b/mathgenerator/funcs/data_summary.py @@ -16,7 +16,7 @@ def dataSummaryFunc(number_values=15, minval=5, maxval=50): var += (random_list[i] - mean)**2 standardDeviation = var / number_values - variance = (var / number_values) ** 0.5 + variance = (var / number_values)**0.5 problem = "Find the mean,standard deviation and variance for the data" + \ str(random_list) diff --git a/mathgenerator/funcs/decimal_to_octal.py b/mathgenerator/funcs/decimal_to_octal.py index 5a89b99..e6a2ca9 100644 --- a/mathgenerator/funcs/decimal_to_octal.py +++ b/mathgenerator/funcs/decimal_to_octal.py @@ -9,4 +9,5 @@ def decimalToOctalFunc(maxDecimal=4096): decimal_to_octal = Generator("Converts decimal to octal", 84, - "What's the octal representation of 98?", "0o142", decimalToOctalFunc) + "What's the octal representation of 98?", "0o142", + decimalToOctalFunc) diff --git a/mathgenerator/funcs/decimal_to_roman_numerals.py b/mathgenerator/funcs/decimal_to_roman_numerals.py index 63b64f2..ee66ff6 100644 --- a/mathgenerator/funcs/decimal_to_roman_numerals.py +++ b/mathgenerator/funcs/decimal_to_roman_numerals.py @@ -4,7 +4,15 @@ from .__init__ import * def decimalToRomanNumeralsFunc(maxDecimal=4000): x = random.randint(0, maxDecimal) problem = "The number " + str(x) + " in Roman Numerals is: " - roman_dict = {1: "I", 5: "V", 10: "X", 50: "L", 100: "C", 500: "D", 1000: "M"} + roman_dict = { + 1: "I", + 5: "V", + 10: "X", + 50: "L", + 100: "C", + 500: "D", + 1000: "M" + } divisor = 1 while x >= divisor: divisor *= 10 @@ -17,7 +25,8 @@ def decimalToRomanNumeralsFunc(maxDecimal=4000): elif last_value == 4: solution += (roman_dict[divisor] + roman_dict[divisor * 5]) elif 5 <= last_value <= 8: - solution += (roman_dict[divisor * 5] + (roman_dict[divisor] * (last_value - 5))) + solution += (roman_dict[divisor * 5] + (roman_dict[divisor] * + (last_value - 5))) elif last_value == 9: solution += (roman_dict[divisor] + roman_dict[divisor * 10]) x = math.floor(x % divisor) @@ -25,5 +34,6 @@ def decimalToRomanNumeralsFunc(maxDecimal=4000): return problem, solution -decimal_to_roman_numerals = Generator("Converts decimal to Roman Numerals", - 85, "Convert 20 into Roman Numerals", "XX", decimalToRomanNumeralsFunc) +decimal_to_roman_numerals = Generator("Converts decimal to Roman Numerals", 85, + "Convert 20 into Roman Numerals", "XX", + decimalToRomanNumeralsFunc) diff --git a/mathgenerator/funcs/definite_integral.py b/mathgenerator/funcs/definite_integral.py index 6e8453f..7a46027 100644 --- a/mathgenerator/funcs/definite_integral.py +++ b/mathgenerator/funcs/definite_integral.py @@ -4,9 +4,8 @@ from scipy.integrate import quad def definiteIntegralFunc(max_coeff=100): - def integrand(x, a, b, c): - return a * x ** 2 + b * x + c + return a * x**2 + b * x + c a = random.randint(0, max_coeff) b = random.randint(0, max_coeff) @@ -23,5 +22,7 @@ def definiteIntegralFunc(max_coeff=100): return problem, solution -definite_integral = Generator("Definite Integral of Quadratic Equation", 89, - "The definite integral within limits 0 to 1 of quadratic equation ax^2+bx+c is = ", "S", definiteIntegralFunc) +definite_integral = Generator( + "Definite Integral of Quadratic Equation", 89, + "The definite integral within limits 0 to 1 of quadratic equation ax^2+bx+c is = ", + "S", definiteIntegralFunc) diff --git a/mathgenerator/funcs/degree_to_rad.py b/mathgenerator/funcs/degree_to_rad.py index dc63f10..a17d72f 100644 --- a/mathgenerator/funcs/degree_to_rad.py +++ b/mathgenerator/funcs/degree_to_rad.py @@ -13,5 +13,5 @@ def degreeToRadFunc(max_deg=360): return problem, solution -degree_to_rad = Generator("Degrees to Radians", 86, - "Angle a in radians is = ", "b", degreeToRadFunc) +degree_to_rad = Generator("Degrees to Radians", 86, "Angle a in radians is = ", + "b", degreeToRadFunc) diff --git a/mathgenerator/funcs/differentiation.py b/mathgenerator/funcs/differentiation.py index 2b40dea..1c0205d 100644 --- a/mathgenerator/funcs/differentiation.py +++ b/mathgenerator/funcs/differentiation.py @@ -49,5 +49,6 @@ def differentiationFunc(diff_lvl=2): return problem, solution -differentiation = Generator( - "Differentiation", 88, "differentiate w.r.t x : d(f(x))/dx", "g(x)", differentiationFunc) +differentiation = Generator("Differentiation", 88, + "differentiate w.r.t x : d(f(x))/dx", "g(x)", + differentiationFunc) diff --git a/mathgenerator/funcs/distance_two_points.py b/mathgenerator/funcs/distance_two_points.py index 6dc6b7d..7277702 100644 --- a/mathgenerator/funcs/distance_two_points.py +++ b/mathgenerator/funcs/distance_two_points.py @@ -14,6 +14,7 @@ def distanceTwoPointsFunc(maxValXY=20, minValXY=-20): return problem, solution -distance_two_points = Generator("Distance between 2 points", 24, - "Find the distance between (x1,y1) and (x2,y2)", - "sqrt(distanceSquared)", distanceTwoPointsFunc) +distance_two_points = Generator( + "Distance between 2 points", 24, + "Find the distance between (x1,y1) and (x2,y2)", "sqrt(distanceSquared)", + distanceTwoPointsFunc) diff --git a/mathgenerator/funcs/euclidian_norm.py b/mathgenerator/funcs/euclidian_norm.py index cfd178c..017fa74 100644 --- a/mathgenerator/funcs/euclidian_norm.py +++ b/mathgenerator/funcs/euclidian_norm.py @@ -2,12 +2,15 @@ from .__init__ import * def euclidianNormFunc(maxEltAmt=20): - vec = [random.uniform(0, 1000) for i in range(random.randint(2, maxEltAmt))] + vec = [ + random.uniform(0, 1000) for i in range(random.randint(2, maxEltAmt)) + ] problem = f"Euclidian norm or L2 norm of the vector{vec} is:" solution = math.sqrt(sum([i**2 for i in vec])) return problem, solution -eucldian_norm = Generator("Euclidian norm or L2 norm of a vector", 69, - "Euclidian Norm of a vector V:[v1, v2, ......., vn]", - "sqrt(v1^2 + v2^2 ........ +vn^2)", euclidianNormFunc) +eucldian_norm = Generator( + "Euclidian norm or L2 norm of a vector", 69, + "Euclidian Norm of a vector V:[v1, v2, ......., vn]", + "sqrt(v1^2 + v2^2 ........ +vn^2)", euclidianNormFunc) diff --git a/mathgenerator/funcs/geometric_mean.py b/mathgenerator/funcs/geometric_mean.py index 034ddf2..606269e 100644 --- a/mathgenerator/funcs/geometric_mean.py +++ b/mathgenerator/funcs/geometric_mean.py @@ -27,6 +27,7 @@ def geometricMeanFunc(maxValue=100, maxNum=4): return problem, solution -geometric_mean = Generator("Geometric Mean of N Numbers", 67, - "Geometric mean of n numbers A1 , A2 , ... , An = ", - "(A1*A2*...An)^(1/n) = ans", geometricMeanFunc) +geometric_mean = Generator( + "Geometric Mean of N Numbers", 67, + "Geometric mean of n numbers A1 , A2 , ... , An = ", + "(A1*A2*...An)^(1/n) = ans", geometricMeanFunc) diff --git a/mathgenerator/funcs/invert_matrix.py b/mathgenerator/funcs/invert_matrix.py index 7a196c5..f089c3c 100644 --- a/mathgenerator/funcs/invert_matrix.py +++ b/mathgenerator/funcs/invert_matrix.py @@ -78,5 +78,6 @@ def matrixInversion(SquareMatrixDimension=3, return problem, solution -invert_matrix = Generator("Inverse of a Matrix", 74, "Inverse of a matrix A is", - "A^(-1)", matrixInversion) +invert_matrix = Generator("Inverse of a Matrix", 74, + "Inverse of a matrix A is", "A^(-1)", + matrixInversion) diff --git a/mathgenerator/funcs/is_prime.py b/mathgenerator/funcs/is_prime.py index 143f4d3..ac3ede5 100644 --- a/mathgenerator/funcs/is_prime.py +++ b/mathgenerator/funcs/is_prime.py @@ -18,5 +18,5 @@ def isprime(max_a=100): return (problem, solution) -is_prime = Generator('isprime', 90, 'a any positive integer', - 'True/False', isprime) +is_prime = Generator('isprime', 90, 'a any positive integer', 'True/False', + isprime) diff --git a/mathgenerator/funcs/midpoint_of_two_points.py b/mathgenerator/funcs/midpoint_of_two_points.py index 2b021aa..9e458a4 100644 --- a/mathgenerator/funcs/midpoint_of_two_points.py +++ b/mathgenerator/funcs/midpoint_of_two_points.py @@ -13,5 +13,6 @@ def MidPointOfTwoPointFunc(maxValue=20): midPoint_of_two_points = Generator("Midpoint of the two point", 20, - "((X1,Y1),(X2,Y2))=", "((X1+X2)/2,(Y1+Y2)/2)", + "((X1,Y1),(X2,Y2))=", + "((X1+X2)/2,(Y1+Y2)/2)", MidPointOfTwoPointFunc) diff --git a/mathgenerator/funcs/nth_fibonacci_number.py b/mathgenerator/funcs/nth_fibonacci_number.py index cfb7e8a..3d28655 100644 --- a/mathgenerator/funcs/nth_fibonacci_number.py +++ b/mathgenerator/funcs/nth_fibonacci_number.py @@ -5,7 +5,8 @@ def nthFibonacciNumberFunc(maxN=100): golden_ratio = (1 + math.sqrt(5)) / 2 n = random.randint(1, maxN) problem = f"What is the {n}th Fibonacci number?" - ans = round((math.pow(golden_ratio, n) - math.pow(-golden_ratio, -n)) / (math.sqrt(5))) + ans = round((math.pow(golden_ratio, n) - math.pow(-golden_ratio, -n)) / + (math.sqrt(5))) solution = f"{ans}" return problem, solution diff --git a/mathgenerator/funcs/power_rule_differentiation.py b/mathgenerator/funcs/power_rule_differentiation.py index cdc8c76..25a85c2 100644 --- a/mathgenerator/funcs/power_rule_differentiation.py +++ b/mathgenerator/funcs/power_rule_differentiation.py @@ -18,6 +18,6 @@ def powerRuleDifferentiationFunc(maxCoef=10, maxExp=10, maxTerms=5): return problem, solution -power_rule_differentiation = Generator("Power Rule Differentiation", 7, "nx^m=", - "(n*m)x^(m-1)", +power_rule_differentiation = Generator("Power Rule Differentiation", 7, + "nx^m=", "(n*m)x^(m-1)", powerRuleDifferentiationFunc) diff --git a/mathgenerator/funcs/radian_to_deg.py b/mathgenerator/funcs/radian_to_deg.py index e48acc0..0281b82 100644 --- a/mathgenerator/funcs/radian_to_deg.py +++ b/mathgenerator/funcs/radian_to_deg.py @@ -14,5 +14,5 @@ def radianToDegFunc(max_rad=3): return problem, solution -radian_to_deg = Generator("Radians to Degrees", 87, - "Angle a in degrees is = ", "b", radianToDegFunc) +radian_to_deg = Generator("Radians to Degrees", 87, "Angle a in degrees is = ", + "b", radianToDegFunc) diff --git a/mathgenerator/funcs/sector_area.py b/mathgenerator/funcs/sector_area.py index 9a14728..12692fb 100644 --- a/mathgenerator/funcs/sector_area.py +++ b/mathgenerator/funcs/sector_area.py @@ -12,5 +12,5 @@ def sectorAreaFunc(maxRadius=49, maxAngle=359): sector_area = Generator("Area of a Sector", 75, - "Area of a sector with radius, r and angle, a ", "Area", - sectorAreaFunc) + "Area of a sector with radius, r and angle, a ", + "Area", sectorAreaFunc) diff --git a/mathgenerator/funcs/set_operation.py b/mathgenerator/funcs/set_operation.py index f328368..263b548 100644 --- a/mathgenerator/funcs/set_operation.py +++ b/mathgenerator/funcs/set_operation.py @@ -14,11 +14,14 @@ def set_operation(minval=3, maxval=7, n_a=4, n_b=5): b = set(b) problem = "Given the two sets a=" + \ str(a) + " ,b=" + str(b) + ".Find the Union,intersection,a-b,b-a and symmetric difference" - solution = "Union is " + str(a.union(b)) + ",Intersection is " + str(a.intersection(b)) + ", a-b is " + str( - a.difference(b)) + ",b-a is " + str(b.difference(a)) + ", Symmetric difference is " + str(a.symmetric_difference(b)) + solution = "Union is " + str(a.union(b)) + ",Intersection is " + str( + a.intersection(b)) + ", a-b is " + str( + a.difference(b)) + ",b-a is " + str( + b.difference(a)) + ", Symmetric difference is " + str( + a.symmetric_difference(b)) return problem, solution set_operation = Generator("Union,Intersection,Difference of Two Sets", 93, - "Union,intersection,difference", - "aUb,a^b,a-b,b-a,", set_operation) + "Union,intersection,difference", "aUb,a^b,a-b,b-a,", + set_operation) diff --git a/mathgenerator/mathgen.py b/mathgenerator/mathgen.py index 2a969fa..1a09015 100644 --- a/mathgenerator/mathgen.py +++ b/mathgenerator/mathgen.py @@ -1,7 +1,6 @@ from .funcs import * from .__init__ import getGenList - genList = getGenList() diff --git a/setup.py b/setup.py index 7b022b4..23e337e 100644 --- a/setup.py +++ b/setup.py @@ -8,9 +8,5 @@ setup(name='mathgenerator', author_email='lukew25073@gmail.com', license='MIT', packages=find_packages(), - install_requires=[ - 'sympy', - 'numpy', - 'scipy' - ], + install_requires=['sympy', 'numpy', 'scipy'], entry_points={}) From abddf069c270046e5e03ecdefb5590a034870abf Mon Sep 17 00:00:00 2001 From: lukew3 Date: Wed, 21 Oct 2020 14:39:44 -0400 Subject: [PATCH 43/43] linter fix --- mathgenerator/funcs/complex_to_polar.py | 2 +- mathgenerator/funcs/decimal_to_roman_numerals.py | 3 +-- mathgenerator/funcs/nth_fibonacci_number.py | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/mathgenerator/funcs/complex_to_polar.py b/mathgenerator/funcs/complex_to_polar.py index 90fb72d..ad4798d 100644 --- a/mathgenerator/funcs/complex_to_polar.py +++ b/mathgenerator/funcs/complex_to_polar.py @@ -9,7 +9,7 @@ def complexToPolarFunc(minRealImaginaryNum=-20, maxRealImaginaryNum=20): r = round(math.hypot(a, b), 2) theta = round(math.atan2(b, a), 2) plr = str(r) + "exp(i" + str(theta) + ")" - problem = f"rexp(itheta) = " + problem = "rexp(itheta) = " solution = plr return problem, solution diff --git a/mathgenerator/funcs/decimal_to_roman_numerals.py b/mathgenerator/funcs/decimal_to_roman_numerals.py index ee66ff6..c2470dc 100644 --- a/mathgenerator/funcs/decimal_to_roman_numerals.py +++ b/mathgenerator/funcs/decimal_to_roman_numerals.py @@ -25,8 +25,7 @@ def decimalToRomanNumeralsFunc(maxDecimal=4000): elif last_value == 4: solution += (roman_dict[divisor] + roman_dict[divisor * 5]) elif 5 <= last_value <= 8: - solution += (roman_dict[divisor * 5] + (roman_dict[divisor] * - (last_value - 5))) + solution += (roman_dict[divisor * 5] + (roman_dict[divisor] * (last_value - 5))) elif last_value == 9: solution += (roman_dict[divisor] + roman_dict[divisor * 10]) x = math.floor(x % divisor) diff --git a/mathgenerator/funcs/nth_fibonacci_number.py b/mathgenerator/funcs/nth_fibonacci_number.py index 3d28655..cfb7e8a 100644 --- a/mathgenerator/funcs/nth_fibonacci_number.py +++ b/mathgenerator/funcs/nth_fibonacci_number.py @@ -5,8 +5,7 @@ def nthFibonacciNumberFunc(maxN=100): golden_ratio = (1 + math.sqrt(5)) / 2 n = random.randint(1, maxN) problem = f"What is the {n}th Fibonacci number?" - ans = round((math.pow(golden_ratio, n) - math.pow(-golden_ratio, -n)) / - (math.sqrt(5))) + ans = round((math.pow(golden_ratio, n) - math.pow(-golden_ratio, -n)) / (math.sqrt(5))) solution = f"{ans}" return problem, solution