Wednesday, April 11, 2012

Visualizing the Power Function

After some recent discussion on the power function, it occurred to me that if I tried to visualize the function b^a, I really didn't know what it would look like. Here it is below:



As shown here, the base b is along the x-axis, and the power a is on the y-axis. The range displayed is between +/-2 on both axes, with the origin (0, 0) in the center. Positive values are shown in red, negative values in blue; intensity is scaled to the highest value in the top-right corner (i.e., 2^2 = 4). Black pixels represent either very small values (on the right half, for b>0) or else undefined values (on the left half, for b<0).

So a few things are apparent. In the 1st quadrant, going towards the top-right, you get larger positive values (when b>0 and a>0); near the y-axis in that quadrant you get diminishing values, namely 0 when b=0. But in the 4th quadrant the situation is reversed: you get diminishing values towards the bottom-right and arbitrarily large value near the y-axis (hence the intense bright region on the bottom, with vanishing b and negative a, generating values much larger than what you get in the top-right). On the left-hand side (b<0), the graph is mostly black, with only narrow bands of value where the power a is an integer (alternating red and blue, as the powers alternate positive or negative values).

One discovery regarding that left side: I didn't realize how contentious it was to possibly define rational exponents for a negative base! Apparently some textbooks go either way with that. For example, the textbooks at my school permit it, but they have to institute a clunky "assume root exists and exponent on b^(m/n) is reduced to lowest terms" definition, so as to avoid a contradiction like -2 = (-8)^(1/3) = (-8)^(2/6) = ((-8)^2)^(1/6) = (64)^(1/6) = +2. On the other hand, you have academic papers such as from Tirosh/Even, "To Define or Not to Define: The Case of (-8)^1/3" (Educational Studies in Mathematics, Vol. 33 No. 3, Sep. 1997) which point out this problem and others, and recommend leaving them undefined. I think I'm personally convinced by that. Hopefully we all agree that irrational exponents to negative bases are undefined, so the left-hand side of the graph above really does need to be black almost everywhere.

And then of course you've got the case of 0^0, which I'm likewise convinced (again contrary to the books at my school) should be defined to be 1. On the one hand, the horizontal axis a=0 will definitely have a value of 1 for all b with that possible single exception. While on the other hand, the vertical axis has a value of 0 coming down from the top, but you're going to have a discontinuity at the origin no matter what; either a value of 1 when a=0, or, failing that, an undefined value as soon as you take an arbitrarily small step below the origin (since given negative power -a, 0^(-a) = 1/(0^a) = 1/0 which is undefined). So I figure you might as well define 0^0 = 1 and the loss in continuity on the vertical axis is immeasurably small.

In summary: Certainly not a picture I could have intuited, and one with unexpectedly complicated structure and more regions of controversy regarding definitions than I expected (granted such a fundamental function as b^a).

Possibly there's some additional use in seeing a spreadsheet of numerical values from the same region, below:


Download if you want:
- Java source code (JAVA) to generate the image
- Open Document Spreadsheet (ODS) for the numbers
- Wikipedia 3D graph of similar region (positive base only)