Mathematics in the algorithm

Source: Internet
Author: User

Combinatorial mathematics:

1. Principle of addition: class independence; Multiplication principle: Step-by-step correlation.

2. Arrangement combination: http://www.cnblogs.com/PegasusWang/archive/2013/01/22/2872312.html

3. Recurrence Relationship: http://www.cnblogs.com/skyme/p/3541863.html

Arithmetical:

1, Prime and division of the problem: familiar with the concept can be.

2, the binary bit: master the conversion between the system

3, the same comodule operation: here we introduce the following three formulas:

(a+b) mod n = ((a mod n) + (b mod n)) mod n;

MoD n = ((a mod n)-(b mod n) +n) mod n;

AB mod n = (a mod n) (b mod n) mod n

Note that in subtraction, because a mod n may be less than B mod N, you need to add N to the result, and in multiplication you need to be aware that a mod n and b mod n multiplication will overflow, so be careful to save the intermediate result with a long type.

Mathematics in the algorithm

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.