Number of unique ways to select $3$ balls from $4$ red balls, $2$ green balls and $1$ blue ball











up vote
1
down vote

favorite












Suppose there is a jar with $7$ balls: $4$ red, $2$ green and $1$ blue.

In how many unique ways can we choose $3$ balls?



Just by considering all the possibilities, I found out the answer is $6$. Namely:




  • red, red, red

  • red, red, green

  • red, red, blue

  • green, green, red

  • green, green, blue

  • blue, green, red


I was wondering if it is possible to express the solution in terms of the amount of different colors (in this case $3$) and the quantity per color. (in this case $4$, $2$ and $1$)










share|cite|improve this question
























  • It is possible. That said, for the given numbers, simply listing the possibilities is probably the most efficient method.
    – N. F. Taussig
    Nov 16 at 18:20










  • Another way to look at it is : Let $x_1,x_2,x_3$ be the number of red, green and blue balls respectively. You wish to find all possible solutions to $x_1+x_2+x_3=3$ such that $0leq x_1leq 4, 0leq x_2leq 2, 0leq x_3leq 1$. By the way your answer is $^7C_3$ I guess.
    – Yadati Kiran
    Nov 16 at 18:22












  • One might also think of this as a sample problem for counting the number of contingency tables with two rows and three columns having prescribed marginal sums. Even for two rows but arbitrarily many columns such counting problems have been shown to be NP hard.
    – hardmath
    Nov 16 at 18:25












  • @YadatiKiran $binom{7}{3}$ is an answer to a related but different question where the balls were all distinctly labeled. Here, presumably, the red balls are all identical, etc... Your rephrasing of the question however is correct, but the method of solution would likely either involve brute force, or inclusion-exclusion with stars and bars which is likely just as tedious as brute force here.
    – JMoravitz
    Nov 16 at 18:35










  • An alternate solution, which if you have access to computer software is easy to implement for reasonable numbers (but is practically brute force in disguise) is to look at the coefficient of $x^3$ in the expansion of $(1+x+x^2+x^3+x^4)(1+x+x^2)(1+x)$.
    – JMoravitz
    Nov 16 at 18:37















up vote
1
down vote

favorite












Suppose there is a jar with $7$ balls: $4$ red, $2$ green and $1$ blue.

In how many unique ways can we choose $3$ balls?



Just by considering all the possibilities, I found out the answer is $6$. Namely:




  • red, red, red

  • red, red, green

  • red, red, blue

  • green, green, red

  • green, green, blue

  • blue, green, red


I was wondering if it is possible to express the solution in terms of the amount of different colors (in this case $3$) and the quantity per color. (in this case $4$, $2$ and $1$)










share|cite|improve this question
























  • It is possible. That said, for the given numbers, simply listing the possibilities is probably the most efficient method.
    – N. F. Taussig
    Nov 16 at 18:20










  • Another way to look at it is : Let $x_1,x_2,x_3$ be the number of red, green and blue balls respectively. You wish to find all possible solutions to $x_1+x_2+x_3=3$ such that $0leq x_1leq 4, 0leq x_2leq 2, 0leq x_3leq 1$. By the way your answer is $^7C_3$ I guess.
    – Yadati Kiran
    Nov 16 at 18:22












  • One might also think of this as a sample problem for counting the number of contingency tables with two rows and three columns having prescribed marginal sums. Even for two rows but arbitrarily many columns such counting problems have been shown to be NP hard.
    – hardmath
    Nov 16 at 18:25












  • @YadatiKiran $binom{7}{3}$ is an answer to a related but different question where the balls were all distinctly labeled. Here, presumably, the red balls are all identical, etc... Your rephrasing of the question however is correct, but the method of solution would likely either involve brute force, or inclusion-exclusion with stars and bars which is likely just as tedious as brute force here.
    – JMoravitz
    Nov 16 at 18:35










  • An alternate solution, which if you have access to computer software is easy to implement for reasonable numbers (but is practically brute force in disguise) is to look at the coefficient of $x^3$ in the expansion of $(1+x+x^2+x^3+x^4)(1+x+x^2)(1+x)$.
    – JMoravitz
    Nov 16 at 18:37













up vote
1
down vote

favorite









up vote
1
down vote

favorite











Suppose there is a jar with $7$ balls: $4$ red, $2$ green and $1$ blue.

In how many unique ways can we choose $3$ balls?



Just by considering all the possibilities, I found out the answer is $6$. Namely:




  • red, red, red

  • red, red, green

  • red, red, blue

  • green, green, red

  • green, green, blue

  • blue, green, red


I was wondering if it is possible to express the solution in terms of the amount of different colors (in this case $3$) and the quantity per color. (in this case $4$, $2$ and $1$)










share|cite|improve this question















Suppose there is a jar with $7$ balls: $4$ red, $2$ green and $1$ blue.

In how many unique ways can we choose $3$ balls?



Just by considering all the possibilities, I found out the answer is $6$. Namely:




  • red, red, red

  • red, red, green

  • red, red, blue

  • green, green, red

  • green, green, blue

  • blue, green, red


I was wondering if it is possible to express the solution in terms of the amount of different colors (in this case $3$) and the quantity per color. (in this case $4$, $2$ and $1$)







combinatorics






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Nov 16 at 18:18









N. F. Taussig

42.9k93254




42.9k93254










asked Nov 16 at 18:13









Whebon

82




82












  • It is possible. That said, for the given numbers, simply listing the possibilities is probably the most efficient method.
    – N. F. Taussig
    Nov 16 at 18:20










  • Another way to look at it is : Let $x_1,x_2,x_3$ be the number of red, green and blue balls respectively. You wish to find all possible solutions to $x_1+x_2+x_3=3$ such that $0leq x_1leq 4, 0leq x_2leq 2, 0leq x_3leq 1$. By the way your answer is $^7C_3$ I guess.
    – Yadati Kiran
    Nov 16 at 18:22












  • One might also think of this as a sample problem for counting the number of contingency tables with two rows and three columns having prescribed marginal sums. Even for two rows but arbitrarily many columns such counting problems have been shown to be NP hard.
    – hardmath
    Nov 16 at 18:25












  • @YadatiKiran $binom{7}{3}$ is an answer to a related but different question where the balls were all distinctly labeled. Here, presumably, the red balls are all identical, etc... Your rephrasing of the question however is correct, but the method of solution would likely either involve brute force, or inclusion-exclusion with stars and bars which is likely just as tedious as brute force here.
    – JMoravitz
    Nov 16 at 18:35










  • An alternate solution, which if you have access to computer software is easy to implement for reasonable numbers (but is practically brute force in disguise) is to look at the coefficient of $x^3$ in the expansion of $(1+x+x^2+x^3+x^4)(1+x+x^2)(1+x)$.
    – JMoravitz
    Nov 16 at 18:37


















  • It is possible. That said, for the given numbers, simply listing the possibilities is probably the most efficient method.
    – N. F. Taussig
    Nov 16 at 18:20










  • Another way to look at it is : Let $x_1,x_2,x_3$ be the number of red, green and blue balls respectively. You wish to find all possible solutions to $x_1+x_2+x_3=3$ such that $0leq x_1leq 4, 0leq x_2leq 2, 0leq x_3leq 1$. By the way your answer is $^7C_3$ I guess.
    – Yadati Kiran
    Nov 16 at 18:22












  • One might also think of this as a sample problem for counting the number of contingency tables with two rows and three columns having prescribed marginal sums. Even for two rows but arbitrarily many columns such counting problems have been shown to be NP hard.
    – hardmath
    Nov 16 at 18:25












  • @YadatiKiran $binom{7}{3}$ is an answer to a related but different question where the balls were all distinctly labeled. Here, presumably, the red balls are all identical, etc... Your rephrasing of the question however is correct, but the method of solution would likely either involve brute force, or inclusion-exclusion with stars and bars which is likely just as tedious as brute force here.
    – JMoravitz
    Nov 16 at 18:35










  • An alternate solution, which if you have access to computer software is easy to implement for reasonable numbers (but is practically brute force in disguise) is to look at the coefficient of $x^3$ in the expansion of $(1+x+x^2+x^3+x^4)(1+x+x^2)(1+x)$.
    – JMoravitz
    Nov 16 at 18:37
















It is possible. That said, for the given numbers, simply listing the possibilities is probably the most efficient method.
– N. F. Taussig
Nov 16 at 18:20




It is possible. That said, for the given numbers, simply listing the possibilities is probably the most efficient method.
– N. F. Taussig
Nov 16 at 18:20












Another way to look at it is : Let $x_1,x_2,x_3$ be the number of red, green and blue balls respectively. You wish to find all possible solutions to $x_1+x_2+x_3=3$ such that $0leq x_1leq 4, 0leq x_2leq 2, 0leq x_3leq 1$. By the way your answer is $^7C_3$ I guess.
– Yadati Kiran
Nov 16 at 18:22






Another way to look at it is : Let $x_1,x_2,x_3$ be the number of red, green and blue balls respectively. You wish to find all possible solutions to $x_1+x_2+x_3=3$ such that $0leq x_1leq 4, 0leq x_2leq 2, 0leq x_3leq 1$. By the way your answer is $^7C_3$ I guess.
– Yadati Kiran
Nov 16 at 18:22














One might also think of this as a sample problem for counting the number of contingency tables with two rows and three columns having prescribed marginal sums. Even for two rows but arbitrarily many columns such counting problems have been shown to be NP hard.
– hardmath
Nov 16 at 18:25






One might also think of this as a sample problem for counting the number of contingency tables with two rows and three columns having prescribed marginal sums. Even for two rows but arbitrarily many columns such counting problems have been shown to be NP hard.
– hardmath
Nov 16 at 18:25














@YadatiKiran $binom{7}{3}$ is an answer to a related but different question where the balls were all distinctly labeled. Here, presumably, the red balls are all identical, etc... Your rephrasing of the question however is correct, but the method of solution would likely either involve brute force, or inclusion-exclusion with stars and bars which is likely just as tedious as brute force here.
– JMoravitz
Nov 16 at 18:35




@YadatiKiran $binom{7}{3}$ is an answer to a related but different question where the balls were all distinctly labeled. Here, presumably, the red balls are all identical, etc... Your rephrasing of the question however is correct, but the method of solution would likely either involve brute force, or inclusion-exclusion with stars and bars which is likely just as tedious as brute force here.
– JMoravitz
Nov 16 at 18:35












An alternate solution, which if you have access to computer software is easy to implement for reasonable numbers (but is practically brute force in disguise) is to look at the coefficient of $x^3$ in the expansion of $(1+x+x^2+x^3+x^4)(1+x+x^2)(1+x)$.
– JMoravitz
Nov 16 at 18:37




An alternate solution, which if you have access to computer software is easy to implement for reasonable numbers (but is practically brute force in disguise) is to look at the coefficient of $x^3$ in the expansion of $(1+x+x^2+x^3+x^4)(1+x+x^2)(1+x)$.
– JMoravitz
Nov 16 at 18:37










1 Answer
1






active

oldest

votes

















up vote
0
down vote



accepted










Consider the polynomial
$$eqalign{p(x)&:=(1+x+x^2+x^3+x^4)(1+x+x^2)(1+x)cr &=(1-x^5)(1-x^3)(1-x^2)(1-x)^{-3}cr &=(1-x^5)(1-x^3)(1-x^2)sum_{kgeq0}{2+kchoose k}x^k .cr}tag{1}$$
For each admissible choice of $rin[0 .. 4]$ red balls, $gin[0 .. 2]$ green balls, and $bin[0 .. 1]$ blue balls the expansion of this polynomial creates a term $x^r,x^g,x^b=x^{r+g+b}$. Now we want $r+g+b=3$. It follows that we have to extract $N:={rm coeff}[x^3]$ on the last line of $(1)$. Since
$$(1-x^5)(1-x^3)(1-x^2)=1-x^2-x^3+{rm higher terms}$$
it follows that
$$N={2+3choose3}-{2+1choose1}-{2+0choose0}=6 .$$






share|cite|improve this answer





















    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',
    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%2f3001464%2fnumber-of-unique-ways-to-select-3-balls-from-4-red-balls-2-green-balls-an%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








    up vote
    0
    down vote



    accepted










    Consider the polynomial
    $$eqalign{p(x)&:=(1+x+x^2+x^3+x^4)(1+x+x^2)(1+x)cr &=(1-x^5)(1-x^3)(1-x^2)(1-x)^{-3}cr &=(1-x^5)(1-x^3)(1-x^2)sum_{kgeq0}{2+kchoose k}x^k .cr}tag{1}$$
    For each admissible choice of $rin[0 .. 4]$ red balls, $gin[0 .. 2]$ green balls, and $bin[0 .. 1]$ blue balls the expansion of this polynomial creates a term $x^r,x^g,x^b=x^{r+g+b}$. Now we want $r+g+b=3$. It follows that we have to extract $N:={rm coeff}[x^3]$ on the last line of $(1)$. Since
    $$(1-x^5)(1-x^3)(1-x^2)=1-x^2-x^3+{rm higher terms}$$
    it follows that
    $$N={2+3choose3}-{2+1choose1}-{2+0choose0}=6 .$$






    share|cite|improve this answer

























      up vote
      0
      down vote



      accepted










      Consider the polynomial
      $$eqalign{p(x)&:=(1+x+x^2+x^3+x^4)(1+x+x^2)(1+x)cr &=(1-x^5)(1-x^3)(1-x^2)(1-x)^{-3}cr &=(1-x^5)(1-x^3)(1-x^2)sum_{kgeq0}{2+kchoose k}x^k .cr}tag{1}$$
      For each admissible choice of $rin[0 .. 4]$ red balls, $gin[0 .. 2]$ green balls, and $bin[0 .. 1]$ blue balls the expansion of this polynomial creates a term $x^r,x^g,x^b=x^{r+g+b}$. Now we want $r+g+b=3$. It follows that we have to extract $N:={rm coeff}[x^3]$ on the last line of $(1)$. Since
      $$(1-x^5)(1-x^3)(1-x^2)=1-x^2-x^3+{rm higher terms}$$
      it follows that
      $$N={2+3choose3}-{2+1choose1}-{2+0choose0}=6 .$$






      share|cite|improve this answer























        up vote
        0
        down vote



        accepted







        up vote
        0
        down vote



        accepted






        Consider the polynomial
        $$eqalign{p(x)&:=(1+x+x^2+x^3+x^4)(1+x+x^2)(1+x)cr &=(1-x^5)(1-x^3)(1-x^2)(1-x)^{-3}cr &=(1-x^5)(1-x^3)(1-x^2)sum_{kgeq0}{2+kchoose k}x^k .cr}tag{1}$$
        For each admissible choice of $rin[0 .. 4]$ red balls, $gin[0 .. 2]$ green balls, and $bin[0 .. 1]$ blue balls the expansion of this polynomial creates a term $x^r,x^g,x^b=x^{r+g+b}$. Now we want $r+g+b=3$. It follows that we have to extract $N:={rm coeff}[x^3]$ on the last line of $(1)$. Since
        $$(1-x^5)(1-x^3)(1-x^2)=1-x^2-x^3+{rm higher terms}$$
        it follows that
        $$N={2+3choose3}-{2+1choose1}-{2+0choose0}=6 .$$






        share|cite|improve this answer












        Consider the polynomial
        $$eqalign{p(x)&:=(1+x+x^2+x^3+x^4)(1+x+x^2)(1+x)cr &=(1-x^5)(1-x^3)(1-x^2)(1-x)^{-3}cr &=(1-x^5)(1-x^3)(1-x^2)sum_{kgeq0}{2+kchoose k}x^k .cr}tag{1}$$
        For each admissible choice of $rin[0 .. 4]$ red balls, $gin[0 .. 2]$ green balls, and $bin[0 .. 1]$ blue balls the expansion of this polynomial creates a term $x^r,x^g,x^b=x^{r+g+b}$. Now we want $r+g+b=3$. It follows that we have to extract $N:={rm coeff}[x^3]$ on the last line of $(1)$. Since
        $$(1-x^5)(1-x^3)(1-x^2)=1-x^2-x^3+{rm higher terms}$$
        it follows that
        $$N={2+3choose3}-{2+1choose1}-{2+0choose0}=6 .$$







        share|cite|improve this answer












        share|cite|improve this answer



        share|cite|improve this answer










        answered Nov 16 at 18:53









        Christian Blatter

        171k7111325




        171k7111325






























            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.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • 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.


            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%2f3001464%2fnumber-of-unique-ways-to-select-3-balls-from-4-red-balls-2-green-balls-an%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 to send String Array data to Server using php in android

            Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

            Is anime1.com a legal site for watching anime?