charredgrass / charred-discord-bot

Personal Discord bot. Written in Typescript, run using node.js.
MIT License
1 stars 1 forks source link

pullpmf function (and consequently cmf) do not return proper results #57

Closed charredgrass closed 2 years ago

charredgrass commented 2 years ago
> pullpmf(1, 0.06);
0.06
> pullpmf(2, 0.06);
0.05639999999999999
> pullpmf(74, 0.06);
0.00720903689703703
> pullpmf(75, 0.06);
-0.6063848617593166
> pullpmf(76, 0.06);
40.52133028323587

Works properly for 0 <= n < 75 but anything n >= 75 gives nonsense responses (negative answers and answers above 1 are not within its range).

Additionally, pullpmf is not functionally useful for future commands. Command should be overhauled to simply be a piecewise function that shows probability

charredgrass commented 2 years ago

p is supposed to be 0.006, 0.06. Function still needs rewriting.