Re: minimizing sum{x(i)*log(x(i))}



Ming wrote:
This is because log(0) = -inf and 0*-inf = NaN while mathematically x*log(x) = 0 when x
takes on zero.

No, mathematically x*log(x) is indeterminate when x takes on 0, and if your
code requires 0 * infinity to be any particular real number, the code is
mathematically broken.

One argument sometimes given is:

Let c be any real number. Then limit c/x as x approaches infinity is 0.
Now consider limit c/x * x as x approaches infinity. Do the usual "cancellation"
of the numerator and denominator, to find that limit c/x * x as x approaches infinity
"must be" c. But c was any arbitrary real constant, so 0 * infinity must be simultaneously
equal to all real constants, and therefore the answer to 0 * infinity is indeterminate.

--
..signature note: I am now avoiding replying to unclear or ambiguous postings.
Please review questions before posting them. Be specific. Use examples of what you mean,
of what you don't mean. Specify boundary conditions, and data classes and value
relationships -- what if we scrambled your data or used -Inf, NaN, or complex(rand,rand)?
.



Relevant Pages

  • Re: Truncation of array elements and imported data.
    ... them to zero. ... is the result infinity? ... I am now avoiding replying to unclear or ambiguous postings. ... and data classes and value ...
    (comp.soft-sys.matlab)
  • Re: minimizing sum{x(i)*log(x(i))}
    ... Then limit c/x as x approaches infinity is 0. ... But c was any arbitrary real constant, so 0 * infinity must be simultaneously ... I am now avoiding replying to unclear or ambiguous postings. ... and data classes and value ...
    (comp.soft-sys.matlab)
  • Re: minimizing sum{x(i)*log(x(i))}
    ... Then limit c/x as x approaches infinity is 0. ... But c was any arbitrary real constant, so 0 * infinity must be simultaneously ... Roger Stafford ...
    (comp.soft-sys.matlab)
  • Re: How to tell if an array contains integer values?
    ... There is a hidden assumption above that you do not consider infinity or nan ... I am now avoiding replying to unclear or ambiguous postings. ... and data classes and value ...
    (comp.soft-sys.matlab)
  • Re: 0 * X = null?
    ... > real constant) is clearly 0. ... > +infinity) depending on whether you are approaching from the right or ...
    (sci.math)

Loading