{"id":231,"date":"2010-11-11T16:56:43","date_gmt":"2010-11-11T21:56:43","guid":{"rendered":"https:\/\/cyrussamii.com\/?p=231"},"modified":"2010-11-11T18:23:30","modified_gmt":"2010-11-11T23:23:30","slug":"fun-math-sum-of-integers","status":"publish","type":"post","link":"https:\/\/cyrussamii.com\/?p=231","title":{"rendered":"Fun math: sum of integers"},"content":{"rendered":"<p>Math is often about finding the right analogy, often a spatial analogy. \u00a0Suppose you want to compute the sum of integers, $latex S = 1+2+3+ \\hdots + N$.  Consider decomposing the sum as,<\/p>\n<p style=\"text-align: center;\">$latex \\begin{array}{cccccc}S = &amp; 1 &amp; + 1 &amp; + 1 &amp; + \\hdots &amp; + 1\\\\    &amp;   &amp; + 1 &amp; + 1 &amp; + \\hdots &amp; + 1 \\\\    &amp;   &amp;     &amp; + 1 &amp; + \\hdots &amp; + 1\\\\    &amp;   &amp;     &amp;     &amp;   \\vdots &amp; \\\\        &amp;   &amp;     &amp;     &amp;     &amp; + 1,\\end{array}$<\/p>\n<p>where you&#8217;ll note the column sums equal the integers in the sequence. \u00a0You&#8217;ll have a bunch of ones that form a triangle.  Imagine taking such triangle, copying it, flipping it and then joining the copy to the first triangle.  Removing the &#8220;$latex +$&#8221; signs you&#8217;d get something that looks like,<\/p>\n<p style=\"text-align: center;\">$latex \\begin{array}{ccccc} 1 &amp; 1 &amp; 1 &amp; \\hdots &amp; 1\\\\ (1)  &amp; 1 &amp; 1 &amp; \\hdots &amp; 1\\\\ (1)  &amp; (1) &amp; 1 &amp; \\hdots &amp; 1\\\\   &amp;   &amp;   &amp; \\vdots &amp;  \\\\ (1)  &amp; (1)  &amp; (1)  &amp; \\hdots       &amp; 1 \\\\ (1) &amp; (1) &amp; (1) &amp; \\hdots &amp; (1), \\end{array}$<\/p>\n<p>where I&#8217;ve put parentheses on the $latex 1$&#8217;s from the second, copied triangle.  By analogy, the sum of the integers from the original sequence is equal to half the area of a rectangle that is characterized by this matrix of ones&#8212;that is, a rectangle of height $latex n+1$ and width $latex n$.  As such, $latex S = n(n+1)\/2$. \u00a0This comes up, e.g., in the asymptotic approximation for the Wilcoxon signed rank test (<a href=\"http:\/\/en.wikipedia.org\/wiki\/Wilcoxon_signed-rank_test\">link<\/a>).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Math is often about finding the right analogy, often a spatial analogy. \u00a0Suppose you want to compute the sum of integers, $latex S = 1+2+3+ \\hdots + N$. Consider decomposing the sum as, $latex \\begin{array}{cccccc}S = &amp; 1 &amp; + 1 &amp; + 1 &amp; + \\hdots &amp; + 1\\\\ &amp; &amp; + 1 &amp; &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/cyrussamii.com\/?p=231\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Fun math: sum of integers&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-231","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/cyrussamii.com\/index.php?rest_route=\/wp\/v2\/posts\/231","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cyrussamii.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cyrussamii.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cyrussamii.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cyrussamii.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=231"}],"version-history":[{"count":15,"href":"https:\/\/cyrussamii.com\/index.php?rest_route=\/wp\/v2\/posts\/231\/revisions"}],"predecessor-version":[{"id":246,"href":"https:\/\/cyrussamii.com\/index.php?rest_route=\/wp\/v2\/posts\/231\/revisions\/246"}],"wp:attachment":[{"href":"https:\/\/cyrussamii.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=231"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cyrussamii.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=231"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cyrussamii.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=231"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}