Surds comparison

This commit is contained in:
ieshaan12
2020-10-17 17:24:23 +05:30
parent a4fdc4ce99
commit 7bbfec529f
2 changed files with 16 additions and 0 deletions

View File

@@ -81,3 +81,4 @@ problem, solution = mathgen.genById(0)
| 47 | Cube Root | cuberoot of 711 upto 2 decimal places is: | 8.93 | CubeRoot | | 47 | Cube Root | cuberoot of 711 upto 2 decimal places is: | 8.93 | CubeRoot |
| 48 | Power Rule Integration | 3x^1 | (3/1)x^2 + c | powerRuleIntegration | | 48 | Power Rule Integration | 3x^1 | (3/1)x^2 + c | powerRuleIntegration |
| 49 | Fourth Angle of Quadrilateral | Fourth angle of quadrilateral with angles 94 , 101, 102 = | 63 | fourthAngleOfQuadrilateral | | 49 | Fourth Angle of Quadrilateral | Fourth angle of quadrilateral with angles 94 , 101, 102 = | 63 | fourthAngleOfQuadrilateral |
| 50 | Surd Comparison | 25^(1/3) _ 37^(1/2) | < | surdsComparisonGen |

View File

@@ -714,6 +714,20 @@ def fourthAngleOfQuadriFunc(maxAngle = 180):
solution = angle4 solution = angle4
return problem, solution return problem, solution
def surdsComparison(maxValue = 100, maxRoot = 10):
radicand1,radicand2 = tuple(random.sample(range(1,maxValue),2))
degree1, degree2 = tuple(random.sample(range(1,maxRoot),2))
problem = f"Fill in the blanks {radicand1}^(1/{degree1}) _ {radicand2}^(1/{degree2})"
first = math.pow(radicand1, 1/degree1)
second = math.pow(radicand2, 1/degree2)
solution = "="
if first > second:
solution = ">"
elif first < second:
solution = "<"
return problem, solution
# || Class Instances # || Class Instances
#Format is: #Format is:
@@ -769,3 +783,4 @@ matrixMultiplication = Generator("Multiplication of two matrices", 46, "Multipl
CubeRoot = Generator("Cube Root",47,"Cuberoot of a upto 2 decimal places is","b",cubeRootFunc) CubeRoot = Generator("Cube Root",47,"Cuberoot of a upto 2 decimal places is","b",cubeRootFunc)
powerRuleIntegration = Generator("Power Rule Integration", 48, "nx^m=", "(n/m)x^(m+1)", powerRuleIntegrationFunc) powerRuleIntegration = Generator("Power Rule Integration", 48, "nx^m=", "(n/m)x^(m+1)", powerRuleIntegrationFunc)
fourthAngleOfQuadrilateral = Generator("Fourth Angle of Quadrilateral",49,"Fourth angle of Quadrilateral with angles a,b,c =","angle4",fourthAngleOfQuadriFunc) fourthAngleOfQuadrilateral = Generator("Fourth Angle of Quadrilateral",49,"Fourth angle of Quadrilateral with angles a,b,c =","angle4",fourthAngleOfQuadriFunc)
surdsComparisonGen = Generator("Comparing surds", 50, "Fill in the blanks a^(1/b) _ c^(1/d)", "</>/=", surdsComparison)