Why is the formula for combinations with repetition equal to $(n + k - 1)$ choose $k$?












0












$begingroup$


If we had something like:



$$
x_1 + x_2 + x_3 = 7, x_i >= 0
$$



It could be solved using the stars and bars method:



$$
****|**|*
$$

The number of ways to choose 2 spots for the bars is 9 choose 2. But using the $(n+r-1)$ choose $r$ formula, it would be:



(7 + 3 - 1) choose 3 = 9 choose 3.



So I'm confused why the formula for combinations with repetition isn't $(n+r-1)$ choose $(r-1)$. It seems like what we care about is the number of bars involved in choosing r objects, which is $r-1$. Why is r used in the formula whatsoever?










share|cite|improve this question











$endgroup$

















    0












    $begingroup$


    If we had something like:



    $$
    x_1 + x_2 + x_3 = 7, x_i >= 0
    $$



    It could be solved using the stars and bars method:



    $$
    ****|**|*
    $$

    The number of ways to choose 2 spots for the bars is 9 choose 2. But using the $(n+r-1)$ choose $r$ formula, it would be:



    (7 + 3 - 1) choose 3 = 9 choose 3.



    So I'm confused why the formula for combinations with repetition isn't $(n+r-1)$ choose $(r-1)$. It seems like what we care about is the number of bars involved in choosing r objects, which is $r-1$. Why is r used in the formula whatsoever?










    share|cite|improve this question











    $endgroup$















      0












      0








      0





      $begingroup$


      If we had something like:



      $$
      x_1 + x_2 + x_3 = 7, x_i >= 0
      $$



      It could be solved using the stars and bars method:



      $$
      ****|**|*
      $$

      The number of ways to choose 2 spots for the bars is 9 choose 2. But using the $(n+r-1)$ choose $r$ formula, it would be:



      (7 + 3 - 1) choose 3 = 9 choose 3.



      So I'm confused why the formula for combinations with repetition isn't $(n+r-1)$ choose $(r-1)$. It seems like what we care about is the number of bars involved in choosing r objects, which is $r-1$. Why is r used in the formula whatsoever?










      share|cite|improve this question











      $endgroup$




      If we had something like:



      $$
      x_1 + x_2 + x_3 = 7, x_i >= 0
      $$



      It could be solved using the stars and bars method:



      $$
      ****|**|*
      $$

      The number of ways to choose 2 spots for the bars is 9 choose 2. But using the $(n+r-1)$ choose $r$ formula, it would be:



      (7 + 3 - 1) choose 3 = 9 choose 3.



      So I'm confused why the formula for combinations with repetition isn't $(n+r-1)$ choose $(r-1)$. It seems like what we care about is the number of bars involved in choosing r objects, which is $r-1$. Why is r used in the formula whatsoever?







      combinatorics discrete-mathematics combinations






      share|cite|improve this question















      share|cite|improve this question













      share|cite|improve this question




      share|cite|improve this question








      edited Jan 29 at 21:03









      Michael Rybkin

      4,084422




      4,084422










      asked Jan 29 at 19:55









      Inertial IgnoranceInertial Ignorance

      17419




      17419






















          1 Answer
          1






          active

          oldest

          votes


















          2












          $begingroup$

          You are confusing yourself as to what role the $n$ plays and what role the $r$ plays. In order to try to clarify this, I will use neither $n$ nor will I use $r$.



          The number of non-negative integer solutions to the following system:



          $$begin{cases}x_1+x_2+dots+x_a = b\0leq x_iend{cases}$$



          is going to be



          $$binom{a+b-1}{a-1}$$



          which is the same thing as



          $$binom{a+b-1}{b}$$



          These are equal due to the well known identity that $binom{n}{r}=binom{n}{n-r}$, e.g. to choose $r$ winners from $n$ people and the rest be losers is the same as choosing $n-r$ losers from $n$ people instead and the rest be winners.





          Your confusion comes from some people choosing to write the formula with $n$ representing the number of balls and $k$ the number of bins while other people might choose to write $n$ as the number of bins with $k$ as the number of balls. In the first case it might have been written as $binom{n+k-1}{k-1}$ and in the second case it might have been written as $binom{n+k-1}{k}$. These are the same formula just with the roles of $n$ and $k$ reversed!



          In either case, the top of the binomial coefficient will be the number of balls plus the number of bins minus one, and the bottom will be the number of bins minus one (or equivalently, the number of balls). Do not try to memorize formulas based on how they appear... instead try to learn formulas for what they mean and what they actually represent.






          share|cite|improve this answer









          $endgroup$














            Your Answer





            StackExchange.ifUsing("editor", function () {
            return StackExchange.using("mathjaxEditing", function () {
            StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
            StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
            });
            });
            }, "mathjax-editing");

            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%2f3092645%2fwhy-is-the-formula-for-combinations-with-repetition-equal-to-n-k-1-choos%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            2












            $begingroup$

            You are confusing yourself as to what role the $n$ plays and what role the $r$ plays. In order to try to clarify this, I will use neither $n$ nor will I use $r$.



            The number of non-negative integer solutions to the following system:



            $$begin{cases}x_1+x_2+dots+x_a = b\0leq x_iend{cases}$$



            is going to be



            $$binom{a+b-1}{a-1}$$



            which is the same thing as



            $$binom{a+b-1}{b}$$



            These are equal due to the well known identity that $binom{n}{r}=binom{n}{n-r}$, e.g. to choose $r$ winners from $n$ people and the rest be losers is the same as choosing $n-r$ losers from $n$ people instead and the rest be winners.





            Your confusion comes from some people choosing to write the formula with $n$ representing the number of balls and $k$ the number of bins while other people might choose to write $n$ as the number of bins with $k$ as the number of balls. In the first case it might have been written as $binom{n+k-1}{k-1}$ and in the second case it might have been written as $binom{n+k-1}{k}$. These are the same formula just with the roles of $n$ and $k$ reversed!



            In either case, the top of the binomial coefficient will be the number of balls plus the number of bins minus one, and the bottom will be the number of bins minus one (or equivalently, the number of balls). Do not try to memorize formulas based on how they appear... instead try to learn formulas for what they mean and what they actually represent.






            share|cite|improve this answer









            $endgroup$


















              2












              $begingroup$

              You are confusing yourself as to what role the $n$ plays and what role the $r$ plays. In order to try to clarify this, I will use neither $n$ nor will I use $r$.



              The number of non-negative integer solutions to the following system:



              $$begin{cases}x_1+x_2+dots+x_a = b\0leq x_iend{cases}$$



              is going to be



              $$binom{a+b-1}{a-1}$$



              which is the same thing as



              $$binom{a+b-1}{b}$$



              These are equal due to the well known identity that $binom{n}{r}=binom{n}{n-r}$, e.g. to choose $r$ winners from $n$ people and the rest be losers is the same as choosing $n-r$ losers from $n$ people instead and the rest be winners.





              Your confusion comes from some people choosing to write the formula with $n$ representing the number of balls and $k$ the number of bins while other people might choose to write $n$ as the number of bins with $k$ as the number of balls. In the first case it might have been written as $binom{n+k-1}{k-1}$ and in the second case it might have been written as $binom{n+k-1}{k}$. These are the same formula just with the roles of $n$ and $k$ reversed!



              In either case, the top of the binomial coefficient will be the number of balls plus the number of bins minus one, and the bottom will be the number of bins minus one (or equivalently, the number of balls). Do not try to memorize formulas based on how they appear... instead try to learn formulas for what they mean and what they actually represent.






              share|cite|improve this answer









              $endgroup$
















                2












                2








                2





                $begingroup$

                You are confusing yourself as to what role the $n$ plays and what role the $r$ plays. In order to try to clarify this, I will use neither $n$ nor will I use $r$.



                The number of non-negative integer solutions to the following system:



                $$begin{cases}x_1+x_2+dots+x_a = b\0leq x_iend{cases}$$



                is going to be



                $$binom{a+b-1}{a-1}$$



                which is the same thing as



                $$binom{a+b-1}{b}$$



                These are equal due to the well known identity that $binom{n}{r}=binom{n}{n-r}$, e.g. to choose $r$ winners from $n$ people and the rest be losers is the same as choosing $n-r$ losers from $n$ people instead and the rest be winners.





                Your confusion comes from some people choosing to write the formula with $n$ representing the number of balls and $k$ the number of bins while other people might choose to write $n$ as the number of bins with $k$ as the number of balls. In the first case it might have been written as $binom{n+k-1}{k-1}$ and in the second case it might have been written as $binom{n+k-1}{k}$. These are the same formula just with the roles of $n$ and $k$ reversed!



                In either case, the top of the binomial coefficient will be the number of balls plus the number of bins minus one, and the bottom will be the number of bins minus one (or equivalently, the number of balls). Do not try to memorize formulas based on how they appear... instead try to learn formulas for what they mean and what they actually represent.






                share|cite|improve this answer









                $endgroup$



                You are confusing yourself as to what role the $n$ plays and what role the $r$ plays. In order to try to clarify this, I will use neither $n$ nor will I use $r$.



                The number of non-negative integer solutions to the following system:



                $$begin{cases}x_1+x_2+dots+x_a = b\0leq x_iend{cases}$$



                is going to be



                $$binom{a+b-1}{a-1}$$



                which is the same thing as



                $$binom{a+b-1}{b}$$



                These are equal due to the well known identity that $binom{n}{r}=binom{n}{n-r}$, e.g. to choose $r$ winners from $n$ people and the rest be losers is the same as choosing $n-r$ losers from $n$ people instead and the rest be winners.





                Your confusion comes from some people choosing to write the formula with $n$ representing the number of balls and $k$ the number of bins while other people might choose to write $n$ as the number of bins with $k$ as the number of balls. In the first case it might have been written as $binom{n+k-1}{k-1}$ and in the second case it might have been written as $binom{n+k-1}{k}$. These are the same formula just with the roles of $n$ and $k$ reversed!



                In either case, the top of the binomial coefficient will be the number of balls plus the number of bins minus one, and the bottom will be the number of bins minus one (or equivalently, the number of balls). Do not try to memorize formulas based on how they appear... instead try to learn formulas for what they mean and what they actually represent.







                share|cite|improve this answer












                share|cite|improve this answer



                share|cite|improve this answer










                answered Jan 29 at 20:02









                JMoravitzJMoravitz

                48.7k43988




                48.7k43988






























                    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%2f3092645%2fwhy-is-the-formula-for-combinations-with-repetition-equal-to-n-k-1-choos%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

                    MongoDB - Not Authorized To Execute Command

                    How to fix TextFormField cause rebuild widget in Flutter

                    in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith