In-depth understanding of the principles of inclusion and exclusion

(Given the limited performance capabilities blog park, hereinafter '^' denotes the set of line with pay, 'U' symbol and represents a collection. '| |' Represents the number of elements of the collection)

For the number of the most basic principles of inclusion and exclusion, is seeking something to satisfy at least one condition, namely:

  Provided there are n elements are confined attributes: a1, a2, ..., an, have a set of attributes for things a1 A1, a2 have attributes to set things A2, ..., there is an attribute of the set of things as An, seeking at least one property of the number of things that beg | A1UA2U ... UAn |

  There is a formula (Formula 1):

        

 

  

  Certify as follows:

      

  There is an equivalent formula (Formula II):   

        With  k  kinds of attributes, F (S) to satisfy at least the number of items property set S, while the definition of F ( ) = 0, then the number of the at least one attribute of the article is:

        

 

 

   prove:

        By the Venn diagram that  k 3 when the formula is very clear and easy to understand, then  k  case of larger, may wish to prove why this formula is right

        Consider each item, it is assumed that there are  n attributes, the  n = 0 when it answers contribution will only be  f ( ) to calculate, but the contribution of the answer is  zero.

        If the n- 1, you can calculate its contribution by enumeration will calculate its contribution to the collection, then its contribution to:

          

 

        Exactly 1, so this article if at least one property, then use this formula will only produce answers when calculating the cost of the contribution 1. z

  Summary: As can be seen from Equation 1, the size of the inclusion and exclusion demand is complicated and a plurality of sets of sets. Often with a method seeking more sophisticated collection and / intersection. 

     The following methods to add a complementary set intersection of using, and sets.

          

Guess you like

Origin www.cnblogs.com/InductiveSorting-QYF/p/11799088.html