diff --git a/README.md b/README.md index ca34822..87ca9e6 100644 --- a/README.md +++ b/README.md @@ -31,92 +31,92 @@ problem, solution = mathgen.genById(0) | Id | Skill | Example problem | Example Solution | Function Name | |------|-----------------------------------|--------------------|-----------------------|--------------------------| [//]: # list start -| 0 | Addition | 24+32= | 56 | addition | -| 1 | Subtraction | 14-4= | 10 | subtractionFunc | -| 2 | Multiplication | 28*3= | 84 | multiplicationFunc | -| 3 | Division | 55/39= | 1.4102564102564104 | divisionFunc | -| 4 | Binary Complement 1s | 1010000= | 0101111 | binaryComplement1sFunc | -| 5 | Modulo Division | 74%21= | 11 | moduloFunc | -| 6 | Square Root | sqrt(1)= | 1 | squareRootFunc | -| 7 | Power Rule Differentiation | 6x^5 + 10x^4 + 10x^9 | 30x^4 + 40x^3 + 90x^8 | powerRuleDifferentiationFunc | -| 8 | Square | 17^2= | 289 | squareFunc | -| 9 | LCM (Least Common Multiple) | LCM of 6 and 13 = | 78 | lcmFunc | -| 10 | GCD (Greatest Common Denominator) | GCD of 1 and 3 = | 1 | gcdFunc | -| 11 | Basic Algebra | 3x + 9 = 9 | 0 | basicAlgebraFunc | -| 12 | Logarithm | log3(2187) | 7 | logFunc | -| 13 | Easy Division | 275/11 = | 25 | divisionToIntFunc | -| 14 | Decimal to Binary | Binary of 87= | 1010111 | DecimalToBinaryFunc | -| 15 | Binary to Decimal | 01111 | 15 | BinaryToDecimalFunc | -| 16 | Fraction Division | (1/8)/(8/1) | 1/64 | divideFractionsFunc | -| 17 | Integer Multiplication with 2x2 Matrix | 7 * [[7, 6], [1, 4]] = | [[49,42],[7,28]] | multiplyIntToMatrix22 | -| 18 | Area of Triangle | Area of triangle with side lengths: 8 5 18 = | (3.3825325984308986e-15+55.24094948496088j) | areaOfTriangleFunc | -| 19 | Triangle exists check | Does triangle with sides 22, 8 and 3 exist? | No | isTriangleValidFunc | -| 20 | Midpoint of the two point | (17,-8),(-14,-2)= | (1.5,-5.0) | MidPointOfTwoPointFunc | -| 21 | Factoring Quadratic | x^2+x-20 | (x+5)(x-4) | factoringFunc | -| 22 | Third Angle of Triangle | Third angle of triangle with angles 36 and 55 = | 89 | thirdAngleOfTriangleFunc | -| 23 | Solve a System of Equations in R^2 | 2x - 7y = 56, -8x + 2y = 36 | x = -7, y = -10 | systemOfEquationsFunc | -| 24 | Distance between 2 points | Find the distance between (2, 19) and (3, 7) | sqrt(145) | distanceTwoPointsFunc | -| 25 | Pythagorean Theorem | The hypotenuse of a right triangle given the other two lengths 16 and 7 = | 17.46 | pythagoreanTheoremFunc | -| 26 | Linear Equations | -14x + -15y = 219 -8x = -48 | x = -6, y = -9 | linearEquationsFunc | -| 27 | Prime Factorisation | Find prime factors of 73 | [73] | primeFactorsFunc | -| 28 | Fraction Multiplication | (8/10)*(6/5) | 24/25 | multiplyFractionsFunc | -| 29 | Angle of a Regular Polygon | Find the angle of a regular polygon with 15 sides | 156.0 | regularPolygonAngleFunc | -| 30 | Combinations of Objects | Number of combinations from 15 objects picked 8 at a time | 6435 | combinationsFunc | -| 31 | Factorial | 4! = | 24 | factorialFunc | -| 32 | Surface Area of Cube | Surface area of cube with side = 15m is | 1350 m^2 | surfaceAreaCube | -| 33 | Surface Area of Cuboid | Surface area of cuboid with sides = 18m, 11m, 19m is | 1498 m^2 | surfaceAreaCuboid | -| 34 | Surface Area of Cylinder | Surface area of cylinder with height = 38m and radius = 16m is | 5428 m^2 | surfaceAreaCylinder | -| 35 | Volum of Cube | Volume of cube with side = 5m is | 125 m^3 | volumeCube | -| 36 | Volume of Cuboid | Volume of cuboid with sides = 3m, 11m, 3m is | 99 m^3 | volumeCuboid | -| 37 | Volume of cylinder | Volume of cylinder with height = 20m and radius = 7m is | 3078 m^3 | volumeCylinder | -| 38 | Surface Area of cone | Surface area of cone with height = 23m and radius = 2m is | 157 m^2 | surfaceAreaCone | -| 39 | Volume of cone | Volume of cone with height = 44m and radius = 5m is | 1151 m^3 | volumeCone | -| 40 | Common Factors | Common Factors of 99 and 93 = | [1, 3] | commonFactorsFunc | -| 41 | Intersection of Two Lines | Find the point of intersection of the two lines: y = 10/3x - 8 and y = -10x + 4 | (9/10, -5) | intersectionOfTwoLinesFunc | -| 42 | Permutations | Number of Permutations from 19 objects picked 5 at a time = | 1395360 | permutationFunc | -| 43 | Cross Product of 2 Vectors | [0, 2, -6] X [4, 13, 15] = | [108, -24, -8] | vectorCrossFunc | -| 44 | Compare Fractions | Which symbol represents the comparison between 1/7 and 7/10? | < | compareFractionsFunc | -| 45 | Simple Interest | Simple interest for a principle amount of 9501 dollars, 10% rate of interest and for a time period of 10 years is = | 9501.0 | simpleInterestFunc | -| 46 | Multiplication of two matrices | Multiply
-106
2-4
1-8
-74
and
-5-2
-3-8
|
32-28
228
1962
23-18
| matrixMultiplicationFunc | -| 47 | Cube Root | cuberoot of 100 upto 2 decimal places is: | 4.64 | cubeRootFunc | -| 48 | Power Rule Integration | 9x^9 | (9/9)x^10 + c | powerRuleIntegrationFunc | -| 49 | Fourth Angle of Quadrilateral | Fourth angle of quadrilateral with angles 29 , 84, 126 = | 121 | fourthAngleOfQuadriFunc | -| 50 | Quadratic Equation | Zeros of the Quadratic Equation 39x^2+176x+64=0 | [-0.4, -4.11] | quadraticEquation | -| 51 | HCF (Highest Common Factor) | HCF of 7 and 9 = | 1 | hcfFunc | +| 0 | Addition | 39+14= | 53 | addition | +| 1 | Subtraction | 28-20= | 8 | subtractionFunc | +| 2 | Multiplication | 23*2= | 46 | multiplicationFunc | +| 3 | Division | 34/27= | 1.2592592592592593 | divisionFunc | +| 4 | Binary Complement 1s | 01101= | 10010 | binaryComplement1sFunc | +| 5 | Modulo Division | 27%67= | 27 | moduloFunc | +| 6 | Square Root | sqrt(81)= | 9 | squareRootFunc | +| 7 | Power Rule Differentiation | 7x^2 + 1x^4 + 4x^8 + 5x^10 | 14x^1 + 4x^3 + 32x^7 + 50x^9 | powerRuleDifferentiationFunc | +| 8 | Square | 2^2= | 4 | squareFunc | +| 9 | LCM (Least Common Multiple) | LCM of 7 and 10 = | 70 | lcmFunc | +| 10 | GCD (Greatest Common Denominator) | GCD of 15 and 3 = | 3 | gcdFunc | +| 11 | Basic Algebra | 9x + 8 = 9 | 1/9 | basicAlgebraFunc | +| 12 | Logarithm | log2(32) | 5 | logFunc | +| 13 | Easy Division | 176/11 = | 16 | divisionToIntFunc | +| 14 | Decimal to Binary | Binary of 49= | 110001 | DecimalToBinaryFunc | +| 15 | Binary to Decimal | 01100 | 12 | BinaryToDecimalFunc | +| 16 | Fraction Division | (9/5)/(10/2) | 9/25 | divideFractionsFunc | +| 17 | Integer Multiplication with 2x2 Matrix | 8 * [[8, 9], [0, 3]] = | [[64,72],[0,24]] | multiplyIntToMatrix22 | +| 18 | Area of Triangle | Area of triangle with side lengths: 19 2 15 = | (1.7998558638262156e-15+29.393876913398138j) | areaOfTriangleFunc | +| 19 | Triangle exists check | Does triangle with sides 9, 12 and 5 exist? | Yes | isTriangleValidFunc | +| 20 | Midpoint of the two point | (-3,-3),(-7,-4)= | (-5.0,-3.5) | MidPointOfTwoPointFunc | +| 21 | Factoring Quadratic | x^2+4x-12 | (x+6)(x-2) | factoringFunc | +| 22 | Third Angle of Triangle | Third angle of triangle with angles 4 and 27 = | 149 | thirdAngleOfTriangleFunc | +| 23 | Solve a System of Equations in R^2 | -6x - 10y = 22, 4x - 3y = 53 | x = 8, y = -7 | systemOfEquationsFunc | +| 24 | Distance between 2 points | Find the distance between (6, 2) and (-2, -2) | sqrt(80) | distanceTwoPointsFunc | +| 25 | Pythagorean Theorem | The hypotenuse of a right triangle given the other two lengths 10 and 13 = | 16.40 | pythagoreanTheoremFunc | +| 26 | Linear Equations | 8x + -8y = -40 +20x + -16y = -108 | x = -7, y = -2 | linearEquationsFunc | +| 27 | Prime Factorisation | Find prime factors of 29 | [29] | primeFactorsFunc | +| 28 | Fraction Multiplication | (4/7)*(3/9) | 4/21 | multiplyFractionsFunc | +| 29 | Angle of a Regular Polygon | Find the angle of a regular polygon with 3 sides | 60.0 | regularPolygonAngleFunc | +| 30 | Combinations of Objects | Number of combinations from 20 objects picked 5 at a time | 15504 | combinationsFunc | +| 31 | Factorial | 3! = | 6 | factorialFunc | +| 32 | Surface Area of Cube | Surface area of cube with side = 3m is | 54 m^2 | surfaceAreaCube | +| 33 | Surface Area of Cuboid | Surface area of cuboid with sides = 4m, 15m, 5m is | 310 m^2 | surfaceAreaCuboid | +| 34 | Surface Area of Cylinder | Surface area of cylinder with height = 14m and radius = 11m is | 1727 m^2 | surfaceAreaCylinder | +| 35 | Volum of Cube | Volume of cube with side = 6m is | 216 m^3 | volumeCube | +| 36 | Volume of Cuboid | Volume of cuboid with sides = 9m, 6m, 15m is | 810 m^3 | volumeCuboid | +| 37 | Volume of cylinder | Volume of cylinder with height = 21m and radius = 4m is | 1055 m^3 | volumeCylinder | +| 38 | Surface Area of cone | Surface area of cone with height = 7m and radius = 7m is | 371 m^2 | surfaceAreaCone | +| 39 | Volume of cone | Volume of cone with height = 46m and radius = 15m is | 10838 m^3 | volumeCone | +| 40 | Common Factors | Common Factors of 12 and 76 = | [1, 2, 4] | commonFactorsFunc | +| 41 | Intersection of Two Lines | Find the point of intersection of the two lines: y = 6x + 8 and y = 3/2x + 4 | (-8/9, 8/3) | intersectionOfTwoLinesFunc | +| 42 | Permutations | Number of Permutations from 15 objects picked 5 at a time = | 360360 | permutationFunc | +| 43 | Cross Product of 2 Vectors | [-13, -2, 0] X [-4, 14, -4] = | [8, -52, -190] | vectorCrossFunc | +| 44 | Compare Fractions | Which symbol represents the comparison between 3/8 and 3/9? | > | compareFractionsFunc | +| 45 | Simple Interest | Simple interest for a principle amount of 6266 dollars, 8% rate of interest and for a time period of 3 years is = | 1503.84 | simpleInterestFunc | +| 46 | Multiplication of two matrices | Multiply
30
-1-6
and
4-75-9
08-10-2
|
12-2115-27
-4-415521
| matrixMultiplicationFunc | +| 47 | Cube Root | cuberoot of 362 upto 2 decimal places is: | 7.13 | cubeRootFunc | +| 48 | Power Rule Integration | 2x^6 + 1x^5 + 7x^9 + 1x^10 | (2/6)x^7 + (1/5)x^6 + (7/9)x^10 + (1/10)x^11 + c | powerRuleIntegrationFunc | +| 49 | Fourth Angle of Quadrilateral | Fourth angle of quadrilateral with angles 60 , 18, 7 = | 275 | fourthAngleOfQuadriFunc | +| 50 | Quadratic Equation | Zeros of the Quadratic Equation 40x^2+121x+89=0 | [-1.26, -1.76] | quadraticEquation | +| 51 | HCF (Highest Common Factor) | HCF of 4 and 12 = | 4 | hcfFunc | | 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 13 = | 21/216 | DiceSumProbFunc | -| 53 | Exponentiation | 6^4 = | 1296 | exponentiationFunc | -| 54 | Confidence interval For sample S | The confidence interval for sample [293, 222, 227, 237, 299, 265, 238, 273, 229, 236, 286, 243, 220, 233, 224, 226, 257, 285, 268, 271, 247, 262] with 90% confidence is | (260.4441418746136, 243.28313085265916) | confidenceIntervalFunc | -| 55 | Comparing surds | Fill in the blanks 66^(1/5) _ 74^(1/6) | > | surdsComparisonFunc | -| 56 | Fibonacci Series | The Fibonacci Series of the first 18 numbers is ? | [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597] | fibonacciSeriesFunc | -| 57 | Trigonometric Values | What is sin(0)? | 0 | basicTrigonometryFunc | -| 58 | Sum of Angles of Polygon | Sum of angles of polygon with 4 sides = | 360 | sumOfAnglesOfPolygonFunc | -| 59 | Mean,Standard Deviation,Variance | Find the mean,standard deviation and variance for the data[31, 20, 40, 14, 41, 42, 12, 18, 26, 41, 16, 48, 37, 30, 18] | The Mean is 28.933333333333334 , Standard Deviation is 134.86222222222221, Variance is 11.61301951355556 | dataSummaryFunc | -| 60 | Surface Area of Sphere | Surface area of Sphere with radius = 16m is | 3216.990877275948 m^2 | surfaceAreaSphere | -| 61 | Volume of Sphere | Volume of sphere with radius 10 m = | 4188.790204786391 m^3 | volumeSphereFunc | -| 62 | nth Fibonacci number | What is the 65th Fibonacci number? | 17167680177565 | nthFibonacciNumberFunc | -| 63 | Profit or Loss Percent | Loss percent when CP = 639 and SP = 20 is: | 96.87010954616588 | profitLossPercentFunc | -| 64 | Binary to Hexidecimal | 10000010 | 0x82 | binaryToHexFunc | -| 65 | Multiplication of 2 complex numbers | (-16-5j) * (13+4j) = | (-188-129j) | multiplyComplexNumbersFunc | -| 66 | Geometric Progression | For the given GP [5, 30, 180, 1080, 6480, 38880] ,Find the value of a,common ratio,7th term value, sum upto 11th term | The value of a is 5, common ratio is 6 , 7th term is 233280 , sum upto 11th term is 362797055.0 | geomProgrFunc | -| 67 | Geometric Mean of N Numbers | Geometric mean of 3 numbers 12 , 76 and 88 = | (12*76*88)^(1/3) = 43.134606135637426 | geometricMeanFunc | -| 68 | Harmonic Mean of N Numbers | Harmonic mean of 4 numbers 32 , 82 , 98 , 59 = | 4/((1/32) + (1/82) + (1/98) + (1/59)) = 56.658543052293126 | harmonicMeanFunc | -| 69 | Euclidian norm or L2 norm of a vector | Euclidian norm or L2 norm of the vector[30.49374303007102, 744.9799127067523, 232.71392717506222, 219.07162873155772, 268.6667105157799, 655.700721848602, 630.8781230231998, 525.0331442958861, 603.1960329056955] is: | 1482.467804008134 | euclidianNormFunc | -| 70 | Angle between 2 vectors | angle between the vectors [411.45287273810993, 475.5310005335923, 585.8235737751623, 654.4447552592987, 7.9372591993011055, 944.1669660662357, 82.85267978544842, 855.1153353684535, 401.897628624623, 208.74276524448533, 18.113378046332063, 329.92425644581766, 656.1658677733768] and [340.21944929120787, 595.8624349766976, 458.3226781953552, 460.8316651658132, 237.2935680919427, 562.2537489196774, 705.3352878976389, 21.91461098842251, 950.6814899692208, 879.1343421626799, 177.86771165838067, 867.0564995964864, 762.591298578088] is: | NaN | angleBtwVectorsFunc | -| 71 | Absolute difference between two numbers | Absolute difference between numbers -22 and 85 = | 107 | absoluteDifferenceFunc | -| 72 | Dot Product of 2 Vectors | [-4, -15, -19] . [-12, -18, -13] = | 565 | vectorDotFunc | -| 73 | Binary 2's Complement | 2's complement of = | | binary2sComplement | -| 74 | Inverse of a Matrix | Inverse of Matrix Matrix([[23, 14, 90], [15, 42, 7], [37, 19, 79]]) is: | Matrix([[-3185/53919, -604/53919, 3682/53919], [926/53919, 1513/53919, -1189/53919], [47/1997, -3/1997, -28/1997]]) | matrixInversion | -| 75 | Area of a Sector | Given radius, 32 and angle, 182. Find the area of the sector. | Area of sector = 1626.36761 | sectorAreaFunc | -| 76 | Mean and Median | Given the series of numbers [83, 63, 31, 44, 12, 73, 42, 51, 93, 3]. find the arithmatic mean and mdian of the series | Arithmetic mean of the series is 49.5 and Arithmetic median of this series is 47.5 | meanMedianFunc | -| 77 | Determinant to 2x2 Matrix | Det([[35, 67], [54, 48]]) = | -1938 | determinantToMatrix22 | -| 78 | Compound Interest | Compound Interest for a principle amount of 4487 dollars, 5% rate of interest and for a time period of 9 compounded monthly is = | 4487.0 | compoundInterestFunc | -| 79 | Decimal to Hexadecimal | Binary of 992= | 0x3e0 | deciToHexaFunc | -| 80 | Percentage of a number | What is 37% of 83? | Required percentage = 30.71% | percentageFunc | -| 81 | Celsius To Fahrenheit | Convert 15 degrees Celsius to degrees Fahrenheit = | 59.0 | celsiustofahrenheit | -| 82 | AP Term Calculation | Find the term number 31 of the AP series: -53, -107, -161 ... | -1673 | arithmeticProgressionTermFunc | -| 83 | AP Sum Calculation | Find the sum of first 56 terms of the AP series: -14, -24, -34 ... | -16184.0 | arithmeticProgressionSumFunc | -| 84 | Converts decimal to octal | The decimal number 1430 in Octal is: | 0o2626 | decimalToOctalFunc | -| 85 | Converts decimal to Roman Numerals | The number 3537 in Roman Numerals is: | MMMDXXXVII | decimalToRomanNumeralsFunc | -| 86 | Degrees to Radians | Angle 87 in radians is = | 1.52 | degreeToRadFunc | +| 53 | Exponentiation | 11^8 = | 214358881 | exponentiationFunc | +| 54 | Confidence interval For sample S | The confidence interval for sample [239, 265, 215, 283, 231, 296, 270, 260, 289, 271, 245, 251, 206, 255, 257, 247, 292, 232, 276, 297, 263, 254, 279, 253, 211, 236, 274, 209, 275, 278, 212, 214, 226, 230, 256, 249, 293] with 95% confidence is | (262.3172302973649, 245.19628321614857) | confidenceIntervalFunc | +| 55 | Comparing surds | Fill in the blanks 86^(1/4) _ 39^(1/1) | < | surdsComparisonFunc | +| 56 | Fibonacci Series | The Fibonacci Series of the first 10 numbers is ? | [0, 1, 1, 2, 3, 5, 8, 13, 21, 34] | fibonacciSeriesFunc | +| 57 | Trigonometric Values | What is sin(90)? | 1 | basicTrigonometryFunc | +| 58 | Sum of Angles of Polygon | Sum of angles of polygon with 5 sides = | 540 | sumOfAnglesOfPolygonFunc | +| 59 | Mean,Standard Deviation,Variance | Find the mean,standard deviation and variance for the data[19, 23, 36, 18, 44, 47, 18, 40, 27, 25, 14, 16, 6, 29, 50] | The Mean is 27.466666666666665 , Standard Deviation is 163.0488888888889, Variance is 12.769059827915637 | dataSummaryFunc | +| 60 | Surface Area of Sphere | Surface area of Sphere with radius = 5m is | 314.1592653589793 m^2 | surfaceAreaSphere | +| 61 | Volume of Sphere | Volume of sphere with radius 63 m = | 1047394.4243362226 m^3 | volumeSphereFunc | +| 62 | nth Fibonacci number | What is the 60th Fibonacci number? | 1548008755920 | nthFibonacciNumberFunc | +| 63 | Profit or Loss Percent | Profit percent when CP = 121 and SP = 615 is: | 408.26446280991735 | profitLossPercentFunc | +| 64 | Binary to Hexidecimal | 10110 | 0x16 | binaryToHexFunc | +| 65 | Multiplication of 2 complex numbers | (20-1j) * (-7+14j) = | (-126+287j) | multiplyComplexNumbersFunc | +| 66 | Geometric Progression | For the given GP [2, 24, 288, 3456, 41472, 497664] ,Find the value of a,common ratio,9th term value, sum upto 10th term | The value of a is 2, common ratio is 12 , 9th term is 859963392 , sum upto 10th term is 11257702586.0 | geomProgrFunc | +| 67 | Geometric Mean of N Numbers | Geometric mean of 4 numbers 18 , 24 , 99 , 12 = | (18*24*99*12)^(1/4) = 26.765480655440626 | geometricMeanFunc | +| 68 | Harmonic Mean of N Numbers | Harmonic mean of 2 numbers 41 and 82 = | 2/((1/41) + (1/82)) = 54.66666666666666 | harmonicMeanFunc | +| 69 | Euclidian norm or L2 norm of a vector | Euclidian norm or L2 norm of the vector[690.1926568125737, 148.904898302192, 222.19798825467595, 667.3276829127157, 366.9178192723557, 875.6869024243441, 336.14075266140685, 949.1256775112896, 626.0180041672427, 290.7427227038134, 207.55193301803965, 64.93900706542944, 736.3114771837603, 785.1756497858677] is: | 2142.639328828992 | euclidianNormFunc | +| 70 | Angle between 2 vectors | angle between the vectors [293.12905111302047, 909.0452944804068, 423.60965609823086, 870.8703924858319, 958.9076883380749, 837.4625321599826] and [938.5559146533071, 63.15299226225102, 418.14038421596024, 865.5267136591071, 513.9066820998474, 680.6577264839382] is: | NaN | angleBtwVectorsFunc | +| 71 | Absolute difference between two numbers | Absolute difference between numbers 76 and -20 = | 96 | absoluteDifferenceFunc | +| 72 | Dot Product of 2 Vectors | [19, 10, -5] . [0, -18, 15] = | -255 | vectorDotFunc | +| 73 | Binary 2's Complement | 2's complement of 110 = | 10 | binary2sComplement | +| 74 | Inverse of a Matrix | Inverse of Matrix Matrix([[61, 68, 75], [31, 77, 66], [33, 59, 58]]) is: | Matrix([[11/141, 37/564, -33/188], [95/1833, 1063/7332, -567/2444], [-178/1833, -1355/7332, 863/2444]]) | matrixInversion | +| 75 | Area of a Sector | Given radius, 20 and angle, 235. Find the area of the sector. | Area of sector = 820.30475 | sectorAreaFunc | +| 76 | Mean and Median | Given the series of numbers [7, 89, 72, 14, 97, 48, 35, 12, 11, 27]. find the arithmatic mean and mdian of the series | Arithmetic mean of the series is 41.2 and Arithmetic median of this series is 31.0 | meanMedianFunc | +| 77 | Determinant to 2x2 Matrix | Det([[26, 78], [39, 24]]) = | -2418 | determinantToMatrix22 | +| 78 | Compound Interest | Compound Interest for a principle amount of 6842 dollars, 8% rate of interest and for a time period of 5 compounded monthly is = | 6842.0 | compoundInterestFunc | +| 79 | Decimal to Hexadecimal | Binary of 860= | 0x35c | deciToHexaFunc | +| 80 | Percentage of a number | What is 75% of 28? | Required percentage = 21.00% | percentageFunc | +| 81 | Celsius To Fahrenheit | Convert 30 degrees Celsius to degrees Fahrenheit = | 86.0 | celsiustofahrenheit | +| 82 | AP Term Calculation | Find the term number 47 of the AP series: -56, 37, 130 ... | 4222 | arithmeticProgressionTermFunc | +| 83 | AP Sum Calculation | Find the sum of first 79 terms of the AP series: 34, 24, 14 ... | -28124.0 | arithmeticProgressionSumFunc | +| 84 | Converts decimal to octal | The decimal number 2245 in Octal is: | 0o4305 | decimalToOctalFunc | +| 85 | Converts decimal to Roman Numerals | The number 1658 in Roman Numerals is: | MDCLVIII | decimalToRomanNumeralsFunc | +| 86 | Degrees to Radians | Angle 12 in radians is = | 0.21 | degreeToRadFunc | | 87 | Radians to Degrees | Angle 3 in degrees is = | 171.89 | radianToDegFunc | diff --git a/makeReadme.py b/makeReadme.py index fb2894c..c17e15b 100644 --- a/makeReadme.py +++ b/makeReadme.py @@ -1,5 +1,3 @@ -# To use, paste at bottom of mathgen.py code, change line variable and remove all table rows in README.md except for the top 2 and run mathgen.py -# NOTE: not anymore. but still leaving this comment in. from mathgenerator.mathgen import * @@ -20,12 +18,9 @@ with open('mathgenerator/mathgen.py', 'r') as f: lines = f.readlines() allRows = [] -# get the first line of the functions in mathgen.py -# line = lines.index('# Funcs_start - DO NOT REMOVE!\n') + 1 for item in wList: myGen = item[2] # NOTE: renamed 'sol' to 'solu' to make it look nicer - # print(item[3]) prob, solu = myGen() prob = str(prob).rstrip("\n") solu = str(solu).rstrip("\n") @@ -37,15 +32,10 @@ for item in wList: prob = array2markdown_table(prob) solu = array2markdown_table(solu) - # instName = lines[line] # NOTE: renamed 'def_name' to 'func_name' because it suits it more - #func_name = instName[:instName.find('=')].strip() func_name = item[3] row = [myGen.id, myGen.title, prob, solu, func_name] print('added', item[1], '-', func_name, 'to the README.md') - # line += 1 - # if line > len(lines): - # break allRows.append(row) with open('README.md', "r") as g: diff --git a/mathgenerator/__init__.py b/mathgenerator/__init__.py index 33669b5..c4cea28 100644 --- a/mathgenerator/__init__.py +++ b/mathgenerator/__init__.py @@ -14,7 +14,7 @@ class Generator: (filename, line_number, function_name, text) = traceback.extract_stack()[-2] funcname = filename[filename.rfind('/'):].strip() funcname = funcname[1:-3] - print(funcname) + # print(funcname) genList.append([id, title, self, funcname]) def __str__(self): diff --git a/mathgenerator/funcs/dataSummaryFunc.py b/mathgenerator/funcs/dataSummaryFunc.py index cd5db00..9cd5a8f 100644 --- a/mathgenerator/funcs/dataSummaryFunc.py +++ b/mathgenerator/funcs/dataSummaryFunc.py @@ -16,16 +16,13 @@ def dataSummaryFunc(number_values=15, minval=5, maxval=50): for i in range(number_values): var += (random_list[i] - mean)**2 - # we're printing stuff here? - print(random_list) - print(mean) - print(var / number_values) - print((var / number_values)**0.5) + standardDeviation = var / number_values + variance = (var / number_values) ** 0.5 problem = "Find the mean,standard deviation and variance for the data" + \ str(random_list) solution = "The Mean is {} , Standard Deviation is {}, Variance is {}".format( - mean, var / number_values, (var / number_values)**0.5) + mean, standardDeviation, variance) return problem, solution