Number of ways to distribute 20 identical pencils to 6 non-identical children with restrictions The Next CEO of Stack OverflowNumber of ways distribute 12 identical action figures to 5 childrenProbability and Statistics (Normal Distribution)IN how many ways we can distribute 10 identical looking pencils given the following conditions?Determine number of ways to distribute sixteen identical pieces of candy to five non-identical kids…What is the difference between ways to distribute identical and different objects?Identical and different object distribution among childrenCombinatorics question involving distributing identical candies to different childrenCombinatorics question involving distributing 9 different candies to three different kidsMuddy Children Puzzle (when more than 2 kids are muddy)In how many ways can 9 different books and 17 identical cakes be divided on 6 children, so that each child receive at least one book and one cake?

Why am I allowed to create multiple unique pointers from a single object?

What is "(CFMCC)" on an ILS approach chart?

Can I run my washing machine drain line into a condensate pump so it drains better?

How to invert MapIndexed on a ragged structure? How to construct a tree from rules?

Why does the UK parliament need a vote on the political declaration?

How do we know the LHC results are robust?

What happens if you roll doubles 3 times then land on "Go to jail?"

Complex fractions

To not tell, not take, and not want

"In the right combination" vs "with the right combination"?

How to count occurrences of text in a file?

Is it my responsibility to learn a new technology in my own time my employer wants to implement?

Return the Closest Prime Number

Why do remote companies require working in the US?

How did the Bene Gesserit know how to make a Kwisatz Haderach?

Is there a way to save my career from absolute disaster?

How did people program for Consoles with multiple CPUs?

I believe this to be a fraud - hired, then asked to cash check and send cash as Bitcoin

Inappropriate reference requests from Journal reviewers

Sending manuscript to multiple publishers

Unreliable Magic - Is it worth it?

Would this house-rule that treats advantage as a +1 to the roll instead (and disadvantage as -1) and allows them to stack be balanced?

How to start emacs in "nothing" mode (`fundamental-mode`)

Is it professional to write unrelated content in an almost-empty email?



Number of ways to distribute 20 identical pencils to 6 non-identical children with restrictions



The Next CEO of Stack OverflowNumber of ways distribute 12 identical action figures to 5 childrenProbability and Statistics (Normal Distribution)IN how many ways we can distribute 10 identical looking pencils given the following conditions?Determine number of ways to distribute sixteen identical pieces of candy to five non-identical kids…What is the difference between ways to distribute identical and different objects?Identical and different object distribution among childrenCombinatorics question involving distributing identical candies to different childrenCombinatorics question involving distributing 9 different candies to three different kidsMuddy Children Puzzle (when more than 2 kids are muddy)In how many ways can 9 different books and 17 identical cakes be divided on 6 children, so that each child receive at least one book and one cake?










3












$begingroup$



How many ways are there to pass out 20 pencils (assume all the pencils are identical the same) to six children?



Based on the following condition:



a) No restriction. ( i.e. each kid may receive zero to 20 pencils.)



b) Every child receives at least one pencil.



c) None of child receives the same number of pencils.



d) If the pencils are given out randomly. What is the probability that there are at least two kids receive the same number of pencils if every kids receives at least one pencil?




I have calculated a) using C(25,20) = 53,130



I calculated b) using C(19,14) = 11,628



for c) I get answer 840 using the following program



class final34
public static void main(String[] args)
int u,v,x,y,z;
int count = 0;
int last=0;

for(u =1;u<11;u++)
for(v = 1;v<11; v++)
if(u!=v)
for(x = 1;x<11;x++)
if(x!=u && x!=v)
for(y = 1; y<11;y++)
if(y!=u && y!=v && y!=x)
for(z=1;z<11;z++)
if(z!=u && z!=v && z!=x && z!=y)
if(u+v+x+y+z == 20)
System.out.println(u+" "+v+" "+x+" "+y+" "+z);
count++;

System.out.println("Count after iteration "+u+": "+(count-last));
last = count;

System.out.println("Total Count: "+count);




I see the output:




Count after iteration 1: 144



Count after iteration 2: 144



Count after iteration 3: 120



Count after iteration 4: 120



Count after iteration 5: 96



Count after iteration 6: 72



Count after iteration 7: 48



Count after iteration 8: 48



Count after iteration 9: 24



Count after iteration 10: 24



Total Count: 840




But I don't know how to prove this using discrete mathematics.



Also I need help on d).










share|cite|improve this question











$endgroup$
















    3












    $begingroup$



    How many ways are there to pass out 20 pencils (assume all the pencils are identical the same) to six children?



    Based on the following condition:



    a) No restriction. ( i.e. each kid may receive zero to 20 pencils.)



    b) Every child receives at least one pencil.



    c) None of child receives the same number of pencils.



    d) If the pencils are given out randomly. What is the probability that there are at least two kids receive the same number of pencils if every kids receives at least one pencil?




    I have calculated a) using C(25,20) = 53,130



    I calculated b) using C(19,14) = 11,628



    for c) I get answer 840 using the following program



    class final34
    public static void main(String[] args)
    int u,v,x,y,z;
    int count = 0;
    int last=0;

    for(u =1;u<11;u++)
    for(v = 1;v<11; v++)
    if(u!=v)
    for(x = 1;x<11;x++)
    if(x!=u && x!=v)
    for(y = 1; y<11;y++)
    if(y!=u && y!=v && y!=x)
    for(z=1;z<11;z++)
    if(z!=u && z!=v && z!=x && z!=y)
    if(u+v+x+y+z == 20)
    System.out.println(u+" "+v+" "+x+" "+y+" "+z);
    count++;

    System.out.println("Count after iteration "+u+": "+(count-last));
    last = count;

    System.out.println("Total Count: "+count);




    I see the output:




    Count after iteration 1: 144



    Count after iteration 2: 144



    Count after iteration 3: 120



    Count after iteration 4: 120



    Count after iteration 5: 96



    Count after iteration 6: 72



    Count after iteration 7: 48



    Count after iteration 8: 48



    Count after iteration 9: 24



    Count after iteration 10: 24



    Total Count: 840




    But I don't know how to prove this using discrete mathematics.



    Also I need help on d).










    share|cite|improve this question











    $endgroup$














      3












      3








      3





      $begingroup$



      How many ways are there to pass out 20 pencils (assume all the pencils are identical the same) to six children?



      Based on the following condition:



      a) No restriction. ( i.e. each kid may receive zero to 20 pencils.)



      b) Every child receives at least one pencil.



      c) None of child receives the same number of pencils.



      d) If the pencils are given out randomly. What is the probability that there are at least two kids receive the same number of pencils if every kids receives at least one pencil?




      I have calculated a) using C(25,20) = 53,130



      I calculated b) using C(19,14) = 11,628



      for c) I get answer 840 using the following program



      class final34
      public static void main(String[] args)
      int u,v,x,y,z;
      int count = 0;
      int last=0;

      for(u =1;u<11;u++)
      for(v = 1;v<11; v++)
      if(u!=v)
      for(x = 1;x<11;x++)
      if(x!=u && x!=v)
      for(y = 1; y<11;y++)
      if(y!=u && y!=v && y!=x)
      for(z=1;z<11;z++)
      if(z!=u && z!=v && z!=x && z!=y)
      if(u+v+x+y+z == 20)
      System.out.println(u+" "+v+" "+x+" "+y+" "+z);
      count++;

      System.out.println("Count after iteration "+u+": "+(count-last));
      last = count;

      System.out.println("Total Count: "+count);




      I see the output:




      Count after iteration 1: 144



      Count after iteration 2: 144



      Count after iteration 3: 120



      Count after iteration 4: 120



      Count after iteration 5: 96



      Count after iteration 6: 72



      Count after iteration 7: 48



      Count after iteration 8: 48



      Count after iteration 9: 24



      Count after iteration 10: 24



      Total Count: 840




      But I don't know how to prove this using discrete mathematics.



      Also I need help on d).










      share|cite|improve this question











      $endgroup$





      How many ways are there to pass out 20 pencils (assume all the pencils are identical the same) to six children?



      Based on the following condition:



      a) No restriction. ( i.e. each kid may receive zero to 20 pencils.)



      b) Every child receives at least one pencil.



      c) None of child receives the same number of pencils.



      d) If the pencils are given out randomly. What is the probability that there are at least two kids receive the same number of pencils if every kids receives at least one pencil?




      I have calculated a) using C(25,20) = 53,130



      I calculated b) using C(19,14) = 11,628



      for c) I get answer 840 using the following program



      class final34
      public static void main(String[] args)
      int u,v,x,y,z;
      int count = 0;
      int last=0;

      for(u =1;u<11;u++)
      for(v = 1;v<11; v++)
      if(u!=v)
      for(x = 1;x<11;x++)
      if(x!=u && x!=v)
      for(y = 1; y<11;y++)
      if(y!=u && y!=v && y!=x)
      for(z=1;z<11;z++)
      if(z!=u && z!=v && z!=x && z!=y)
      if(u+v+x+y+z == 20)
      System.out.println(u+" "+v+" "+x+" "+y+" "+z);
      count++;

      System.out.println("Count after iteration "+u+": "+(count-last));
      last = count;

      System.out.println("Total Count: "+count);




      I see the output:




      Count after iteration 1: 144



      Count after iteration 2: 144



      Count after iteration 3: 120



      Count after iteration 4: 120



      Count after iteration 5: 96



      Count after iteration 6: 72



      Count after iteration 7: 48



      Count after iteration 8: 48



      Count after iteration 9: 24



      Count after iteration 10: 24



      Total Count: 840




      But I don't know how to prove this using discrete mathematics.



      Also I need help on d).







      probability discrete-mathematics permutations combinations






      share|cite|improve this question















      share|cite|improve this question













      share|cite|improve this question




      share|cite|improve this question








      edited Mar 19 at 14:17









      Maria Mazur

      48.9k1260122




      48.9k1260122










      asked Mar 18 at 21:25









      Abhishek PanjabiAbhishek Panjabi

      1267




      1267




















          2 Answers
          2






          active

          oldest

          votes


















          3












          $begingroup$

          a) and b) are correctly calculated.



          d) If they all get the different number of pencils, then there would be at least $1+2+3+4+5+6=21$ pencils wich is impossibile.



          So the probability that at least two will get the same number of pencil is $1$.






          share|cite|improve this answer











          $endgroup$








          • 1




            $begingroup$
            Every one gets at least one pencil.
            $endgroup$
            – Maria Mazur
            Mar 18 at 21:34










          • $begingroup$
            Have you read what I wrote?
            $endgroup$
            – Maria Mazur
            Mar 18 at 21:45










          • $begingroup$
            can u please elaborate more? and give one or two examples of cases. I can not understand properly.
            $endgroup$
            – Abhishek Panjabi
            Mar 18 at 21:48







          • 2




            $begingroup$
            It is impossibile to everone get differnt number of pencils if each gets at least one pencil. So the probability that at least two will get the same number of pencils is 100%
            $endgroup$
            – Maria Mazur
            Mar 18 at 21:51










          • $begingroup$
            Thank you. That helped.
            $endgroup$
            – Abhishek Panjabi
            Mar 18 at 21:52


















          1












          $begingroup$

          I realized that there is no way to generalize the answer for question c). it needs a special solution.



          First of all, out of 6 children, 1 child has to get 0 pencils.
          After that 5 children are remaining. So, there are just 7 ways to distribute 20 pencils among them, which are:



          (1,2,3,4,10)



          (1,2,3,5,9)



          (1,2,3,6,8)



          (1,2,4,5,8)



          (1,2,4,6,7)



          (1,3,4,5,7)



          (2,3,4,5,6)



          Now, with these 7 cases, there are 5! ways to arrange them in order.



          Therefore, we get 120*7 = 840 ways.




          Now, coming back to the first child, to whom we gave 0 pencils. It can be any of the 6 children.




          So, 840*6 = 5040 is the final answer.



          I could found the first 5 cases by myself, but, as anyone can see that the last two cases are too far and so many cases need to be checked before one can figure those two out. that's why I used a program to compute these. I am also providing that here so that it is helpful for others.



          import java.util.*;

          class final34
          public static void main(String[] args)
          int u,v,x,y,z;
          int count = 0;
          int last=0;
          List<List<Integer>> val = new ArrayList<List<Integer>>();

          for(u =1;u<11;u++)
          for(v = 1;v<11; v++)
          if(u!=v)
          for(x = 1;x<11;x++)
          if(x!=u && x!=v)
          for(y = 1; y<11;y++)
          if(y!=u && y!=v && y!=x)
          for(z=1;z<11;z++)
          if(z!=u && z!=v && z!=x && z!=y)
          if(u+v+x+y+z == 20)
          List<Integer> temp = new ArrayList<>();
          temp.add(u);
          temp.add(v);
          temp.add(x);
          temp.add(y);
          temp.add(z);
          Collections.sort(temp);
          boolean check = false;
          for(List a: val)
          Collections.sort(a);
          if(a.equals(temp))
          check = true;


          if(!check)
          val.add(temp);

          count++;

          System.out.println("Count after iteration "+u+": "+(count-last));
          last = count;

          System.out.println("Count: "+count);
          System.out.println(val);







          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%2f3153331%2fnumber-of-ways-to-distribute-20-identical-pencils-to-6-non-identical-children-wi%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            3












            $begingroup$

            a) and b) are correctly calculated.



            d) If they all get the different number of pencils, then there would be at least $1+2+3+4+5+6=21$ pencils wich is impossibile.



            So the probability that at least two will get the same number of pencil is $1$.






            share|cite|improve this answer











            $endgroup$








            • 1




              $begingroup$
              Every one gets at least one pencil.
              $endgroup$
              – Maria Mazur
              Mar 18 at 21:34










            • $begingroup$
              Have you read what I wrote?
              $endgroup$
              – Maria Mazur
              Mar 18 at 21:45










            • $begingroup$
              can u please elaborate more? and give one or two examples of cases. I can not understand properly.
              $endgroup$
              – Abhishek Panjabi
              Mar 18 at 21:48







            • 2




              $begingroup$
              It is impossibile to everone get differnt number of pencils if each gets at least one pencil. So the probability that at least two will get the same number of pencils is 100%
              $endgroup$
              – Maria Mazur
              Mar 18 at 21:51










            • $begingroup$
              Thank you. That helped.
              $endgroup$
              – Abhishek Panjabi
              Mar 18 at 21:52















            3












            $begingroup$

            a) and b) are correctly calculated.



            d) If they all get the different number of pencils, then there would be at least $1+2+3+4+5+6=21$ pencils wich is impossibile.



            So the probability that at least two will get the same number of pencil is $1$.






            share|cite|improve this answer











            $endgroup$








            • 1




              $begingroup$
              Every one gets at least one pencil.
              $endgroup$
              – Maria Mazur
              Mar 18 at 21:34










            • $begingroup$
              Have you read what I wrote?
              $endgroup$
              – Maria Mazur
              Mar 18 at 21:45










            • $begingroup$
              can u please elaborate more? and give one or two examples of cases. I can not understand properly.
              $endgroup$
              – Abhishek Panjabi
              Mar 18 at 21:48







            • 2




              $begingroup$
              It is impossibile to everone get differnt number of pencils if each gets at least one pencil. So the probability that at least two will get the same number of pencils is 100%
              $endgroup$
              – Maria Mazur
              Mar 18 at 21:51










            • $begingroup$
              Thank you. That helped.
              $endgroup$
              – Abhishek Panjabi
              Mar 18 at 21:52













            3












            3








            3





            $begingroup$

            a) and b) are correctly calculated.



            d) If they all get the different number of pencils, then there would be at least $1+2+3+4+5+6=21$ pencils wich is impossibile.



            So the probability that at least two will get the same number of pencil is $1$.






            share|cite|improve this answer











            $endgroup$



            a) and b) are correctly calculated.



            d) If they all get the different number of pencils, then there would be at least $1+2+3+4+5+6=21$ pencils wich is impossibile.



            So the probability that at least two will get the same number of pencil is $1$.







            share|cite|improve this answer














            share|cite|improve this answer



            share|cite|improve this answer








            edited Mar 18 at 21:47

























            answered Mar 18 at 21:28









            Maria MazurMaria Mazur

            48.9k1260122




            48.9k1260122







            • 1




              $begingroup$
              Every one gets at least one pencil.
              $endgroup$
              – Maria Mazur
              Mar 18 at 21:34










            • $begingroup$
              Have you read what I wrote?
              $endgroup$
              – Maria Mazur
              Mar 18 at 21:45










            • $begingroup$
              can u please elaborate more? and give one or two examples of cases. I can not understand properly.
              $endgroup$
              – Abhishek Panjabi
              Mar 18 at 21:48







            • 2




              $begingroup$
              It is impossibile to everone get differnt number of pencils if each gets at least one pencil. So the probability that at least two will get the same number of pencils is 100%
              $endgroup$
              – Maria Mazur
              Mar 18 at 21:51










            • $begingroup$
              Thank you. That helped.
              $endgroup$
              – Abhishek Panjabi
              Mar 18 at 21:52












            • 1




              $begingroup$
              Every one gets at least one pencil.
              $endgroup$
              – Maria Mazur
              Mar 18 at 21:34










            • $begingroup$
              Have you read what I wrote?
              $endgroup$
              – Maria Mazur
              Mar 18 at 21:45










            • $begingroup$
              can u please elaborate more? and give one or two examples of cases. I can not understand properly.
              $endgroup$
              – Abhishek Panjabi
              Mar 18 at 21:48







            • 2




              $begingroup$
              It is impossibile to everone get differnt number of pencils if each gets at least one pencil. So the probability that at least two will get the same number of pencils is 100%
              $endgroup$
              – Maria Mazur
              Mar 18 at 21:51










            • $begingroup$
              Thank you. That helped.
              $endgroup$
              – Abhishek Panjabi
              Mar 18 at 21:52







            1




            1




            $begingroup$
            Every one gets at least one pencil.
            $endgroup$
            – Maria Mazur
            Mar 18 at 21:34




            $begingroup$
            Every one gets at least one pencil.
            $endgroup$
            – Maria Mazur
            Mar 18 at 21:34












            $begingroup$
            Have you read what I wrote?
            $endgroup$
            – Maria Mazur
            Mar 18 at 21:45




            $begingroup$
            Have you read what I wrote?
            $endgroup$
            – Maria Mazur
            Mar 18 at 21:45












            $begingroup$
            can u please elaborate more? and give one or two examples of cases. I can not understand properly.
            $endgroup$
            – Abhishek Panjabi
            Mar 18 at 21:48





            $begingroup$
            can u please elaborate more? and give one or two examples of cases. I can not understand properly.
            $endgroup$
            – Abhishek Panjabi
            Mar 18 at 21:48





            2




            2




            $begingroup$
            It is impossibile to everone get differnt number of pencils if each gets at least one pencil. So the probability that at least two will get the same number of pencils is 100%
            $endgroup$
            – Maria Mazur
            Mar 18 at 21:51




            $begingroup$
            It is impossibile to everone get differnt number of pencils if each gets at least one pencil. So the probability that at least two will get the same number of pencils is 100%
            $endgroup$
            – Maria Mazur
            Mar 18 at 21:51












            $begingroup$
            Thank you. That helped.
            $endgroup$
            – Abhishek Panjabi
            Mar 18 at 21:52




            $begingroup$
            Thank you. That helped.
            $endgroup$
            – Abhishek Panjabi
            Mar 18 at 21:52











            1












            $begingroup$

            I realized that there is no way to generalize the answer for question c). it needs a special solution.



            First of all, out of 6 children, 1 child has to get 0 pencils.
            After that 5 children are remaining. So, there are just 7 ways to distribute 20 pencils among them, which are:



            (1,2,3,4,10)



            (1,2,3,5,9)



            (1,2,3,6,8)



            (1,2,4,5,8)



            (1,2,4,6,7)



            (1,3,4,5,7)



            (2,3,4,5,6)



            Now, with these 7 cases, there are 5! ways to arrange them in order.



            Therefore, we get 120*7 = 840 ways.




            Now, coming back to the first child, to whom we gave 0 pencils. It can be any of the 6 children.




            So, 840*6 = 5040 is the final answer.



            I could found the first 5 cases by myself, but, as anyone can see that the last two cases are too far and so many cases need to be checked before one can figure those two out. that's why I used a program to compute these. I am also providing that here so that it is helpful for others.



            import java.util.*;

            class final34
            public static void main(String[] args)
            int u,v,x,y,z;
            int count = 0;
            int last=0;
            List<List<Integer>> val = new ArrayList<List<Integer>>();

            for(u =1;u<11;u++)
            for(v = 1;v<11; v++)
            if(u!=v)
            for(x = 1;x<11;x++)
            if(x!=u && x!=v)
            for(y = 1; y<11;y++)
            if(y!=u && y!=v && y!=x)
            for(z=1;z<11;z++)
            if(z!=u && z!=v && z!=x && z!=y)
            if(u+v+x+y+z == 20)
            List<Integer> temp = new ArrayList<>();
            temp.add(u);
            temp.add(v);
            temp.add(x);
            temp.add(y);
            temp.add(z);
            Collections.sort(temp);
            boolean check = false;
            for(List a: val)
            Collections.sort(a);
            if(a.equals(temp))
            check = true;


            if(!check)
            val.add(temp);

            count++;

            System.out.println("Count after iteration "+u+": "+(count-last));
            last = count;

            System.out.println("Count: "+count);
            System.out.println(val);







            share|cite|improve this answer









            $endgroup$

















              1












              $begingroup$

              I realized that there is no way to generalize the answer for question c). it needs a special solution.



              First of all, out of 6 children, 1 child has to get 0 pencils.
              After that 5 children are remaining. So, there are just 7 ways to distribute 20 pencils among them, which are:



              (1,2,3,4,10)



              (1,2,3,5,9)



              (1,2,3,6,8)



              (1,2,4,5,8)



              (1,2,4,6,7)



              (1,3,4,5,7)



              (2,3,4,5,6)



              Now, with these 7 cases, there are 5! ways to arrange them in order.



              Therefore, we get 120*7 = 840 ways.




              Now, coming back to the first child, to whom we gave 0 pencils. It can be any of the 6 children.




              So, 840*6 = 5040 is the final answer.



              I could found the first 5 cases by myself, but, as anyone can see that the last two cases are too far and so many cases need to be checked before one can figure those two out. that's why I used a program to compute these. I am also providing that here so that it is helpful for others.



              import java.util.*;

              class final34
              public static void main(String[] args)
              int u,v,x,y,z;
              int count = 0;
              int last=0;
              List<List<Integer>> val = new ArrayList<List<Integer>>();

              for(u =1;u<11;u++)
              for(v = 1;v<11; v++)
              if(u!=v)
              for(x = 1;x<11;x++)
              if(x!=u && x!=v)
              for(y = 1; y<11;y++)
              if(y!=u && y!=v && y!=x)
              for(z=1;z<11;z++)
              if(z!=u && z!=v && z!=x && z!=y)
              if(u+v+x+y+z == 20)
              List<Integer> temp = new ArrayList<>();
              temp.add(u);
              temp.add(v);
              temp.add(x);
              temp.add(y);
              temp.add(z);
              Collections.sort(temp);
              boolean check = false;
              for(List a: val)
              Collections.sort(a);
              if(a.equals(temp))
              check = true;


              if(!check)
              val.add(temp);

              count++;

              System.out.println("Count after iteration "+u+": "+(count-last));
              last = count;

              System.out.println("Count: "+count);
              System.out.println(val);







              share|cite|improve this answer









              $endgroup$















                1












                1








                1





                $begingroup$

                I realized that there is no way to generalize the answer for question c). it needs a special solution.



                First of all, out of 6 children, 1 child has to get 0 pencils.
                After that 5 children are remaining. So, there are just 7 ways to distribute 20 pencils among them, which are:



                (1,2,3,4,10)



                (1,2,3,5,9)



                (1,2,3,6,8)



                (1,2,4,5,8)



                (1,2,4,6,7)



                (1,3,4,5,7)



                (2,3,4,5,6)



                Now, with these 7 cases, there are 5! ways to arrange them in order.



                Therefore, we get 120*7 = 840 ways.




                Now, coming back to the first child, to whom we gave 0 pencils. It can be any of the 6 children.




                So, 840*6 = 5040 is the final answer.



                I could found the first 5 cases by myself, but, as anyone can see that the last two cases are too far and so many cases need to be checked before one can figure those two out. that's why I used a program to compute these. I am also providing that here so that it is helpful for others.



                import java.util.*;

                class final34
                public static void main(String[] args)
                int u,v,x,y,z;
                int count = 0;
                int last=0;
                List<List<Integer>> val = new ArrayList<List<Integer>>();

                for(u =1;u<11;u++)
                for(v = 1;v<11; v++)
                if(u!=v)
                for(x = 1;x<11;x++)
                if(x!=u && x!=v)
                for(y = 1; y<11;y++)
                if(y!=u && y!=v && y!=x)
                for(z=1;z<11;z++)
                if(z!=u && z!=v && z!=x && z!=y)
                if(u+v+x+y+z == 20)
                List<Integer> temp = new ArrayList<>();
                temp.add(u);
                temp.add(v);
                temp.add(x);
                temp.add(y);
                temp.add(z);
                Collections.sort(temp);
                boolean check = false;
                for(List a: val)
                Collections.sort(a);
                if(a.equals(temp))
                check = true;


                if(!check)
                val.add(temp);

                count++;

                System.out.println("Count after iteration "+u+": "+(count-last));
                last = count;

                System.out.println("Count: "+count);
                System.out.println(val);







                share|cite|improve this answer









                $endgroup$



                I realized that there is no way to generalize the answer for question c). it needs a special solution.



                First of all, out of 6 children, 1 child has to get 0 pencils.
                After that 5 children are remaining. So, there are just 7 ways to distribute 20 pencils among them, which are:



                (1,2,3,4,10)



                (1,2,3,5,9)



                (1,2,3,6,8)



                (1,2,4,5,8)



                (1,2,4,6,7)



                (1,3,4,5,7)



                (2,3,4,5,6)



                Now, with these 7 cases, there are 5! ways to arrange them in order.



                Therefore, we get 120*7 = 840 ways.




                Now, coming back to the first child, to whom we gave 0 pencils. It can be any of the 6 children.




                So, 840*6 = 5040 is the final answer.



                I could found the first 5 cases by myself, but, as anyone can see that the last two cases are too far and so many cases need to be checked before one can figure those two out. that's why I used a program to compute these. I am also providing that here so that it is helpful for others.



                import java.util.*;

                class final34
                public static void main(String[] args)
                int u,v,x,y,z;
                int count = 0;
                int last=0;
                List<List<Integer>> val = new ArrayList<List<Integer>>();

                for(u =1;u<11;u++)
                for(v = 1;v<11; v++)
                if(u!=v)
                for(x = 1;x<11;x++)
                if(x!=u && x!=v)
                for(y = 1; y<11;y++)
                if(y!=u && y!=v && y!=x)
                for(z=1;z<11;z++)
                if(z!=u && z!=v && z!=x && z!=y)
                if(u+v+x+y+z == 20)
                List<Integer> temp = new ArrayList<>();
                temp.add(u);
                temp.add(v);
                temp.add(x);
                temp.add(y);
                temp.add(z);
                Collections.sort(temp);
                boolean check = false;
                for(List a: val)
                Collections.sort(a);
                if(a.equals(temp))
                check = true;


                if(!check)
                val.add(temp);

                count++;

                System.out.println("Count after iteration "+u+": "+(count-last));
                last = count;

                System.out.println("Count: "+count);
                System.out.println(val);








                share|cite|improve this answer












                share|cite|improve this answer



                share|cite|improve this answer










                answered Mar 18 at 23:54









                Abhishek PanjabiAbhishek Panjabi

                1267




                1267



























                    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%2f3153331%2fnumber-of-ways-to-distribute-20-identical-pencils-to-6-non-identical-children-wi%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

                    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

                    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

                    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