コード例 #1
0
    def cochran(sd, data, rnge):
        z = zScore.zScore(data)
        p = PopulationProportion.proportion(sd, data, rnge)
        e = MarginError.marginError(sd, data)
        q = 1 - p

        cochran = (Exponentiation.sqr(z, 2) * p * q) / Exponentiation.sqr(e, 2)

        return cochran
コード例 #2
0
    def sampleSize(sd, data):

        e = MarginError.margin(sd, data)
        stdDev = StandardDeviation.standardDeviation(data)
        val = (1.96 * stdDev) / e
        sample = Exponentiation.exponent(val, 2)

        return sample
コード例 #3
0
    def sampleSize(sd, data, percentage):
        z = Zscore.zscore(sd, data)
        e = MarginError.margin(sd, data)
        p = percentage
        q = 1 - p
        val = z / e
        sample = Exponentiation.exponent(val, 2) * p * q

        return sample
コード例 #4
0
    def sampleSize(sd, data, percentage):
        z = zScore.zScore(sd)
        e = MarginError.marginError(sd, data)
        p = percentage
        q = 1 - p
        val = z/e
        sample = Exponentiation.sqr(val, 2) * p * q

        return sample
コード例 #5
0
 def test_MathOperations_exponentiation(self):
     self.assertEqual(4, Exponentiation.exponentiation(2, 2))
コード例 #6
0
 def test_MathOperations_exponentiation(self):
     self.assertEqual(8, Exponentiation.power(2, 3))
コード例 #7
0
 def test_MathOperations_exponent(self):
     self.assertEqual(81, Exponentiation.exponent(9, 2))
コード例 #8
0
 def test_MathOperations_exponentiation(self):
     Exponentiation.power(2, 2)
     self.assertEqual(4, Exponentiation.power(2, 2))
コード例 #9
0
ファイル: Calculator.py プロジェクト: njitsuarez/OOP
 def Exponentiation(self, a, b):
     self.Result = Exponentiation.exponentiation(a, b)
     return self.Result
コード例 #10
0
def Power(a, b):
    return Exponentiation.power(a, b)
コード例 #11
0
ファイル: calculator.py プロジェクト: Benlnj33/BasicCalc
 def Power(self, a, b):
     self.Result = Exponentiation.power(a, b)
     return math.pow(a, b)
コード例 #12
0
 def test_MathOperations_Exponentiation(self):
     self.assertEqual(16, Exponentiation.power(4, 2))
コード例 #13
0
 def test_MathOperations_Exponentiation(self):
     self.assertEqual(27, Exponentiation.exponentiation(3, 3))
コード例 #14
0
 def Power(self, a, b):
     self.Result = Exponentiation.power(a, b)
コード例 #15
0
 def Exponent(self, a, b):
     self.Result = Exponentiation.sqr(a, b)
     return self.Result