Hacker News new | past | comments | ask | show | jobs | submit login

"A child prodigy, capable of doing cubic roots in his head as a kid"

I'll teach you. I used to do that when I was 10. Easy enough.

Let's say you want to take a cubic root from 148877. Looks scary enough?

First, look at the last digit. It's 7. Map it through the following correspondence:

1 -> 1, 2 -> 8, 3 -> 7, 4 -> 4, 5 -> 5, 6 -> 6, 7 -> 3, 8 -> 2, 9 -> 9, 0 -> 0

(basically, each digit maps to itself, except (2, 8) and (3, 7) which map to the other one in the pair).

So, the last digit of the cubic root of 148877 is therefore 3.

Now, erase the last 3 digits. You are left with 148. To figure out the first digit of the answer, you have to memorize the cubes of 1 to 10, you probably already know most of them:

1, 8, 27, 64, 125, 216, 343, 512, 729, 1000. (You probably know 343 from Halo series, and 729 is 1729 (http://en.wikipedia.org/wiki/1729_%28number%29) without one, so the only hard thing here is 216).

So, 148 is between 125 and 216. Take the lesser one, 125 is 5^3. So the first digit is 5.

The answer is therefore 53. It only works with two-digit numbers, but with some practice you can do it in seconds.

Now go impress someone.




Had a classmate who was a prodigy. He did the same cubic roots trick, except he could work with non-integers.

e.g. By your method, if I ask for the cube root 270119, you'd say 69, but the answer is is closer to 64.64. He could usually give the right answer to within four sig digs.

The way I understood his explanation, he'd do all the calculations in log space, so he could pull out high order roots, but the answers were less accurate.


Hmm...

Convert to binary, take (approximate) log2 of the number, divide by three, take 2 to the power of ans?

(Binary both because most programmers know powers of two, and because you are more accurate when you know the closest power of two to something than the closest power of 10)

Even just approximating log2(270119) as 18 gives you an answer of 64.


> So, the last digit of the cubic root of 148877 is therefore 3.

So your algorithm only works for numbers that are cubes of an integer, right?


I believe the first digit trick still works with off-numbers, but the second digit trick definitely fails, as it depends on tricks of cubics.

1=>[1], 2=>[8], 3=>2[7], 4=>6[4], 5=>12[5], 6=>21[6], 7=>34[3], 8=>51[2], 9=>72[9], 10=>100[0] (or 0=>[0])

Basically, if you memorize the first 10 cubics, then you can do the next 10 cubics (and actually, there's probably a trick for doing all the integer ones recursively)

If you're really good at this trick, I'm sure you can bound non-integer numbers with referenced cubics and then do something like Newtonian descent.

Its kinds of like building a lookup table of lookup tables in your head for integer cubics.


Right. Still enough to claim that you can do "cubic roots of 6-digit numbers in your head".




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: