Minimal example:
let r0 = discrete(0.9,0.1) in
let r1 = discrete(0.9,0.1) in
r0 + r1
Expected:
[{"Joint Distribution":[["Value","Probability"],["0","0.81"],["1","0.18000000000000005"],["2","0.010000000000000004"]]}]
Or a type error of some kind telling me this is not possible.
Actual:
{"Joint Distribution":[["Value","Probability"],["0","0.82000000000000006"],["1","0.18000000000000005"]]}]
Workaround:
let r0 = discrete(0.9,0.1,0) in
let r1 = discrete(0.9,0.1,0) in
r0 + r1
Output:
[{"Joint Distribution":[["Value","Probability"],["0","0.81"],["1","0.18000000000000005"],["2","0.010000000000000004"],["3","0"]]}]
Note that this output has an entry for '3' but this should always have probability zero. In other words, the workaround results in excess entries in the distribution.