binomial_distribution 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6622daa3e81337424a264d794ab0cf6f7c86c375
4
- data.tar.gz: 725288b83c2568b74a45ad7391aa813e3c3e222c
3
+ metadata.gz: a0e15646906d992cda0f47a41a6db78e385c9a8b
4
+ data.tar.gz: 67343e4343d6e8cf6d9195e1351779ef9811f2e8
5
5
  SHA512:
6
- metadata.gz: d472d9760571bd9bb1cc2ec21b7d23d485406e67efa3afcdb57e203c3974cc32b7c813027e137bf724c6b9d769fa7896fd6bbd46cb6d9acdb84f045591208ce5
7
- data.tar.gz: e853d80ff48ffea3dee69b5f8b46ecc814f4ad626b3090144a2c2ab6e5ab8c53ac012bdb55c5d02f57460b44376ab89460735e9001d8d2fb0fc78bd167cca9cc
6
+ metadata.gz: 48bb052dac010275480ad874c9e76c0eccfb0430f7a8bc903ce66fdd96aa8ff986ef8b5b5f7b2806f81457d0d549b3e44a75e8bd193d77ec5f655c4325139c4b
7
+ data.tar.gz: fa44ab506e37268023246235d30d24abd2dc93f7f741c7775de63383933c7f35dc65594844984f8c0d19ae9ed0daef43392790f3fb40e566d39d44b788fa9e4f
@@ -1,3 +1,2 @@
1
- T�+=M9RW8���{h�5�>�{$�X�ܗ��1]�����P���Td@�R��LC7��-�R��!Y��e
2
- P聐2L�䘜q����)
3
- L{QM!�y:\@��n�m.��vI1��e��g������핇�S)����:� �v���-؅I���^�AXj
1
+ Ap��aFWjVr��CDP���g��p�V-����ȏ��~��.I�Ls�=]B�|��2�G�Iq�W_fT�`��픔Zo� �(��0�� ǓD��?m��d7��iʟn����� C�k��H:��mF�&�<��h�\�d����d
2
+ >;.0Q]��C������S`��\�>�k������ڋ3�N�xg/�㳓��c��6D���`��t���GNHa��]ʌ��&�� ؑ�,��<�OC��J
data.tar.gz.sig CHANGED
Binary file
data/CHANGELOG CHANGED
@@ -1,3 +1,5 @@
1
+ v0.1.2
2
+ * Fix enumerable calculations
1
3
  v0.1.1
2
4
  * Initialize the project
3
5
  * Add tests
@@ -66,7 +66,7 @@ class Binomial
66
66
  end
67
67
 
68
68
  private def distribute_enumerable k
69
- k.map{|p| calc(p) }.inject(&:+)
69
+ k.map{|p| distribute_integer(p) }.reduce(&:+)
70
70
  end
71
71
 
72
72
  private def distribute_integer k
@@ -15,6 +15,14 @@ class TestBinomialDistribution < Test::Unit::TestCase
15
15
  assert_equal 0.4, Math.binomial_distribution(0.4, 1, tries: 1)
16
16
  assert_equal 0.4, Math.binomial_distribution(1, 0.4, 1)
17
17
  assert_equal 0.4, Math.binomial_distribution(1, 1, probability: 0.4)
18
- end
18
+ end
19
+
20
+ def test_enum
21
+ t3 = Math.binomial_distribution(tries: 10, probability: 0.1, success: 3)
22
+ t2 = Math.binomial_distribution(tries: 10, probability: 0.1, success: 2)
23
+ t1 = Math.binomial_distribution(tries: 10, probability: 0.1, success: 1)
24
+ tt = Math.binomial_distribution(tries: 10, probability: 0.1, success: [1,2,3])
25
+ assert_equal t3 + t2 + t1, tt
26
+ end
19
27
 
20
28
  end
data/version CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: binomial_distribution
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nephos (poulet_a)
@@ -31,7 +31,7 @@ cert_chain:
31
31
  tcYkgfqUJPitIJx1RvWZpIyH5uJhRUYK3+vU9nMOxez5WbIlC1TtpByKAPMX+sht
32
32
  gib3AoIT8jh/2w==
33
33
  -----END CERTIFICATE-----
34
- date: 2016-05-05 00:00:00.000000000 Z
34
+ date: 2016-08-18 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: nomorebeer
metadata.gz.sig CHANGED
Binary file