Base 13 - Hitchhiker's Guide to the Galaxy

I know base 13 is not practical. However, I again checked the hitchhiking guide for the galaxy because today's date is 10/10/10 = 42 in binary format. (you know, the answer to the final question about life, the universe, etc.). It takes 42 million years to compute and verify the answer, which is 42 years. Unfortunately, The Ultimate Question itself is unknown. In any case, he said: "Six on nine. Forty-two. - That's it. That's all there is." "I always thought something was fundamentally wrong with the universe."

My question is, how is 6 x 9 in the base 13 = 42?

I know how to convert base 10, 2,16,8, but the transition from base 10 to base 13 is a mystery to me. I understand that in base 13, that 6 is probably = 6 and 9, probably = 9 S0, is it just a matter of multiplying in base 13?

Can someone fix this? I found this, but not very helpful

in base 13, 6 13 Γ— 9 13 is actually 4213 (as 4 Γ— 13 + 2 = 54, ie 54 in decimal is equal to 42 expressed in base 13). 
+7
binary
source share
3 answers

This is a method that can convert the base-10 number to base-13:

Start with the number 9x6 = 54, we want to find the equivalent of 54 in base 13.

 54 / 13 = 4 remainder 2 4 / 13 = 0 remainder 4 

and we combine the remnants, from bottom to top, 42.

A more general algorithm starting with the decimal number N, we want to find the equivalent of N in base B.

 N / B = a1 remainder r1 a1 / B = a2 remainder r2 .... an / B = 0 remainder rn 

and combine the numbers, from bottom to top: rn ..... r2. g1

iterative implementation in Python:

 digits = '0123456789abcdefghijklmnopqrstuvwxyz' def rebase(n, base=2): ''' Convert a positive integer to number string with base `base` ''' s = [] while n != 0: n, rem = divmod(n, base) s.append(digits[rem]) return ''.join(reversed(s)) 

recursive implementation in Python:

 digits = '0123456789abcdefghijklmnopqrstuvwxyz' def rebase(n, base=2): ''' Convert a positive integer to number string with base `base` ''' return rebase(n // base, base) + digits[n % base] if n != 0 else '' 

even more broadly, if you have a string representing a number in base N, and you want to convert it to a string representing a number in base M:

 digits = '0123456789abcdefghijklmnopqrstuvwxyz' def rebase(orig, orig_base=10, target_base=2): ''' Convert a positive integer to number string with base `base` ''' num = 0 for i, n in enumerate(reversed(orig)): num += digits.find(n) * (orig_base**i) target = [] while num != 0: num, rem = divmod(num, target_base) target.append(digits[rem]) return ''.join(reversed(target)) 
+7
source share

This is not a question of the number plurality in another database, but about the expression of a product in this database

Let's start with a very simple base, unary, which is expressed only in units (not even zeros)

6x9 in the unary state 111111 x 111111111. We can perform this calculation by replacing all units in one member with units in another member. copy and paste nine six times

1111111111111111111111111111111111111111111111111111111111

When we want to express this number in more convenient bases, we group them by radius. If there are enough groups to group groups, we group them. we then replace the group numbers with numbers. We will do it in decimal form.

 111111111111111111111111111111111111111111111111111111 ^ ^ ^ ^ ^ 

Each arrow represents a group of 10, and 4 remain, so in dozens of places we put 5, and in them - 4, 54.

allows you to do the same for a small base, so we can get an idea of ​​how to generalize groups of groups:

 1 111111111111111111111111111111111111111111111111111111 2 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 4 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 8 ^ ^ ^ ^ ^ ^ 16 ^ ^ ^ 32 ^ 

We could do groups five times. starting from one place, we won’t leave there after we have grouped two, so the first digit is 0. When we are grouped by 4, there remains a group of 2 remaining, so the next digit is 1. When we grouped by 8, the group remains of the remaining 4, the other 1 is the next digit. when we grouped by 16, there was one remaining group of 8. when grouped by 32, there remained a group of 16. we cannot create a group up to 64, so all digits for places above 32 are 0. Therefore, the binary representation will be

 110110 

finally base 13. it's as simple as base 10

 111111111111111111111111111111111111111111111111111111 ^ ^ ^ ^ 

there are 4 groups of 13. after we make these 4 groups, there are two numbers left. thus, the product 6 x 9, if presented in base 13, is equal to "42"

+2
source share

Answer 42 has nothing to do with base 13, it was just a computational error.

The answer to this question is very simple. It was a joke. It should be a number, an ordinary, small number, and I chose that one. Binary representations, basic thirteen, Tibetan monks are all utter nonsense. I sat at my table, looked into the garden and thought: '42 I will do it. I typed it. The end of the story.

http://en.wikipedia.org/wiki/Answer_to_the_Ultimate_Question_of_Life,_the_Universe,_and_Everything#Answer_to_the_Ultimate_Question_of_Life.2C_the_Universe_and_Everything_.2842.29

0
source share

All Articles