Merge branch 'master' into helplessThor-deci-hex

This commit is contained in:
Luke Weiler
2020-10-19 11:06:19 -04:00
committed by GitHub
6 changed files with 44 additions and 1 deletions

View File

@@ -77,4 +77,7 @@ from .absoluteDifferenceFunc import *
from .vectorDotFunc import *
from .binary2sComplement import *
from .matrixInversion import *
from .sectorAreaFunc import*
from .meanMedianFunc import*
from .determinantToMatrix22 import *
from .deciToHexaFunc 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

@@ -0,0 +1,13 @@
from .__init__ import *
def meanMedianFunc(maxlen = 10):
randomlist = random.sample(range(1, 99), maxlen)
total = 0
for n in randomlist:
total = total + n
mean = total/10
problem = f"Given the series of numbers {randomlist}. find the arithmatic mean and mdian of the series"
randomlist.sort()
median = (randomlist[4]+randomlist[5])/2
solution = f"Arithmetic mean of the series is {mean} and Arithmetic median of this series is {median}"
return problem, solution

View File

@@ -0,0 +1,10 @@
from .__init__ import *
def sectorAreaFunc(maxRadius = 49,maxAngle = 359):
Radius = random.randint(1, maxRadius)
Angle = random.randint(1, maxAngle)
problem = f"Given radius, {Radius} and angle, {Angle}. Find the area of the sector."
secArea = float((Angle / 360) * math.pi*Radius*Radius)
formatted_float = "{:.5f}".format(secArea)
solution = f"Area of sector = {formatted_float}"
return problem, solution