A question on changing bases of numbers

In summary, to convert from base 6 to base 3, you would take the number in base 6 and multiply it by 2, then add it to the number in base 3.
  • #1
transgalactic
1,395
0
i want to transform a number in base 6 into a number in base 3


i was looking for a way to transform straight forward without any middle man
("from 6 to 10 and from 10 to 3" that's not the way i am looking for)
 
Physics news on Phys.org
  • #2
Are you looking for a calculator (see http://www.1728.com/numbbase.htm) or a formula?

The algorithm for conversion into decimal is:

Let's say you have a number

10121 in base 3

and you want to know what it is in base 10. Well, in base three the place values are

1,3,9,27,81

so we have 1 *81 + 0 * 27 + 1 * 9 + 2* 3 + 1* 1

81 +0+ 9 +6 +1 = 97
http://mathforum.org/library/drmath/view/57074.html

In base 5 this is: 97 = 3x25 + 4x5 + 2x1 = 3425.

If you wanted to convert 101213 to base 5 directly, you'd need to figure out the "place values" in base 5.

{1, 3, 9, 27, 81} = {15, 35, 145, 1025, 3115}

Then: 1 *3115 + 0 * 1025 + 1 * 145 + 2* 35 + 1* 15 = (3115 + 145) + (115 + 15) = 3305 + 125 = 3425
 
Last edited:
  • #3
i am looking for a formula
 
  • #4
See edits to my post.
 
  • #5
i know how to convert to ten base from each number
i want to covert from base 6 to base 3 straight forward
 
  • #6
transgalactic said:
i want to transform a number in base 6 into a number in base 3


i was looking for a way to transform straight forward without any middle man
("from 6 to 10 and from 10 to 3" that's not the way i am looking for)

Easy! Just learn how to add, subtract, multiply, and divide in base 6. Doing so with "3" is very easy, because it is just half of 6 (kind of like working with "5" in base ten). Then convert the exact same way you otherwise would - only in base six. Ex:

12345 base six should be 1010,20111 base three (check me)
 
  • #7
doGraeF said:
Easy! Just learn how to add, subtract, multiply, and divide in base 6. Doing so with "3" is very easy, because it is just half of 6 (kind of like working with "5" in base ten). Then convert the exact same way you otherwise would - only in base six. Ex:

12345 base six should be 1010,20111 base three (check me)

I'm sorry! I actually wound up calculating the REVERSE sequence: "54321 base six"!

For reference, please let me show you how I arrived at this number - going straight from base six to base three:

15304 base six
______
3)54321 base six

Remainder: 1

3501 base six
______
3)15304 base six ... (I will cease to make this note, and let any following number be base six unless otherwise noted)

Remainder: 1

1140
_____
3)3501

Remainder: 1

232
_____
3)1140

Remainder: 0

50
____
3)232

Remainder: 2

14
___
3)50

Remainder: 0

3
___
3)14

Remainder: 1

1
__
3)3

Remainder: 0

0
__
3)1

Remainder: 1

Now, put the "remainders" in order, starting with the last and ending with the first:

1010,20111 base three (trinary)

Now, let's try "12345 base six":

2513
______
3)12345 base six (as will be the case UON (unless otherwise noted))
-10
23
-23
04
-3
15
-13
Remainder: 2

543
_____
3)2513
-23
21
-20
13
-13
Remainder: 0

153
____
3)543
-3
24
-23
13
-13
Remainder: 0

35
____
3)153
-13
23
-23
Remainder: 0

11
___
3)35
-33
Remainder: 2

2
___
3)11
-10
Remainder: 1

0
__
3)2
Remainder: 2

Now, again, just arrange the respective remainders in reverse order for the trinary equivalent: 2120002 base three (trinary)

(By the way, I have come to prefer grouping my numerical expressions into groups of five bits, instead of three; as you may have noticed. My reason for this preference would actually be quite a long story).

doGraeF
 
  • #8
An even better answer!

I found an even more convenient method of changing bases. Let's consider base six: "12345" again.

First, we take the left-most digit: "1". Then, if it were "3" or higher, we would convert it to base three, but "1" is the same in base six as in base three.

Second, multiply it by two: 1*2 = 2

Third, multiple by base three "10": 2*10 = 20 base three


Now, we take the second left-most digit: "2", and leave it alone, because it is the same in base six or base three. Then, add it to our running total: 20+2 = 22.

Multiply 22 by 2: 22 * 2 = 110 + 11 = 121.

And multiply 121 by 10: 121 * 10 = 1210.


Now, we take the middle digit: "3", and convert it to base three: "10". Add it to 1210: 1210 + 10 = 1220.

Multiply by 2: 1220 * 2 = 2000 + 1100 + 110 = 10210.

Multiply by 10: 10210 * 10 = 1,02100.


Take second right-most digit: "4", and convert to base three: "11". Add it to 102100: 1,02100 + 11 = 1,02111.

1,02111 * 2 = 2,11222.

2,11222 * 10 = 21,12220.


Take the right-most digit: "5", and convert to base three: "12". Add it to 21,12220: 21,12220 + 12: 21,20002.

So, in summary: work from left to right, take the the digit, convert to base three, multiply by 2, then multiply by base three "10", then convert the next digit to base three and add it to the running total, multiply the running total by 2, multply the running total by base three "10", and etc. until you have finally added the rightmost digit, converted to base three, to the running total. At that point, the running total will be your base six number converted to base three.

Daniel
 
  • #9
As if I have not already said enough about this (and do bear with me if this seems a little excessive), let's try our other example: 54321 base six. (All numbers will be in base three unless otherwise noted).

First, let's take the left-most digit: "5", and convert it to base three: "12". Now, let's multiply it by two: 12 * 2 = 20 + 11 = 101. Next, multiply it by 10: 101 * 10 = 1010.

Now, we convert the second left-most digit, "4", to base three: 11. Now, add it to our running total: 1010 + 11 = 1021. Multiply running total by 2: 1021 * 2 = 2000 + 110 + 2 = 2112. Multiply it by 10: 2112 + 10 = 21120.

Take the middle digit, "3", and convert to base three: 10. Add it to running total: 21120 + 10 = 21200. Multiply total by 2: 21200 * 2 = 1,10000 + 2000 + 1100 = 1,20100. Multiply it by 10: 1,20100 * 10 + 12,01000.

Add second right-most digit, "2" to total: 12,01000 + 2 = 12,01002. Multiply by 2: 12,01002 * 2 = 20,00000 + 11,00000 + 2000 + 11 = 101,02011. Multiply by 10: 101,02011 * 10 = 1010,02110.

Add right-most digit, "1", to total: 1010,02110 + 1 = 1010,02111.
 
Last edited:

1. What is a base in mathematics?

A base in mathematics refers to the number of different digits or values used to represent numbers. The most commonly used base in mathematics is base 10, which uses 10 different digits (0-9) to represent all numbers. Other commonly used bases include base 2 (binary), base 8 (octal), and base 16 (hexadecimal).

2. What does it mean to change the base of a number?

To change the base of a number means to represent the number using a different set of digits or values. This is often done to make calculations or conversions easier, as certain bases may be more suited for specific operations.

3. How do you convert a number from one base to another?

To convert a number from one base to another, you can use the repeated division method. This involves continuously dividing the original number by the new base, and then using the remainders as the digits in the new base. Alternatively, you can use a conversion chart or a calculator with a base conversion function.

4. What is the significance of different bases in computer science?

Bases are significant in computer science because computers use binary (base 2) as their primary number system. This means that all data, including numbers and characters, are represented using only 0s and 1s. Other bases, such as octal and hexadecimal, are also commonly used in computer programming to represent binary numbers in a more compact and readable format.

5. Can numbers be converted from any base to another?

Yes, numbers can be converted from any base to another as long as the two bases are compatible. For example, it is possible to convert a number from base 10 to base 2, 8, or 16, but it is not possible to convert it to base 3 or 5. Additionally, some numbers may have repeating or infinite representations in certain bases, making conversion more complex.

Similar threads

  • Precalculus Mathematics Homework Help
Replies
1
Views
295
  • Calculus and Beyond Homework Help
Replies
13
Views
2K
  • Calculus and Beyond Homework Help
Replies
5
Views
1K
  • Precalculus Mathematics Homework Help
Replies
4
Views
313
  • Calculus and Beyond Homework Help
Replies
11
Views
1K
  • Calculus and Beyond Homework Help
Replies
2
Views
161
  • Calculus and Beyond Homework Help
Replies
9
Views
1K
  • Calculus and Beyond Homework Help
Replies
6
Views
1K
  • Calculus and Beyond Homework Help
Replies
16
Views
1K
  • Precalculus Mathematics Homework Help
Replies
13
Views
910
Back
Top