Talk:Greatest subsequential sum: Difference between revisions

→‎Erroneous Examples: Summation is properly defined for this task.
(→‎<i>subarray</i> is a somewhat unclear term: Fixed indentation on old comment.)
(→‎Erroneous Examples: Summation is properly defined for this task.)
Line 18:
The statement that a zero length array will produce a sum of 0 is nonsense. 0 is a valid sum. A zero length array cannot have a sum. All solutions should provide a valid representation for a zero length array as an input to the maximum subarray calculation. The zero length subarray should be reported as an exceptional (or erroneous) condition.--[[User:Waldorf|Waldorf]] 21:20, 29 December 2007 (MST)
:This brings up an interesting philosophical discussion. What is the sum of no numbers (and is it related to the sound of one hand clapping)? --[[User:Mwn3d|Mwn3d]] 14:24, 30 December 2007 (MST)
 
:It is wholly sensible to specify summation such that zero is the result of summation of a list of no elements. While this is not derivable from the qualities of addition, it may be established by definition. The value of avoiding exceptional conditions is very high. To have summation defined for all nonnegative integers allows many things to be specified simply that would otherwise involve messy special-case handling. One important result is notational clarity. For the unusual situations where summation should be rejected for lists shorter than two elements, input qualification testing will suffice. --[[User:TBH|TBH]] 06:15, 4 January 2008 (PST)
Anonymous user