Adding in Base 9 and Base 5Date: 10/21/97 at 10:13:13 From: Costa, Jose Subject: Rule for adding two numbers in base 9 I'm a Computer Programmer and am aware of the binary system as well as hexadecimal. My 8-year-old son is in 3rd grade and is learning how to add other bases other than 10. I have already found useful information, but I need to know more about some methods. Observation: - the number 243 in base 10 decomposed is: 2x10^2 + 4x10^1 + 3x10^0 - the same number in base 9 decomposed is: 2x9^2 + 4x9^1 + 3x9^0 ( I think this is correct! ) Givin the following addition: base 10 base 9 4687 4687 + 8456 + 8456 ------ ------ 13143 ????? What is the rule for the addition? Question 1: If we apply the decomposition rule for the number 13143 to base 9, would the result be the same as if we sum the operators 4687 and 8456 using base 9? Question 2: Is there a general rule for adding numbers in any base? I need to help him to understand how this works. Thank you very much in advance. Congratulations for this site. Best regards. Costa, Jose - Portugal Date: 10/21/97 at 16:10:15 From: Doctor Rob Subject: Re: Rule for adding two numbers in base 9 You have the first part correct. Good thinking! Now to answer your questions. 1. No, applying the decomposition rule for 13143 to base 9 would not give the same result as adding 4687 and 8456 using base 9. 2. Yes, this is how it goes. a. Start with the rightmost column of digits (be sure the numbers are properly aligned with units digits under each other). b. Begin with carry zero. c. Add the digits in the current column plus the carry. d. If the sum is less than the base, put it down at the bottom and set the carry to zero. If it is not less than the base, subtract the base, put down the result, and set the carry to one. e. If you are not out of columns, move to the next one to the left, and go back to step c above. f. If the carry is not zero, write it down as the leftmost digit of the sum. g. Stop. In your example, the work would look like this: 4687 + 8456 ------ ????? 7 + 6 = 13 > 9, 13 - 9 = 4, write this digit down, with carry of 1. 1 4687 + 8456 ------ 4 1 + 8 + 5 = 14 > 9, 14 - 9 = 5, write down 5, carry 1. 11 4687 + 8456 ------ 54 1 + 6 + 4 = 11 > 9, 11 - 9 = 2, write down 2, carry 1. 111 4687 + 8456 ------ 254 1 + 4 + 8 = 13 > 9, 13 - 9 = 4, write down 4, carry 1. 1111 4687 + 8456 ------ 4254 Write down the carry, 1. 1111 4687 + 8456 ------ 14254 Stop, you are done. The answer is 14254 (base 9), or 1*9^4 + 4*9^3 + 2*9^2 + 5*9 + 4, which equals 9688 (base 10). Notice that this is different from 13143 (base 9), which equals 8868 (base 10). -Doctor Rob, The Math Forum Check out our web site! http://mathforum.org/dr.math/ Date: 10/29/97 at 10:47:58 From: Costa, Jose Subject: Adding in base 5 Dear Dr.Math, I recently asked you a question about base 9. The question was clearly answered by Dr. Rob. Now I have another question. Consider the following: 4687 base 10 + 8456 ------ 13143 adding the units we get 7+6 = 13 and the result is 13 - 10(base) = 3 and we borrow 1 to the ten's. If we're in base 9 it would be 13 - 9(base), right? The same addition in base 5 should be: 4687 base 5 + 8456 ------ ? adding the units we get 7+6 = 13 and the result is 13 - 5(base) = 8 (8 is greater than the own base) Question 1: What should we carry in this case? Should we borrow more than 1? Question 2: Is it logical to say that the result should never exceed the figures within the base range? Looking forward to hearing from you. Best regards. Date: 11/04/97 at 13:48:52 From: Doctor Pipe Subject: Re: Adding in base 5 Jose, The numbers 4687 and 8456 are not base 5 numbers. A base 5 number will not contain any digits that are 5 or greater. 4687 and 8456 could be base 9 or base 10 numbers but not base 8 or base 7 or base 6 and so on. Your question concerns base 5. so let's use that as an example. When I write a number like this: b^n, I mean the base b to the nth power. For example, 5^2 is 5 to the second power, or 5 squared, which is 5 x 5 or 25. In the decimal, or base 10, system, a three-digit number contains the hundreds, tens and units positions - or 10^2, 10^1, and 10^0. The decimal number 527 is interpreted as: (5 x 10^2) + (2 x 10^1) + (7 x 10^0) = (5 x 100) + (2 x 10) + (7 x 1) = 500 + 20 + 7 = 527 A three-digit number in base 5 contains the 5^2, 5^1, and 5^0 positions. The base 5 number 243 is not two hundred forty-three; instead, it is two four three base 5. But we can convert it to a decimal number: (2 x 5^2) + (4 x 5^1) + (3 x 5^0) = (2 x 25) + (4 x 5) + (3 x 1) = 50 + 20 + 3 = 73 So 243 base 5 is equal to 73 base 10. Why is the digit 5 invalid in a base 5 number? Look at the following two columns. The left column is base 5 and the right column is base 10: 1 1 2 2 3 3 4 4 10 5 - the base 5 number is: (1 x 5^1) + (0 x 5^0) 11 6 12 7 13 8 14 9 20 10 - the base 5 number is: (2 x 5^1) + (0 x 5^0) 21 11 22 12 23 13 24 14 30 15 - the base 5 number is: (3 x 5^1) + (0 x 5^0) 31 16 32 17 33 18 34 19 40 20 - the base 5 number is: (4 x 5^1) + (0 x 5^0) 41 21 42 22 43 23 44 24 100 25 - the base 5 number is: (1 x 5^2) + (0 x 5^1) + (0 x 5^0) In a base 10 number, there is no single digit that means ten of something; in a base 5 number, there is no single digit that means five of something. When you have five of something, you write 0 and carry a one to the left. So, when you add two base 5 numbers, you carry "fives" to the left in the same way that you carry "tens" to the left in the decimal system. 1243 base 5 + 4243 base 5 ------ 11041 adding the units we get 3+3 = 11 base 5; write down 1 and carry 1 to the 5^1 column. 1+4+4=14 base 5; write down 4 and carry 1 to the 5^2 column. 1+2+2=10 base 5; write down 0 and carry 1 to the 5^3 column. 1+1+4=11 base 5; write down 11. I hope that this helps! -Doctor Pipe, The Math Forum Check out our web site! http://mathforum.org/dr.math/ |
Search the Dr. Math Library: |
[Privacy Policy] [Terms of Use]
Ask Dr. Math^{TM}
© 1994-2015 The Math Forum
http://mathforum.org/dr.math/