Wrong results returned by draw method

Issue #19 closed
Pierre Denis repo owner created an issue

The draw method returns wrong results for non-uniform probability distributions. Example:

>>> h = Lea.fromValFreqs(("A",3),("B",2),("C",1))
>>> h.draw(2)
('A', 'B') : 6/22
('A', 'C') : 3/22
('B', 'A') : 6/22
('B', 'C') : 2/22
('C', 'A') : 3/22
('C', 'B') : 2/22

The right result should be:

>>> h.draw(2)
('A', 'B') : 20/60
('A', 'C') : 10/60
('B', 'A') : 15/60
('B', 'C') :  5/60
('C', 'A') :  6/60
('C', 'B') :  4/60

Comments (3)

  1. Log in to comment