Do summations always increment by one? How do you incrment by a negative number? Or any real number? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)The sum of an uncountable number of positive numbersA good book on programming for numerical optimizationMath Courses involving clever integration techniquesSolving equations that contain summationsSumming standard deviations? or summing variances?Evaluation of an Infinite Converging SumQuestion involving summations and the Θ-notation of running timesClosed-form Solution of Log SumChanging summation in a power seriesWhy I cannot simplify these two summations?Finding the formula for the summation $sum_i=1^n (2i-1) = 1+3+5+…+(2n-1)$.Jumping-index summations

Denied boarding although I have proper visa and documentation. To whom should I make a complaint?

Maximum summed powersets with non-adjacent items

Is there any way for the UK Prime Minister to make a motion directly dependent on Government confidence?

Fantasy story; one type of magic grows in power with use, but the more powerful they are, they more they are drawn to travel to their source

Did MS DOS itself ever use blinking text?

How could we fake a moon landing now?

How to find all the available tools in mac terminal?

Using audio cues to encourage good posture

Compare a given version number in the form major.minor.build.patch and see if one is less than the other

How would a mousetrap for use in space work?

2001: A Space Odyssey's use of the song "Daisy Bell" (Bicycle Built for Two); life imitates art or vice-versa?

What would be the ideal power source for a cybernetic eye?

If a VARCHAR(MAX) column is included in an index, is the entire value always stored in the index page(s)?

How to convince students of the implication truth values?

Why are the trig functions versine, haversine, exsecant, etc, rarely used in modern mathematics?

If my PI received research grants from a company to be able to pay my postdoc salary, did I have a potential conflict interest too?

Delete nth line from bottom

Using et al. for a last / senior author rather than for a first author

What is the meaning of the new sigil in Game of Thrones Season 8 intro?

What is the longest distance a player character can jump in one leap?

Is it cost-effective to upgrade an old-ish Giant Escape R3 commuter bike with entry-level branded parts (wheels, drivetrain)?

Is it a good idea to use CNN to classify 1D signal?

How do I find out the mythology and history of my Fortress?

For a new assistant professor in CS, how to build/manage a publication pipeline



Do summations always increment by one? How do you incrment by a negative number? Or any real number?



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)The sum of an uncountable number of positive numbersA good book on programming for numerical optimizationMath Courses involving clever integration techniquesSolving equations that contain summationsSumming standard deviations? or summing variances?Evaluation of an Infinite Converging SumQuestion involving summations and the Θ-notation of running timesClosed-form Solution of Log SumChanging summation in a power seriesWhy I cannot simplify these two summations?Finding the formula for the summation $sum_i=1^n (2i-1) = 1+3+5+…+(2n-1)$.Jumping-index summations










1












$begingroup$


Do summations always increment by one?



Having a more of background in programming than math. I am just learning about summations and I look at them as loops that increment by one.



If my assumption correct what an equivalent method / form to increment by values not equal to one?










share|cite|improve this question









$endgroup$







  • 1




    $begingroup$
    Summations do not always have to be incremented by $1$. Take $$sum_ktext eventext, 0 leq k leq 10k = 0 + 2 + cdots + 10 $$ for example. The possibilities with what you can write for summations are endless, but by convention, summations are incremented by $1$ if you have an upper index and lower index, unless of course indicated otherwise.
    $endgroup$
    – Clarinetist
    Jan 5 '16 at 2:39















1












$begingroup$


Do summations always increment by one?



Having a more of background in programming than math. I am just learning about summations and I look at them as loops that increment by one.



If my assumption correct what an equivalent method / form to increment by values not equal to one?










share|cite|improve this question









$endgroup$







  • 1




    $begingroup$
    Summations do not always have to be incremented by $1$. Take $$sum_ktext eventext, 0 leq k leq 10k = 0 + 2 + cdots + 10 $$ for example. The possibilities with what you can write for summations are endless, but by convention, summations are incremented by $1$ if you have an upper index and lower index, unless of course indicated otherwise.
    $endgroup$
    – Clarinetist
    Jan 5 '16 at 2:39













1












1








1


1



$begingroup$


Do summations always increment by one?



Having a more of background in programming than math. I am just learning about summations and I look at them as loops that increment by one.



If my assumption correct what an equivalent method / form to increment by values not equal to one?










share|cite|improve this question









$endgroup$




Do summations always increment by one?



Having a more of background in programming than math. I am just learning about summations and I look at them as loops that increment by one.



If my assumption correct what an equivalent method / form to increment by values not equal to one?







summation






share|cite|improve this question













share|cite|improve this question











share|cite|improve this question




share|cite|improve this question










asked Jan 5 '16 at 2:33









user136952user136952

13418




13418







  • 1




    $begingroup$
    Summations do not always have to be incremented by $1$. Take $$sum_ktext eventext, 0 leq k leq 10k = 0 + 2 + cdots + 10 $$ for example. The possibilities with what you can write for summations are endless, but by convention, summations are incremented by $1$ if you have an upper index and lower index, unless of course indicated otherwise.
    $endgroup$
    – Clarinetist
    Jan 5 '16 at 2:39












  • 1




    $begingroup$
    Summations do not always have to be incremented by $1$. Take $$sum_ktext eventext, 0 leq k leq 10k = 0 + 2 + cdots + 10 $$ for example. The possibilities with what you can write for summations are endless, but by convention, summations are incremented by $1$ if you have an upper index and lower index, unless of course indicated otherwise.
    $endgroup$
    – Clarinetist
    Jan 5 '16 at 2:39







1




1




$begingroup$
Summations do not always have to be incremented by $1$. Take $$sum_ktext eventext, 0 leq k leq 10k = 0 + 2 + cdots + 10 $$ for example. The possibilities with what you can write for summations are endless, but by convention, summations are incremented by $1$ if you have an upper index and lower index, unless of course indicated otherwise.
$endgroup$
– Clarinetist
Jan 5 '16 at 2:39




$begingroup$
Summations do not always have to be incremented by $1$. Take $$sum_ktext eventext, 0 leq k leq 10k = 0 + 2 + cdots + 10 $$ for example. The possibilities with what you can write for summations are endless, but by convention, summations are incremented by $1$ if you have an upper index and lower index, unless of course indicated otherwise.
$endgroup$
– Clarinetist
Jan 5 '16 at 2:39










5 Answers
5






active

oldest

votes


















2












$begingroup$


Do summations always increment by one?




That depends on what you mean by summation.



E.g
$$
S = sum_i = 1^n s_i = sum_i in I s_i
$$
means a summation, where the indices are picked from $I = 1,ldots, n$.
The index set $I$ could be traversed by starting at $1$ and incrementing to $n$ in steps of $+1$. But that is just one way of $n!$ possible ways to sum the $s_i$ up.




Having a more of background in programming than math. I am just
learning about summations and I look at them as loops that increment
by one.



If my assumption correct what an equivalent method / form to increment
by values not equal to one?




You could start with $n$ and finish with $1$. Or you first use the odd indices ascending and the the even ones descending.
$$
S = sum_overseti in I i bmod 2 = 1 s_i +
sum_overseti in I i bmod 2 = 0 s_i
$$



It should lead to the same sum, as order does not matter to the finite index set.






share|cite|improve this answer











$endgroup$




















    0












    $begingroup$

    In programming, many languages provide for an optional step in the loop. It defaults to $1$, but you can set it to something else. In math, it is similar. The default is to increment by $1$. If you want to add up all the multiples of $3$ from $3$ to $30$, you could write $$sum_i=1^103i$$, where $i$ increments by $1$ and the factor $3$ gets you the increment you really want. In programming you can do the same thing. You can write for i=1 to 10;k=3*i and use k instead of i for your computations. You can also write for i=3 to 30 step 3. In math you can write $$sum_ substack i=3\ iequiv 0 pmod 3^30i$$ to get a step of 3. It seems fairly rare in math, more common in programming, in my experience






    share|cite|improve this answer









    $endgroup$




















      0












      $begingroup$

      This may at first seem like a problem, but once you start thinking about how to solve it the solution becomes obvious and attests to the beauty of simplicity in math.



      Let's solve the problem of being able to increment by any real number: simply multiply $i$ by $p$, the desired real number.



      Using negative numbers? Increment by a negative number, etc.






      share|cite|improve this answer









      $endgroup$




















        0












        $begingroup$

        No, summations do not always increment by one. In fact, summations can be over many kinds of sets, possibly not even restricted to integers or countable cardinality. Some examples from Wikipedia:



        Summation examples



        An example of a proof involving a summation over an uncountable set can be seen here on SE: The sum of an uncountable number of positive numbers






        share|cite|improve this answer











        $endgroup$












        • $begingroup$
          Your answer is misleading. As the second answer to the question you linked to states quite clearly, one is allowed to write a summation only when (one has shown that) the specified criterion holds. Otherwise it is not even meaningful, such as "$sum_x in [-1,1] x$", which cannot be assigned any meaningful interpretation.
          $endgroup$
          – user21820
          Jan 30 '16 at 5:34






        • 1




          $begingroup$
          @user21820: I changed "any arbitrary set" to "many kinds of sets"; thanks for the suggestion for improvement.
          $endgroup$
          – Daniel R. Collins
          Jan 30 '16 at 6:05


















        -1












        $begingroup$

        Edit, okay, okay strait to it then (if ya want more examples check the edits), so let's commence with the pealing with Python!



        $$
        h left( x right) = x over 2
        $$



        $$
        sum_i=1^end=10 hleft( i right)
        $$




        end=10 really should just be 10 to conform with the normal but it's labeled for referencing




        $sum$ is very analogous to sum(), not much really has to be done, but to ensure everyone's on the same page, both, under the hood kinda look like...





        def sum_of_list(l):
        last_value = 0
        for value in l:
        last_value += value

        return value


        ... and $h left( x right)$ is a bit like...





        def h(x):
        # According to lore, multiplication is often faster than division.
        return x * 0.5


        ... though not quite because that does not sufficiently express infinities, but let's set that aside for a moment.



        $i = textstart$ is very much like an iterator, especially when paired with a limit such as $textend$, above an bellow $sum$ respectively. So let's consider it as such for now.



        $h left( i right)$ when combined with $sum$, eg $sum_h left( i right)$ is almost a function call, it's not quite equivalent but let's not quibble.



        To approximate these behaviors with some code, here's what I came up with...





        #!/usr/bin/env python3

        from collections import Iterator


        class Rolling_Summation(Iterator):
        """
        Rolling_Summation is an __approximation__ of Sigma Notation

        On each iteration of `Rolling_Summation` the result of `f(i.next())` are `yeild`ed

        The current sum maybe inspected at any point via the `.current_sum` property
        """

        def __init__(self, i = range(1, 11), f = lambda x: float(x)):
        super(Rolling_Summation, self).__init__()
        self.i = i
        self.f = f
        self.__current_sum = 0
        self.__finished = False

        @property
        def current_sum(self):
        return self.__current_sum

        @property
        def is_finished(self):
        if bool(self.__finished) is True:
        return True

        return False

        def throw(self, type = None, traceback = None):
        raise StopIteration

        def next(self):
        try:
        if hasattr(i, 'next'):
        # Python 2
        i_value = self.i.next()
        else:
        # Python 3
        i_value = self.i.__next__()
        except (StopIteration, GeneratorExit):
        self.__finished = True
        else:
        f_value = self.f(i_value)
        self.__current_sum += f_value
        return f_value

        if self.is_finished:
        self.throw(GeneratorExit)

        # Python 3 compatibility
        __next__ = next


        ... along with some examples.




        $$
        sum_i=1^10
        $$





        results = 0
        sum_iter = Rolling_Summation(iter(range(1, 11)), lambda x: float(x))
        for r in sum_iter:
        print("r -> 0".format(r))
        results += r
        print("results -> 0".format(results))
        print("sum_iter.current_sum -> 0".format(sum_iter.current_sum))


        The above Python code could also be expressed as...





        sigma = sum([x for x in Rolling_Summation(iter(range(1, 11)), lambda x: float(x))])


        ... if you're one for one-liners.



        Both sum_iter.current_sum and sigma from above should result in the same value of 55.0





        How do you increment by a negative number?




        Stepping by -1 starting at -1 and going to -10...



        $$
        sum_i = -1^-10
        $$





        sum([x for x in Rolling_Summation(iter(range(-1, -11, -1)), lambda x: float(x))])
        # -> -55.0


        While that may not be technically correct I doubt you'll confuse anyone as to the intent or the results expected. However to be explicit one could also translate it as...



        $$
        n left( x right) = -1n
        $$



        $$
        sum_i = n left( 1 right)^-10
        $$



        ... if you're one that must be reminded to decrement, and also a hint to yet another answer to...




        Or any real number?




        $$
        p left( x right) = n + 2
        $$



        $$
        sum_i = p left( 0 right)^ge10
        $$





        sum([x for x in Rolling_Summation(iter(range(2, 12, 2)), lambda x: float(x))])



        Now even with this classy method it's just an approximation, a close one if ya dig into what the code is really doing to emulate much of what sigma notation can relay, but eventually you'll find something that'll compute as an oscillating value, or find floating point errors accumulating (just as two examples), and things'll get messy.




        Bonus examples



        It's a good idea to second-guess one's self when going from one to the other; off by one errors can be a pain, eg matrix vs list indexing...



        $$
        M = beginpmatrix0, 1, 2, dots 9 endpmatrix
        $$



        $$
        sum_i = 1^10 M_i
        $$





        M = [x for x in range(0, 9)]
        # -> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

        sum([x for x in Rolling_Summation(iter(range(0, len(M) - 1)), M.index)])


        ... note where those 0s and 1s differ above to save yourself future headaches...



        $$
        f left( x right) = begincases
        1, & textif 2 mid x \
        0, & textotherwise
        endcases
        $$



        $$
        sum_i = M_1^10 fleft( i right)
        $$





        def f(x):
        if x % 2 == 0:
        return 1
        return 0


        sum([x for x in Rolling_Summation(iter(M[0:10]), f)])


        But this has all just been one interpretation for how to translate as many of the features from one to the other, hopefully all before attention spans have run-out.






        share|cite|improve this answer











        $endgroup$












        • $begingroup$
          preposteriously too long and way to much overkill.
          $endgroup$
          – fleablood
          Mar 28 at 0:59










        • $begingroup$
          Heh, yeah it was getting ridiculous. Perhaps the edits have now honed it to a finer point.
          $endgroup$
          – S0AndS0
          Mar 28 at 2:20











        Your Answer








        StackExchange.ready(function()
        var channelOptions =
        tags: "".split(" "),
        id: "69"
        ;
        initTagRenderer("".split(" "), "".split(" "), channelOptions);

        StackExchange.using("externalEditor", function()
        // Have to fire editor after snippets, if snippets enabled
        if (StackExchange.settings.snippets.snippetsEnabled)
        StackExchange.using("snippets", function()
        createEditor();
        );

        else
        createEditor();

        );

        function createEditor()
        StackExchange.prepareEditor(
        heartbeatType: 'answer',
        autoActivateHeartbeat: false,
        convertImagesToLinks: true,
        noModals: true,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: 10,
        bindNavPrevention: true,
        postfix: "",
        imageUploader:
        brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
        contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
        allowUrls: true
        ,
        noCode: true, onDemand: true,
        discardSelector: ".discard-answer"
        ,immediatelyShowMarkdownHelp:true
        );



        );













        draft saved

        draft discarded


















        StackExchange.ready(
        function ()
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f1600384%2fdo-summations-always-increment-by-one-how-do-you-incrment-by-a-negative-number%23new-answer', 'question_page');

        );

        Post as a guest















        Required, but never shown

























        5 Answers
        5






        active

        oldest

        votes








        5 Answers
        5






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        2












        $begingroup$


        Do summations always increment by one?




        That depends on what you mean by summation.



        E.g
        $$
        S = sum_i = 1^n s_i = sum_i in I s_i
        $$
        means a summation, where the indices are picked from $I = 1,ldots, n$.
        The index set $I$ could be traversed by starting at $1$ and incrementing to $n$ in steps of $+1$. But that is just one way of $n!$ possible ways to sum the $s_i$ up.




        Having a more of background in programming than math. I am just
        learning about summations and I look at them as loops that increment
        by one.



        If my assumption correct what an equivalent method / form to increment
        by values not equal to one?




        You could start with $n$ and finish with $1$. Or you first use the odd indices ascending and the the even ones descending.
        $$
        S = sum_overseti in I i bmod 2 = 1 s_i +
        sum_overseti in I i bmod 2 = 0 s_i
        $$



        It should lead to the same sum, as order does not matter to the finite index set.






        share|cite|improve this answer











        $endgroup$

















          2












          $begingroup$


          Do summations always increment by one?




          That depends on what you mean by summation.



          E.g
          $$
          S = sum_i = 1^n s_i = sum_i in I s_i
          $$
          means a summation, where the indices are picked from $I = 1,ldots, n$.
          The index set $I$ could be traversed by starting at $1$ and incrementing to $n$ in steps of $+1$. But that is just one way of $n!$ possible ways to sum the $s_i$ up.




          Having a more of background in programming than math. I am just
          learning about summations and I look at them as loops that increment
          by one.



          If my assumption correct what an equivalent method / form to increment
          by values not equal to one?




          You could start with $n$ and finish with $1$. Or you first use the odd indices ascending and the the even ones descending.
          $$
          S = sum_overseti in I i bmod 2 = 1 s_i +
          sum_overseti in I i bmod 2 = 0 s_i
          $$



          It should lead to the same sum, as order does not matter to the finite index set.






          share|cite|improve this answer











          $endgroup$















            2












            2








            2





            $begingroup$


            Do summations always increment by one?




            That depends on what you mean by summation.



            E.g
            $$
            S = sum_i = 1^n s_i = sum_i in I s_i
            $$
            means a summation, where the indices are picked from $I = 1,ldots, n$.
            The index set $I$ could be traversed by starting at $1$ and incrementing to $n$ in steps of $+1$. But that is just one way of $n!$ possible ways to sum the $s_i$ up.




            Having a more of background in programming than math. I am just
            learning about summations and I look at them as loops that increment
            by one.



            If my assumption correct what an equivalent method / form to increment
            by values not equal to one?




            You could start with $n$ and finish with $1$. Or you first use the odd indices ascending and the the even ones descending.
            $$
            S = sum_overseti in I i bmod 2 = 1 s_i +
            sum_overseti in I i bmod 2 = 0 s_i
            $$



            It should lead to the same sum, as order does not matter to the finite index set.






            share|cite|improve this answer











            $endgroup$




            Do summations always increment by one?




            That depends on what you mean by summation.



            E.g
            $$
            S = sum_i = 1^n s_i = sum_i in I s_i
            $$
            means a summation, where the indices are picked from $I = 1,ldots, n$.
            The index set $I$ could be traversed by starting at $1$ and incrementing to $n$ in steps of $+1$. But that is just one way of $n!$ possible ways to sum the $s_i$ up.




            Having a more of background in programming than math. I am just
            learning about summations and I look at them as loops that increment
            by one.



            If my assumption correct what an equivalent method / form to increment
            by values not equal to one?




            You could start with $n$ and finish with $1$. Or you first use the odd indices ascending and the the even ones descending.
            $$
            S = sum_overseti in I i bmod 2 = 1 s_i +
            sum_overseti in I i bmod 2 = 0 s_i
            $$



            It should lead to the same sum, as order does not matter to the finite index set.







            share|cite|improve this answer














            share|cite|improve this answer



            share|cite|improve this answer








            edited Jan 5 '16 at 2:57

























            answered Jan 5 '16 at 2:42









            mvwmvw

            31.6k22252




            31.6k22252





















                0












                $begingroup$

                In programming, many languages provide for an optional step in the loop. It defaults to $1$, but you can set it to something else. In math, it is similar. The default is to increment by $1$. If you want to add up all the multiples of $3$ from $3$ to $30$, you could write $$sum_i=1^103i$$, where $i$ increments by $1$ and the factor $3$ gets you the increment you really want. In programming you can do the same thing. You can write for i=1 to 10;k=3*i and use k instead of i for your computations. You can also write for i=3 to 30 step 3. In math you can write $$sum_ substack i=3\ iequiv 0 pmod 3^30i$$ to get a step of 3. It seems fairly rare in math, more common in programming, in my experience






                share|cite|improve this answer









                $endgroup$

















                  0












                  $begingroup$

                  In programming, many languages provide for an optional step in the loop. It defaults to $1$, but you can set it to something else. In math, it is similar. The default is to increment by $1$. If you want to add up all the multiples of $3$ from $3$ to $30$, you could write $$sum_i=1^103i$$, where $i$ increments by $1$ and the factor $3$ gets you the increment you really want. In programming you can do the same thing. You can write for i=1 to 10;k=3*i and use k instead of i for your computations. You can also write for i=3 to 30 step 3. In math you can write $$sum_ substack i=3\ iequiv 0 pmod 3^30i$$ to get a step of 3. It seems fairly rare in math, more common in programming, in my experience






                  share|cite|improve this answer









                  $endgroup$















                    0












                    0








                    0





                    $begingroup$

                    In programming, many languages provide for an optional step in the loop. It defaults to $1$, but you can set it to something else. In math, it is similar. The default is to increment by $1$. If you want to add up all the multiples of $3$ from $3$ to $30$, you could write $$sum_i=1^103i$$, where $i$ increments by $1$ and the factor $3$ gets you the increment you really want. In programming you can do the same thing. You can write for i=1 to 10;k=3*i and use k instead of i for your computations. You can also write for i=3 to 30 step 3. In math you can write $$sum_ substack i=3\ iequiv 0 pmod 3^30i$$ to get a step of 3. It seems fairly rare in math, more common in programming, in my experience






                    share|cite|improve this answer









                    $endgroup$



                    In programming, many languages provide for an optional step in the loop. It defaults to $1$, but you can set it to something else. In math, it is similar. The default is to increment by $1$. If you want to add up all the multiples of $3$ from $3$ to $30$, you could write $$sum_i=1^103i$$, where $i$ increments by $1$ and the factor $3$ gets you the increment you really want. In programming you can do the same thing. You can write for i=1 to 10;k=3*i and use k instead of i for your computations. You can also write for i=3 to 30 step 3. In math you can write $$sum_ substack i=3\ iequiv 0 pmod 3^30i$$ to get a step of 3. It seems fairly rare in math, more common in programming, in my experience







                    share|cite|improve this answer












                    share|cite|improve this answer



                    share|cite|improve this answer










                    answered Jan 5 '16 at 2:53









                    Ross MillikanRoss Millikan

                    302k24200375




                    302k24200375





















                        0












                        $begingroup$

                        This may at first seem like a problem, but once you start thinking about how to solve it the solution becomes obvious and attests to the beauty of simplicity in math.



                        Let's solve the problem of being able to increment by any real number: simply multiply $i$ by $p$, the desired real number.



                        Using negative numbers? Increment by a negative number, etc.






                        share|cite|improve this answer









                        $endgroup$

















                          0












                          $begingroup$

                          This may at first seem like a problem, but once you start thinking about how to solve it the solution becomes obvious and attests to the beauty of simplicity in math.



                          Let's solve the problem of being able to increment by any real number: simply multiply $i$ by $p$, the desired real number.



                          Using negative numbers? Increment by a negative number, etc.






                          share|cite|improve this answer









                          $endgroup$















                            0












                            0








                            0





                            $begingroup$

                            This may at first seem like a problem, but once you start thinking about how to solve it the solution becomes obvious and attests to the beauty of simplicity in math.



                            Let's solve the problem of being able to increment by any real number: simply multiply $i$ by $p$, the desired real number.



                            Using negative numbers? Increment by a negative number, etc.






                            share|cite|improve this answer









                            $endgroup$



                            This may at first seem like a problem, but once you start thinking about how to solve it the solution becomes obvious and attests to the beauty of simplicity in math.



                            Let's solve the problem of being able to increment by any real number: simply multiply $i$ by $p$, the desired real number.



                            Using negative numbers? Increment by a negative number, etc.







                            share|cite|improve this answer












                            share|cite|improve this answer



                            share|cite|improve this answer










                            answered Jan 5 '16 at 2:54









                            theideasmiththeideasmith

                            603417




                            603417





















                                0












                                $begingroup$

                                No, summations do not always increment by one. In fact, summations can be over many kinds of sets, possibly not even restricted to integers or countable cardinality. Some examples from Wikipedia:



                                Summation examples



                                An example of a proof involving a summation over an uncountable set can be seen here on SE: The sum of an uncountable number of positive numbers






                                share|cite|improve this answer











                                $endgroup$












                                • $begingroup$
                                  Your answer is misleading. As the second answer to the question you linked to states quite clearly, one is allowed to write a summation only when (one has shown that) the specified criterion holds. Otherwise it is not even meaningful, such as "$sum_x in [-1,1] x$", which cannot be assigned any meaningful interpretation.
                                  $endgroup$
                                  – user21820
                                  Jan 30 '16 at 5:34






                                • 1




                                  $begingroup$
                                  @user21820: I changed "any arbitrary set" to "many kinds of sets"; thanks for the suggestion for improvement.
                                  $endgroup$
                                  – Daniel R. Collins
                                  Jan 30 '16 at 6:05















                                0












                                $begingroup$

                                No, summations do not always increment by one. In fact, summations can be over many kinds of sets, possibly not even restricted to integers or countable cardinality. Some examples from Wikipedia:



                                Summation examples



                                An example of a proof involving a summation over an uncountable set can be seen here on SE: The sum of an uncountable number of positive numbers






                                share|cite|improve this answer











                                $endgroup$












                                • $begingroup$
                                  Your answer is misleading. As the second answer to the question you linked to states quite clearly, one is allowed to write a summation only when (one has shown that) the specified criterion holds. Otherwise it is not even meaningful, such as "$sum_x in [-1,1] x$", which cannot be assigned any meaningful interpretation.
                                  $endgroup$
                                  – user21820
                                  Jan 30 '16 at 5:34






                                • 1




                                  $begingroup$
                                  @user21820: I changed "any arbitrary set" to "many kinds of sets"; thanks for the suggestion for improvement.
                                  $endgroup$
                                  – Daniel R. Collins
                                  Jan 30 '16 at 6:05













                                0












                                0








                                0





                                $begingroup$

                                No, summations do not always increment by one. In fact, summations can be over many kinds of sets, possibly not even restricted to integers or countable cardinality. Some examples from Wikipedia:



                                Summation examples



                                An example of a proof involving a summation over an uncountable set can be seen here on SE: The sum of an uncountable number of positive numbers






                                share|cite|improve this answer











                                $endgroup$



                                No, summations do not always increment by one. In fact, summations can be over many kinds of sets, possibly not even restricted to integers or countable cardinality. Some examples from Wikipedia:



                                Summation examples



                                An example of a proof involving a summation over an uncountable set can be seen here on SE: The sum of an uncountable number of positive numbers







                                share|cite|improve this answer














                                share|cite|improve this answer



                                share|cite|improve this answer








                                edited Apr 13 '17 at 12:20









                                Community

                                1




                                1










                                answered Jan 5 '16 at 3:02









                                Daniel R. CollinsDaniel R. Collins

                                5,9251534




                                5,9251534











                                • $begingroup$
                                  Your answer is misleading. As the second answer to the question you linked to states quite clearly, one is allowed to write a summation only when (one has shown that) the specified criterion holds. Otherwise it is not even meaningful, such as "$sum_x in [-1,1] x$", which cannot be assigned any meaningful interpretation.
                                  $endgroup$
                                  – user21820
                                  Jan 30 '16 at 5:34






                                • 1




                                  $begingroup$
                                  @user21820: I changed "any arbitrary set" to "many kinds of sets"; thanks for the suggestion for improvement.
                                  $endgroup$
                                  – Daniel R. Collins
                                  Jan 30 '16 at 6:05
















                                • $begingroup$
                                  Your answer is misleading. As the second answer to the question you linked to states quite clearly, one is allowed to write a summation only when (one has shown that) the specified criterion holds. Otherwise it is not even meaningful, such as "$sum_x in [-1,1] x$", which cannot be assigned any meaningful interpretation.
                                  $endgroup$
                                  – user21820
                                  Jan 30 '16 at 5:34






                                • 1




                                  $begingroup$
                                  @user21820: I changed "any arbitrary set" to "many kinds of sets"; thanks for the suggestion for improvement.
                                  $endgroup$
                                  – Daniel R. Collins
                                  Jan 30 '16 at 6:05















                                $begingroup$
                                Your answer is misleading. As the second answer to the question you linked to states quite clearly, one is allowed to write a summation only when (one has shown that) the specified criterion holds. Otherwise it is not even meaningful, such as "$sum_x in [-1,1] x$", which cannot be assigned any meaningful interpretation.
                                $endgroup$
                                – user21820
                                Jan 30 '16 at 5:34




                                $begingroup$
                                Your answer is misleading. As the second answer to the question you linked to states quite clearly, one is allowed to write a summation only when (one has shown that) the specified criterion holds. Otherwise it is not even meaningful, such as "$sum_x in [-1,1] x$", which cannot be assigned any meaningful interpretation.
                                $endgroup$
                                – user21820
                                Jan 30 '16 at 5:34




                                1




                                1




                                $begingroup$
                                @user21820: I changed "any arbitrary set" to "many kinds of sets"; thanks for the suggestion for improvement.
                                $endgroup$
                                – Daniel R. Collins
                                Jan 30 '16 at 6:05




                                $begingroup$
                                @user21820: I changed "any arbitrary set" to "many kinds of sets"; thanks for the suggestion for improvement.
                                $endgroup$
                                – Daniel R. Collins
                                Jan 30 '16 at 6:05











                                -1












                                $begingroup$

                                Edit, okay, okay strait to it then (if ya want more examples check the edits), so let's commence with the pealing with Python!



                                $$
                                h left( x right) = x over 2
                                $$



                                $$
                                sum_i=1^end=10 hleft( i right)
                                $$




                                end=10 really should just be 10 to conform with the normal but it's labeled for referencing




                                $sum$ is very analogous to sum(), not much really has to be done, but to ensure everyone's on the same page, both, under the hood kinda look like...





                                def sum_of_list(l):
                                last_value = 0
                                for value in l:
                                last_value += value

                                return value


                                ... and $h left( x right)$ is a bit like...





                                def h(x):
                                # According to lore, multiplication is often faster than division.
                                return x * 0.5


                                ... though not quite because that does not sufficiently express infinities, but let's set that aside for a moment.



                                $i = textstart$ is very much like an iterator, especially when paired with a limit such as $textend$, above an bellow $sum$ respectively. So let's consider it as such for now.



                                $h left( i right)$ when combined with $sum$, eg $sum_h left( i right)$ is almost a function call, it's not quite equivalent but let's not quibble.



                                To approximate these behaviors with some code, here's what I came up with...





                                #!/usr/bin/env python3

                                from collections import Iterator


                                class Rolling_Summation(Iterator):
                                """
                                Rolling_Summation is an __approximation__ of Sigma Notation

                                On each iteration of `Rolling_Summation` the result of `f(i.next())` are `yeild`ed

                                The current sum maybe inspected at any point via the `.current_sum` property
                                """

                                def __init__(self, i = range(1, 11), f = lambda x: float(x)):
                                super(Rolling_Summation, self).__init__()
                                self.i = i
                                self.f = f
                                self.__current_sum = 0
                                self.__finished = False

                                @property
                                def current_sum(self):
                                return self.__current_sum

                                @property
                                def is_finished(self):
                                if bool(self.__finished) is True:
                                return True

                                return False

                                def throw(self, type = None, traceback = None):
                                raise StopIteration

                                def next(self):
                                try:
                                if hasattr(i, 'next'):
                                # Python 2
                                i_value = self.i.next()
                                else:
                                # Python 3
                                i_value = self.i.__next__()
                                except (StopIteration, GeneratorExit):
                                self.__finished = True
                                else:
                                f_value = self.f(i_value)
                                self.__current_sum += f_value
                                return f_value

                                if self.is_finished:
                                self.throw(GeneratorExit)

                                # Python 3 compatibility
                                __next__ = next


                                ... along with some examples.




                                $$
                                sum_i=1^10
                                $$





                                results = 0
                                sum_iter = Rolling_Summation(iter(range(1, 11)), lambda x: float(x))
                                for r in sum_iter:
                                print("r -> 0".format(r))
                                results += r
                                print("results -> 0".format(results))
                                print("sum_iter.current_sum -> 0".format(sum_iter.current_sum))


                                The above Python code could also be expressed as...





                                sigma = sum([x for x in Rolling_Summation(iter(range(1, 11)), lambda x: float(x))])


                                ... if you're one for one-liners.



                                Both sum_iter.current_sum and sigma from above should result in the same value of 55.0





                                How do you increment by a negative number?




                                Stepping by -1 starting at -1 and going to -10...



                                $$
                                sum_i = -1^-10
                                $$





                                sum([x for x in Rolling_Summation(iter(range(-1, -11, -1)), lambda x: float(x))])
                                # -> -55.0


                                While that may not be technically correct I doubt you'll confuse anyone as to the intent or the results expected. However to be explicit one could also translate it as...



                                $$
                                n left( x right) = -1n
                                $$



                                $$
                                sum_i = n left( 1 right)^-10
                                $$



                                ... if you're one that must be reminded to decrement, and also a hint to yet another answer to...




                                Or any real number?




                                $$
                                p left( x right) = n + 2
                                $$



                                $$
                                sum_i = p left( 0 right)^ge10
                                $$





                                sum([x for x in Rolling_Summation(iter(range(2, 12, 2)), lambda x: float(x))])



                                Now even with this classy method it's just an approximation, a close one if ya dig into what the code is really doing to emulate much of what sigma notation can relay, but eventually you'll find something that'll compute as an oscillating value, or find floating point errors accumulating (just as two examples), and things'll get messy.




                                Bonus examples



                                It's a good idea to second-guess one's self when going from one to the other; off by one errors can be a pain, eg matrix vs list indexing...



                                $$
                                M = beginpmatrix0, 1, 2, dots 9 endpmatrix
                                $$



                                $$
                                sum_i = 1^10 M_i
                                $$





                                M = [x for x in range(0, 9)]
                                # -> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

                                sum([x for x in Rolling_Summation(iter(range(0, len(M) - 1)), M.index)])


                                ... note where those 0s and 1s differ above to save yourself future headaches...



                                $$
                                f left( x right) = begincases
                                1, & textif 2 mid x \
                                0, & textotherwise
                                endcases
                                $$



                                $$
                                sum_i = M_1^10 fleft( i right)
                                $$





                                def f(x):
                                if x % 2 == 0:
                                return 1
                                return 0


                                sum([x for x in Rolling_Summation(iter(M[0:10]), f)])


                                But this has all just been one interpretation for how to translate as many of the features from one to the other, hopefully all before attention spans have run-out.






                                share|cite|improve this answer











                                $endgroup$












                                • $begingroup$
                                  preposteriously too long and way to much overkill.
                                  $endgroup$
                                  – fleablood
                                  Mar 28 at 0:59










                                • $begingroup$
                                  Heh, yeah it was getting ridiculous. Perhaps the edits have now honed it to a finer point.
                                  $endgroup$
                                  – S0AndS0
                                  Mar 28 at 2:20















                                -1












                                $begingroup$

                                Edit, okay, okay strait to it then (if ya want more examples check the edits), so let's commence with the pealing with Python!



                                $$
                                h left( x right) = x over 2
                                $$



                                $$
                                sum_i=1^end=10 hleft( i right)
                                $$




                                end=10 really should just be 10 to conform with the normal but it's labeled for referencing




                                $sum$ is very analogous to sum(), not much really has to be done, but to ensure everyone's on the same page, both, under the hood kinda look like...





                                def sum_of_list(l):
                                last_value = 0
                                for value in l:
                                last_value += value

                                return value


                                ... and $h left( x right)$ is a bit like...





                                def h(x):
                                # According to lore, multiplication is often faster than division.
                                return x * 0.5


                                ... though not quite because that does not sufficiently express infinities, but let's set that aside for a moment.



                                $i = textstart$ is very much like an iterator, especially when paired with a limit such as $textend$, above an bellow $sum$ respectively. So let's consider it as such for now.



                                $h left( i right)$ when combined with $sum$, eg $sum_h left( i right)$ is almost a function call, it's not quite equivalent but let's not quibble.



                                To approximate these behaviors with some code, here's what I came up with...





                                #!/usr/bin/env python3

                                from collections import Iterator


                                class Rolling_Summation(Iterator):
                                """
                                Rolling_Summation is an __approximation__ of Sigma Notation

                                On each iteration of `Rolling_Summation` the result of `f(i.next())` are `yeild`ed

                                The current sum maybe inspected at any point via the `.current_sum` property
                                """

                                def __init__(self, i = range(1, 11), f = lambda x: float(x)):
                                super(Rolling_Summation, self).__init__()
                                self.i = i
                                self.f = f
                                self.__current_sum = 0
                                self.__finished = False

                                @property
                                def current_sum(self):
                                return self.__current_sum

                                @property
                                def is_finished(self):
                                if bool(self.__finished) is True:
                                return True

                                return False

                                def throw(self, type = None, traceback = None):
                                raise StopIteration

                                def next(self):
                                try:
                                if hasattr(i, 'next'):
                                # Python 2
                                i_value = self.i.next()
                                else:
                                # Python 3
                                i_value = self.i.__next__()
                                except (StopIteration, GeneratorExit):
                                self.__finished = True
                                else:
                                f_value = self.f(i_value)
                                self.__current_sum += f_value
                                return f_value

                                if self.is_finished:
                                self.throw(GeneratorExit)

                                # Python 3 compatibility
                                __next__ = next


                                ... along with some examples.




                                $$
                                sum_i=1^10
                                $$





                                results = 0
                                sum_iter = Rolling_Summation(iter(range(1, 11)), lambda x: float(x))
                                for r in sum_iter:
                                print("r -> 0".format(r))
                                results += r
                                print("results -> 0".format(results))
                                print("sum_iter.current_sum -> 0".format(sum_iter.current_sum))


                                The above Python code could also be expressed as...





                                sigma = sum([x for x in Rolling_Summation(iter(range(1, 11)), lambda x: float(x))])


                                ... if you're one for one-liners.



                                Both sum_iter.current_sum and sigma from above should result in the same value of 55.0





                                How do you increment by a negative number?




                                Stepping by -1 starting at -1 and going to -10...



                                $$
                                sum_i = -1^-10
                                $$





                                sum([x for x in Rolling_Summation(iter(range(-1, -11, -1)), lambda x: float(x))])
                                # -> -55.0


                                While that may not be technically correct I doubt you'll confuse anyone as to the intent or the results expected. However to be explicit one could also translate it as...



                                $$
                                n left( x right) = -1n
                                $$



                                $$
                                sum_i = n left( 1 right)^-10
                                $$



                                ... if you're one that must be reminded to decrement, and also a hint to yet another answer to...




                                Or any real number?




                                $$
                                p left( x right) = n + 2
                                $$



                                $$
                                sum_i = p left( 0 right)^ge10
                                $$





                                sum([x for x in Rolling_Summation(iter(range(2, 12, 2)), lambda x: float(x))])



                                Now even with this classy method it's just an approximation, a close one if ya dig into what the code is really doing to emulate much of what sigma notation can relay, but eventually you'll find something that'll compute as an oscillating value, or find floating point errors accumulating (just as two examples), and things'll get messy.




                                Bonus examples



                                It's a good idea to second-guess one's self when going from one to the other; off by one errors can be a pain, eg matrix vs list indexing...



                                $$
                                M = beginpmatrix0, 1, 2, dots 9 endpmatrix
                                $$



                                $$
                                sum_i = 1^10 M_i
                                $$





                                M = [x for x in range(0, 9)]
                                # -> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

                                sum([x for x in Rolling_Summation(iter(range(0, len(M) - 1)), M.index)])


                                ... note where those 0s and 1s differ above to save yourself future headaches...



                                $$
                                f left( x right) = begincases
                                1, & textif 2 mid x \
                                0, & textotherwise
                                endcases
                                $$



                                $$
                                sum_i = M_1^10 fleft( i right)
                                $$





                                def f(x):
                                if x % 2 == 0:
                                return 1
                                return 0


                                sum([x for x in Rolling_Summation(iter(M[0:10]), f)])


                                But this has all just been one interpretation for how to translate as many of the features from one to the other, hopefully all before attention spans have run-out.






                                share|cite|improve this answer











                                $endgroup$












                                • $begingroup$
                                  preposteriously too long and way to much overkill.
                                  $endgroup$
                                  – fleablood
                                  Mar 28 at 0:59










                                • $begingroup$
                                  Heh, yeah it was getting ridiculous. Perhaps the edits have now honed it to a finer point.
                                  $endgroup$
                                  – S0AndS0
                                  Mar 28 at 2:20













                                -1












                                -1








                                -1





                                $begingroup$

                                Edit, okay, okay strait to it then (if ya want more examples check the edits), so let's commence with the pealing with Python!



                                $$
                                h left( x right) = x over 2
                                $$



                                $$
                                sum_i=1^end=10 hleft( i right)
                                $$




                                end=10 really should just be 10 to conform with the normal but it's labeled for referencing




                                $sum$ is very analogous to sum(), not much really has to be done, but to ensure everyone's on the same page, both, under the hood kinda look like...





                                def sum_of_list(l):
                                last_value = 0
                                for value in l:
                                last_value += value

                                return value


                                ... and $h left( x right)$ is a bit like...





                                def h(x):
                                # According to lore, multiplication is often faster than division.
                                return x * 0.5


                                ... though not quite because that does not sufficiently express infinities, but let's set that aside for a moment.



                                $i = textstart$ is very much like an iterator, especially when paired with a limit such as $textend$, above an bellow $sum$ respectively. So let's consider it as such for now.



                                $h left( i right)$ when combined with $sum$, eg $sum_h left( i right)$ is almost a function call, it's not quite equivalent but let's not quibble.



                                To approximate these behaviors with some code, here's what I came up with...





                                #!/usr/bin/env python3

                                from collections import Iterator


                                class Rolling_Summation(Iterator):
                                """
                                Rolling_Summation is an __approximation__ of Sigma Notation

                                On each iteration of `Rolling_Summation` the result of `f(i.next())` are `yeild`ed

                                The current sum maybe inspected at any point via the `.current_sum` property
                                """

                                def __init__(self, i = range(1, 11), f = lambda x: float(x)):
                                super(Rolling_Summation, self).__init__()
                                self.i = i
                                self.f = f
                                self.__current_sum = 0
                                self.__finished = False

                                @property
                                def current_sum(self):
                                return self.__current_sum

                                @property
                                def is_finished(self):
                                if bool(self.__finished) is True:
                                return True

                                return False

                                def throw(self, type = None, traceback = None):
                                raise StopIteration

                                def next(self):
                                try:
                                if hasattr(i, 'next'):
                                # Python 2
                                i_value = self.i.next()
                                else:
                                # Python 3
                                i_value = self.i.__next__()
                                except (StopIteration, GeneratorExit):
                                self.__finished = True
                                else:
                                f_value = self.f(i_value)
                                self.__current_sum += f_value
                                return f_value

                                if self.is_finished:
                                self.throw(GeneratorExit)

                                # Python 3 compatibility
                                __next__ = next


                                ... along with some examples.




                                $$
                                sum_i=1^10
                                $$





                                results = 0
                                sum_iter = Rolling_Summation(iter(range(1, 11)), lambda x: float(x))
                                for r in sum_iter:
                                print("r -> 0".format(r))
                                results += r
                                print("results -> 0".format(results))
                                print("sum_iter.current_sum -> 0".format(sum_iter.current_sum))


                                The above Python code could also be expressed as...





                                sigma = sum([x for x in Rolling_Summation(iter(range(1, 11)), lambda x: float(x))])


                                ... if you're one for one-liners.



                                Both sum_iter.current_sum and sigma from above should result in the same value of 55.0





                                How do you increment by a negative number?




                                Stepping by -1 starting at -1 and going to -10...



                                $$
                                sum_i = -1^-10
                                $$





                                sum([x for x in Rolling_Summation(iter(range(-1, -11, -1)), lambda x: float(x))])
                                # -> -55.0


                                While that may not be technically correct I doubt you'll confuse anyone as to the intent or the results expected. However to be explicit one could also translate it as...



                                $$
                                n left( x right) = -1n
                                $$



                                $$
                                sum_i = n left( 1 right)^-10
                                $$



                                ... if you're one that must be reminded to decrement, and also a hint to yet another answer to...




                                Or any real number?




                                $$
                                p left( x right) = n + 2
                                $$



                                $$
                                sum_i = p left( 0 right)^ge10
                                $$





                                sum([x for x in Rolling_Summation(iter(range(2, 12, 2)), lambda x: float(x))])



                                Now even with this classy method it's just an approximation, a close one if ya dig into what the code is really doing to emulate much of what sigma notation can relay, but eventually you'll find something that'll compute as an oscillating value, or find floating point errors accumulating (just as two examples), and things'll get messy.




                                Bonus examples



                                It's a good idea to second-guess one's self when going from one to the other; off by one errors can be a pain, eg matrix vs list indexing...



                                $$
                                M = beginpmatrix0, 1, 2, dots 9 endpmatrix
                                $$



                                $$
                                sum_i = 1^10 M_i
                                $$





                                M = [x for x in range(0, 9)]
                                # -> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

                                sum([x for x in Rolling_Summation(iter(range(0, len(M) - 1)), M.index)])


                                ... note where those 0s and 1s differ above to save yourself future headaches...



                                $$
                                f left( x right) = begincases
                                1, & textif 2 mid x \
                                0, & textotherwise
                                endcases
                                $$



                                $$
                                sum_i = M_1^10 fleft( i right)
                                $$





                                def f(x):
                                if x % 2 == 0:
                                return 1
                                return 0


                                sum([x for x in Rolling_Summation(iter(M[0:10]), f)])


                                But this has all just been one interpretation for how to translate as many of the features from one to the other, hopefully all before attention spans have run-out.






                                share|cite|improve this answer











                                $endgroup$



                                Edit, okay, okay strait to it then (if ya want more examples check the edits), so let's commence with the pealing with Python!



                                $$
                                h left( x right) = x over 2
                                $$



                                $$
                                sum_i=1^end=10 hleft( i right)
                                $$




                                end=10 really should just be 10 to conform with the normal but it's labeled for referencing




                                $sum$ is very analogous to sum(), not much really has to be done, but to ensure everyone's on the same page, both, under the hood kinda look like...





                                def sum_of_list(l):
                                last_value = 0
                                for value in l:
                                last_value += value

                                return value


                                ... and $h left( x right)$ is a bit like...





                                def h(x):
                                # According to lore, multiplication is often faster than division.
                                return x * 0.5


                                ... though not quite because that does not sufficiently express infinities, but let's set that aside for a moment.



                                $i = textstart$ is very much like an iterator, especially when paired with a limit such as $textend$, above an bellow $sum$ respectively. So let's consider it as such for now.



                                $h left( i right)$ when combined with $sum$, eg $sum_h left( i right)$ is almost a function call, it's not quite equivalent but let's not quibble.



                                To approximate these behaviors with some code, here's what I came up with...





                                #!/usr/bin/env python3

                                from collections import Iterator


                                class Rolling_Summation(Iterator):
                                """
                                Rolling_Summation is an __approximation__ of Sigma Notation

                                On each iteration of `Rolling_Summation` the result of `f(i.next())` are `yeild`ed

                                The current sum maybe inspected at any point via the `.current_sum` property
                                """

                                def __init__(self, i = range(1, 11), f = lambda x: float(x)):
                                super(Rolling_Summation, self).__init__()
                                self.i = i
                                self.f = f
                                self.__current_sum = 0
                                self.__finished = False

                                @property
                                def current_sum(self):
                                return self.__current_sum

                                @property
                                def is_finished(self):
                                if bool(self.__finished) is True:
                                return True

                                return False

                                def throw(self, type = None, traceback = None):
                                raise StopIteration

                                def next(self):
                                try:
                                if hasattr(i, 'next'):
                                # Python 2
                                i_value = self.i.next()
                                else:
                                # Python 3
                                i_value = self.i.__next__()
                                except (StopIteration, GeneratorExit):
                                self.__finished = True
                                else:
                                f_value = self.f(i_value)
                                self.__current_sum += f_value
                                return f_value

                                if self.is_finished:
                                self.throw(GeneratorExit)

                                # Python 3 compatibility
                                __next__ = next


                                ... along with some examples.




                                $$
                                sum_i=1^10
                                $$





                                results = 0
                                sum_iter = Rolling_Summation(iter(range(1, 11)), lambda x: float(x))
                                for r in sum_iter:
                                print("r -> 0".format(r))
                                results += r
                                print("results -> 0".format(results))
                                print("sum_iter.current_sum -> 0".format(sum_iter.current_sum))


                                The above Python code could also be expressed as...





                                sigma = sum([x for x in Rolling_Summation(iter(range(1, 11)), lambda x: float(x))])


                                ... if you're one for one-liners.



                                Both sum_iter.current_sum and sigma from above should result in the same value of 55.0





                                How do you increment by a negative number?




                                Stepping by -1 starting at -1 and going to -10...



                                $$
                                sum_i = -1^-10
                                $$





                                sum([x for x in Rolling_Summation(iter(range(-1, -11, -1)), lambda x: float(x))])
                                # -> -55.0


                                While that may not be technically correct I doubt you'll confuse anyone as to the intent or the results expected. However to be explicit one could also translate it as...



                                $$
                                n left( x right) = -1n
                                $$



                                $$
                                sum_i = n left( 1 right)^-10
                                $$



                                ... if you're one that must be reminded to decrement, and also a hint to yet another answer to...




                                Or any real number?




                                $$
                                p left( x right) = n + 2
                                $$



                                $$
                                sum_i = p left( 0 right)^ge10
                                $$





                                sum([x for x in Rolling_Summation(iter(range(2, 12, 2)), lambda x: float(x))])



                                Now even with this classy method it's just an approximation, a close one if ya dig into what the code is really doing to emulate much of what sigma notation can relay, but eventually you'll find something that'll compute as an oscillating value, or find floating point errors accumulating (just as two examples), and things'll get messy.




                                Bonus examples



                                It's a good idea to second-guess one's self when going from one to the other; off by one errors can be a pain, eg matrix vs list indexing...



                                $$
                                M = beginpmatrix0, 1, 2, dots 9 endpmatrix
                                $$



                                $$
                                sum_i = 1^10 M_i
                                $$





                                M = [x for x in range(0, 9)]
                                # -> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

                                sum([x for x in Rolling_Summation(iter(range(0, len(M) - 1)), M.index)])


                                ... note where those 0s and 1s differ above to save yourself future headaches...



                                $$
                                f left( x right) = begincases
                                1, & textif 2 mid x \
                                0, & textotherwise
                                endcases
                                $$



                                $$
                                sum_i = M_1^10 fleft( i right)
                                $$





                                def f(x):
                                if x % 2 == 0:
                                return 1
                                return 0


                                sum([x for x in Rolling_Summation(iter(M[0:10]), f)])


                                But this has all just been one interpretation for how to translate as many of the features from one to the other, hopefully all before attention spans have run-out.







                                share|cite|improve this answer














                                share|cite|improve this answer



                                share|cite|improve this answer








                                edited Mar 28 at 7:56

























                                answered Mar 27 at 6:58









                                S0AndS0S0AndS0

                                1917




                                1917











                                • $begingroup$
                                  preposteriously too long and way to much overkill.
                                  $endgroup$
                                  – fleablood
                                  Mar 28 at 0:59










                                • $begingroup$
                                  Heh, yeah it was getting ridiculous. Perhaps the edits have now honed it to a finer point.
                                  $endgroup$
                                  – S0AndS0
                                  Mar 28 at 2:20
















                                • $begingroup$
                                  preposteriously too long and way to much overkill.
                                  $endgroup$
                                  – fleablood
                                  Mar 28 at 0:59










                                • $begingroup$
                                  Heh, yeah it was getting ridiculous. Perhaps the edits have now honed it to a finer point.
                                  $endgroup$
                                  – S0AndS0
                                  Mar 28 at 2:20















                                $begingroup$
                                preposteriously too long and way to much overkill.
                                $endgroup$
                                – fleablood
                                Mar 28 at 0:59




                                $begingroup$
                                preposteriously too long and way to much overkill.
                                $endgroup$
                                – fleablood
                                Mar 28 at 0:59












                                $begingroup$
                                Heh, yeah it was getting ridiculous. Perhaps the edits have now honed it to a finer point.
                                $endgroup$
                                – S0AndS0
                                Mar 28 at 2:20




                                $begingroup$
                                Heh, yeah it was getting ridiculous. Perhaps the edits have now honed it to a finer point.
                                $endgroup$
                                – S0AndS0
                                Mar 28 at 2:20

















                                draft saved

                                draft discarded
















































                                Thanks for contributing an answer to Mathematics Stack Exchange!


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid


                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.

                                Use MathJax to format equations. MathJax reference.


                                To learn more, see our tips on writing great answers.




                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function ()
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f1600384%2fdo-summations-always-increment-by-one-how-do-you-incrment-by-a-negative-number%23new-answer', 'question_page');

                                );

                                Post as a guest















                                Required, but never shown





















































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown

































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown







                                Popular posts from this blog

                                How should I support this large drywall patch? Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?How do I cover large gaps in drywall?How do I keep drywall around a patch from crumbling?Can I glue a second layer of drywall?How to patch long strip on drywall?Large drywall patch: how to avoid bulging seams?Drywall Mesh Patch vs. Bulge? To remove or not to remove?How to fix this drywall job?Prep drywall before backsplashWhat's the best way to fix this horrible drywall patch job?Drywall patching using 3M Patch Plus Primer

                                random experiment with two different functions on unit interval Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern)Random variable and probability space notionsRandom Walk with EdgesFinding functions where the increase over a random interval is Poisson distributedNumber of days until dayCan an observed event in fact be of zero probability?Unit random processmodels of coins and uniform distributionHow to get the number of successes given $n$ trials , probability $P$ and a random variable $X$Absorbing Markov chain in a computer. Is “almost every” turned into always convergence in computer executions?Stopped random walk is not uniformly integrable

                                Lowndes Grove History Architecture References Navigation menu32°48′6″N 79°57′58″W / 32.80167°N 79.96611°W / 32.80167; -79.9661132°48′6″N 79°57′58″W / 32.80167°N 79.96611°W / 32.80167; -79.9661178002500"National Register Information System"Historic houses of South Carolina"Lowndes Grove""+32° 48' 6.00", −79° 57' 58.00""Lowndes Grove, Charleston County (260 St. Margaret St., Charleston)""Lowndes Grove"The Charleston ExpositionIt Happened in South Carolina"Lowndes Grove (House), Saint Margaret Street & Sixth Avenue, Charleston, Charleston County, SC(Photographs)"Plantations of the Carolina Low Countrye