# Manipulation Carry System

Source: Internet
Author: User
Tags arabic numbers

People have ten fingers, and it is very convenient to count them with fingers. However, once the number of objects exceeds 10, the finger is not enough. Of course, some people may think of toes. It is unrealistic to move your toes. You only need to stand and draw your fingers. You also need to sit down and study the toes. A good way is to mark the place where ten fingers are finished each time, such as placing a wooden stick on the ground. People can think of this wooden stick as a "big finger", which is equivalent to ten fingers. In this way, I have 37mm, which is represented by three wooden sticks on the ground and seven fingers on it. Haha, you only have two wooden sticks and four fingers, so my MM is more than yours. Over time, people will only accept the 10 numbers 0 to 9, and the larger numbers will be expressed in a few digits. This "ten-in-one" digital system is called the decimal system.
What if a person has only eight fingers? Now we are likely to be using octal. After the development of mathematics, we finally accept only eight numbers, and numbers larger than 8 are represented by higher-level units of measurement. It is likely that these eight numbers are some strange symbols in the Stargate. Here we still use 0 to 7 Arabic numbers for ease of narration. Therefore, the number of human beings will change ,.... Here, the number 8 is recorded as 10, and the number 64 is replaced by 100. In this world of mathematics, 6 + 5 = 13, because the number of 6 + 1 is already the largest in a single digit. In addition, we can only "Enter one. "Full eight into one" will become the basic law of mathematical operations.
If a person has 12 fingers, 12 digits will become more difficult to imagine. In the 12-digit system, humans directly think of 10 and 11 as numbers ". When the carry system is greater than 10, numbers greater than 9 are usually represented by uppercase letters ABC. In this way, there will be two more symbols A and B in the natural number sequence, and the number method will be changed to..., 8, 9, A, B, 10, 11, 12 ,....

We will naturally wonder if there are any other carry-in systems in human life? Of course. For example, the time and angle are in the 60-digit system, 60 seconds = 1 minute. Even more strange, the computer's storage capacity unit is 1024 in hexadecimal format, 1 MB = kb. Of course, there is a reason. We often use 1/2, 1/3, 1/4, or 1/6 when studying ry. We hope these scores are just integers in the angular hexadecimal order for computation. Therefore, the Carry System of the angle is changed to 60. Why is the time also in the 60-digit system? Because time and angle are closely related, you can see your watch (don't tell me your watch is digital ). Why does the clock and watch have to use a circular dial to represent time? In fact, since ancient times, people have been using a circular disc because the rotation of the earth around the sun and the rotation of the Earth has made time cyclical.
The computer uses binary because the computer component has only two States (on and off, or power-on and power-off), so the computer only recognizes 0 and 1. 1024 is the power of 2, and is close to 1000. Therefore, 1024 is regarded as the Carry System of Computer capacity.

Some time ago, someone asked on oibh why are the denominations of banknotes 1*10 ^ N, 2*10 ^ N, 5*10 ^ n. Someone replied that such a currency system could make some greedy method correct. It is indeed the conclusion that such a currency system makes the greedy algorithm to solve the problem of "making money and finding the minimum number of banknotes used at zero time" (continuously obtaining the maximum denomination of banknotes) correct. However, it is obviously ridiculous to use this to explain our problem. What people first consider is not how to easily use the least banknote, but how to easily obtain the total denomination. A currency system with only one-dollar notes and seven-dollar notes is equally greedy, but it is clear that fools will design such awkward currency systems. Therefore, my answer is "the face value of a banknote is about 10, so it is most convenient to make money and change the value by zero ". However, some people may ask, what if we use a carry-in system instead of 10? In other words, if we are using a 23-digit system, we can set up a currency system if there is no other appointment except 1 and 1. The answer is surprising. If we are using a 23-digit system, we may not be able to develop mathematics at all. 10 = 1 + 2 + 3 + 4, is the sum of the first four positive integers; 10 is the product of 2 and 5; such a carry system is very suitable for the development of mathematics. Similarly, 6 = 1 + 2 + 3, 6 = 2*3, so it may be very easy for the six-digit insects to develop mathematics, no one has discovered that the hexagonal style design of the bee honeycomb is the most scientific ). Have you ever seen the computer's God (calculating God? It constructs a creature with 23 fingers. This awkward number can only be thought of by Jordan and chromosomes, without any features. This brings insurmountable difficulties to the mathematical development of this creature. In fact, this creature does not need to develop mathematics. Like humans, he has the ability to directly perceive a small number of objects. The number of objects that humans can directly perceive generally does not exceed 6. That is to say, if you have three or five items in front of you, you don't need to count them. You can see at a glance how many items are there; but when the number of objects that appear in front of you reaches 7 or 8, you must count one to know the number. When we talk about the number of objects facing a creature as many as 46, we can still tell at a glance how many objects are. After the number of objects exceeds 46, it is collectively referred to as "a lot. Directly aware that more than 50 or more biological individuals play the role of a monk in the race. 46. This number is enough for race survival. When a tribe is formed, they always ensure that the number of individuals in the tribe does not exceed this number. Therefore, this creature does not need the ability to count, so they do not need to develop mathematics. They don't know how much a 30 plus 30 equals. In a sense, they don't even know that one plus one equals a few because they don't have the concept of numbers at all. As a compensation, they are extremely keen to perceive things. They even intuitively perceive the theory of relativity because their thinking is not bound by deductive logic.

The following describes the two hexadecimal conversion methods and the application of these two methods in decimal conversion. You can learn more about the placement system in the exercises section.

When talking about the carry system, most textbooks will teach you how to swap binary and decimal. Today I am not going to talk like this. I want to talk like those teaching materials. I 'd better not write these things today. Although binary is commonly used, it is quite special. It may be binary, but it will not be any other hexadecimal. Today we are a bee and look at how the hexadecimal and decimal formats are converted to each other. After learning this, you should convert any hexadecimal system.
Speaking of the carry system, it is often necessary to return to some of the most fundamental counting methods. This is my 237th logs. The number "237" indicates two hundred, three ten, and seven units one. We call them hundreds, ten, and one digit respectively. The actual number of digits indicated by the same number is different. The above expression means 237 = 2*100 + 3*10 + 7. This is the actual meaning of the carry system.
Now, let's assume that I am a hardworking bee. It is certainly impossible for me to write 237 logs, because I do not have the number 7 in the mathematical world. I wrote 235 logs. In combination with what we mentioned above, the number on "Ten" indicates the number of six, the number on "Hundred bits" indicates the number of 36 bits (the quotation marks of the ten or hundred bits mentioned later indicate that this is not "Ten" or "Hundred" in decimal format "). Therefore, in the hexadecimal system, 235 is equal to 2*6 ^ 2 + 3*6 + 5. In this formula, you can use the hexadecimal formula to calculate the answer, which is equivalent to converting 235 in the hexadecimal notation to the hexadecimal notation. However, it is unlikely that you consider this formula as another hexadecimal form, before calculating the formula, you have to repeat the multiplication table (note why I don't say it's the "9th" multiplication table ). This is why we generally only study decimal and other hexadecimal swaps. We can use a familiar decimal number to calculate 2*6 ^ 2 + 3*6 + 5 = 72 + 18 + 5 = 95. This is a hexadecimal conversion method by definition. In hexadecimal notation, 235 equals to 95 in decimal format. We record it as (235) 6 = (95) 10. That 6 and 10 are subscripts, which should be written below as little as 2 of H2O. I don't have to worry about typographical layout. It turns into plain text after I paste it several times.
The following task is to consider how to change (95) 10 back to (235) 6. If we use the hexadecimal notation 13*10 + 5, we can get 235 (9 on 10 is equivalent to 13 in the hexadecimal notation), but we have said that the hexadecimal notation is very troublesome. Next we will provide a method to convert decimal to hexadecimal. If you think about it carefully, you will find that this method is obviously correct. We can write all 6 Power Words in uppercase: 36,216 ,.... 216 is far more than 95, so the 95 hexadecimal system cannot be four digits. There are two 36 in 95, so write "2" on the highest bit ". Remove two 36s, with only 23 in 95. There are three 6 in 23, and the number 3 will be written in the second place, and the last 5 of the Three 6 will be removed to the last place. In other words, we constantly look for the largest X so that 6 ^ X does not exceed the current number. The current number minus 6 ^ X and adds one to the x + 1 position on the right. This is actually the inverse process of the previous hexadecimal to decimal.
The above hexadecimal interchange method is a set of methods, which is the first method we have introduced. This method is characterized by obvious correctness, but complicated calculation, and expensive motor and electricity consumption. We need a more convenient hexadecimal conversion method for computing. Next we will introduce the second scheme of hexadecimal conversion.

Again, let's go back to a very basic question: in decimal notation, Why multiply by 10 is equivalent to adding a 0 to the end of the number? We will also think of the in-place operation: Why does the binary shift one bit left (adding a 0 at the end) Multiply by 2? In fact, this conclusion is generally found in all carry systems: adding 0 at the end of the K-base number is equivalent to multiplying this number by K. The proof method is very simple. multiplying a k is equivalent to adding one to each index in the carry expansion, which is equivalent to moving all numbers to the left. In hexadecimal notation 235 = 2*6 ^ 2 + 3*6 + 5, if multiplied by 6, the formula is changed to 2*6 ^ 3 + 3*6 ^ 2 + 5*6, that is 2350. Using this property, the hexadecimal 235 can be quickly converted to decimal: 235 is equivalent to adding 0 after 2, plus 3, and then adding 0, plus 5, write to formula (2*6 + 3) * 6 + 5 = 95. Expand (2*6 + 3) * 6 + 5. The formula is exactly the same as the previous calculation method (2*6 ^ 2 + 3*6 + 5, however, the calculation method here is simpler. If the program is written, the hexadecimal string T is converted to the decimal number A, which can be completed in one sentence:
`for i:=1 to length(t) do a:=a*6+ord(t[i])-48;`
Using this method to convert decimal to hexadecimal is a complete inverse operation: the current number is constantly divided by 6 and the remainder is used as the new highest bit. For example, if 95 is divided by 6 and equal to 15 plus 5, the remainder 5 is a single digit, 15 is divided by the remainder 3 of 6 as "Ten", and the final quotient 2 is "Hundred bits ". This is called short Division and is the most common method, which can be seen everywhere on the Internet.

The following describes the decimal places in the carry-in system. If we understand the previous things, the decimal conversion will be done in turn. In hexadecimal notation 0.1 is equivalent to 1/6 in decimal notation, because in hexadecimal notation 0.1, 0.2, 0.3, 0.4, and 0.5, the intervals 0 to 1 are evenly divided into 6 points. Similarly, (0.05) 6 = (5/36) 10. You will find that a "very bit" represents 1/6, and a "percentile" represents 1/6 ^ 2. Many previous conclusions are still true. Decimal decimal point 12.345 is equal to 1*6 ^ 1 + 2*6 ^ 0 + 3*6 ^ (-1) + 4*6 ^ (-2) + 5*6 ^ (-3): Associate the integer and decimal parts of the hexadecimal conversion with the negative exponent. (12.345) it is not surprising that 6 is converted into an infinite decimal number after being converted into a decimal number. This is just an approximate number problem: it is also 1/3, in my six-digit system, the points are just clean (0.2), but you can't finish the points in decimal system. There is always one left for the next digit (0. 333333 ...).HereThere are some decimal conversion instances. We can see that the finite decimal places in one base system are probably infinite cyclic decimal places in another base system. Another interesting example is as follows:Here.
Since the first set of six-to-decimal methods is still valid for decimal places, the decimal to six-to-decimal places of the first set of methods can also be used directly on decimal places. If it is awkward to use an infinite number of decimal places, it is a good choice to use scores. The procedure is exactly the same as described above. For the hexadecimal conversion of pure decimal places, let's Replace the preceding description with another method: constantly look for the smallest positive integer x so that 1/6 ^ X does not exceed the current number, subtract 1/6 ^ X from the current number and add one to the X digit after the decimal point. I will not give an example. The following mainly discusses the application of the second method in decimal places.
We once said that adding 0 at the end of K is equivalent to multiplying the number by K. Unfortunately, this is not useful for decimal places. After decimal places, you add eight hundred "0" to the decimal places, which remains unchanged. In fact, adding 0 at the end is only a phenomenon of this nature reflected in integers. We still need to see more essential things (remember the high school philosophy ). Considering the multiplication of decimal places by K and division of K, it is not difficult to think that the essence of this nature is to move the decimal point. adding 0 at the end of the integer is actually the result of moving the decimal point to the right. Obviously, the decimal point has a similar conclusion: shifts the decimal point of K to the left, which is equivalent to dividing the number by K. For example, divide 3.14 by 10 in decimal format to 0.314. The proof of the conclusion is exactly the same as the original one: divide by K and then subtract one from all the indexes in the expansion, which is equivalent to moving one digit to the right of all numbers. With this conclusion, our method will come out. Let's see how to convert hexadecimal 12.345 to decimal. This method has some differences in the processing of integers and decimals. in hexadecimal conversion, we usually perform operations on the integers and decimals respectively. First, convert 12 to 8 in decimal format, and then separately consider the decimal part. 0.345 can be seen as the decimal point left shift of the number "5", plus 4 to move the decimal point left again, plus 3 and the last left shift decimal point; it is written as a formula (5/6 + 4) /6 + 3)/6. Expand this formula, which is essentially the same as the previous method. Decimal to hexadecimal is still a complete inverse operation: the current number is multiplied by 6 and the integer is taken out and written down.
Here is an example for your reference. In this example, the hexadecimal conversion does not involve infinite cyclic decimals. 1/4 in decimal and hexadecimal notation must be finite decimal, because the only factor 2 of 4 is also a factor of 10 and 6. First, let's take a look at how 0.25 is converted into a hexadecimal system: 0.25*6 = 1.5, take out 1, and leave 0.5; 0.5*6 = 3, no decimal part, so (0.25) 10 is equal to (0.13) 6. Now I will change it back to: (3/6 + 1)/6 = (0.5 + 1)/6 = 1.5/6 = 0.25. Isn't this a complete inverse operation?

Someone asked about the negative carry-in system before noip every year. In fact, if you understand the problem above, the negative carry system will be very easy to understand. The negative carry system has a very strange function: it can indicate negative numbers but does not need to use negative numbers. A negative hexadecimal number may be a negative number or a positive number. For example, 12 in the negative six-digit system is equal to-4 in decimal system, and 123 in the negative six-digit system is equal to 1 * (-6) ^ 2 + 2 * (-6) ^ 1 + 3, that is, 27 in decimal format. It is precisely because the negative value depends on the parity of the number of digits. If the number has an even number, the number is negative. If the number has an odd number, the number is positive. The reason is very simple. the decimal point shifts one digit to the right, which is equivalent to multiplying the number by-6. From the very beginning, after an odd number, the number of digits becomes an even number and the value is negative, the number is still odd and the value is positive. Since the property of adding 0 at the end (decimal point shift) is still true, the conversion between negative hexadecimal and decimal is still the above method: (123) -6 = (1 * (-6) + 2) * (-6) + 3 = (27) 10. Convert decimal to negative hexadecimal? Or that sentence: a complete inverse operation. Find the smallest non-negative integer x so that the current number minus X can be fully divided by 6. This X will be written to the result as the new highest bit, and then the current number minus X will be divided by-6. Here I will not mention the word "remainder", because when the divisor is negative, the definition of the remainder is vague. I will not give an example anymore. I am tired of all the examples. I have taken the line (123)-6 =... = (27) 10 as an example.
Of course, what's more amazing is that the-1 + I hexadecimal system can represent the plural number, because the power of-1 + I sometimes contains virtual numbers and sometimes does not include virtual numbers. Operations and conversions are still the same as those above, so I will not talk about them much.

The problem of carrying is over. Here we use the hexadecimal format as an example, but do not forget that the most interesting thing is binary. Binary-related interesting issues are everywhere. For example, you canHereThe third question shows a classic binary application.

The last three sentences of the article are as follows:
Matrix67 original
Please indicate the source of the post

There may be many typos this time, because I am not using Ziguang, but fcitx, and I cannot use the original dictionary.
There may also be loopholes in the explanation. Many things I suddenly thought of were written on an impromptu basis. Help you correct the error!

Appendix 1: four-digit exercise questions and their simple answers
The following questions are in the courseware I published. They are some of the most representative questions I have collected. They have been used many times in the lectures.

1. Proof: Σ (n = 1 to ∞) 6 ^ (2-3n-n ^ 2)/2) is irrational.
A: The number is expressed in hexadecimal notation, which is obviously irrational.

2. In which operating system, 35 and 58 are mutually compatible?
Answer: Given the occurrence of number 8, The carry system must be at least 9. In fact, 35 and 58 are mutually qualitative in any carry-in system not less than 9, because there will be no "not enough subtraction" in tossing and subtracting, and in any hexadecimal system, one will eventually be required.

3. Proof: there is no mechanism to make three-digit AAA equal to a ^ 3.
Answer: If this number is set to K, AK ^ 2 + aK + A = a ^ 3. This equation has no integer solution.

4. In which operating system can 792 be divisible by 297?
Answer: This question is very interesting. In any input system, four times of 200 has exceeded two times of 792,300 and less than 792. Then, 792 may only be three times that of 297. Set carry to K. The problem is converted to equation 7k ^ 2 + 9 K + 2 = 3*(2 k ^ 2 + 9 K + 7 ).

Appendix 2: incomplete collection of carry-in jokes :)

1. What wocould the value of 190 in hexadecimal be?

3. There are only 10 types of people in the world-those who understand binary, and those who don't.

4. There are only 10 types of people in the world-those who understand trinary, those who don't, And those who mistake it for binary.

5. Why do mathematicians think Halloween and Christmas are the same? Because 31 Oct = 25 dec.

Matrix67

Related Keywords:

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.