jedusor: (please?)
[personal profile] jedusor
Can anyone explain to me how to convert from base 8 to base 6 by hand?

Date: 2010-02-11 07:27 pm (UTC)
From: [identity profile] persona.livejournal.com
Yes! By hand, you'll probably want to take it through Base 10. Just remember that the kth digit in a base n number is that many multiples of n**k. So base 8, from right to left, is 1,8,64,512,4096....
and base 6 is 1,6,36,216,1296... . A quick example:

314_8 = (3*64)+(1*8)+(4) = 204_10

204 is less than 216, so we only need 3 digits in base 6.
But it's not a 32 less, so it'll be 5xx_6
204-(36*5)=24, which is 4*6.
314_8=204_10=540_6

Date: 2010-02-11 07:30 pm (UTC)
From: [identity profile] persona.livejournal.com
This is actually relevant to me this week, since my discrete math homework this week includes a problem in base -2 (where the digits go 1,-2,4,-8,16,-32...). We have to provide an efficient algorithm to perform subtraction.

Date: 2010-02-11 07:33 pm (UTC)
From: [identity profile] rubrick.livejournal.com
Using your hands, type into Google...

Date: 2010-02-11 07:37 pm (UTC)
From: [identity profile] jedusor.livejournal.com
See, that would be how I'd do it if I had a choice, but my comp sci professor wants to make sure we understand the concept of positional notation, which means writing out a lot of tedious arithmetic.

Date: 2010-02-11 08:43 pm (UTC)
From: [identity profile] tigupine.livejournal.com
Barring an invasion of alien Count Rugens, are there cases in CS (or anywhere) in which base 6 is relevant, or is this just an exercise? I checked the Wikipedia page on senary and didn't see anything that convinced me that base 6 is super-important.

Date: 2010-02-11 10:01 pm (UTC)
From: [identity profile] jedusor.livejournal.com
Nope, just an exercise.

Here is an insane method.

Date: 2010-02-11 07:49 pm (UTC)
From: [identity profile] rikchik.livejournal.com
My usual conversion method is to divide (long-division, yay!) by the target base, in the source base. Your remainder is the last digit in the new base. Repeat with the result to get the rest of the digits.

So 12348 / 6 = 1578, remainder is 2.
1578 / 6 = 228, remainder is 3.
228 / 6 = 3, remainder is 0.
38 / 6 = 0, remainder is 3.
12348 = 30326.

I realize this is the hard way to do it. It's certainly easier if your source base is one you're comfortable with, such as decimal.

Re: Here is an insane method.

Date: 2010-02-11 10:02 pm (UTC)
From: [identity profile] jedusor.livejournal.com
Yeah, uh... I ended up converting to base 10 and using that method (which we were taught in class) to get it to base 6 from there.

Re: Here is an insane method.

Date: 2010-02-11 10:15 pm (UTC)
From: [identity profile] rikchik.livejournal.com
That's what I'd expect. I just enjoy doing long division in alternate bases for some reason.

Date: 2010-02-11 07:55 pm (UTC)
ext_87516: (simpsonized)
From: [identity profile] 530nm330hz.livejournal.com
By hand:

Chop off one finger from each hand.
Do your arithmetic.
Now chop off one more finger from each hand and do the arithmetic again.

"Ask a silly question...."

Date: 2010-02-11 08:26 pm (UTC)
From: [identity profile] hahathor.livejournal.com
You beat me to it! But you didn't include this song (http://popup.lala.com/popup/3459046010289187476) which makes the point so well (no, it's not Tom Lehrer)

Date: 2010-02-11 08:40 pm (UTC)
ext_87516: (simpsonized)
From: [identity profile] 530nm330hz.livejournal.com
Well, of course, the thumb isn't a finger.

Date: 2010-02-11 10:03 pm (UTC)
From: [identity profile] jedusor.livejournal.com
Okay, so what's a good word for "writing it out in arithmetic rather than using a program," then, if that one is silly?

Date: 2010-02-11 10:11 pm (UTC)
ext_87516: (simpsonized)
From: [identity profile] 530nm330hz.livejournal.com
Sorry, I didn't mean your question itself was silly; I was quoting from Tom Lehrer's song about doing arithmetic in base eight. The next line is "Now go back to the 64s...."

Date: 2010-02-11 10:15 pm (UTC)
From: [identity profile] jedusor.livejournal.com
Ah, okay. Hadn't heard that one.

Date: 2010-02-11 10:17 pm (UTC)
ext_87516: (simpsonized)
From: [identity profile] 530nm330hz.livejournal.com
Oh, you must. Search for "New Math." The line that inspired my comment in the first place is "But don't worry; base eight is just like base ten --- if you're missing two fingers!"

And, FWIW, I don't know anything by Jonathan Coulton, so we're even. :-)

Date: 2010-02-11 10:24 pm (UTC)
From: [identity profile] jedusor.livejournal.com
Hey, I didn't say I didn't know ANYTHING by Tom Lehrer! I memorized the entirety of "The Elements" last semester. :P

Date: 2010-02-12 10:16 pm (UTC)
From: [identity profile] jedusor.livejournal.com
I am only nineteen, you know.

Date: 2010-02-11 07:57 pm (UTC)
From: (Anonymous)
It's easier if you turn it all into base10 as an intermediate step. Conceptually bases are just power-of-n buckets, so an arbitrary octal number like 4417 is 4*(8^3)+4*(8^2)+1*(8^1)+7*(8^0)=2048+256+32+7=2319 in the base-10 numbers you're used to.

Turning that into a base-6 number, you go by sixes -- rightmost position is 0-5, then multiples of 6, 36, 216, and 1296. 2319/1296 is 1 and 1023 as a remainder. So the first base-six digit is 1, and it's a 5-digit number since we're starting with the fourth power of six (and we count down to zero). 1023 is left, divided by 216 (6 cubed) is 4, leaving 159. 159 divided by 36 (6 squared) is 4 leaving 15 as a remainder. 16 divided by 6 is 2 leaving 3 as a remainder.

4417 base 8 = 14423 base 6.

Let me know if you need further detail or unpacking on any of that.

Date: 2010-02-11 07:58 pm (UTC)
From: [identity profile] palecur.livejournal.com
Thanks, random livejournal log-me-out functionality!

Profile

jedusor: (Default)
jedusor

November 2020

S M T W T F S
1234567
89101112 1314
15161718192021
22232425262728
2930     

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Feb. 13th, 2026 01:55 pm
Powered by Dreamwidth Studios