If you change the probability vector into a weight vector (as above), the numerical instability of the error condition vanishes. All you need is that the weights are non-negative and that their sum is positive.
In my beginning is my end; weights are what my original draft asked for.
"Nature and Nature's laws lay hid in night / God said, "Let Newton be!" and all was light." --Alexander Pope (1688-1744)
"It did not last: the devil howling "Ho! / Let Einstein be!" restored the status quo. --J. C. Squire (1884–1958)
John Cowan
http://vrici.lojban.org/~cowan xxxxxx@ccil.orgWe want more school houses and less jails; more books and less arsenals;
more learning and less vice; more constant work and less crime; more
leisure and less greed; more justice and less revenge; in fact, more of
the opportunities to cultivate our better natures. --Samuel Gompers