Principle of combining mathematics

Source: Internet
Author: User

Principle of combining mathematics

In composite mathematics, content rejection is often used. We use content rejection to solve some composite numbers with conditions.

  • Refresh principle: the number of elements with Properties A and B is equivalent to the number of elements with Properties A and B and the number of elements with both Properties A and B.
    The mathematical formula is represented as | A ∪ B | = | A | + | B |-| A ∩ B |.
    Graphical Representation
     
    The yellow area is what we want.
    Similarly, for the three properties, the mathematical formula is | A ∪ B ∪ C | = | A | + | B | + | C |-| A ∩ B |-| A ∩ C |-| B Branch C | + | A branch B Branch C |
    Why should we add the last one? This is because one more is subtracted during the subtraction process.

  • For the principle of rejection, recursive and binary enumeration are commonly used. The biggest advantage of binary enumeration is to enumerate the subsets of all elements. Assume that there are m elements in a set, m is 1 or 0 for m-long binary numbers, for each 1
    -Corresponds to an element. The entire binary enumeration is all subsets, from 0 to 2 ^ m.

  • Recursive Algorithms use the concept of dfs to search and retrieve each scheme for rejection. Because each question has a different search method, the same template is not used, so no code is required.

  • In this case, all the odd and even properties are subtracted. If the requested properties are the opposite, the total number is subtracted.
  • The principle of rejection is simple, and the actual situation is very complicated. Each question is rejected by a different nature, but the final idea remains unchanged, if you do more questions, you will gradually accumulate experience and finally get a good idea.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.