Explanation of counting by Inclusion Exclusion











up vote
0
down vote

favorite












In my notes I have the following as an example for counting by inclusion exclusion.



Let S be a set. Let $c_i(x)$ where $i=1,2,3,4....k$, be a statement that is either true or false for $x in S$.



Denote $N(c_i)= |space {x in S| c_i(x)(is space true)}space|$



$N(c_ic_j)= |space {x in S| c_i(x) wedge}c_j(x)space |$



Then the number of elements of S that satisfy none of $c_1,c_2,c_3.....c_k$
is given by $|S|- sum_{1le ile k}N(c_i) + sum_{1le ile j le k}N(c_ic_j) - sum_{1le ile j le l le k}N(c_ic_jc_l) +........+(-1)^kN(c_1c_2c_3c_4......c_k)$



I am familiar enough with the Exclusion-Inclusion principle that I can express by understanding of it through a simple Venn diagram to convey how overcounting is being corrected. I honestly have no idea whatsoever what is happening in the above example. If someone could translate this into English I would greatly appreciate it. I've been at this for about an hour now so I am looking for a simple and really dumbed down explanation of what's going on.










share|cite|improve this question


























    up vote
    0
    down vote

    favorite












    In my notes I have the following as an example for counting by inclusion exclusion.



    Let S be a set. Let $c_i(x)$ where $i=1,2,3,4....k$, be a statement that is either true or false for $x in S$.



    Denote $N(c_i)= |space {x in S| c_i(x)(is space true)}space|$



    $N(c_ic_j)= |space {x in S| c_i(x) wedge}c_j(x)space |$



    Then the number of elements of S that satisfy none of $c_1,c_2,c_3.....c_k$
    is given by $|S|- sum_{1le ile k}N(c_i) + sum_{1le ile j le k}N(c_ic_j) - sum_{1le ile j le l le k}N(c_ic_jc_l) +........+(-1)^kN(c_1c_2c_3c_4......c_k)$



    I am familiar enough with the Exclusion-Inclusion principle that I can express by understanding of it through a simple Venn diagram to convey how overcounting is being corrected. I honestly have no idea whatsoever what is happening in the above example. If someone could translate this into English I would greatly appreciate it. I've been at this for about an hour now so I am looking for a simple and really dumbed down explanation of what's going on.










    share|cite|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      In my notes I have the following as an example for counting by inclusion exclusion.



      Let S be a set. Let $c_i(x)$ where $i=1,2,3,4....k$, be a statement that is either true or false for $x in S$.



      Denote $N(c_i)= |space {x in S| c_i(x)(is space true)}space|$



      $N(c_ic_j)= |space {x in S| c_i(x) wedge}c_j(x)space |$



      Then the number of elements of S that satisfy none of $c_1,c_2,c_3.....c_k$
      is given by $|S|- sum_{1le ile k}N(c_i) + sum_{1le ile j le k}N(c_ic_j) - sum_{1le ile j le l le k}N(c_ic_jc_l) +........+(-1)^kN(c_1c_2c_3c_4......c_k)$



      I am familiar enough with the Exclusion-Inclusion principle that I can express by understanding of it through a simple Venn diagram to convey how overcounting is being corrected. I honestly have no idea whatsoever what is happening in the above example. If someone could translate this into English I would greatly appreciate it. I've been at this for about an hour now so I am looking for a simple and really dumbed down explanation of what's going on.










      share|cite|improve this question













      In my notes I have the following as an example for counting by inclusion exclusion.



      Let S be a set. Let $c_i(x)$ where $i=1,2,3,4....k$, be a statement that is either true or false for $x in S$.



      Denote $N(c_i)= |space {x in S| c_i(x)(is space true)}space|$



      $N(c_ic_j)= |space {x in S| c_i(x) wedge}c_j(x)space |$



      Then the number of elements of S that satisfy none of $c_1,c_2,c_3.....c_k$
      is given by $|S|- sum_{1le ile k}N(c_i) + sum_{1le ile j le k}N(c_ic_j) - sum_{1le ile j le l le k}N(c_ic_jc_l) +........+(-1)^kN(c_1c_2c_3c_4......c_k)$



      I am familiar enough with the Exclusion-Inclusion principle that I can express by understanding of it through a simple Venn diagram to convey how overcounting is being corrected. I honestly have no idea whatsoever what is happening in the above example. If someone could translate this into English I would greatly appreciate it. I've been at this for about an hour now so I am looking for a simple and really dumbed down explanation of what's going on.







      combinatorics elementary-number-theory inclusion-exclusion






      share|cite|improve this question













      share|cite|improve this question











      share|cite|improve this question




      share|cite|improve this question










      asked Nov 24 at 5:40









      user140161

      635614




      635614






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted










          The following is a somewhat more concrete statement of the principle, copied verbatim from Notes on Introductory Combinatorics by George Polya, Robert E. Tarjan and Donald R. Woods. I personally find this version very useful in actual applications.



          "Suppose we have a set of $N$ objects that have various properties $alpha, beta, gamma, dots , lambda$. Each of the objects may have any or none of the properties. Let $N_alpha$ be the number of objects that have property $alpha$. Some of these objects may have other properties in addition to property $alpha$; that doesn't matter. (In fact, that's the whole idea!) Similarly, let $N_beta$ be the number of objects that have property $beta$, and so on. Let $N_{alpha beta}$ be the number of objects that have both property $alpha$ and property $beta$, $N_{alpha gamma}$ be the number that have properties $alpha$ and $gamma$, etc. $N_{alpha beta gamma dots lambda}$ is the number of objects with all the properties. Given this information, we want to find $N_0$, the number of objects that have none of the properties."



          "The general formula for computing this is called the Principle of Inclusion and Exclusion (or sometimes PIE for short), and is the following:
          $$begin{align}
          N_0 = N &- N_alpha - N_beta - N_gamma - dots - N_lambda \
          &+ N_{alpha beta} + N_{alpha gamma} + N_{beta gamma} + dots + N_{kappa lambda} \
          &- N_{alpha beta gamma} - N_{alpha beta delta} - dots \
          & vdots \
          & pm N_{alpha beta gamma dots lambda}
          end{align}$$



          End of quotation.



          In actual practice, I might add, the trickiest part may be formulating the problem to fit into this framework. Note that PIE requires that your final answer be the number of objects that have none of the properties. This forces you to "think negatively".






          share|cite|improve this answer























          • What does N denote here? The number of all possible objects? Could you give a concrete example of this?
            – user140161
            Nov 24 at 19:03










          • @user140161 Yes, $N$ is the number of all objects. One of my solutions using PIE is math.stackexchange.com/questions/2032110/…. Another is math.stackexchange.com/questions/2879280/…
            – awkward
            Nov 24 at 20:23












          • I think I get it now. So for example if you have sets ABC in a universe U, then what we are really doing is counting ABC by PIE, and then subtracting that from U to calculate $(ABC)^c$. It's kind of like a complement version of PIE
            – user140161
            Nov 24 at 20:46












          • I think the only confusion I have left is why the last term has $(-1)^k$
            – user140161
            Nov 24 at 20:47










          • @user140161 Suppose you have two sets $A$ and $B$; then $|A cup B| = |A| + |B| - |A cap B|$. If you add the sizes of two sets together, you've counted the stuff in their intersection twice, so you have to subtract it out. PIE is just the generalization to more than two sets.
            – awkward
            Nov 25 at 12:50











          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%2f3011229%2fexplanation-of-counting-by-inclusion-exclusion%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
          1
          down vote



          accepted










          The following is a somewhat more concrete statement of the principle, copied verbatim from Notes on Introductory Combinatorics by George Polya, Robert E. Tarjan and Donald R. Woods. I personally find this version very useful in actual applications.



          "Suppose we have a set of $N$ objects that have various properties $alpha, beta, gamma, dots , lambda$. Each of the objects may have any or none of the properties. Let $N_alpha$ be the number of objects that have property $alpha$. Some of these objects may have other properties in addition to property $alpha$; that doesn't matter. (In fact, that's the whole idea!) Similarly, let $N_beta$ be the number of objects that have property $beta$, and so on. Let $N_{alpha beta}$ be the number of objects that have both property $alpha$ and property $beta$, $N_{alpha gamma}$ be the number that have properties $alpha$ and $gamma$, etc. $N_{alpha beta gamma dots lambda}$ is the number of objects with all the properties. Given this information, we want to find $N_0$, the number of objects that have none of the properties."



          "The general formula for computing this is called the Principle of Inclusion and Exclusion (or sometimes PIE for short), and is the following:
          $$begin{align}
          N_0 = N &- N_alpha - N_beta - N_gamma - dots - N_lambda \
          &+ N_{alpha beta} + N_{alpha gamma} + N_{beta gamma} + dots + N_{kappa lambda} \
          &- N_{alpha beta gamma} - N_{alpha beta delta} - dots \
          & vdots \
          & pm N_{alpha beta gamma dots lambda}
          end{align}$$



          End of quotation.



          In actual practice, I might add, the trickiest part may be formulating the problem to fit into this framework. Note that PIE requires that your final answer be the number of objects that have none of the properties. This forces you to "think negatively".






          share|cite|improve this answer























          • What does N denote here? The number of all possible objects? Could you give a concrete example of this?
            – user140161
            Nov 24 at 19:03










          • @user140161 Yes, $N$ is the number of all objects. One of my solutions using PIE is math.stackexchange.com/questions/2032110/…. Another is math.stackexchange.com/questions/2879280/…
            – awkward
            Nov 24 at 20:23












          • I think I get it now. So for example if you have sets ABC in a universe U, then what we are really doing is counting ABC by PIE, and then subtracting that from U to calculate $(ABC)^c$. It's kind of like a complement version of PIE
            – user140161
            Nov 24 at 20:46












          • I think the only confusion I have left is why the last term has $(-1)^k$
            – user140161
            Nov 24 at 20:47










          • @user140161 Suppose you have two sets $A$ and $B$; then $|A cup B| = |A| + |B| - |A cap B|$. If you add the sizes of two sets together, you've counted the stuff in their intersection twice, so you have to subtract it out. PIE is just the generalization to more than two sets.
            – awkward
            Nov 25 at 12:50















          up vote
          1
          down vote



          accepted










          The following is a somewhat more concrete statement of the principle, copied verbatim from Notes on Introductory Combinatorics by George Polya, Robert E. Tarjan and Donald R. Woods. I personally find this version very useful in actual applications.



          "Suppose we have a set of $N$ objects that have various properties $alpha, beta, gamma, dots , lambda$. Each of the objects may have any or none of the properties. Let $N_alpha$ be the number of objects that have property $alpha$. Some of these objects may have other properties in addition to property $alpha$; that doesn't matter. (In fact, that's the whole idea!) Similarly, let $N_beta$ be the number of objects that have property $beta$, and so on. Let $N_{alpha beta}$ be the number of objects that have both property $alpha$ and property $beta$, $N_{alpha gamma}$ be the number that have properties $alpha$ and $gamma$, etc. $N_{alpha beta gamma dots lambda}$ is the number of objects with all the properties. Given this information, we want to find $N_0$, the number of objects that have none of the properties."



          "The general formula for computing this is called the Principle of Inclusion and Exclusion (or sometimes PIE for short), and is the following:
          $$begin{align}
          N_0 = N &- N_alpha - N_beta - N_gamma - dots - N_lambda \
          &+ N_{alpha beta} + N_{alpha gamma} + N_{beta gamma} + dots + N_{kappa lambda} \
          &- N_{alpha beta gamma} - N_{alpha beta delta} - dots \
          & vdots \
          & pm N_{alpha beta gamma dots lambda}
          end{align}$$



          End of quotation.



          In actual practice, I might add, the trickiest part may be formulating the problem to fit into this framework. Note that PIE requires that your final answer be the number of objects that have none of the properties. This forces you to "think negatively".






          share|cite|improve this answer























          • What does N denote here? The number of all possible objects? Could you give a concrete example of this?
            – user140161
            Nov 24 at 19:03










          • @user140161 Yes, $N$ is the number of all objects. One of my solutions using PIE is math.stackexchange.com/questions/2032110/…. Another is math.stackexchange.com/questions/2879280/…
            – awkward
            Nov 24 at 20:23












          • I think I get it now. So for example if you have sets ABC in a universe U, then what we are really doing is counting ABC by PIE, and then subtracting that from U to calculate $(ABC)^c$. It's kind of like a complement version of PIE
            – user140161
            Nov 24 at 20:46












          • I think the only confusion I have left is why the last term has $(-1)^k$
            – user140161
            Nov 24 at 20:47










          • @user140161 Suppose you have two sets $A$ and $B$; then $|A cup B| = |A| + |B| - |A cap B|$. If you add the sizes of two sets together, you've counted the stuff in their intersection twice, so you have to subtract it out. PIE is just the generalization to more than two sets.
            – awkward
            Nov 25 at 12:50













          up vote
          1
          down vote



          accepted







          up vote
          1
          down vote



          accepted






          The following is a somewhat more concrete statement of the principle, copied verbatim from Notes on Introductory Combinatorics by George Polya, Robert E. Tarjan and Donald R. Woods. I personally find this version very useful in actual applications.



          "Suppose we have a set of $N$ objects that have various properties $alpha, beta, gamma, dots , lambda$. Each of the objects may have any or none of the properties. Let $N_alpha$ be the number of objects that have property $alpha$. Some of these objects may have other properties in addition to property $alpha$; that doesn't matter. (In fact, that's the whole idea!) Similarly, let $N_beta$ be the number of objects that have property $beta$, and so on. Let $N_{alpha beta}$ be the number of objects that have both property $alpha$ and property $beta$, $N_{alpha gamma}$ be the number that have properties $alpha$ and $gamma$, etc. $N_{alpha beta gamma dots lambda}$ is the number of objects with all the properties. Given this information, we want to find $N_0$, the number of objects that have none of the properties."



          "The general formula for computing this is called the Principle of Inclusion and Exclusion (or sometimes PIE for short), and is the following:
          $$begin{align}
          N_0 = N &- N_alpha - N_beta - N_gamma - dots - N_lambda \
          &+ N_{alpha beta} + N_{alpha gamma} + N_{beta gamma} + dots + N_{kappa lambda} \
          &- N_{alpha beta gamma} - N_{alpha beta delta} - dots \
          & vdots \
          & pm N_{alpha beta gamma dots lambda}
          end{align}$$



          End of quotation.



          In actual practice, I might add, the trickiest part may be formulating the problem to fit into this framework. Note that PIE requires that your final answer be the number of objects that have none of the properties. This forces you to "think negatively".






          share|cite|improve this answer














          The following is a somewhat more concrete statement of the principle, copied verbatim from Notes on Introductory Combinatorics by George Polya, Robert E. Tarjan and Donald R. Woods. I personally find this version very useful in actual applications.



          "Suppose we have a set of $N$ objects that have various properties $alpha, beta, gamma, dots , lambda$. Each of the objects may have any or none of the properties. Let $N_alpha$ be the number of objects that have property $alpha$. Some of these objects may have other properties in addition to property $alpha$; that doesn't matter. (In fact, that's the whole idea!) Similarly, let $N_beta$ be the number of objects that have property $beta$, and so on. Let $N_{alpha beta}$ be the number of objects that have both property $alpha$ and property $beta$, $N_{alpha gamma}$ be the number that have properties $alpha$ and $gamma$, etc. $N_{alpha beta gamma dots lambda}$ is the number of objects with all the properties. Given this information, we want to find $N_0$, the number of objects that have none of the properties."



          "The general formula for computing this is called the Principle of Inclusion and Exclusion (or sometimes PIE for short), and is the following:
          $$begin{align}
          N_0 = N &- N_alpha - N_beta - N_gamma - dots - N_lambda \
          &+ N_{alpha beta} + N_{alpha gamma} + N_{beta gamma} + dots + N_{kappa lambda} \
          &- N_{alpha beta gamma} - N_{alpha beta delta} - dots \
          & vdots \
          & pm N_{alpha beta gamma dots lambda}
          end{align}$$



          End of quotation.



          In actual practice, I might add, the trickiest part may be formulating the problem to fit into this framework. Note that PIE requires that your final answer be the number of objects that have none of the properties. This forces you to "think negatively".







          share|cite|improve this answer














          share|cite|improve this answer



          share|cite|improve this answer








          edited Nov 24 at 16:09

























          answered Nov 24 at 16:01









          awkward

          5,71111022




          5,71111022












          • What does N denote here? The number of all possible objects? Could you give a concrete example of this?
            – user140161
            Nov 24 at 19:03










          • @user140161 Yes, $N$ is the number of all objects. One of my solutions using PIE is math.stackexchange.com/questions/2032110/…. Another is math.stackexchange.com/questions/2879280/…
            – awkward
            Nov 24 at 20:23












          • I think I get it now. So for example if you have sets ABC in a universe U, then what we are really doing is counting ABC by PIE, and then subtracting that from U to calculate $(ABC)^c$. It's kind of like a complement version of PIE
            – user140161
            Nov 24 at 20:46












          • I think the only confusion I have left is why the last term has $(-1)^k$
            – user140161
            Nov 24 at 20:47










          • @user140161 Suppose you have two sets $A$ and $B$; then $|A cup B| = |A| + |B| - |A cap B|$. If you add the sizes of two sets together, you've counted the stuff in their intersection twice, so you have to subtract it out. PIE is just the generalization to more than two sets.
            – awkward
            Nov 25 at 12:50


















          • What does N denote here? The number of all possible objects? Could you give a concrete example of this?
            – user140161
            Nov 24 at 19:03










          • @user140161 Yes, $N$ is the number of all objects. One of my solutions using PIE is math.stackexchange.com/questions/2032110/…. Another is math.stackexchange.com/questions/2879280/…
            – awkward
            Nov 24 at 20:23












          • I think I get it now. So for example if you have sets ABC in a universe U, then what we are really doing is counting ABC by PIE, and then subtracting that from U to calculate $(ABC)^c$. It's kind of like a complement version of PIE
            – user140161
            Nov 24 at 20:46












          • I think the only confusion I have left is why the last term has $(-1)^k$
            – user140161
            Nov 24 at 20:47










          • @user140161 Suppose you have two sets $A$ and $B$; then $|A cup B| = |A| + |B| - |A cap B|$. If you add the sizes of two sets together, you've counted the stuff in their intersection twice, so you have to subtract it out. PIE is just the generalization to more than two sets.
            – awkward
            Nov 25 at 12:50
















          What does N denote here? The number of all possible objects? Could you give a concrete example of this?
          – user140161
          Nov 24 at 19:03




          What does N denote here? The number of all possible objects? Could you give a concrete example of this?
          – user140161
          Nov 24 at 19:03












          @user140161 Yes, $N$ is the number of all objects. One of my solutions using PIE is math.stackexchange.com/questions/2032110/…. Another is math.stackexchange.com/questions/2879280/…
          – awkward
          Nov 24 at 20:23






          @user140161 Yes, $N$ is the number of all objects. One of my solutions using PIE is math.stackexchange.com/questions/2032110/…. Another is math.stackexchange.com/questions/2879280/…
          – awkward
          Nov 24 at 20:23














          I think I get it now. So for example if you have sets ABC in a universe U, then what we are really doing is counting ABC by PIE, and then subtracting that from U to calculate $(ABC)^c$. It's kind of like a complement version of PIE
          – user140161
          Nov 24 at 20:46






          I think I get it now. So for example if you have sets ABC in a universe U, then what we are really doing is counting ABC by PIE, and then subtracting that from U to calculate $(ABC)^c$. It's kind of like a complement version of PIE
          – user140161
          Nov 24 at 20:46














          I think the only confusion I have left is why the last term has $(-1)^k$
          – user140161
          Nov 24 at 20:47




          I think the only confusion I have left is why the last term has $(-1)^k$
          – user140161
          Nov 24 at 20:47












          @user140161 Suppose you have two sets $A$ and $B$; then $|A cup B| = |A| + |B| - |A cap B|$. If you add the sizes of two sets together, you've counted the stuff in their intersection twice, so you have to subtract it out. PIE is just the generalization to more than two sets.
          – awkward
          Nov 25 at 12:50




          @user140161 Suppose you have two sets $A$ and $B$; then $|A cup B| = |A| + |B| - |A cap B|$. If you add the sizes of two sets together, you've counted the stuff in their intersection twice, so you have to subtract it out. PIE is just the generalization to more than two sets.
          – awkward
          Nov 25 at 12:50


















          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%2f3011229%2fexplanation-of-counting-by-inclusion-exclusion%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

          Sphinx de Gizeh

          Dijon

          Get global maximum slope