示例#1
0
 def test_3d10_target_10(self):
     self.assertEqual(
         calc.probability_of_success(size=10, k=3, target=10), 0.3
     )
示例#2
0
 def test_1d6_target_6(self):
     self.assertEqual(
         calc.probability_of_success(size=6, k=1, target=6),
         1.0 / 6
     )
示例#3
0
 def test_3d10_target_5(self):
     self.assertAlmostEqual(
         calc.probability_of_success(size=10, k=3, target=5),
         0.9666666667,
         places=10,
     )
示例#4
0
 def test_d10_target_1(self):
     self.assertEqual(
         calc.probability_of_success(size=10, k=3, target=1), 1.0
     )
示例#5
0
 def test_2d6_target_6(self):
     self.assertAlmostEqual(
         calc.probability_of_success(size=6, k=2, target=6),
         0.3333333333,
         places=10,
     )
示例#6
0
 def test_2d6_target_1(self):
     self.assertEqual(
         calc.probability_of_success(size=6, k=2, target=1), 1.0
     )
示例#7
0
 def test_1d8_target_8(self):
     self.assertEqual(
         calc.probability_of_success(size=8, k=1, target=8),
         1.0 / 8
     )