diff --git a/README.md b/README.md index 39cce4e..1500dac 100644 --- a/README.md +++ b/README.md @@ -31,105 +31,108 @@ problem, solution = mathgen.genById(0) | Id | Skill | Example problem | Example Solution | Function Name | |------|-----------------------------------|--------------------|-----------------------|--------------------------| [//]: # list start -| 0 | Addition | 6+34= | 40 | addition | -| 1 | Subtraction | 66-1= | 65 | subtraction | -| 2 | Multiplication | 69*1= | 69 | multiplication | -| 3 | Division | 19/52= | 0.36538461538461536 | division | -| 4 | Binary Complement 1s | 10000= | 01111 | binary_complement_1s | -| 5 | Modulo Division | 79%84= | 79 | modulo_division | -| 6 | Square Root | sqrt(64)= | 8 | square_root | -| 7 | Power Rule Differentiation | 2x^8 + 6x^2 + 10x^7 | 16x^7 + 12x^1 + 70x^6 | power_rule_differentiation | -| 8 | Square | 18^2= | 324 | square | -| 9 | LCM (Least Common Multiple) | LCM of 1 and 14 = | 14 | lcm | -| 10 | GCD (Greatest Common Denominator) | GCD of 5 and 7 = | 1 | gcd | -| 11 | Basic Algebra | 8x + 1 = 9 | 8 | basic_algebra | -| 12 | Logarithm | log2(32) | 5 | log | -| 13 | Easy Division | 165/11 = | 15 | int_division | -| 14 | Decimal to Binary | Binary of 95= | 1011111 | decimal_to_binary | -| 15 | Binary to Decimal | 1111001000 | 968 | binary_to_decimal | -| 16 | Fraction Division | (3/8)/(1/3) | 9/8 | divide_fractions | -| 17 | Integer Multiplication with 2x2 Matrix | 11 * [[9, 6], [9, 9]] = | [[99,66],[99,99]] | multiply_int_to_22_matrix | -| 18 | Area of Triangle | Area of triangle with side lengths: 2 3 9 = | (1.0246130234694952e-15+16.73320053068151j) | area_of_triangle | -| 19 | Triangle exists check | Does triangle with sides 15, 24 and 22 exist? | Yes | valid_triangle | -| 20 | Midpoint of the two point | (8,-11),(8,-6)= | (8.0,-8.5) | midpoint_of_two_points | -| 21 | Factoring Quadratic | x^2+7x+10 | (x+5)(x+2) | factoring | -| 22 | Third Angle of Triangle | Third angle of triangle with angles 53 and 11 = | 116 | third_angle_of_triangle | -| 23 | Solve a System of Equations in R^2 | -8x - 2y = 78, -8x + 3y = 63 | x = -9, y = -3 | system_of_equations | -| 24 | Distance between 2 points | Find the distance between (-9, -20) and (17, -19) | sqrt(677) | distance_two_points | -| 25 | Pythagorean Theorem | The hypotenuse of a right triangle given the other two lengths 17 and 10 = | 19.72 | pythagorean_theorem | -| 26 | Linear Equations | 20x + -5y = -240, -8x + -9y = -36 | x = -9, y = 12 | linear_equations | -| 27 | Prime Factorisation | Find prime factors of 60 | [2, 2, 3, 5] | prime_factors | -| 28 | Fraction Multiplication | (10/8)*(2/8) | 5/16 | fraction_multiplication | -| 29 | Angle of a Regular Polygon | Find the angle of a regular polygon with 4 sides | 90.0 | angle_regular_polygon | -| 30 | Combinations of Objects | Number of combinations from 10 objects picked 1 at a time | 10 | combinations | -| 31 | Factorial | 3! = | 6 | factorial | -| 32 | Surface Area of Cube | Surface area of cube with side = 5m is | 150 m^2 | surface_area_cube | -| 33 | Surface Area of Cuboid | Surface area of cuboid with sides = 20m, 2m, 4m is | 256 m^2 | surface_area_cuboid | -| 34 | Surface Area of Cylinder | Surface area of cylinder with height = 4m and radius = 6m is | 376 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 = 10m, 6m, 17m is | 1020 m^3 | volume_cuboid | -| 37 | Volume of cylinder | Volume of cylinder with height = 50m and radius = 14m is | 30787 m^3 | volume_cylinder | -| 38 | Surface Area of cone | Surface area of cone with height = 9m and radius = 5m is | 240 m^2 | surface_area_cone | -| 39 | Volume of cone | Volume of cone with height = 26m and radius = 9m is | 2205 m^3 | volume_cone | -| 40 | Common Factors | Common Factors of 85 and 23 = | [1] | common_factors | -| 41 | Intersection of Two Lines | Find the point of intersection of the two lines: y = -8/2x + 6 and y = -7/5x + 5 | (5/13, 58/13) | intersection_of_two_lines | -| 42 | Permutations | Number of Permutations from 18 objects picked 9 at a time = | 17643225600 | permutation | -| 43 | Cross Product of 2 Vectors | [-9, -11, -7] X [-6, -14, 4] = | [-142, 78, 60] | vector_cross | -| 44 | Compare Fractions | Which symbol represents the comparison between 9/1 and 9/4? | > | compare_fractions | -| 45 | Simple Interest | Simple interest for a principle amount of 6270 dollars, 4% rate of interest and for a time period of 8 years is = | 2006.4 | simple_interest | -| 46 | Multiplication of two matrices | Multiply
8-41
22-1
and
3-5-4
2-10-7
8-87
|
24-83
2-22-29
| matrix_multiplication | -| 47 | Cube Root | cuberoot of 462 upto 2 decimal places is: | 7.73 | cube_root | -| 48 | Power Rule Integration | 3x^5 | (3/5)x^6 + c | power_rule_integration | -| 49 | Fourth Angle of Quadrilateral | Fourth angle of quadrilateral with angles 173 , 63, 34 = | 90 | fourth_angle_of_quadrilateral | -| 50 | Quadratic Equation | Zeros of the Quadratic Equation 64x^2+175x+26=0 | [-0.16, -2.58] | quadratic_equation | -| 51 | HCF (Highest Common Factor) | HCF of 15 and 3 = | 3 | hcf | -| 52 | Probability of a certain sum appearing on faces of dice | If 3 dice are rolled at the same time, the probability of getting a sum of 13 = | 21/216 | dice_sum_probability | -| 53 | Exponentiation | 11^9 = | 2357947691 | exponentiation | -| 54 | Confidence interval For sample S | The confidence interval for sample [234, 272, 289, 255, 291, 219, 225, 282, 266, 288, 259, 269, 275, 260, 262, 250, 270, 241, 287, 294, 200, 210, 298, 273] with 90% confidence is | (270.221486487058, 252.19518017960863) | confidence_interval | -| 55 | Comparing surds | Fill in the blanks 22^(1/2) _ 74^(1/6) | > | surds_comparison | -| 56 | Fibonacci Series | The Fibonacci Series of the first 14 numbers is ? | [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233] | fibonacci_series | -| 57 | Trigonometric Values | What is sin(90)? | 1 | basic_trigonometry | -| 58 | Sum of Angles of Polygon | Sum of angles of polygon with 12 sides = | 1800 | sum_of_polygon_angles | -| 59 | Mean,Standard Deviation,Variance | Find the mean,standard deviation and variance for the data[29, 50, 21, 44, 44, 17, 34, 47, 7, 10, 26, 7, 6, 49, 21] | The Mean is 27.466666666666665 , Standard Deviation is 249.5822222222222, Variance is 15.798171483504735 | data_summary | -| 60 | Surface Area of Sphere | Surface area of Sphere with radius = 8m is | 804.247719318987 m^2 | surface_area_sphere | -| 61 | Volume of Sphere | Volume of sphere with radius 80 m = | 2144660.584850632 m^3 | volume_sphere | -| 62 | nth Fibonacci number | What is the 4th Fibonacci number? | 3 | nth_fibonacci_number | -| 63 | Profit or Loss Percent | Profit percent when CP = 37 and SP = 447 is: | 1108.1081081081081 | profit_loss_percent | -| 64 | Binary to Hexidecimal | 01100001 | 0x61 | binary_to_hex | -| 65 | Multiplication of 2 complex numbers | (17+7j) * (7+14j) = | (21+287j) | multiply_complex_numbers | -| 66 | Geometric Progression | For the given GP [12, 60, 300, 1500, 7500, 37500] ,Find the value of a,common ratio,8th term value, sum upto 6th term | The value of a is 12, common ratio is 5 , 8th term is 937500 , sum upto 6th term is 46872.0 | geometric_progression | -| 67 | Geometric Mean of N Numbers | Geometric mean of 2 numbers 46 and 20 = | (46*20)^(1/2) = 30.331501776206203 | geometric_mean | -| 68 | Harmonic Mean of N Numbers | Harmonic mean of 2 numbers 35 and 3 = | 2/((1/35) + (1/3)) = 5.526315789473684 | harmonic_mean | -| 69 | Euclidian norm or L2 norm of a vector | Euclidian norm or L2 norm of the vector[653.9717397584312, 689.1069921882294, 19.887404949723187, 17.33889409833278, 762.6266577725075, 189.70375690805275, 673.7332899787874] is: | 1405.2569550674714 | euclidian_norm | -| 70 | Angle between 2 vectors | angle between the vectors [638.9, 178.91, 936.86, 859.08, 27.18, 730.15, 513.96, 244.4, 698.55] and [546.02, 51.57, 631.8, 932.17, 558.58, 598.42, 537.63, 334.25, 289.47] is: | 0.43 radians | angle_btw_vectors | -| 71 | Absolute difference between two numbers | Absolute difference between numbers -98 and 73 = | 171 | absolute_difference | -| 72 | Dot Product of 2 Vectors | [11, -12, -15] . [1, -1, 3] = | -22 | vector_dot | -| 73 | Binary 2's Complement | 2's complement of 1 = | 1 | binary_2s_complement | -| 74 | Inverse of a Matrix | Inverse of Matrix Matrix([[75, 30, 13], [5, 89, 16], [74, 48, 59]]) is: | Matrix([[4483/280397, -1146/280397, -677/280397], [889/280397, 3463/280397, -1135/280397], [-6346/280397, -1380/280397, 6525/280397]]) | invert_matrix | -| 75 | Area of a Sector | Given radius, 18 and angle, 137. Find the area of the sector. | Area of sector = 387.35837 | sector_area | -| 76 | Mean and Median | Given the series of numbers [80, 93, 16, 39, 48, 88, 7, 95, 40, 2]. find the arithmatic mean and mdian of the series | Arithmetic mean of the series is 50.8 and Arithmetic median of this series is 44.0 | mean_median | -| 77 | Determinant to 2x2 Matrix | Det([[68, 11], [22, 34]]) = | 2070 | int_matrix_22_determinant | -| 78 | Compound Interest | Compound interest for a principle amount of 6075 dollars, 8% rate of interest and for a time period of 9 year is = | 12143.95 | compound_interest | -| 79 | Decimal to Hexadecimal | Binary of 716= | 0x2cc | decimal_to_hexadeci | -| 80 | Percentage of a number | What is 13% of 5? | Required percentage = 0.65% | percentage | -| 81 | Celsius To Fahrenheit | Convert -42 degrees Celsius to degrees Fahrenheit = | -43.60000000000001 | celsius_to_fahrenheit | -| 82 | AP Term Calculation | Find the term number 11 of the AP series: -17, 71, 159 ... | 863 | arithmetic_progression_term | -| 83 | AP Sum Calculation | Find the sum of first 80 terms of the AP series: 2, 86, 170 ... | 265600.0 | arithmetic_progression_sum | -| 84 | Converts decimal to octal | The decimal number 3350 in Octal is: | 0o6426 | decimal_to_octal | -| 85 | Converts decimal to Roman Numerals | The number 1203 in Roman Numerals is: | MCCIII | decimal_to_roman_numerals | +| 0 | Addition | 15+24= | 39 | addition | +| 1 | Subtraction | 25-1= | 24 | subtraction | +| 2 | Multiplication | 1*88= | 88 | multiplication | +| 3 | Division | 42/80= | 0.525 | division | +| 4 | Binary Complement 1s | 00100011= | 11011100 | binary_complement_1s | +| 5 | Modulo Division | 27%18= | 9 | modulo_division | +| 6 | Square Root | sqrt(36)= | 6 | square_root | +| 7 | Power Rule Differentiation | 1x^7 | 7x^6 | power_rule_differentiation | +| 8 | Square | 15^2= | 225 | square | +| 9 | LCM (Least Common Multiple) | LCM of 19 and 6 = | 114 | lcm | +| 10 | GCD (Greatest Common Denominator) | GCD of 14 and 17 = | 1 | gcd | +| 11 | Basic Algebra | 8x + 10 = 10 | 0 | basic_algebra | +| 12 | Logarithm | log3(3) | 1 | log | +| 13 | Easy Division | 169/13 = | 13 | int_division | +| 14 | Decimal to Binary | Binary of 55= | 110111 | decimal_to_binary | +| 15 | Binary to Decimal | 0 | 0 | binary_to_decimal | +| 16 | Fraction Division | (1/3)/(8/4) | 1/6 | divide_fractions | +| 17 | Integer Multiplication with 2x2 Matrix | 2 * [[6, 1], [9, 2]] = | [[12,2],[18,4]] | multiply_int_to_22_matrix | +| 18 | Area of Triangle | Area of triangle with side lengths: 10 12 1 = | (5.827134701491688e-16+9.51643315533714j) | area_of_triangle | +| 19 | Triangle exists check | Does triangle with sides 24, 11 and 22 exist? | Yes | valid_triangle | +| 20 | Midpoint of the two point | (-1,6),(4,13)= | (1.5,9.5) | midpoint_of_two_points | +| 21 | Factoring Quadratic | x^2-15x+54 | (x-6)(x-9) | factoring | +| 22 | Third Angle of Triangle | Third angle of triangle with angles 30 and 49 = | 101 | third_angle_of_triangle | +| 23 | Solve a System of Equations in R^2 | -x + 3y = 23, 2x + 6y = 74 | x = 7, y = 10 | system_of_equations | +| 24 | Distance between 2 points | Find the distance between (-2, -1) and (9, 21) | sqrt(605) | distance_two_points | +| 25 | Pythagorean Theorem | The hypotenuse of a right triangle given the other two lengths 1 and 2 = | 2.24 | pythagorean_theorem | +| 26 | Linear Equations | -3x + 5y = 47, -2x + 5y = 63 | x = 16, y = 19 | linear_equations | +| 27 | Prime Factorisation | Find prime factors of 58 | [2, 29] | prime_factors | +| 28 | Fraction Multiplication | (3/5)*(5/9) | 1/3 | fraction_multiplication | +| 29 | Angle of a Regular Polygon | Find the angle of a regular polygon with 6 sides | 120.0 | angle_regular_polygon | +| 30 | Combinations of Objects | Number of combinations from 14 objects picked 8 at a time | 3003 | combinations | +| 31 | Factorial | 1! = | 1 | factorial | +| 32 | Surface Area of Cube | Surface area of cube with side = 10m is | 600 m^2 | surface_area_cube | +| 33 | Surface Area of Cuboid | Surface area of cuboid with sides = 7m, 20m, 12m is | 928 m^2 | surface_area_cuboid | +| 34 | Surface Area of Cylinder | Surface area of cylinder with height = 33m and radius = 6m is | 1470 m^2 | surface_area_cylinder | +| 35 | Volum of Cube | Volume of cube with side = 18m is | 5832 m^3 | volume_cube | +| 36 | Volume of Cuboid | Volume of cuboid with sides = 3m, 20m, 20m is | 1200 m^3 | volume_cuboid | +| 37 | Volume of cylinder | Volume of cylinder with height = 14m and radius = 10m is | 4398 m^3 | volume_cylinder | +| 38 | Surface Area of cone | Surface area of cone with height = 19m and radius = 1m is | 62 m^2 | surface_area_cone | +| 39 | Volume of cone | Volume of cone with height = 17m and radius = 13m is | 3008 m^3 | volume_cone | +| 40 | Common Factors | Common Factors of 81 and 74 = | [1] | common_factors | +| 41 | Intersection of Two Lines | Find the point of intersection of the two lines: y = -7/2x - 5 and y = -10/4x + 6 | (-11, 67/2) | intersection_of_two_lines | +| 42 | Permutations | Number of Permutations from 17 objects picked 8 at a time = | 980179200 | permutation | +| 43 | Cross Product of 2 Vectors | [3, -10, 2] X [8, 8, -9] = | [74, 43, 104] | vector_cross | +| 44 | Compare Fractions | Which symbol represents the comparison between 5/6 and 10/7? | < | compare_fractions | +| 45 | Simple Interest | Simple interest for a principle amount of 1332 dollars, 7% rate of interest and for a time period of 8 years is = | 745.92 | simple_interest | +| 46 | Multiplication of two matrices | Multiply
2-10-8
-1060
00-2
6-1-2
and
-17-3
-10-810
773
|
4238-130
-50-11890
-14-14-6
-1036-34
| matrix_multiplication | +| 47 | Cube Root | cuberoot of 845 upto 2 decimal places is: | 9.45 | cube_root | +| 48 | Power Rule Integration | 10x^7 + 7x^2 + 1x^10 + 9x^10 + 6x^1 | (10/7)x^8 + (7/2)x^3 + (1/10)x^11 + (9/10)x^11 + (6/1)x^2 + c | power_rule_integration | +| 49 | Fourth Angle of Quadrilateral | Fourth angle of quadrilateral with angles 24 , 205, 108 = | 23 | fourth_angle_of_quadrilateral | +| 50 | Quadratic Equation | Zeros of the Quadratic Equation 4x^2+38x+53=0 | [-1.7, -7.8] | quadratic_equation | +| 51 | HCF (Highest Common Factor) | HCF of 3 and 5 = | 1 | hcf | +| 52 | Probability of a certain sum appearing on faces of dice | If 1 dice are rolled at the same time, the probability of getting a sum of 6 = | 1/6 | dice_sum_probability | +| 53 | Exponentiation | 13^7 = | 62748517 | exponentiation | +| 54 | Confidence interval For sample S | The confidence interval for sample [246, 234, 252, 233, 250, 229, 272, 299, 214, 287, 263, 237, 209, 279, 230, 244, 265, 284, 266, 260] with 90% confidence is | (261.450577042693, 243.849422957307) | confidence_interval | +| 55 | Comparing surds | Fill in the blanks 61^(1/3) _ 54^(1/6) | > | surds_comparison | +| 56 | Fibonacci Series | The Fibonacci Series of the first 12 numbers is ? | [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] | fibonacci_series | +| 57 | Trigonometric Values | What is tan(60)? | √3 | basic_trigonometry | +| 58 | Sum of Angles of Polygon | Sum of angles of polygon with 10 sides = | 1440 | sum_of_polygon_angles | +| 59 | Mean,Standard Deviation,Variance | Find the mean,standard deviation and variance for the data[48, 15, 20, 21, 30, 17, 8, 13, 27, 7, 41, 34, 50, 18, 19] | The Mean is 24.533333333333335 , Standard Deviation is 170.91555555555558, Variance is 13.073467617872298 | data_summary | +| 60 | Surface Area of Sphere | Surface area of Sphere with radius = 18m is | 4071.5040790523717 m^2 | surface_area_sphere | +| 61 | Volume of Sphere | Volume of sphere with radius 32 m = | 137258.27743044044 m^3 | volume_sphere | +| 62 | nth Fibonacci number | What is the 67th Fibonacci number? | 44945570212853 | nth_fibonacci_number | +| 63 | Profit or Loss Percent | Profit percent when CP = 15 and SP = 981 is: | 6440.000000000001 | profit_loss_percent | +| 64 | Binary to Hexidecimal | 1011 | 0xb | binary_to_hex | +| 65 | Multiplication of 2 complex numbers | (-13-6j) * (-13-17j) = | (67+299j) | multiply_complex_numbers | +| 66 | Geometric Progression | For the given GP [7, 49, 343, 2401, 16807, 117649] ,Find the value of a,common ratio,6th term value, sum upto 9th term | The value of a is 7, common ratio is 7 , 6th term is 117649 , sum upto 9th term is 47079207.0 | geometric_progression | +| 67 | Geometric Mean of N Numbers | Geometric mean of 3 numbers 67 , 39 and 61 = | (67*39*61)^(1/3) = 54.2196131865444 | geometric_mean | +| 68 | Harmonic Mean of N Numbers | Harmonic mean of 2 numbers 51 and 18 = | 2/((1/51) + (1/18)) = 26.608695652173914 | harmonic_mean | +| 69 | Euclidian norm or L2 norm of a vector | Euclidian norm or L2 norm of the vector[475.73215854843386, 666.5961230551579, 318.8322922614731, 347.0393782548222, 132.48630879767597, 29.71776575489249, 241.27251126475247, 183.2591565913506, 829.9340763816024, 450.0454983692942, 227.01770730801584, 543.7951344512942, 704.1995480202837, 416.40405265214866] is: | 1706.1257272861317 | euclidian_norm | +| 70 | Angle between 2 vectors | angle between the vectors [520.47, 629.68, 925.7, 911.2, 727.7, 843.94, 808.55, 80.4, 157.49, 661.37, 877.4, 196.54, 283.16, 69.83] and [840.19, 459.69, 241.22, 334.45, 5.59, 696.72, 776.19, 223.28, 414.7, 875.6, 837.18, 68.45, 863.78, 961.51] is: | 0.72 radians | angle_btw_vectors | +| 71 | Absolute difference between two numbers | Absolute difference between numbers 6 and -66 = | 72 | absolute_difference | +| 72 | Dot Product of 2 Vectors | [-7, -13, -11] . [0, -3, -17] = | 226 | vector_dot | +| 73 | Binary 2's Complement | 2's complement of 10110 = | 1010 | binary_2s_complement | +| 74 | Inverse of a Matrix | Inverse of Matrix Matrix([[1, 94, 7], [25, 90, 5], [73, 43, 60]]) is: | Matrix([[-1037/27994, 5339/139970, 16/13997], [227/27994, 451/139970, -17/13997], [1099/27994, -6819/139970, 226/13997]]) | invert_matrix | +| 75 | Area of a Sector | Given radius, 21 and angle, 2. Find the area of the sector. | Area of sector = 7.69690 | sector_area | +| 76 | Mean and Median | Given the series of numbers [96, 45, 60, 15, 20, 4, 29, 36, 69, 47]. find the arithmatic mean and mdian of the series | Arithmetic mean of the series is 42.1 and Arithmetic median of this series is 40.5 | mean_median | +| 77 | Determinant to 2x2 Matrix | Det([[59, 81], [33, 79]]) = | 1988 | int_matrix_22_determinant | +| 78 | Compound Interest | Compound interest for a principle amount of 8179 dollars, 7% rate of interest and for a time period of 1 year is = | 8751.53 | compound_interest | +| 79 | Decimal to Hexadecimal | Binary of 106= | 0x6a | decimal_to_hexadeci | +| 80 | Percentage of a number | What is 5% of 98? | Required percentage = 4.90% | percentage | +| 81 | Celsius To Fahrenheit | Convert 67 degrees Celsius to degrees Fahrenheit = | 152.60000000000002 | celsius_to_fahrenheit | +| 82 | AP Term Calculation | Find the term number 56 of the AP series: -55, -142, -229 ... | -4840 | arithmetic_progression_term | +| 83 | AP Sum Calculation | Find the sum of first 46 terms of the AP series: 96, 169, 242 ... | 79971.0 | arithmetic_progression_sum | +| 84 | Converts decimal to octal | The decimal number 7 in Octal is: | 0o7 | decimal_to_octal | +| 85 | Converts decimal to Roman Numerals | The number 2558 in Roman Numerals is: | MMDLVIII | decimal_to_roman_numerals | | 86 | Degrees to Radians | Angle 313 in radians is = | 5.46 | degree_to_rad | -| 87 | Radians to Degrees | Angle 1 in degrees is = | 57.3 | radian_to_deg | -| 88 | Differentiation | differentiate w.r.t x : d(cos(x)+6*x^(-2))/dx | -sin(x) - 12/x^3 | differentiation | -| 89 | Definite Integral of Quadratic Equation | The definite integral within limits 0 to 1 of the equation 24x^2 + 13x + 13 is = | 27.5 | definite_integral | -| 90 | isprime | 84 | False | is_prime | -| 91 | Binary Coded Decimal to Integer | Integer of Binary Coded Decimal 1 is = | 5458 | bcd_to_decimal | -| 92 | Complex To Polar Form | rexp(itheta) = | 12.21exp(i0.61) | complex_to_polar | -| 93 | Union,Intersection,Difference of Two Sets | Given the two sets a={10, 3, 4, 7} ,b={2, 5, 6, 7}.Find the Union,intersection,a-b,b-a and symmetric difference | Union is {2, 3, 4, 5, 6, 7, 10},Intersection is {7}, a-b is {10, 3, 4},b-a is {2, 5, 6}, Symmetric difference is {2, 3, 4, 5, 6, 10} | set_operation | -| 94 | Base Conversion | Convert 44854 from base 10 to base 2. | 1010111100110110 | base_conversion | -| 95 | Curved surface area of a cylinder | What is the curved surface area of a cylinder of radius, 1 and height, 20? | CSA of cylinder = 125.66 | curved_surface_area_cylinder | -| 96 | Perimeter of Polygons | The perimeter of a 9 sided polygon with lengths of [35, 114, 106, 106, 66, 53, 18, 96, 27]cm is: | 621 | perimeter_of_polygons | -| 97 | Power of Powers | The 15^7^6 = 15^(7*6) = 15^42 | 24878997722115027320114677422679960727691650390625 | power_of_powers | -| 98 | Quotient of Powers with Same Base | The Quotient of 47^3 and 47^10 = 47^(3-10) = 47^-7 | 1.973853856267171e-12 | quotient_of_power_same_base | -| 99 | Quotient of Powers with Same Power | The Quotient of 34^1 and 17^1 = (34/17)^1 = 2.0^1 | 2.0 | quotient_of_power_same_power | -| 100 | complex Quadratic Equation | Find the roots of given Quadratic Equation 4x^2 + 8x + 3 = 0 | simplified solution : ((-0.5, -1.5)), generalized solution : ((-8 + 4)/2*4, (-8 - 4)/2*4) | complex_quadratic | -| 101 | Conditional Probability | Someone tested positive for a nasty disease which only 1.61% of population have. Test sensitivity (true positive) is equal to SN= 93.28% whereas test specificity (true negative) SP= 92.26%. What is the probability that this guy really has that disease? | 16.47% | conditionalProbability | +| 87 | Radians to Degrees | Angle 0 in degrees is = | 0.0 | radian_to_deg | +| 88 | Differentiation | differentiate w.r.t x : d(sin(x)+2*x^(-3))/dx | cos(x) - 6/x^4 | differentiation | +| 89 | Definite Integral of Quadratic Equation | The definite integral within limits 0 to 1 of the equation 22x^2 + 32x + 88 is = | 111.3333 | definite_integral | +| 90 | isprime | 28 | False | is_prime | +| 91 | Binary Coded Decimal to Integer | Integer of Binary Coded Decimal 6 is = | 25632 | bcd_to_decimal | +| 92 | Complex To Polar Form | rexp(itheta) = | 23.85exp(i-2.15) | complex_to_polar | +| 93 | Union,Intersection,Difference of Two Sets | Given the two sets a={1, 2, 5, 6, 7, 9} ,b={9, 3, 6, 7}.Find the Union,intersection,a-b,b-a and symmetric difference | Union is {1, 2, 3, 5, 6, 7, 9},Intersection is {9, 6, 7}, a-b is {1, 2, 5},b-a is {3}, Symmetric difference is {1, 2, 3, 5} | set_operation | +| 94 | Base Conversion | Convert 215 from base 16 to base 2. | 1000010101 | base_conversion | +| 95 | Curved surface area of a cylinder | What is the curved surface area of a cylinder of radius, 3 and height, 33? | CSA of cylinder = 622.04 | curved_surface_area_cylinder | +| 96 | Perimeter of Polygons | The perimeter of a 5 sided polygon with lengths of [21, 36, 107, 101, 15]cm is: | 280 | perimeter_of_polygons | +| 97 | Power of Powers | The 47^10^9 = 47^(10*9) = 47^90 | 3081819609348702575993710664086973378213775077494296491025662508716527867059742510518129558368670228609205866092648641076825215755720847840202232380449 | power_of_powers | +| 98 | Quotient of Powers with Same Base | The Quotient of 21^2 and 21^9 = 21^(2-9) = 21^-7 | 5.552197891641574e-10 | quotient_of_power_same_base | +| 99 | Quotient of Powers with Same Power | The Quotient of 25^1 and 3^1 = (25/3)^1 = 8.333333333333334^1 | 8.333333333333334 | quotient_of_power_same_power | +| 100 | complex Quadratic Equation | Find the roots of given Quadratic Equation 3x^2 + 5x + 2 = 0 | simplified solution : ((-0.667, -1.0)), generalized solution : ((-5 + 1)/2*3, (-5 - 1)/2*3) | complex_quadratic | +| 101 | Leap Year or Not | Year 2049 | is not a leap year | is_leap_year | +| 102 | Minute to Hour conversion | Convert 960 minutes to Hours & Minutes | 16 hours and 0 minutes | minutes_to_hours | +| 103 | Decimal to Binary Coded Decimal | BCD of Decimal Number 6561 is = | 19101 | decimal_to_bcd | +| 104 | Circumference | Circumference of circle with radius 11 | 69.14285714285714 | circumference | \ No newline at end of file diff --git a/mathgenerator/funcs/__init__.py b/mathgenerator/funcs/__init__.py index bf856ee..292ca1f 100644 --- a/mathgenerator/funcs/__init__.py +++ b/mathgenerator/funcs/__init__.py @@ -105,4 +105,9 @@ from .power_of_powers import * from .quotient_of_power_same_base import * from .quotient_of_power_same_power import * from .complex_quadratic import * -from .conditionalProbability import * +from .is_leap_year import * +from .minutes_to_hours import * +from .decimal_to_bcd import * +from .circumference import * +from .combine_like_terms import * +from .conditional_probability import * \ No newline at end of file diff --git a/mathgenerator/funcs/circumference.py b/mathgenerator/funcs/circumference.py new file mode 100644 index 0000000..6c05a60 --- /dev/null +++ b/mathgenerator/funcs/circumference.py @@ -0,0 +1,13 @@ +from .__init__ import * + + +def circumferenceCircle(maxRadius=100): + r = random.randint(0, maxRadius) + pi = 22/7 + circumference = 2*pi*r + problem = f"Circumference of circle with radius {r}" + solution = circumference + return problem, solution + + +circumference = Generator("Circumference", 104, "2*pi*r=", "circumference", circumferenceCircle) diff --git a/mathgenerator/funcs/combine_like_terms.py b/mathgenerator/funcs/combine_like_terms.py new file mode 100644 index 0000000..c6b3412 --- /dev/null +++ b/mathgenerator/funcs/combine_like_terms.py @@ -0,0 +1,45 @@ +from .__init__ import * + + +def likeTermCombineFunc(maxCoef=10, maxExp=20, maxTerms=10): + numTerms = random.randint(1, maxTerms) + problem = "" + solution = "" + + for i in range(numTerms): + if i > 0: + problem += " + " + solution += " + " + coefficient = random.randint(1, maxCoef) + exponent = random.randint(1, max(numTerms - 1, 2)) + + problem += str(coefficient) + "x^" + str(exponent) + + solution = combineTerms(problem) + return problem, solution + + +def combineTerms(string): + each_terms = string.split("+") + dict_power_wise_terms = {} + for i in range(11): + dict_power_wise_terms[i] = [] + for term in each_terms: + term = term.split("^") + appendee = term[0].split("x")[0] + if len(term) == 1: + dict_power_wise_terms[1].append(int(appendee)) + else: + dict_power_wise_terms[int(term[1])].append(int(appendee)) + + final_string = '' + for i in range(11): + if len(dict_power_wise_terms[i]) != 0: + total = sum(dict_power_wise_terms[i]) + final_string += str(total) + "x^" + str(i) + " + " + final_string = '+'.join(final_string.split("+")[:-1]) + return final_string + + +combine_like_terms = Generator("Combine Like terms", 105, "nx^m+lx^k+bx^m", + "(n+b)x^m+lx^k", likeTermCombineFunc) diff --git a/mathgenerator/funcs/decimal_to_bcd.py b/mathgenerator/funcs/decimal_to_bcd.py new file mode 100644 index 0000000..5075ce0 --- /dev/null +++ b/mathgenerator/funcs/decimal_to_bcd.py @@ -0,0 +1,21 @@ +from .__init__ import * + + +def DecimalToBCDFunc(maxNumber=10000): + n = random.randint(1000, maxNumber) + x = n + # binstring = '' + bcdstring = '' + while x > 0: + nibble = x % 16 + bcdstring = str(nibble) + bcdstring + x >>= 4 + + problem = "BCD of Decimal Number " + str(n) + " is = " + solution = int(bcdstring) + return problem, solution + + +decimal_to_bcd = Generator("Decimal to Binary Coded Decimal", 103, + "Binary Coded Decimal of Decimal n is ", "b", + DecimalToBCDFunc) diff --git a/mathgenerator/funcs/is_leap_year.py b/mathgenerator/funcs/is_leap_year.py new file mode 100644 index 0000000..3f9c351 --- /dev/null +++ b/mathgenerator/funcs/is_leap_year.py @@ -0,0 +1,25 @@ +from .__init__ import * + + +def IsLeapYear(minNumber=1900, maxNumber=2099): + year = random.randint(minNumber, maxNumber) + problem = "Year " + str(year) + " " + solution = "" + if (year % 4) == 0: + if (year % 100) == 0: + if (year % 400) == 0: + solution = "is a leap year" + else: + solution = "is not a leap year" + else: + solution = "is a leap year" + else: + solution = "is not a leap year" + + return problem, solution + + +is_leap_year = Generator("Leap Year or Not", 101, + "Year y ", "is/not a leap year", + IsLeapYear) +# for readme ## | 102 | Leap Year or Not | Year 1964 | is a leap year | is_leap_year | diff --git a/mathgenerator/funcs/minutes_to_hours.py b/mathgenerator/funcs/minutes_to_hours.py new file mode 100644 index 0000000..7b52b82 --- /dev/null +++ b/mathgenerator/funcs/minutes_to_hours.py @@ -0,0 +1,14 @@ +from .__init__ import * + + +def minutesToHoursFunc(maxMinutes=999): + minutes = random.randint(1, maxMinutes) + hours1 = int(minutes / 60) + hours2 = minutes % 60 + problem = f"Convert {minutes} minutes to Hours & Minutes" + solution = f"{hours1} hours and {hours2} minutes" + return problem, solution + + +minutes_to_hours = Generator("Minute to Hour conversion", 102, + "Convert minutes to Hours & Minutes", "hours:minutes", minutesToHoursFunc) diff --git a/test.py b/test.py index ee450c0..f1f0e5d 100644 --- a/test.py +++ b/test.py @@ -10,4 +10,4 @@ from mathgenerator import mathgen # print(item[2]) # print(mathgen.getGenList()) -print(mathgen.genById(101)) +print(mathgen.genById(101)) \ No newline at end of file