This commit is contained in:
D-T-666
2020-10-19 18:44:37 +04:00
3 changed files with 14 additions and 0 deletions

View File

@@ -79,3 +79,4 @@ from .binary2sComplement import *
from .matrixInversion import *
from .sectorAreaFunc import*
from .meanMedianFunc import*
from .determinantToMatrix22 import *

View File

@@ -0,0 +1,12 @@
from .__init__ import *
def determinantToMatrix22(maxMatrixVal = 100):
a = random.randint(0, maxMatrixVal)
b = random.randint(0, maxMatrixVal)
c = random.randint(0, maxMatrixVal)
d = random.randint(0, maxMatrixVal)
determinant = a*d - b*c
problem = f"Det([[{a}, {b}], [{c}, {d}]]) = "
solution = f" {determinant}"
return problem, solution

View File

@@ -111,3 +111,4 @@ binary2sComplement = Generator("Binary 2's Complement", 73, "2's complement of 1
invertmatrix = Generator("Inverse of a Matrix", 74, "Inverse of a matrix A is", "A^(-1)", matrixInversion)
sectorArea=Generator("Area of a Sector", 75,"Area of a sector with radius, r and angle, a ","Area",sectorAreaFunc)
meanMedian=Generator("Mean and Median", 76,"Mean and median of given set of numbers","Mean, Median",meanMedianFunc)
intMatrix22determinant = Generator("Determinant to 2x2 Matrix", 77, "Det([[a,b],[c,d]]) =", " a * d - b * c", determinantToMatrix22)