Tuesday, April 26, 2011

Hand Calculation of Fractional Decimal Exponents

You have probably looked at numbers like this one: 30.7 and wondered how one actually calculates a number like that. We understand exponents as meaning multiplication of the number by itself exponent times. Thus 32 means 3 x 3. But how do you render that when the exponent is a fraction? Suppose that it was 30.2?

This is not a practical question. Any decent spreadsheet or scientific calculator (Excel or TI-36X in my case) can produce the number in the flash of an eye. But sometimes we wonder how it is really done. This question started to irritate me a while back. In the process I discovered that I shared this irritation with lots of other people. And if they go on the Internet, they will not, repeat, will not, get a satisfactory answer. The answers that are on offer are trivial. They never address questions like the above—three to the power of 0.7. At best you will be told to use log functions or log tables. And that works. But I got to wondering how log tables were calculated. That turned out to be a bit of a nightmare presented here a while back.

Since then I’ve discovered that there are no straight-forward ways to solve that puzzle above except by methods just as complicated as finding the log of a number by hand. When the exponent is an integer value, the process is serial multiplication. To be sure, if the exponent is big, you’ll be at it for a while, e.g. 3139. It turns out that if the exponent is a fraction, the process is serial root pulling. And if a whole number and an fractional power are both present, e.g. 32.7, you have to engage in both operations. First 3^2=9 (by multiplication), then 3^0.7 (by root pulling), equal to 2.15766928, and the last action required is to multiply those two numbers (9 x 2.15766928) in order to get the answer, 19.419.

I went through a dog-in-a-junk-yard process of finding an algorithm that did not itself involve doing anything beyond multiplication, division, and pulling square roots. No powers or exponential functions, no logarithms, common or natural. Finally I hit on the idea of using the very same method the eighteenth century Euler used to find logarithms—to solve for the value of a number raised to a fractional decimal exponent.

I will explain the method here. I first did it using Excel, as before. Next (the process is mind-numbingly slow), I automated it using a Visual Basic program. Both are in an Excel spreadsheet that you can download here.  If you have problems, e-mail me. You can find my e-mail in the About tab. The spreadsheet also has the Visual Basic program embedded within it, accessible by Alt-F11; it also handles negative fractional exponents.

Here is how the process works. And for my example I am using 30.7.

It occurred to me that every number to the power of 1 is that number itself, thus 31 = 3. At the same time one to the zeroeth power (10) is also always 1. This gave me the anchorage for applying Euler’s method—two values that, as it were, bound any fractional decimal. 0.7 is greater than 0, the exponent of 1 and is less than 1, the exponent of any whole number to be raised.

Therefore I started with three numbers. The first is 1. The second is the number to be raised. Third is the decimal fraction to which I want to raise the second.

I arranged the first two as follows:

Col ACol B
NumbersPowers
10
31

I wished to raise 3 to the power of 0.7. (30.7) 0.7 then became my target in Column B — and the value corresponding to it in Column A would then become my answer.

The first two, and their powers, are knowns. Their powers are obtained without any calculation. The number and the target are supplied by the user, in this case me.

The procedure is as follows:

In Col A we multiply 1 * 3 and take the square root of the result (=1.7320508). The formula is SQRT(1*3).

In Col B, we add 0 and 1 and then divide by 2 (0.5). The formula is (0 + 1)/2

The results are entered as the next item in each column:

10
31
1.73205080.5

Our target is 0.7. In the next step, we look in Column B for one value that is higher than the target and one that is lower— and then repeat the process. In this case the next step is to obtain the square root of (3 * 1.7320508) and to divide (1 + 0.5) by 2. The results are shown below. Needless to say, if our last value is the target, we don’t have to go on.

10
31
1.73205080.5
2.2795051 0.75

Once more we find the two values that bracket our target most closely (0.5 is lower, 0.75 is higher) and once more undergo the process.

What we are looking for is 0.7 in column B. When it appears, we’re done—and our answer is in Column A.

This process is automated as a computer algorithm in the spreadsheet I offer for downloading. The program is set to run maximally 35 iterations. It may cycle fewer times if the exponent in Column B matches our target to 10 decimal points. In the case shown above, the answer after 35 cycles is:

10
31
1.73205080.5
2.2795051 0.75
. . .
2.1576692790.6999999997

My TI-36X Scientific Calculator produces 2.15766928; so does Excel. Both round one decimal earlier.

Now it turns out, of course, that in “real life,” meaning life before electronic calculators, finding square roots was an equally painful and slow process of division and multiplication until the right number of digits was found. Which tells me why, in the post-Renaissance period western humanity’s mad nerds (whose characteristics I seem to share) developed all kinds of helpful tables, not least root tables and the logarithms.

Have as much fun as I did!
---------------
Added later: In this later post I describe the process of getting your own square roots by hand as well...

9 comments:

  1. Thanks for the explanation. This is a question which has been bugging me since high school. I do have one question: why do you multiply the lower and higher value before taking the square root?

    ReplyDelete
    Replies
    1. Because we want to find a number between the two of them, in a sense participating in both. So we use the product of the two and reduce it to its root. In the case above, the ultimate answer is between 1 and 3. But we have to get there in stages. At each stage we use a product, achieved by multiplication in Col A and addition in Col B. As we advance, the two numbers we multiply, one greater, one less than the target result, in Col B, becomes ever closer in magnitude.

      Delete
  2. In the 3d paragraph, you mention this example:

    "e.g. 3^2.7, you have to engage in both operations. First 3^2=9 (by multiplication), then 3^0.7 (by root pulling), equal to 2.15766928, and the last action required is to multiply those two numbers (9 x 2.15766928) in order to get the answer, 19.419. "

    The part impossible for me to understand is this:

    "3^0.7 (by root pulling), equal to 2.15766928"

    Root pulling? What is that and how is it done? Please, could you show the step-by-step calculation by which 3^0.7 results in 2.15766928?

    I just can't figure out how you got that number! --2.15766928--

    Thanks in advance!

    ReplyDelete
    Replies
    1. The rest of this post is a step-by-step demonstration. You just gave up too soon.

      Delete
  3. Great post.
    I'm sure you've explored this avenue but I'll comment on it anyway.

    A fractional exponent, for example 4^0.5, can be expressed as 4^(1/2) which is the square root of 4 = 2. 4^(2/3) is 4 squared (16) then the cube root of 16 = 2.52 (or cube root of 4=1.59 and then 1.59 squared = 2.59 - it can be done either way).

    So if the exponent can be expressed as a fraction then it can be solved in this manner.

    This obviously doesn't work for numbers that can't be expressed as a fraction, such as 4^pi, but I suppose one could always approximate with a large fraction such as 4^(314159/100000). Solving this long hand would kill most mortal men, so there's really no winning.

    Just wanted to throw it out there.

    ReplyDelete
  4. Thank You - yours is not my first stop on trying to find the solution to this problem - but - so far it is the best

    ReplyDelete
  5. My TI-36X Solar appears to take the same time to do 3^1 as it does for 3^139. So, is it really doing serial multiplication?

    ReplyDelete
  6. Interesting method, however why not just turn the decimal into a fraction and solve by taking roots? For example, 3^0.7 could be represented as 3^ (7/10), in which case you could just do ^10sqrt(3^7). Of course, this would be slow due to the roots, but it's an alternative

    ReplyDelete