2.5 Integers and algorithms

Source: Internet
Author: User

2.5.1 Introduction

As described in section 2.1, the term algorithm originally refers to the process of arithmetic operations using the use of integer notation in decimal notation. These algorithms, modified to handle binary representations, are the basis of computer arithmetic. These algorithms provide a good example for understanding the concept of the algorithm and the complexity of the algorithm. So this book will discuss these algorithms.

In addition to the integer algorithms commonly used in arithmetic, there are many algorithms involving integers, including Euclid's algorithm, which is one of the most useful algorithms, most likely the oldest in mathematics. We will also describe an algorithm that is used to expand and Yu Yu the B-System of a positive integer for any cardinality B, which is an important algorithm in cryptography.

The representation of an 2.5.2 integer

  In everyday life, integers are represented by decimal notation. For example, 965 is used to denote 9.102+6.10+5. However, it is sometimes easier to use numbers other than 10 for the base. In particular, computers commonly use binary notation (base 2) for arithmetic operations, and use octal (base 8) or hexadecimal (radix 16) notation to denote characters, such as letters or characters. In fact, you can use any positive integer other than 1 to represent the integer as the cardinality. This conclusion is stated in Theorem 1.

theorem 1 makes B a positive integer that is not equal to 1. Then if n is a positive integer, it can be represented as the following form only:

n=ak.bk+ ak-1.bk-1+...+a1b+a0

where k is a non-negative integer, A0, A1,...,

2.5 Integers and algorithms

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.