Number of times I will get b balls from the bag












0












$begingroup$


I have 'n' identical balls and 'k' distinct bags. So total number of ways I can put balls with no restriction in bags is ${k+n-1 choose k-1}$. So I want to know the number of times there were exactly 'b' balls in a particular bag.



Eg-> I have 3 balls and 3 bags. So ${3+3-1 choose 3-1}$ = 10 ways.



If b = 0, there are 4 times [(0,0,3),(0,3,0),(0,1,2),(0,2,1)]



If b = 1, there are 3 times [(1,0,2),(1,2,0),(1,1,1)]



(here I am assuming that the chosen bag is first one)



So how many times do I get exactly 'b' balls in a particular bag?










share|cite|improve this question











$endgroup$

















    0












    $begingroup$


    I have 'n' identical balls and 'k' distinct bags. So total number of ways I can put balls with no restriction in bags is ${k+n-1 choose k-1}$. So I want to know the number of times there were exactly 'b' balls in a particular bag.



    Eg-> I have 3 balls and 3 bags. So ${3+3-1 choose 3-1}$ = 10 ways.



    If b = 0, there are 4 times [(0,0,3),(0,3,0),(0,1,2),(0,2,1)]



    If b = 1, there are 3 times [(1,0,2),(1,2,0),(1,1,1)]



    (here I am assuming that the chosen bag is first one)



    So how many times do I get exactly 'b' balls in a particular bag?










    share|cite|improve this question











    $endgroup$















      0












      0








      0





      $begingroup$


      I have 'n' identical balls and 'k' distinct bags. So total number of ways I can put balls with no restriction in bags is ${k+n-1 choose k-1}$. So I want to know the number of times there were exactly 'b' balls in a particular bag.



      Eg-> I have 3 balls and 3 bags. So ${3+3-1 choose 3-1}$ = 10 ways.



      If b = 0, there are 4 times [(0,0,3),(0,3,0),(0,1,2),(0,2,1)]



      If b = 1, there are 3 times [(1,0,2),(1,2,0),(1,1,1)]



      (here I am assuming that the chosen bag is first one)



      So how many times do I get exactly 'b' balls in a particular bag?










      share|cite|improve this question











      $endgroup$




      I have 'n' identical balls and 'k' distinct bags. So total number of ways I can put balls with no restriction in bags is ${k+n-1 choose k-1}$. So I want to know the number of times there were exactly 'b' balls in a particular bag.



      Eg-> I have 3 balls and 3 bags. So ${3+3-1 choose 3-1}$ = 10 ways.



      If b = 0, there are 4 times [(0,0,3),(0,3,0),(0,1,2),(0,2,1)]



      If b = 1, there are 3 times [(1,0,2),(1,2,0),(1,1,1)]



      (here I am assuming that the chosen bag is first one)



      So how many times do I get exactly 'b' balls in a particular bag?







      combinatorics balls-in-bins






      share|cite|improve this question















      share|cite|improve this question













      share|cite|improve this question




      share|cite|improve this question








      edited Dec 13 '18 at 6:14







      Sagar Chand

















      asked Dec 13 '18 at 4:38









      Sagar ChandSagar Chand

      1,2731520




      1,2731520






















          1 Answer
          1






          active

          oldest

          votes


















          2












          $begingroup$

          Your formula is slightly wrong. The number of ways in which $n$ balls can be put in $k$ distinct bags is $binom{n+k-1}{color{red}k-1}$. The reason being, that while applying stars and bars, we have to insert $k-1$ bars in any of $k+n-1$ positions, so that there are $k$ partitions formed, which we assume form the contents of each bag. For example, distributing $3$ balls in two boxes means you have to put $1$ bar between three balls, and there are $4$ places for it($2$ in the middle and two on either side) :
          $$
          - cdot-cdot-cdot-
          $$



          The problem that you state can be reformed as follows : if $x_i$ denotes the number of balls in bag $b_i$, then the number of ways that $n$ balls can be put in $k$ bags is the number of non-negative solutions to the equation $x_1+...+x_k = n$.



          Suppose there are exactly $b$ balls in some pre-chosen bag, say $b_1$. Then, the rest of the balls contain exactly $n-b$ ball without restriction. So the number of possibilities is the number of solutions to $x_2+...+x_{k} = n-b$, the answer to which is $binom{n-b+k-2}{k-2}$, using the very same stars and bars logic with which one determines the number of non-negative solutions to $x_1+...+x_k = n$.



          For example, if $n=3,k=3$, we see that $binom 52 = 10$.



          If $b = 0$, then $binom{3-0+3-2}{3-2} = binom{4}{1} = 4$ possibilities present themselves. They are as you have specified.



          If $b = 1$, then $binom{3-1+3-2}{3-2} = binom 31 = 3$ with possibilities as given.






          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%2f3037602%2fnumber-of-times-i-will-get-b-balls-from-the-bag%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$

            Your formula is slightly wrong. The number of ways in which $n$ balls can be put in $k$ distinct bags is $binom{n+k-1}{color{red}k-1}$. The reason being, that while applying stars and bars, we have to insert $k-1$ bars in any of $k+n-1$ positions, so that there are $k$ partitions formed, which we assume form the contents of each bag. For example, distributing $3$ balls in two boxes means you have to put $1$ bar between three balls, and there are $4$ places for it($2$ in the middle and two on either side) :
            $$
            - cdot-cdot-cdot-
            $$



            The problem that you state can be reformed as follows : if $x_i$ denotes the number of balls in bag $b_i$, then the number of ways that $n$ balls can be put in $k$ bags is the number of non-negative solutions to the equation $x_1+...+x_k = n$.



            Suppose there are exactly $b$ balls in some pre-chosen bag, say $b_1$. Then, the rest of the balls contain exactly $n-b$ ball without restriction. So the number of possibilities is the number of solutions to $x_2+...+x_{k} = n-b$, the answer to which is $binom{n-b+k-2}{k-2}$, using the very same stars and bars logic with which one determines the number of non-negative solutions to $x_1+...+x_k = n$.



            For example, if $n=3,k=3$, we see that $binom 52 = 10$.



            If $b = 0$, then $binom{3-0+3-2}{3-2} = binom{4}{1} = 4$ possibilities present themselves. They are as you have specified.



            If $b = 1$, then $binom{3-1+3-2}{3-2} = binom 31 = 3$ with possibilities as given.






            share|cite|improve this answer









            $endgroup$


















              2












              $begingroup$

              Your formula is slightly wrong. The number of ways in which $n$ balls can be put in $k$ distinct bags is $binom{n+k-1}{color{red}k-1}$. The reason being, that while applying stars and bars, we have to insert $k-1$ bars in any of $k+n-1$ positions, so that there are $k$ partitions formed, which we assume form the contents of each bag. For example, distributing $3$ balls in two boxes means you have to put $1$ bar between three balls, and there are $4$ places for it($2$ in the middle and two on either side) :
              $$
              - cdot-cdot-cdot-
              $$



              The problem that you state can be reformed as follows : if $x_i$ denotes the number of balls in bag $b_i$, then the number of ways that $n$ balls can be put in $k$ bags is the number of non-negative solutions to the equation $x_1+...+x_k = n$.



              Suppose there are exactly $b$ balls in some pre-chosen bag, say $b_1$. Then, the rest of the balls contain exactly $n-b$ ball without restriction. So the number of possibilities is the number of solutions to $x_2+...+x_{k} = n-b$, the answer to which is $binom{n-b+k-2}{k-2}$, using the very same stars and bars logic with which one determines the number of non-negative solutions to $x_1+...+x_k = n$.



              For example, if $n=3,k=3$, we see that $binom 52 = 10$.



              If $b = 0$, then $binom{3-0+3-2}{3-2} = binom{4}{1} = 4$ possibilities present themselves. They are as you have specified.



              If $b = 1$, then $binom{3-1+3-2}{3-2} = binom 31 = 3$ with possibilities as given.






              share|cite|improve this answer









              $endgroup$
















                2












                2








                2





                $begingroup$

                Your formula is slightly wrong. The number of ways in which $n$ balls can be put in $k$ distinct bags is $binom{n+k-1}{color{red}k-1}$. The reason being, that while applying stars and bars, we have to insert $k-1$ bars in any of $k+n-1$ positions, so that there are $k$ partitions formed, which we assume form the contents of each bag. For example, distributing $3$ balls in two boxes means you have to put $1$ bar between three balls, and there are $4$ places for it($2$ in the middle and two on either side) :
                $$
                - cdot-cdot-cdot-
                $$



                The problem that you state can be reformed as follows : if $x_i$ denotes the number of balls in bag $b_i$, then the number of ways that $n$ balls can be put in $k$ bags is the number of non-negative solutions to the equation $x_1+...+x_k = n$.



                Suppose there are exactly $b$ balls in some pre-chosen bag, say $b_1$. Then, the rest of the balls contain exactly $n-b$ ball without restriction. So the number of possibilities is the number of solutions to $x_2+...+x_{k} = n-b$, the answer to which is $binom{n-b+k-2}{k-2}$, using the very same stars and bars logic with which one determines the number of non-negative solutions to $x_1+...+x_k = n$.



                For example, if $n=3,k=3$, we see that $binom 52 = 10$.



                If $b = 0$, then $binom{3-0+3-2}{3-2} = binom{4}{1} = 4$ possibilities present themselves. They are as you have specified.



                If $b = 1$, then $binom{3-1+3-2}{3-2} = binom 31 = 3$ with possibilities as given.






                share|cite|improve this answer









                $endgroup$



                Your formula is slightly wrong. The number of ways in which $n$ balls can be put in $k$ distinct bags is $binom{n+k-1}{color{red}k-1}$. The reason being, that while applying stars and bars, we have to insert $k-1$ bars in any of $k+n-1$ positions, so that there are $k$ partitions formed, which we assume form the contents of each bag. For example, distributing $3$ balls in two boxes means you have to put $1$ bar between three balls, and there are $4$ places for it($2$ in the middle and two on either side) :
                $$
                - cdot-cdot-cdot-
                $$



                The problem that you state can be reformed as follows : if $x_i$ denotes the number of balls in bag $b_i$, then the number of ways that $n$ balls can be put in $k$ bags is the number of non-negative solutions to the equation $x_1+...+x_k = n$.



                Suppose there are exactly $b$ balls in some pre-chosen bag, say $b_1$. Then, the rest of the balls contain exactly $n-b$ ball without restriction. So the number of possibilities is the number of solutions to $x_2+...+x_{k} = n-b$, the answer to which is $binom{n-b+k-2}{k-2}$, using the very same stars and bars logic with which one determines the number of non-negative solutions to $x_1+...+x_k = n$.



                For example, if $n=3,k=3$, we see that $binom 52 = 10$.



                If $b = 0$, then $binom{3-0+3-2}{3-2} = binom{4}{1} = 4$ possibilities present themselves. They are as you have specified.



                If $b = 1$, then $binom{3-1+3-2}{3-2} = binom 31 = 3$ with possibilities as given.







                share|cite|improve this answer












                share|cite|improve this answer



                share|cite|improve this answer










                answered Dec 13 '18 at 5:50









                астон вілла олоф мэллбэргастон вілла олоф мэллбэрг

                38.5k33376




                38.5k33376






























                    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%2f3037602%2fnumber-of-times-i-will-get-b-balls-from-the-bag%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

                    Probability when a professor distributes a quiz and homework assignment to a class of n students.

                    Aardman Animations

                    Are they similar matrix