'given' method ignored when mixed with 'times' method

Issue #28 closed
Pierre Denis repo owner created an issue

The case appears in the following example:

>>> flip = Lea.fromVals(0,1)
>>> flip4 = flip.times(4)
>>> flip4.given(flip4<=2)
0 : 1/16
1 : 4/16
2 : 6/16
3 : 4/16
4 : 1/16

The probability distribution returned is the same as flip4 's. This is wrong.

Comments (5)

  1. Pierre Denis reporter

    You can use getAlea() method as workaround:

    >>> flip4b = flip4.getAlea()
    >>> flip4b.given(flip4b<=2)
    0 : 1/11
    1 : 4/11
    2 : 6/11
    
  2. Log in to comment