Number of solutions to $x_1+x_2+cdots+x_5=41$ Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)Why are generating functions useful?Count the number of integer solutions to $x_1+x_2+cdots+x_5=36$number of solutions to $x_1 + x_2 + x_3 + x_4 + x_5 = 31$ via generating function?How do you count the number of solutions to simultaneous boolean equations?The number of nonnegative integer solutions of $x_1+cdots+x_6=24$ with $x_1+x_2+x_3>x_4+x_5+x_6$Determine a generating function and name the coefficient you would need to count the solutions to distribution questionNumber of non-negative integers solutions of $x_1 + x_2 + x_3 + x_4 + x_5 = 10$ when $x_1 = x_2$ and when $x_1 > x_2$How many solutions are there to $x_1 + x_2 + … + x_5 = 21$?How many natural solutions to $x_1 + x_2 + x_3 + x_4 + x_5 + x_6 = 24$ if $x_1 + x_2 + x_3 > x_4 + x_5 + x_6$?How many solutions are there to the equation $x_1+x_2+x_3+x_4+x_5=30$ with restrictions using generating functions?

AppleTVs create a chatty alternate WiFi network

Google .dev domain strangely redirects to https

License to disallow distribution in closed source software, but allow exceptions made by owner?

Is there hard evidence that the grant peer review system performs significantly better than random?

What initially awakened the Balrog?

Mounting TV on a weird wall that has some material between the drywall and stud

Asymptotics question

Putting class ranking in CV, but against dept guidelines

Why do early math courses focus on the cross sections of a cone and not on other 3D objects?

Does the Black Tentacles spell do damage twice at the start of turn to an already restrained creature?

Why weren't discrete x86 CPUs ever used in game hardware?

Central Vacuuming: Is it worth it, and how does it compare to normal vacuuming?

Can two person see the same photon?

The Nth Gryphon Number

Drawing a ribbon graph

One-one communication

Why is std::move not [[nodiscard]] in C++20?

Did any compiler fully use 80-bit floating point?

Why not send Voyager 3 and 4 following up the paths taken by Voyager 1 and 2 to re-transmit signals of later as they fly away from Earth?

Nose gear failure in single prop aircraft: belly landing or nose-gear up landing?

Special flights

How do living politicians protect their readily obtainable signatures from misuse?

Tannaka duality for semisimple groups

Co-worker has annoying ringtone



Number of solutions to $x_1+x_2+cdots+x_5=41$



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)Why are generating functions useful?Count the number of integer solutions to $x_1+x_2+cdots+x_5=36$number of solutions to $x_1 + x_2 + x_3 + x_4 + x_5 = 31$ via generating function?How do you count the number of solutions to simultaneous boolean equations?The number of nonnegative integer solutions of $x_1+cdots+x_6=24$ with $x_1+x_2+x_3>x_4+x_5+x_6$Determine a generating function and name the coefficient you would need to count the solutions to distribution questionNumber of non-negative integers solutions of $x_1 + x_2 + x_3 + x_4 + x_5 = 10$ when $x_1 = x_2$ and when $x_1 > x_2$How many solutions are there to $x_1 + x_2 + … + x_5 = 21$?How many natural solutions to $x_1 + x_2 + x_3 + x_4 + x_5 + x_6 = 24$ if $x_1 + x_2 + x_3 > x_4 + x_5 + x_6$?How many solutions are there to the equation $x_1+x_2+x_3+x_4+x_5=30$ with restrictions using generating functions?










4












$begingroup$



Use a generating function to count the number of integer solutions
to $x_1+x_2+cdots+x_5=41$ that satisfy $0le x_ile20$ for all $i$,
$x_i$ is even when $i$ is even, and $x_i$ is odd when $i$ is odd.




Ignoring the conditions at the end, I believe that $g(x)=(1+x+x^2+cdots+x^20)^5$, and the answer to the problem is the coefficient of $x^41$ in $g(x)$. But, as I said, I have ignored the terms after all; I haven't the faintest idea of how to go about incorporating them. I'm (obviously) missing something, and I don't seem to be getting anywhere, no matter how many examples I go through. Any help is greatly appreciated!!










share|cite|improve this question











$endgroup$
















    4












    $begingroup$



    Use a generating function to count the number of integer solutions
    to $x_1+x_2+cdots+x_5=41$ that satisfy $0le x_ile20$ for all $i$,
    $x_i$ is even when $i$ is even, and $x_i$ is odd when $i$ is odd.




    Ignoring the conditions at the end, I believe that $g(x)=(1+x+x^2+cdots+x^20)^5$, and the answer to the problem is the coefficient of $x^41$ in $g(x)$. But, as I said, I have ignored the terms after all; I haven't the faintest idea of how to go about incorporating them. I'm (obviously) missing something, and I don't seem to be getting anywhere, no matter how many examples I go through. Any help is greatly appreciated!!










    share|cite|improve this question











    $endgroup$














      4












      4








      4


      1



      $begingroup$



      Use a generating function to count the number of integer solutions
      to $x_1+x_2+cdots+x_5=41$ that satisfy $0le x_ile20$ for all $i$,
      $x_i$ is even when $i$ is even, and $x_i$ is odd when $i$ is odd.




      Ignoring the conditions at the end, I believe that $g(x)=(1+x+x^2+cdots+x^20)^5$, and the answer to the problem is the coefficient of $x^41$ in $g(x)$. But, as I said, I have ignored the terms after all; I haven't the faintest idea of how to go about incorporating them. I'm (obviously) missing something, and I don't seem to be getting anywhere, no matter how many examples I go through. Any help is greatly appreciated!!










      share|cite|improve this question











      $endgroup$





      Use a generating function to count the number of integer solutions
      to $x_1+x_2+cdots+x_5=41$ that satisfy $0le x_ile20$ for all $i$,
      $x_i$ is even when $i$ is even, and $x_i$ is odd when $i$ is odd.




      Ignoring the conditions at the end, I believe that $g(x)=(1+x+x^2+cdots+x^20)^5$, and the answer to the problem is the coefficient of $x^41$ in $g(x)$. But, as I said, I have ignored the terms after all; I haven't the faintest idea of how to go about incorporating them. I'm (obviously) missing something, and I don't seem to be getting anywhere, no matter how many examples I go through. Any help is greatly appreciated!!







      combinatorics generating-functions






      share|cite|improve this question















      share|cite|improve this question













      share|cite|improve this question




      share|cite|improve this question








      edited Apr 2 at 8:29









      Eevee Trainer

      10.6k31842




      10.6k31842










      asked Apr 2 at 8:07









      Esther RoseEsther Rose

      795




      795




















          2 Answers
          2






          active

          oldest

          votes


















          2












          $begingroup$

          In the general scenario,



          $$x_1 + x_2 + ... + x_n = r$$



          where $x_k geq 0$ for all $k$, we have a generating function $g$ that is a product of $n$ polynomials $P$:



          $$g(x) = P_1(x)P_2(x)...P_n(x)$$



          Each of these $P_k(x)$ is defined by the restrictions on the $x_k$. Each $P_k$ will be a sum of powers of $x$, where each exponent of a $x$ term is a valid value $x_k$ may take on in the above equation. Some examples are prudent:





          Example $#1$: We want to find the number of nonnegative integer solutions to
          $$x_1 + x_2 + x_3 = 10$$
          where $x_i geq 0$ for all $i$




          This is the scenario you seem to be fine with: effectively no restrictions. Though it must be noted that there is an implicit maximum of $10$ here for each $x_k$: as you deal with more of these, you will learn whether to use $0 le x_k le 10$ or simply $0 le x_k$ (and thus use an infinite sum). I won't bog us down on the details here regarding which to use, and simply assume finite sums.



          Here, since $x_k$ can be $0,1,...,10$, then, each of the $P_k$ polynomials are



          $$P_k(x) = 1 + x + x^2 + x^3 + ... + x^10$$



          (Notice: $x^0 = 1$.) Then the generating function is the product of $P_1,P_2,P_3$ - which are all the same and thus give you the cube of the above.





          Example $#2$: We want to find the number of nonnegative integer solutions to
          $$x_1 + x_2 + x_3 = 10$$
          where $x_i geq 0$ for all $i$, and $x_i$ must be even.




          In this scenario, the allowed values for $x_i$ have changed. Now we cannot have odd values! Thus, $x_k$ must be $0,2,4,6,8,$ or $10$ for all $k$. Since these are the allowed values, we see that



          $$P_1(x) = P_2(x) = P_3(x) = 1 + x^2 + x^4 + x^6 + x^8 + x^10$$



          Again, bear in mind how the exponents (when $1 = x^0$) correspond to the allowed values for $x_k$!



          Again in this case, $P_1 = P_2 = P_3$, so $g$ is just the cube of any one of them.





          Example $#3$: We want to find the number of nonnegative integer solutions to
          $$x_1 + x_2 + x_3 = 10$$
          where $x_i geq 0$ for all $i$. Further, $x_1$ must be even, $x_2$ must be prime, and $x_3$ must be a perfect square.




          Now have different conditions for all three numbers! But this is still doable! We first individually see what values are allowed per variable. On investigation...




          • $x_1$ can be $0,2,4,6,8,10$


          • $x_2$ can be $2,3,5,7$


          • $x_3$ can be $0,1,4,9$

          With these in mind, we construct the polynomials one by one. Again, the exponents are the permissibile powers of the corresponding summand, with $x_i^0 = 1$. Then we see



          • $P_1(x) = 1 + x^2 + x^4 + x^6 + x^8 + x^10$

          • $P_2(x) = x^2 + x^3 + x^7 + x^9$

          • $P_3(x) = 1 + x + x^4 + x^9$

          Our generating function, $g(x)$, this time is not a cube, but simply the product



          $$g(x) = P_1(x)P_2(x)P_3(x)$$



          If one wanted to write it explicitly they could with no trouble, just substitute in the expressions in the bullets.




          With these in mind, we consider now your scenario:



          $$x_1 + x_2 + x_3 + x_4 + x_5 = 41$$



          where, for $k = 1,2,...,5$,



          • $x_k ge 0$

          • $x_k le 20$


          • $x_k$ is even for even $k$


          • $x_k$ is odd for odd $k$

          We translate this into the sets of permissible values. Keep in mind that we cannot go any higher than $41$ necessarily for any value. If you want to, I think this is the kind of equation that would allow for an infinite sum instead of finite - and if you're familiar with that, the work is similar enough that you should be able to analogize it.



          In any event, the set of permissible values:




          • $x_2,x_4$ can be $0,2,4,6,...,20$


          • $x_1,x_3,x_5$ can be $1,3,5,7,...,19$

          Then the corresponding polynomials are? We again construct them by basing the exponents on the allowed values:



          $$beginalign
          P_1(x) = P_3(x) = P_5(x) &= x + x^3 + x^5 + x^7 + ... + x^19\
          P_2(x) = P_4(x) &= 1 + x^2 + x^4 + x^6 + ... + x^20
          endalign$$



          and then $g(x) = P_1(x)P_2(x)P_3(x)P_4(x)P_5(x)$.






          share|cite|improve this answer











          $endgroup$












          • $begingroup$
            wow, thank you for the detailed explanation, that makes tons of sense.
            $endgroup$
            – Esther Rose
            Apr 3 at 0:04










          • $begingroup$
            @evee, so at this point, this is what I've got, I'm not sure if it's at all correct $g(x)=x^3(1+x^2+x^4+cdots+x^18)^3(1+x^2+x^4+cdots+x^20)^2 = x^3frac(1-x^19)^3(1-x^2)^3frac(1-x^21)^2(1-x^2)^2$
            $endgroup$
            – Esther Rose
            Apr 3 at 0:12











          • $begingroup$
            I would have simplified by grouping the denominators together, but yup that seems correct!
            $endgroup$
            – Eevee Trainer
            Apr 3 at 0:47


















          3












          $begingroup$

          You're a good deal of the way there. What you have so far is five copies of $1+x+cdots+x^20$. They all stop at $20$ because no $x_i$ can be larger than $20$.



          The limitation that $x_1$ can only be odd is similarily simple. It just means that the factor of the generating function that corresponds to $x_1$ only has odd-degree terms. So instead of $1+x+x^2+cdots + x^20$, you get $x + x^3 + cdots + x^19$. Do a similar thing for the other four variables, and you have your generating function.






          share|cite|improve this answer









          $endgroup$













            Your Answer








            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%2f3171605%2fnumber-of-solutions-to-x-1x-2-cdotsx-5-41%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









            2












            $begingroup$

            In the general scenario,



            $$x_1 + x_2 + ... + x_n = r$$



            where $x_k geq 0$ for all $k$, we have a generating function $g$ that is a product of $n$ polynomials $P$:



            $$g(x) = P_1(x)P_2(x)...P_n(x)$$



            Each of these $P_k(x)$ is defined by the restrictions on the $x_k$. Each $P_k$ will be a sum of powers of $x$, where each exponent of a $x$ term is a valid value $x_k$ may take on in the above equation. Some examples are prudent:





            Example $#1$: We want to find the number of nonnegative integer solutions to
            $$x_1 + x_2 + x_3 = 10$$
            where $x_i geq 0$ for all $i$




            This is the scenario you seem to be fine with: effectively no restrictions. Though it must be noted that there is an implicit maximum of $10$ here for each $x_k$: as you deal with more of these, you will learn whether to use $0 le x_k le 10$ or simply $0 le x_k$ (and thus use an infinite sum). I won't bog us down on the details here regarding which to use, and simply assume finite sums.



            Here, since $x_k$ can be $0,1,...,10$, then, each of the $P_k$ polynomials are



            $$P_k(x) = 1 + x + x^2 + x^3 + ... + x^10$$



            (Notice: $x^0 = 1$.) Then the generating function is the product of $P_1,P_2,P_3$ - which are all the same and thus give you the cube of the above.





            Example $#2$: We want to find the number of nonnegative integer solutions to
            $$x_1 + x_2 + x_3 = 10$$
            where $x_i geq 0$ for all $i$, and $x_i$ must be even.




            In this scenario, the allowed values for $x_i$ have changed. Now we cannot have odd values! Thus, $x_k$ must be $0,2,4,6,8,$ or $10$ for all $k$. Since these are the allowed values, we see that



            $$P_1(x) = P_2(x) = P_3(x) = 1 + x^2 + x^4 + x^6 + x^8 + x^10$$



            Again, bear in mind how the exponents (when $1 = x^0$) correspond to the allowed values for $x_k$!



            Again in this case, $P_1 = P_2 = P_3$, so $g$ is just the cube of any one of them.





            Example $#3$: We want to find the number of nonnegative integer solutions to
            $$x_1 + x_2 + x_3 = 10$$
            where $x_i geq 0$ for all $i$. Further, $x_1$ must be even, $x_2$ must be prime, and $x_3$ must be a perfect square.




            Now have different conditions for all three numbers! But this is still doable! We first individually see what values are allowed per variable. On investigation...




            • $x_1$ can be $0,2,4,6,8,10$


            • $x_2$ can be $2,3,5,7$


            • $x_3$ can be $0,1,4,9$

            With these in mind, we construct the polynomials one by one. Again, the exponents are the permissibile powers of the corresponding summand, with $x_i^0 = 1$. Then we see



            • $P_1(x) = 1 + x^2 + x^4 + x^6 + x^8 + x^10$

            • $P_2(x) = x^2 + x^3 + x^7 + x^9$

            • $P_3(x) = 1 + x + x^4 + x^9$

            Our generating function, $g(x)$, this time is not a cube, but simply the product



            $$g(x) = P_1(x)P_2(x)P_3(x)$$



            If one wanted to write it explicitly they could with no trouble, just substitute in the expressions in the bullets.




            With these in mind, we consider now your scenario:



            $$x_1 + x_2 + x_3 + x_4 + x_5 = 41$$



            where, for $k = 1,2,...,5$,



            • $x_k ge 0$

            • $x_k le 20$


            • $x_k$ is even for even $k$


            • $x_k$ is odd for odd $k$

            We translate this into the sets of permissible values. Keep in mind that we cannot go any higher than $41$ necessarily for any value. If you want to, I think this is the kind of equation that would allow for an infinite sum instead of finite - and if you're familiar with that, the work is similar enough that you should be able to analogize it.



            In any event, the set of permissible values:




            • $x_2,x_4$ can be $0,2,4,6,...,20$


            • $x_1,x_3,x_5$ can be $1,3,5,7,...,19$

            Then the corresponding polynomials are? We again construct them by basing the exponents on the allowed values:



            $$beginalign
            P_1(x) = P_3(x) = P_5(x) &= x + x^3 + x^5 + x^7 + ... + x^19\
            P_2(x) = P_4(x) &= 1 + x^2 + x^4 + x^6 + ... + x^20
            endalign$$



            and then $g(x) = P_1(x)P_2(x)P_3(x)P_4(x)P_5(x)$.






            share|cite|improve this answer











            $endgroup$












            • $begingroup$
              wow, thank you for the detailed explanation, that makes tons of sense.
              $endgroup$
              – Esther Rose
              Apr 3 at 0:04










            • $begingroup$
              @evee, so at this point, this is what I've got, I'm not sure if it's at all correct $g(x)=x^3(1+x^2+x^4+cdots+x^18)^3(1+x^2+x^4+cdots+x^20)^2 = x^3frac(1-x^19)^3(1-x^2)^3frac(1-x^21)^2(1-x^2)^2$
              $endgroup$
              – Esther Rose
              Apr 3 at 0:12











            • $begingroup$
              I would have simplified by grouping the denominators together, but yup that seems correct!
              $endgroup$
              – Eevee Trainer
              Apr 3 at 0:47















            2












            $begingroup$

            In the general scenario,



            $$x_1 + x_2 + ... + x_n = r$$



            where $x_k geq 0$ for all $k$, we have a generating function $g$ that is a product of $n$ polynomials $P$:



            $$g(x) = P_1(x)P_2(x)...P_n(x)$$



            Each of these $P_k(x)$ is defined by the restrictions on the $x_k$. Each $P_k$ will be a sum of powers of $x$, where each exponent of a $x$ term is a valid value $x_k$ may take on in the above equation. Some examples are prudent:





            Example $#1$: We want to find the number of nonnegative integer solutions to
            $$x_1 + x_2 + x_3 = 10$$
            where $x_i geq 0$ for all $i$




            This is the scenario you seem to be fine with: effectively no restrictions. Though it must be noted that there is an implicit maximum of $10$ here for each $x_k$: as you deal with more of these, you will learn whether to use $0 le x_k le 10$ or simply $0 le x_k$ (and thus use an infinite sum). I won't bog us down on the details here regarding which to use, and simply assume finite sums.



            Here, since $x_k$ can be $0,1,...,10$, then, each of the $P_k$ polynomials are



            $$P_k(x) = 1 + x + x^2 + x^3 + ... + x^10$$



            (Notice: $x^0 = 1$.) Then the generating function is the product of $P_1,P_2,P_3$ - which are all the same and thus give you the cube of the above.





            Example $#2$: We want to find the number of nonnegative integer solutions to
            $$x_1 + x_2 + x_3 = 10$$
            where $x_i geq 0$ for all $i$, and $x_i$ must be even.




            In this scenario, the allowed values for $x_i$ have changed. Now we cannot have odd values! Thus, $x_k$ must be $0,2,4,6,8,$ or $10$ for all $k$. Since these are the allowed values, we see that



            $$P_1(x) = P_2(x) = P_3(x) = 1 + x^2 + x^4 + x^6 + x^8 + x^10$$



            Again, bear in mind how the exponents (when $1 = x^0$) correspond to the allowed values for $x_k$!



            Again in this case, $P_1 = P_2 = P_3$, so $g$ is just the cube of any one of them.





            Example $#3$: We want to find the number of nonnegative integer solutions to
            $$x_1 + x_2 + x_3 = 10$$
            where $x_i geq 0$ for all $i$. Further, $x_1$ must be even, $x_2$ must be prime, and $x_3$ must be a perfect square.




            Now have different conditions for all three numbers! But this is still doable! We first individually see what values are allowed per variable. On investigation...




            • $x_1$ can be $0,2,4,6,8,10$


            • $x_2$ can be $2,3,5,7$


            • $x_3$ can be $0,1,4,9$

            With these in mind, we construct the polynomials one by one. Again, the exponents are the permissibile powers of the corresponding summand, with $x_i^0 = 1$. Then we see



            • $P_1(x) = 1 + x^2 + x^4 + x^6 + x^8 + x^10$

            • $P_2(x) = x^2 + x^3 + x^7 + x^9$

            • $P_3(x) = 1 + x + x^4 + x^9$

            Our generating function, $g(x)$, this time is not a cube, but simply the product



            $$g(x) = P_1(x)P_2(x)P_3(x)$$



            If one wanted to write it explicitly they could with no trouble, just substitute in the expressions in the bullets.




            With these in mind, we consider now your scenario:



            $$x_1 + x_2 + x_3 + x_4 + x_5 = 41$$



            where, for $k = 1,2,...,5$,



            • $x_k ge 0$

            • $x_k le 20$


            • $x_k$ is even for even $k$


            • $x_k$ is odd for odd $k$

            We translate this into the sets of permissible values. Keep in mind that we cannot go any higher than $41$ necessarily for any value. If you want to, I think this is the kind of equation that would allow for an infinite sum instead of finite - and if you're familiar with that, the work is similar enough that you should be able to analogize it.



            In any event, the set of permissible values:




            • $x_2,x_4$ can be $0,2,4,6,...,20$


            • $x_1,x_3,x_5$ can be $1,3,5,7,...,19$

            Then the corresponding polynomials are? We again construct them by basing the exponents on the allowed values:



            $$beginalign
            P_1(x) = P_3(x) = P_5(x) &= x + x^3 + x^5 + x^7 + ... + x^19\
            P_2(x) = P_4(x) &= 1 + x^2 + x^4 + x^6 + ... + x^20
            endalign$$



            and then $g(x) = P_1(x)P_2(x)P_3(x)P_4(x)P_5(x)$.






            share|cite|improve this answer











            $endgroup$












            • $begingroup$
              wow, thank you for the detailed explanation, that makes tons of sense.
              $endgroup$
              – Esther Rose
              Apr 3 at 0:04










            • $begingroup$
              @evee, so at this point, this is what I've got, I'm not sure if it's at all correct $g(x)=x^3(1+x^2+x^4+cdots+x^18)^3(1+x^2+x^4+cdots+x^20)^2 = x^3frac(1-x^19)^3(1-x^2)^3frac(1-x^21)^2(1-x^2)^2$
              $endgroup$
              – Esther Rose
              Apr 3 at 0:12











            • $begingroup$
              I would have simplified by grouping the denominators together, but yup that seems correct!
              $endgroup$
              – Eevee Trainer
              Apr 3 at 0:47













            2












            2








            2





            $begingroup$

            In the general scenario,



            $$x_1 + x_2 + ... + x_n = r$$



            where $x_k geq 0$ for all $k$, we have a generating function $g$ that is a product of $n$ polynomials $P$:



            $$g(x) = P_1(x)P_2(x)...P_n(x)$$



            Each of these $P_k(x)$ is defined by the restrictions on the $x_k$. Each $P_k$ will be a sum of powers of $x$, where each exponent of a $x$ term is a valid value $x_k$ may take on in the above equation. Some examples are prudent:





            Example $#1$: We want to find the number of nonnegative integer solutions to
            $$x_1 + x_2 + x_3 = 10$$
            where $x_i geq 0$ for all $i$




            This is the scenario you seem to be fine with: effectively no restrictions. Though it must be noted that there is an implicit maximum of $10$ here for each $x_k$: as you deal with more of these, you will learn whether to use $0 le x_k le 10$ or simply $0 le x_k$ (and thus use an infinite sum). I won't bog us down on the details here regarding which to use, and simply assume finite sums.



            Here, since $x_k$ can be $0,1,...,10$, then, each of the $P_k$ polynomials are



            $$P_k(x) = 1 + x + x^2 + x^3 + ... + x^10$$



            (Notice: $x^0 = 1$.) Then the generating function is the product of $P_1,P_2,P_3$ - which are all the same and thus give you the cube of the above.





            Example $#2$: We want to find the number of nonnegative integer solutions to
            $$x_1 + x_2 + x_3 = 10$$
            where $x_i geq 0$ for all $i$, and $x_i$ must be even.




            In this scenario, the allowed values for $x_i$ have changed. Now we cannot have odd values! Thus, $x_k$ must be $0,2,4,6,8,$ or $10$ for all $k$. Since these are the allowed values, we see that



            $$P_1(x) = P_2(x) = P_3(x) = 1 + x^2 + x^4 + x^6 + x^8 + x^10$$



            Again, bear in mind how the exponents (when $1 = x^0$) correspond to the allowed values for $x_k$!



            Again in this case, $P_1 = P_2 = P_3$, so $g$ is just the cube of any one of them.





            Example $#3$: We want to find the number of nonnegative integer solutions to
            $$x_1 + x_2 + x_3 = 10$$
            where $x_i geq 0$ for all $i$. Further, $x_1$ must be even, $x_2$ must be prime, and $x_3$ must be a perfect square.




            Now have different conditions for all three numbers! But this is still doable! We first individually see what values are allowed per variable. On investigation...




            • $x_1$ can be $0,2,4,6,8,10$


            • $x_2$ can be $2,3,5,7$


            • $x_3$ can be $0,1,4,9$

            With these in mind, we construct the polynomials one by one. Again, the exponents are the permissibile powers of the corresponding summand, with $x_i^0 = 1$. Then we see



            • $P_1(x) = 1 + x^2 + x^4 + x^6 + x^8 + x^10$

            • $P_2(x) = x^2 + x^3 + x^7 + x^9$

            • $P_3(x) = 1 + x + x^4 + x^9$

            Our generating function, $g(x)$, this time is not a cube, but simply the product



            $$g(x) = P_1(x)P_2(x)P_3(x)$$



            If one wanted to write it explicitly they could with no trouble, just substitute in the expressions in the bullets.




            With these in mind, we consider now your scenario:



            $$x_1 + x_2 + x_3 + x_4 + x_5 = 41$$



            where, for $k = 1,2,...,5$,



            • $x_k ge 0$

            • $x_k le 20$


            • $x_k$ is even for even $k$


            • $x_k$ is odd for odd $k$

            We translate this into the sets of permissible values. Keep in mind that we cannot go any higher than $41$ necessarily for any value. If you want to, I think this is the kind of equation that would allow for an infinite sum instead of finite - and if you're familiar with that, the work is similar enough that you should be able to analogize it.



            In any event, the set of permissible values:




            • $x_2,x_4$ can be $0,2,4,6,...,20$


            • $x_1,x_3,x_5$ can be $1,3,5,7,...,19$

            Then the corresponding polynomials are? We again construct them by basing the exponents on the allowed values:



            $$beginalign
            P_1(x) = P_3(x) = P_5(x) &= x + x^3 + x^5 + x^7 + ... + x^19\
            P_2(x) = P_4(x) &= 1 + x^2 + x^4 + x^6 + ... + x^20
            endalign$$



            and then $g(x) = P_1(x)P_2(x)P_3(x)P_4(x)P_5(x)$.






            share|cite|improve this answer











            $endgroup$



            In the general scenario,



            $$x_1 + x_2 + ... + x_n = r$$



            where $x_k geq 0$ for all $k$, we have a generating function $g$ that is a product of $n$ polynomials $P$:



            $$g(x) = P_1(x)P_2(x)...P_n(x)$$



            Each of these $P_k(x)$ is defined by the restrictions on the $x_k$. Each $P_k$ will be a sum of powers of $x$, where each exponent of a $x$ term is a valid value $x_k$ may take on in the above equation. Some examples are prudent:





            Example $#1$: We want to find the number of nonnegative integer solutions to
            $$x_1 + x_2 + x_3 = 10$$
            where $x_i geq 0$ for all $i$




            This is the scenario you seem to be fine with: effectively no restrictions. Though it must be noted that there is an implicit maximum of $10$ here for each $x_k$: as you deal with more of these, you will learn whether to use $0 le x_k le 10$ or simply $0 le x_k$ (and thus use an infinite sum). I won't bog us down on the details here regarding which to use, and simply assume finite sums.



            Here, since $x_k$ can be $0,1,...,10$, then, each of the $P_k$ polynomials are



            $$P_k(x) = 1 + x + x^2 + x^3 + ... + x^10$$



            (Notice: $x^0 = 1$.) Then the generating function is the product of $P_1,P_2,P_3$ - which are all the same and thus give you the cube of the above.





            Example $#2$: We want to find the number of nonnegative integer solutions to
            $$x_1 + x_2 + x_3 = 10$$
            where $x_i geq 0$ for all $i$, and $x_i$ must be even.




            In this scenario, the allowed values for $x_i$ have changed. Now we cannot have odd values! Thus, $x_k$ must be $0,2,4,6,8,$ or $10$ for all $k$. Since these are the allowed values, we see that



            $$P_1(x) = P_2(x) = P_3(x) = 1 + x^2 + x^4 + x^6 + x^8 + x^10$$



            Again, bear in mind how the exponents (when $1 = x^0$) correspond to the allowed values for $x_k$!



            Again in this case, $P_1 = P_2 = P_3$, so $g$ is just the cube of any one of them.





            Example $#3$: We want to find the number of nonnegative integer solutions to
            $$x_1 + x_2 + x_3 = 10$$
            where $x_i geq 0$ for all $i$. Further, $x_1$ must be even, $x_2$ must be prime, and $x_3$ must be a perfect square.




            Now have different conditions for all three numbers! But this is still doable! We first individually see what values are allowed per variable. On investigation...




            • $x_1$ can be $0,2,4,6,8,10$


            • $x_2$ can be $2,3,5,7$


            • $x_3$ can be $0,1,4,9$

            With these in mind, we construct the polynomials one by one. Again, the exponents are the permissibile powers of the corresponding summand, with $x_i^0 = 1$. Then we see



            • $P_1(x) = 1 + x^2 + x^4 + x^6 + x^8 + x^10$

            • $P_2(x) = x^2 + x^3 + x^7 + x^9$

            • $P_3(x) = 1 + x + x^4 + x^9$

            Our generating function, $g(x)$, this time is not a cube, but simply the product



            $$g(x) = P_1(x)P_2(x)P_3(x)$$



            If one wanted to write it explicitly they could with no trouble, just substitute in the expressions in the bullets.




            With these in mind, we consider now your scenario:



            $$x_1 + x_2 + x_3 + x_4 + x_5 = 41$$



            where, for $k = 1,2,...,5$,



            • $x_k ge 0$

            • $x_k le 20$


            • $x_k$ is even for even $k$


            • $x_k$ is odd for odd $k$

            We translate this into the sets of permissible values. Keep in mind that we cannot go any higher than $41$ necessarily for any value. If you want to, I think this is the kind of equation that would allow for an infinite sum instead of finite - and if you're familiar with that, the work is similar enough that you should be able to analogize it.



            In any event, the set of permissible values:




            • $x_2,x_4$ can be $0,2,4,6,...,20$


            • $x_1,x_3,x_5$ can be $1,3,5,7,...,19$

            Then the corresponding polynomials are? We again construct them by basing the exponents on the allowed values:



            $$beginalign
            P_1(x) = P_3(x) = P_5(x) &= x + x^3 + x^5 + x^7 + ... + x^19\
            P_2(x) = P_4(x) &= 1 + x^2 + x^4 + x^6 + ... + x^20
            endalign$$



            and then $g(x) = P_1(x)P_2(x)P_3(x)P_4(x)P_5(x)$.







            share|cite|improve this answer














            share|cite|improve this answer



            share|cite|improve this answer








            edited Apr 2 at 8:45

























            answered Apr 2 at 8:26









            Eevee TrainerEevee Trainer

            10.6k31842




            10.6k31842











            • $begingroup$
              wow, thank you for the detailed explanation, that makes tons of sense.
              $endgroup$
              – Esther Rose
              Apr 3 at 0:04










            • $begingroup$
              @evee, so at this point, this is what I've got, I'm not sure if it's at all correct $g(x)=x^3(1+x^2+x^4+cdots+x^18)^3(1+x^2+x^4+cdots+x^20)^2 = x^3frac(1-x^19)^3(1-x^2)^3frac(1-x^21)^2(1-x^2)^2$
              $endgroup$
              – Esther Rose
              Apr 3 at 0:12











            • $begingroup$
              I would have simplified by grouping the denominators together, but yup that seems correct!
              $endgroup$
              – Eevee Trainer
              Apr 3 at 0:47
















            • $begingroup$
              wow, thank you for the detailed explanation, that makes tons of sense.
              $endgroup$
              – Esther Rose
              Apr 3 at 0:04










            • $begingroup$
              @evee, so at this point, this is what I've got, I'm not sure if it's at all correct $g(x)=x^3(1+x^2+x^4+cdots+x^18)^3(1+x^2+x^4+cdots+x^20)^2 = x^3frac(1-x^19)^3(1-x^2)^3frac(1-x^21)^2(1-x^2)^2$
              $endgroup$
              – Esther Rose
              Apr 3 at 0:12











            • $begingroup$
              I would have simplified by grouping the denominators together, but yup that seems correct!
              $endgroup$
              – Eevee Trainer
              Apr 3 at 0:47















            $begingroup$
            wow, thank you for the detailed explanation, that makes tons of sense.
            $endgroup$
            – Esther Rose
            Apr 3 at 0:04




            $begingroup$
            wow, thank you for the detailed explanation, that makes tons of sense.
            $endgroup$
            – Esther Rose
            Apr 3 at 0:04












            $begingroup$
            @evee, so at this point, this is what I've got, I'm not sure if it's at all correct $g(x)=x^3(1+x^2+x^4+cdots+x^18)^3(1+x^2+x^4+cdots+x^20)^2 = x^3frac(1-x^19)^3(1-x^2)^3frac(1-x^21)^2(1-x^2)^2$
            $endgroup$
            – Esther Rose
            Apr 3 at 0:12





            $begingroup$
            @evee, so at this point, this is what I've got, I'm not sure if it's at all correct $g(x)=x^3(1+x^2+x^4+cdots+x^18)^3(1+x^2+x^4+cdots+x^20)^2 = x^3frac(1-x^19)^3(1-x^2)^3frac(1-x^21)^2(1-x^2)^2$
            $endgroup$
            – Esther Rose
            Apr 3 at 0:12













            $begingroup$
            I would have simplified by grouping the denominators together, but yup that seems correct!
            $endgroup$
            – Eevee Trainer
            Apr 3 at 0:47




            $begingroup$
            I would have simplified by grouping the denominators together, but yup that seems correct!
            $endgroup$
            – Eevee Trainer
            Apr 3 at 0:47











            3












            $begingroup$

            You're a good deal of the way there. What you have so far is five copies of $1+x+cdots+x^20$. They all stop at $20$ because no $x_i$ can be larger than $20$.



            The limitation that $x_1$ can only be odd is similarily simple. It just means that the factor of the generating function that corresponds to $x_1$ only has odd-degree terms. So instead of $1+x+x^2+cdots + x^20$, you get $x + x^3 + cdots + x^19$. Do a similar thing for the other four variables, and you have your generating function.






            share|cite|improve this answer









            $endgroup$

















              3












              $begingroup$

              You're a good deal of the way there. What you have so far is five copies of $1+x+cdots+x^20$. They all stop at $20$ because no $x_i$ can be larger than $20$.



              The limitation that $x_1$ can only be odd is similarily simple. It just means that the factor of the generating function that corresponds to $x_1$ only has odd-degree terms. So instead of $1+x+x^2+cdots + x^20$, you get $x + x^3 + cdots + x^19$. Do a similar thing for the other four variables, and you have your generating function.






              share|cite|improve this answer









              $endgroup$















                3












                3








                3





                $begingroup$

                You're a good deal of the way there. What you have so far is five copies of $1+x+cdots+x^20$. They all stop at $20$ because no $x_i$ can be larger than $20$.



                The limitation that $x_1$ can only be odd is similarily simple. It just means that the factor of the generating function that corresponds to $x_1$ only has odd-degree terms. So instead of $1+x+x^2+cdots + x^20$, you get $x + x^3 + cdots + x^19$. Do a similar thing for the other four variables, and you have your generating function.






                share|cite|improve this answer









                $endgroup$



                You're a good deal of the way there. What you have so far is five copies of $1+x+cdots+x^20$. They all stop at $20$ because no $x_i$ can be larger than $20$.



                The limitation that $x_1$ can only be odd is similarily simple. It just means that the factor of the generating function that corresponds to $x_1$ only has odd-degree terms. So instead of $1+x+x^2+cdots + x^20$, you get $x + x^3 + cdots + x^19$. Do a similar thing for the other four variables, and you have your generating function.







                share|cite|improve this answer












                share|cite|improve this answer



                share|cite|improve this answer










                answered Apr 2 at 8:15









                ArthurArthur

                123k7122211




                123k7122211



























                    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%2f3171605%2fnumber-of-solutions-to-x-1x-2-cdotsx-5-41%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

                    Boston (Lincolnshire) Stedsbyld | Berne yn Boston | NavigaasjemenuBoston Borough CouncilBoston, Lincolnshire

                    Trouble understanding the speech of overseas colleaguesHow can I better understand manager or clients with strong accents?Adding more movement and speech at the fundamental level to a highly-sedentary job?Difficulty in understanding Manager's accent(language and communication)How to adjust yourself where your colleagues are not understanding to you?Understanding manager's expectationsForeigner and colleagues using slangHaving difficulty understanding meetingsHow do you breathe when giving a speech?Trouble Waking Up for Emergencies (On-Call)Problems with colleaguesColleagues feeling insecure when I do my work

                    Ballerup Komuun Stääden an saarpen | Futnuuten | Luke uk diar | Nawigatsjuunwww.ballerup.dkwww.statistikbanken.dk: Tabelle BEF44 (Folketal pr. 1. januar fordelt på byer)Commonskategorii: Ballerup Komuun55° 44′ N, 12° 22′ O