Message Boards Message Boards

0
|
2643 Views
|
3 Replies
|
5 Total Likes
View groups...
Share
Share this post:

Possible bug in evaluation of purely symbolic product?

Posted 10 years ago

Hello,

The following expression:

Product[0, {i, 0, -1}]

Evaluates to 1, as it should. However

Product[0, {i, 0, k}]

Is immediately evaluated to 0, which seems odd to me.

So does this make sense or is this a bug?

3 Replies

What do you think zero multiplied by itself k times should be?

POSTED BY: Frank Kampas

See refguide > Product > Possible Issues: "The upper product limit is assumed to be an integer distance from the lower limit:" This is in reference to a (similar) example wherein the lower bound is explicit and the upper is a symbol. It should really state "positive integer distance" I guess. It goes on to mention the possibility of getting explicit conditions. In the example above this would be

Product[0, {i, 0, k}, GenerateConditions -> True]

(* Out[42]= ConditionalExpression[0, k \[Element] Integers && k >= 0]
*)

So it is behaving as documented, and this is an edge case where things can happen that might be confusing if documentation is not consulted.

POSTED BY: Daniel Lichtblau

Thanks Daniel, I guess I learned to consult the documentation before assuming it's a bug

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract