예제 #1
0
 def test_three_diamonds_hits_zero_zero(self):
     s = Solver(3)
     self.assertEqual(1.0, s.get_probability(0, 0))
예제 #2
0
 def test_one_diamond_hits_zero_zero(self):
     s = Solver(1)
     self.assertEqual(1.0, s.get_probability(0, 0))
예제 #3
0
 def test_one_diamond_misses_zero_two(self):
     s = Solver(1)
     self.assertEqual(0.0, s.get_probability(0, 2))
예제 #4
0
 def test_six_diamonds_hits_zero_two_always(self):
     s = Solver(6)
     self.assertEqual(1.0, s.get_probability(0, 2))
예제 #5
0
 def test_four_diamonds_hits_one_two_never(self):
     s = Solver(4)
     self.assertEqual(0, s.get_probability(0, 2))
예제 #6
0
 def test_four_diamonds_hits_one_one_half_the_time(self):
     s = Solver(4)
     self.assertEqual(0.5, s.get_probability(1, 1))
예제 #7
0
 def test_three_diamonds_hits_one_one_occasionally(self):
     s = Solver(3)
     self.assertEqual(0.25, s.get_probability(1, 1))
예제 #8
0
 def test_three_diamonds_hits_two_zero_often(self):
     s = Solver(3)
     self.assertEqual(0.75, s.get_probability(2, 0))