Raising a number to a non-integer power. - Page 1
Forum section: electronics / general

author: Circlotron
author_rank: Super Contributor
timestamp: May 27, 2020, 06:00:11 am
content: Okay, so 4^3 = 4x4x4 = 64.But 4^3.9 = ?? = 222.861.How can you multiply a number by itself a non-integer amount of times?

author: greenpossum
author_rank: Frequent Contributor
timestamp: May 27, 2020, 06:09:31 am
content: It's just the extension in the real number domain of taking the exponent. Mathematics is like that, analogies can only go so far.But if you like, think of it as 4^(39/10) so take the 39th power of 4 and then the 10th root. Things get tricky to imagine when the exponent is irrational.

author: Ian.M
author_rank: Super Contributor
timestamp: May 27, 2020, 06:14:52 am
content: I'm no mathematician so the terminology here is going to give a real mathematician fits. Without getting into logarithms, or huge powers of four, break that down to:43x root10(4)9root10(n) is the tenth root of n, i.e, the function where if:m=root10(n)then:m10=nThat approach is valid for any rational real number.As GreenPossum points out, its not any help with irrational numbers. so letting X be the exponent, although it gives you a function with an infinite number of points along any interval of the X axis, it isn't continuous. To get the 'in-between' irrational values you have to consider exponentiation as multiplying the logarithm of n by the power X, then taking the antilog, which works in any base of logarithms, and is a continuous function, numerically identical to the 'classic' multiplying numbers by them-selves X times concept for any real rational X.Where it gets gnarly to conceptualise is when you start extending exponentiation YXinto the complex number domain for both Y and X. I cant wrap my brain around the number of dimensions required to visualise that plot - its bad enough visualising the complex result of a function operating on a single real number parameter, which is a 3D plot.

author: RoGeorge
author_rank: Super Contributor
timestamp: May 27, 2020, 07:51:55 am
content: Quote from: Circlotron on May 27, 2020, 06:00:11 amShort answer, the exponential function is defined as a polynomial. Explanation starts at minute 7:00, at about 7:50 is exactly your question.

author: tom66
author_rank: Super Contributor
timestamp: May 27, 2020, 08:57:22 am
content: Quote from: Circlotron on May 27, 2020, 06:00:11 amBecause log10(222.861)/log10(3.9) = ~4. And that is the division of two base10 logarithms. You can easily define log10(n), and you have inferred what the solution to your non-integer power is with nothing more than division.Mathematical operations often have an inverse.Try fractional and negative factorial if you -really- want to blow your mind.

author: magic
author_rank: Super Contributor
timestamp: May 27, 2020, 09:00:17 am
content: Quote from: Circlotron on May 27, 2020, 06:00:11 amYou don't. But you can say that you wish to have a function with the following convenient properties, arbitrarily chosen to mach the behavior of normal exponentiation:an= n times a·a·a·..·aax+y= ax·ayax·y= (ax)ybe a continuous function over all real numbers because why notThe first condition defines axfor positive integers.The second condition forces to choose the following for nonpositive integers:a0= 1a-n= 1 / anThe third condition forces the following on rationals:a1/n= nth root of aThe fourth condition leaves little choice for the reals because the rationals are dense in the reals:ax= lim (axn), for any infinite sequence xnof rationals such that lim (xn) = xSimpleQuote from: RoGeorge on May 27, 2020, 07:51:55 amCertainly not. The exponential rises asymptotically faster than any polynomial.x100is not exponential growth, contrary to what most journalists would want you to believe these days.TL;DW but your video either discusses infinite sums of polynomials which aren't really polynomials anymore, locally valid approximations or is simply wrong.

author: Kleinstein
author_rank: Super Contributor
timestamp: May 27, 2020, 09:43:56 am
content: One can use the logarithm and exponential to rewrite the power:A^B = exp( B * ln(A))In this form there is no problem having B with a non integer value. It just gets messy if A is negative as this would lead to complex numbers.

author: Brumby
author_rank: Unknown
timestamp: May 27, 2020, 10:25:42 am
content: This is a good example of how such an expression actually does make sense:Quote from: greenpossum on May 27, 2020, 06:09:31 amYou can then take this to the extreme for any numbers. For example: 3.839^5.776 would be the 1/1000th root of 3.839^5776. Each of these steps is pretty straightforward, even if laborious to solve.By following the principles involved, it becomes apparent that exponentiation encompasses a broad scope where integer exponents are just a special case.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: May 27, 2020, 11:38:22 am
content: Understood more generally, and perhaps apparent if you've watched the 3b1b video -- we use an algebraic expression (exponentiation of ordinary numbers) to imply an algebraic (or higher level, e.g. transcendental) equation, which may have zero, one or many solutions.Of note, taking the 10th root implies there are 10 possible, equivalent, solutions: using the 10 roots of unity. Remember that sqrt(4) = +/- 2, not just +2! If we constrain our answer to the real domain, only two of those remain; but in the complex domain, all ten are equally valid.When working with general analytical functions, we often must be mindful of this, not just to finite numbers of answers, but whole spaces of them -- for example there are infinite "branches" of the ln(z) function, because e^(i x) is periodic. (When this fact isn't interesting, we usually choose the "main branch" (x ∈ (-pi, pi]), denoted Ln(z).)Similar answers pop up for expressions like x^x, or i^i. While you can easily solve these for a superficial curve or value, the functions they are equivalent to lie in much more interesting spaces, and there are many equivalent answers, not just one! (I think one of the follow-up videos in the 3b1b series covers exactly this, if you're interested.)Tim

author: nctnico
author_rank: Super Contributor
timestamp: May 27, 2020, 12:42:24 pm
content: #include "math.h"float a=pow(4.0, 3.9);

author: SiliconWizard
author_rank: Super Contributor
timestamp: May 27, 2020, 03:05:05 pm
content: I guess already explained above.It's the exponentiation, and is explained there:https://en.wikipedia.org/wiki/ExponentiationAn integer exponent is a particular case of exponentiation.

author: mark03
author_rank: Frequent Contributor
timestamp: May 27, 2020, 03:12:31 pm
content: What is this numberithat you speak of?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: May 27, 2020, 03:17:43 pm
content: Quote from: mark03 on May 27, 2020, 03:12:31 pmYou must be'j'okingTim

author: TimFox
author_rank: Super Contributor
timestamp: May 27, 2020, 07:11:36 pm
content: The best joke I encountered in a physics lecture was by the late Professor Ugo Fano at the University of Chicago (ca. 1976).He was demonstrating the quantum calculation of dielectric polarization, expressing the macroscopic result as the expectation value of the quantum calculation.He used quantum perturbation theory to relate the polarization to the applied E field, expressing the Hamiltonian (essentially the energy) as a function of E and the harmonic binding of electrons.He then performed a Fourier decomposition of E(t) into frequency components, an integral overw(I can't find lower-case omega here) of E(w) eiwtdw.One of the theory weenies in the first row objected, "Professor Fano, that Hamiltonian is not Hermitian!", by which he meant that the energy must be real and not complex.Prof. Fano erased the "i", replacing it by "j" and declared the Hamiltonian was now Hermitian.

author: TimFox
author_rank: Super Contributor
timestamp: May 27, 2020, 07:14:17 pm
content: I also learned that the formal definition of exponentiation in modern mathematics is the one involving logarithms, which is required when the exponent is not a rational fraction. It also allows raising a variable by a complex exponent. It reduces to the usual expression when the exponent is an integer or fraction.

author: Alex Eisenhut
author_rank: Super Contributor
timestamp: May 27, 2020, 07:18:20 pm
content: For that matter, how can you multiply a number by itself a negative number of times?

author: RoGeorge
author_rank: Super Contributor
timestamp: May 27, 2020, 07:53:31 pm
content: Quote from: TimFox on May 27, 2020, 07:11:36 pmEEVblog forum can render LaTex notation. Lower case Omega can be written asCode:\$\omega\$That will be displayed as \$\omega\$.

author: daqq
author_rank: Super Contributor
timestamp: May 27, 2020, 08:18:44 pm
content: Quote from: T3sl4co1l on May 27, 2020, 03:17:43 pmHe probably just imagined it.

author: Kleinstein
author_rank: Super Contributor
timestamp: May 27, 2020, 08:33:17 pm
content: Quote from: Alex Eisenhut on May 27, 2020, 07:18:20 pmThis one is easy: the negative exponents give the inverse. So A^(-B) = 1 / A^B.So multiply -2 times is the same as dividing 2 times.

author: magic
author_rank: Super Contributor
timestamp: May 27, 2020, 09:24:55 pm
content: Quote from: Kleinstein on May 27, 2020, 09:43:56 amYeah, I guess you can do that, but then you need to define exp(x) as something other than exto avoid circular definition.It can be done, there are weird-ass formulas which resolve to exwithout explicitly mentioning e itself and taking powers of it.But actually teaching it that way is an exercise in applied obfuscation.Quote from: TimFox on May 27, 2020, 07:14:17 pmNot required. I have defined it without a single stinkin' logarithm

author: TimFox
author_rank: Super Contributor
timestamp: May 28, 2020, 02:54:58 am
content: No, your definition only works for real numbers, using the limit of a sequence of rational numbers to deal with the irrational case.The logarithm method also works for complex numbers.

author: Nominal Animal
author_rank: Super Contributor
timestamp: May 28, 2020, 03:25:48 am
content: Actually, the formab= 2blog2ais useful, as it is something a computer can do in binary directly, and quite efficiently for base-2 floating point numbers.Details.

author: vk6zgo
author_rank: Super Contributor
timestamp: May 28, 2020, 05:12:50 am
content: From 30+ years ago (& it was revision then), the classic formula for fractional indices isa^p/q = the qth root ofa^pI was hoping to use the calculator, but the HP22S doesn't seen to have the capability of powers or roots to other than base 2 or e.I could use the logs, but to hell with it!

author: magic
author_rank: Super Contributor
timestamp: May 28, 2020, 12:57:38 pm
content: Quote from: TimFox on May 28, 2020, 02:54:58 amFair enough, off the top of my head I can't provide a simple algebraic argument why complex exponents should be defined the way they are. That doesn't necessarily mean no such argument exists. I don't know what reasoning originally led to the Euler identity and things like that - perhaps the Taylor series, maybe something more direct and straightforward.That being said, I totally expected OP to stop reading at the first limit if he even made it that far, so who cares about C

author: TimFox
author_rank: Super Contributor
timestamp: May 28, 2020, 01:25:36 pm
content: In my youth, if I needed more accuracy than from my slide rule, I used 5-place logarithm tables (and log-trig tables) to do my serious computations, so the logarithm definition comes naturally to me. We referred to the Chemical Rubber Company "Handbook of Mathematical Tables" as the Rubber Bible. (Formally, the "Mathematical Tables from the Handbook of Chemistry and Physics") 7-place tables were available, but that was overkill.

author: SiliconWizard
author_rank: Super Contributor
timestamp: May 28, 2020, 02:32:37 pm
content: Quote from: Nominal Animal on May 28, 2020, 03:25:48 amYep!Generally speaking, even for integer exponentiation, a binary algorithm is much more efficient than a simple linear algorithm (multiplying the number by itself b times.)

author: Nominal Animal
author_rank: Super Contributor
timestamp: May 29, 2020, 01:05:38 am
content: For those interested, the binary integer algorithm calculatesabfor integerb>0 with at most 2 log2bmultiplications. In pseudocode,Code:Function ipow(a, b):Let result = 1While b > 0:If b is odd:result = result × ab = (b - 1) / 2Elseb = b / 2End Ifa = a × aEnd WhileReturn resultEnd FunctionFor negativeb, you do 1/ipow(a,-b) or ipow(1/a, -b).b=0 is mathematically ambiguous case, and usually handled separately.Programming languages with integer division (dropping the fractional part, or rounding toward zero, or binary shift right by one bit), just dob=b/ 2 in both branches of the If clause.The one extra squaring ofais avoided in practice by moving the end-of-loop test to just after halvingb.

author: RoGeorge
author_rank: Super Contributor
timestamp: May 29, 2020, 05:37:32 am
content: Op asks what is the intuitive representation of raising a number to a fractional power, gets answers about best numerical algorithms.Software devs are the best example for the saying "When you have a hammer, everything looks like a nail". Not sure if this is their biggest flaw or their biggest power. And, if that's a power indeed, is it a non-integer one?

author: magic
author_rank: Super Contributor
timestamp: May 29, 2020, 07:35:10 am
content: Quote from: RoGeorge on May 29, 2020, 05:37:32 amLook at the software available today, compare with the software available 15 years ago, take a wild guess

author: aneevuser
author_rank: Frequent Contributor
timestamp: May 29, 2020, 10:55:17 am
content: Quote from: magic on May 28, 2020, 12:57:38 pmYou might want to take a look at the first chapter (and others) of "Visual Complex Analysis" by Needham, which gives a couple of suggestive geometric/algebraic arguments for the validity of Euler's formula.

author: Nominal Animal
author_rank: Super Contributor
timestamp: May 29, 2020, 06:42:43 pm
content: Quote from: RoGeorge on May 29, 2020, 05:37:32 amHey! It was a clarification to a comment why expressing a fractional powerabusing base-two exponent and base-two logarithm, 2blog2ais a practical way to look at it, because that's how computers deal with it.Let's recap:One way to look at non-integer powers is to look at fractional powers:ab/c=ab·a1/cThe second term is the same asc'th root ofa, by definition. So, for example 23.5= 23·20.5= 23·√2 = 8√2.This approach has the problem that it only works for rational numbers – those that you can express as the ratio of two integers –, you cannot calculate e.g. 2πwith it. Besides, it's slow and burdensome.To solve this problem, John Napier introduced logarithms in 1614. The basic equivalence with exponentiation isex=y⇔x= logeyIt's main purpose is to make multiplication and division easier. Logarithm turns multiplication into addition, division into subtraction, using just standard multiplication rules (for powers), with exponentiation as its inverse:A·B= elogeA· elogeB= e(logeA) + (logeB)A/B=A·B-1= elogeA· e- logeB= e(logeA) - (logeB)Technically, logarithms are defined only for nonnegative reals, but we can treat the signs ofAandBseparately anyway in multiplication and division trivially: if we have an odd number of negative values, the result is also negative; otherwise it is positive. Easy peasy.Mathematically, this equivalence gives us a simple way to express any power via exponentiation and logarithms asab= eblogeaBecause e is an irrational number itself (it has infinite number of digits in any integer base, be it decimal or binary or other), it is something that computers cannot handle directly, and can bother us humans quite a bit, too. So, instead, the base 2 one is used in computers (and some humans, too):ab= 2blog2aThere is lots of information about the base-2 logarithm, or binary logarithm, for example atWikipedia.But wait, didn't we just come around a full circle, and just answer the question with "by raising 2 to a fractional power you calculatethus"?No, because raising 2 to a fractional power is a special function we can call base-2 exponential.You are probably already aware of theexponential function, exp(x) = ex.The base-2 exponential is very similar, except there are algorithms how a computer (or a human counting in binary) can approximate it directly, to whatever precision you like. So, while it looks like the same problem, technically the procedure isab= exp2(blog2a)How one should grasp it intuitively, then?Think of integers in thenumber line. They're distinct, with a gap in between. We use real numbers to describe values that do not match any specific integer, but fall in between two integers. Positive integers can count things, so they're very intuitive, even many animals can do it. Reals are more difficult. Rational numbers are ratios of two integers, but they aren't all reals; we also have irrationals like π that cannot be expressed exactly as a ratio of two integers. So, it is better to think of real numbers as being in between integers, without a perfect real-world analog.In the exact same way as real numbers extend integer points to a continuous line, non-integer powers extend integer powers to a continuous curve. Non-integer powers behave exactly like integer powers, mathematically. So, the best way to intuitively grasp it, is an extension to the integer powers, really.So yeah, we really don't have a good analog for non-integer powers. One tripping point is that if we want to calculate the numerical value without having a tool that can do it directly for us, we'll need exponentiation and logarithms to do so. You might think that is because they are somehow special, but it is quite the opposite: exponentiation and logarithms are just the tool we use for the extension, and themselves have a very clear, intuitive definition.Is this any better, RoGeorge? I bet it is five times more than most members here care to read, so that's why I tried to only drop in the minimal nugget. Would've been much better as a video, too.

author: RoGeorge
author_rank: Super Contributor
timestamp: May 29, 2020, 11:49:24 pm
content: Quote from: Nominal Animal on May 29, 2020, 06:42:43 pmPerfect, hard to explain in less words!The next chart first represents 41, 42, 43, 44, 45as red dots. Looks like the red dots nicely align like the beads on an invisible string. That invisible string is our function 4x, drawn as a green dotted curve. If we stick a blue dot on that green curve, and move it left and right, that would show values for fractional power, and if we drag it to x = 3.9, the blue dot will show us the value for 43.9.It will bealmostlike 4 multiplied 4 times, but a little less than 4x4x4x4.For a live, interactive charthttps://www.desmos.com/calculator/s9zbhc9mcy

author: Nominal Animal
author_rank: Super Contributor
timestamp: May 30, 2020, 04:22:43 am
content: Exactly.Visual examination also gives a good starting point for intuition on the behaviour of the exponential function and the logarithm.The curvey= exp(x) has slopexat x=x, and the natural logarithm curve,y= log(x), has slope 1/xat x=x.This kind of extension is needed for us humans, because our intuition is not sufficient to handle all the things we can understand. We need logic, and mathematical tools we don't have intuitive real-world analogs for, only definitions.As an example, consider functions. There is something called aLambert W function, which cannot be expressed in terms of elementary functions at all; we cannot express it exactly in form W(z) = ... . We can approximate it numerically, though, to any desired precision you want. Anyway, the Lambert W function is defined as the function that satisfies W(z) exp(W(z)) =z. This means that for example, if you wanted to solve exp(-z) =z, the answer isz= W(1) ≃ 0.56714329. Or, if you wanted to solve exp(-z)=z/ 2, the answer isz= W(2) ≃ 0.8526102. Except that W(1) and W(2) are the exact answers, and when looking for abehaviourof something ("What kind of function fulfillstheserules?"), the answer just might be W(z).Before you think that that the Lambert W function is just a mathematical curiosity, I'll just point out that it isthefunction that provides the exact solution for the double-well Dirac delta function model for equal charges: for example, the hydrogen molecule. It's not a curiosity or "pure math", it is an useful tool for describing stuff in nature. It's just hard to pin down in "human terms". At some point, you just have to accept that some of the mathematical tools you use don't have good real-world analogs or plain explanations, and that knowing their operating context and rules is enough – unless you're a mathematician. I ain't.

author: RoGeorge
author_rank: Super Contributor
timestamp: May 30, 2020, 10:42:51 am
content: I'm not familiar with the Lambert W function, but calling that a function feels like cheating. By definition, a function can not have more than one output for a single input.Maybe in math we can change or extend the definition for what a function is, but then it will be out of this world.In the physical world, when for a single input we observe multiple results, it means we are missing something, like an extra input variable we disregarded, or an extra function/phenomenon we don't realize it's there.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: May 30, 2020, 12:29:35 pm
content: It's a function if you specify a main branch, right. That can sometimes be hand-wavy when it shouldn't be.Just as ln(z) is not a function, it has infinite solutions ln(z) = ln(z) + 2n pi i; by convention we take the main branch (-pi < Im(ln(z)) <= pi), Ln(z).Tim

author: SiliconWizard
author_rank: Super Contributor
timestamp: May 30, 2020, 03:01:06 pm
content: Quote from: RoGeorge on May 30, 2020, 10:42:51 amThis is called a multivalued function, and this isn't an ordinary function indeed.https://en.wikipedia.org/wiki/Multivalued_functionQuoteQuoting Wikipedia:Quote

author: Nominal Animal
author_rank: Super Contributor
timestamp: May 30, 2020, 04:10:08 pm
content: Yup!I used Lambert W as an example of a "completely unintuitive function-like thing" that is very useful but almost impossible to find real world analogs or useful intuitive reasoning for, to show why we must not expect to have good analogs or intuitive explanations for all our mathematical tools.When I first started learning calculus, I had a hard time giving up wondering "what value" δ(0) is. δ(x) is theDirac delta function. δ(x)=0 for allxexceptx=0, but its integral over all realxis 1. I internally settled for something like "infinitesimal infinity" (I don't think I've ever said it aloud), before I realized the entire question is nonsense. δ(x) is a mathematical tool with specific rules and behaviour, and does not necessarily have that property at all! Indeed, if you find that to solve a problem you need the value of δ(0) outside any differential equation or similar context, you can be sure that you went wrong somewhere.Also considerdimensional analysis. In dimensional analysis, you drop all quantities (numbers) and apply your model (equation or formulae) to the units only, and see what kind of unit pops out. If you get e.g. m/s where you expect time units, you know that either you made a mistake, or the model is b0rked. But working out a formula or equation with units, and completely without numbers or variables, is pretty counter-intuitive to most people. Many learn to just ignore the units and work with the numbers only, and that sometimes leads to really bad mistakes.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: May 30, 2020, 04:59:19 pm
content: Quote from: Nominal Animal on May 30, 2020, 04:10:08 pmAnother way to express it could be as returning a vector, i.e., a function \$ \mathbb{R} \rightarrow \mathbb{R}^n \$, and more generally than that, functions of arbitrary dimension in the domain and range. This requires more formalism to pack up (i.e., are we using linear algebra, set theory, etc.?), but the basic idea can be seen. Applied in another domain, we might think of functions in computer science as some dimension in the parameters, and the return values (assuming pure functions, i.e. no side effects, no internal state). We introduce type theory (the vectors need to be not just the same number of elements, but the same types as well). And then we can think about data and its typing in various useful ways.QuoteIndeed, when a continuous function is desired, a common implementation is a Gaussian with lim width-->0 and height-->inf, taking the joint limit such that the integral property is preserved. This gives a rigorous basis and allows some analyses which would otherwise fail on the more basic definition. But it is indeed a not-function, in its basic form, and I think most instructors are careful to point that out when it's introduced (at least, mine were).QuoteYup, and since dimensions are conserved under arithmetic operations, you can assign dummy dimensions to mathematical variables (which might otherwise be dimensionless), and track down some algebraic errors in the process (when you're working large equations by hand).And it's not just a physicist's hand-waving tool, it has rigorous application! Using a change of variables, units can be extracted from otherwise very difficult expressions. Feynman integration is a famous case, where the units are extracted from an integral, so that the integral is over an abstract mathematical function, which then merely returns a dimensionless geometric constant. All the dimensional relationships are basic arithmetic, so that qualitatively speaking, we have everything we need to know about the problem, and exact results are merely proportional to that.And we can then compute that function throughanyexperiment or dynamical system which is equivalent to it, not just the problem in question.Tim

author: TimFox
author_rank: Super Contributor
timestamp: May 30, 2020, 08:04:59 pm
content: The rigorous definition of the Dirac delta is not a function, but a “distribution”, sometimes called a “generalized function”. Although the original concept came before him, it was developed and tidied up by Laurent Schwartz midway through the last century. See Wikipedia for a summary. There is no difference between his formulation and the results obtained with common concepts involving shrinking tall Gaussian curves to the limit, but it is a good example of mathematics catching up with a useful bit of physics.(In my youth, we studied the history of the Einstein Summation Convention that was held discretely on the Kronecker Delta.)

author: Nominal Animal
author_rank: Super Contributor
timestamp: May 30, 2020, 09:40:08 pm
content: Quote from: TimFox on May 30, 2020, 08:04:59 pmIn the context of this thread, "generalized function" would be key(Because the mathematical concept of "distribution" doesn't really match what a layman might think a distribution is, you see, and this thread is all about our human need for intuitive real-life analogs.)From generalized functions or "distributions" (in the mathematical, not traditional statistical sense) one gets to functionals and vector spaces and linear algebra and whatnot, all very useful tools.Me, I was never particularly good at math, and what little I know, is all hard-fought. I didn't reallygrokdifferential calculus until I started working withinteratomic potentials. Before, I could solve problems I recognized, sure; but it was just applying methods I knew, like treating each problem as a perp and looking them up in my mental records, then applying the suggested methods therein. No true insight, no creativity, just straightforward grunt work. Now, it feels different. Enjoyable. Like a very nice, well-worn, reliable tool.Or I might just be going bonkers in my middle age, and sliding waaay back on the D-K scale!

author: TimFox
author_rank: Super Contributor
timestamp: May 30, 2020, 10:53:24 pm
content: English terms for mathematical concepts are usually existing words, already in use in common language."Function" (v) can mean to work or operate in a desired way"Function" (n) can refer to a formal social event.The advantage of using "standard" nomenclature is the ease of locating information, as in the Wikipedia article on "distribution". I like Wikipedia's term "disambiguation" for separating out different meanings of the same word.

author: Nominal Animal
author_rank: Super Contributor
timestamp: May 31, 2020, 01:42:36 am
content: I wasn't disagreeing, just trying to make sure others reading this thread won't accidentally conflate it with statistics, TimFox.In this kind of a thread, where we're looking at ways to help others understandstuffbetter, I've found that carefully picking the terms to help steer those climbing the ladder helps, even if the terms used aren't the conventional or usual ones; the implicit associations matter.I do agree that distribution is the better term, in general. But, in the context of this particular thread, the underlying key isextensionorgeneralizationof mathematical tools we have real world analogs for to those we have not.As an example, when talking about unit quaternions in the context of spatial rotations, I like to use the term versor, because many (programmers at least) have encountered quaternions and found them untractable or unreasonably hard. The truth is, unit quaternions areeasy, much easier than Euler or Tait-Bryan angles, and perfectly useful for anyone working in 3D on computers or microcontrollers. In the realm of spatial rotations, versors really only use a couple of details from quaternions proper (Hamilton product, really). Slap on conversion to a 3D rotation matrix (of which there is only one, unlike Euler or Tait-Bryan angle conventions), addition/interpolation properties (and how renormalization to unit quaternion does not have any directional bias, unlike E/T-B), plus possibly recovering the versor from a pure 3D rotation matrix, and it's all there. It all fits one one or two sheets of paper. Picking the name "versor" is just a psychological tool to avoid the association with any preconceptions on how quaternions are "hard". Since they haven't any preconceptions against "versor", they tend to be very surprised how simple the operations and their implementation are.

author: basinstreetdesign
author_rank: Frequent Contributor
timestamp: May 31, 2020, 02:17:37 am
content: Quote from: daqq on May 27, 2020, 08:18:44 pmGet real!

author: RoGeorge
author_rank: Super Contributor
timestamp: May 31, 2020, 06:43:46 am
content: Quote from: basinstreetdesign on May 31, 2020, 02:17:37 amThat's not natural!

author: Brumby
author_rank: Unknown
timestamp: May 31, 2020, 06:59:02 am
content: Quote from: RoGeorge on May 31, 2020, 06:43:46 am

author: Brumby
author_rank: Unknown
timestamp: May 31, 2020, 07:13:16 am
content: Quote from: Nominal Animal on May 30, 2020, 04:10:08 pmBack in high school, I did this when looking at E=mc2to find the units needed to match withEandmwas a velocity. Now I know this actually has a name (many decades later). (Why it was the particular numeric value of the speed of light was a further question - but one which I did not pursue.)Quote from: T3sl4co1l on May 30, 2020, 04:59:19 pmThat's a neat trick. I like it.

author: magic
author_rank: Super Contributor
timestamp: May 31, 2020, 08:40:50 am
content: Quote from: Nominal Animal on May 29, 2020, 06:42:43 pmOK, but there is infinitely many such extensions (even continuous and infinitely differentiable) that differ in the exact curvature between your chosen points. You really need additional arguments to demand this one particular extension that's currently accepted.Quote from: Nominal Animal on May 29, 2020, 06:42:43 pmI would agree it's clear and intuitive what 2+2 is, but not sure what's intuitive about the definition of ln(sqrt(2))Moreover, there is absolutely no readily apparent reason why abdefined in terms of exp/ln should give the results we expect when a and b are natural.Unless you define exp in terms of ex, but you can't do that because you just defined abin terms of exp

author: Someone
author_rank: Super Contributor
timestamp: May 31, 2020, 10:49:22 am
content: abmakes a perfectly logical extension to real values of b. x! for positive reals, still plausible; but over the whole reals.... thats mind bending.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: May 31, 2020, 01:59:08 pm
content: Quote from: Someone on May 31, 2020, 10:49:22 amWell, literally impossible, too; a typical analytic extension of factorial has a pole at (-1)!, so further extension isn't meaningful. However, if we integrate around the poles taking the principal value, we get a meaningful answer again (with finitely many exceptions: the poles themselves). Thus it works for complex numbers, and you can find real (non-integer) values after all.Tim

author: Nominal Animal
author_rank: Super Contributor
timestamp: June 01, 2020, 04:57:46 am
content: Quote from: magic on May 31, 2020, 08:40:50 amNo, there is only one the fulfills the standard arithmetic rules of addition and subtraction in the exponent for both integers and non-integers (reals). I mean, for which exp(a+b) = exp(a)·exp(b) and exp(a-b) = exp(a)/exp(b).Quote from: magic on May 31, 2020, 08:40:50 amI meant that after all the math work to prove their properties are what has been claimed, a layman can grasp exponentiation and logarithm in very simple terms:exp(x) is the curve that has slopexatx, and has value exp(0)=1.loge(x) is the curve that has slope 1/xatx, and has value loge(1)=0.You do need lots more math to prove this is so, or to discover why this is so, but for an intuitive understanding ofwhatthey are (as opposed to why or how), this suffices.Quote from: magic on May 31, 2020, 08:40:50 amLet's not try and be cute here. exp(x) ≝ ex. I use the form exp(x) to remind the reader that this is not a cyclical definition; that we can define exfor all realxas a function that does not rely on being able to raise a value to a non-integer power.It is well and good (and I definitely appreciate it) if you(or anyone else) point out errors or holes in my argument, but in the context of this thread, it is not worthwhile to point out the lack of mathematical rigor, because the issue here is to not prove or claim anything, but to offer A) an intuitive grasp of non-integer powers and B) to show why the need of such intuitive grasp is hindering our use of math as a tool, and why letting go of it, instead understanding that onlysomeof math has a real-world analog or an intuitive explanation and the vast majority is an extension without, is useful and productive.So, to recap the A) point, in the hopes to clear any confusion, because me fail English often:We can define non-integer powers likeab= exp(b·loge(a)). Indeed, computers typically calculate arbitrary real powersab= 2b·C·log2a, where C is a constant (C = loge2).While exp(x) is actually ex, where e is the number known as Euler's constant (approximately 2.71828), this is not a cyclical argument, because we can define, and understand, exp(x) and loge(x) differently, as functions that we can define without relying of non-integer powers at all.Indeed, exp(x) is the curve that has slopexatx, and has value 1 at exp(0).Similarly, loge(x) is the curve that has slope 1/xatx, and has value 0 at loge(1).(Exactly why and how this is so, requires more math, and goes beyond the scope here.)For example, if you needed to calculate exp(x) for somexby hand, you could do so by using the series definition, exp(x) = 1 + sumxk/k! fork= 1, 2, 3, ... and so on, wherek! is the factorial ofk(product of all integers from 1 tok, inclusive).While we do have some series we can use to calculate loge(x), they are too slow (need too many terms) to be practical. Instead, we used to use tables of logarithms and exponentials instead,y= exp(x) ⇔x= loge(y) (listing bothyandx), based on pre-calculated exponentials. However, log2(x) = loge(x) / C, is much easier to calculate. Indeed, computers typically calculate loge(x) = C·log2(a) instead.(For the exact description of how to calculate log2(x), see e.g. the WikipediaBinary logarithmarticle. Most computers approximate real numbers withfloating pointnumbers, wherex=m·2b, wheremis the mantissa (and normally represents a value between 0.5 and 1.0) andbis the exponent. The binary logarithm is especially powerful for numbers expressed in this form. For example, since 1987 or so, the Intel x86 (and x86-64 or AMD64) processor families have had it in hardware: a machine instruction FYL2X that calculates the binary logarithm of a given value, and another, FYL2XP1, that calculates the binary logarithm of one plus the given value, for even more accurate results near 1.)To recap point B), most mathematical tools do not really have real-world analogs. We can use integers for counting, and rationals for ratios, but what about irrationals: real numbers that cannot be represented exactly by any ratio? We know π, and it is irrational, so they are definitely useful. Earlier in this thread, I mentioned the Lambert W function, which isn't really a function because we cannot write it in form W(x)=somethingat all, and belongs to a group called generalized functions, or more properly, distributions (but don't confuse them with statistical distributions; they have some similar properties but are a different thing in math). Many tools in math can be consideredgeneralizationsof the things that do have real-world analogs, of the things we can grasp intuitively, but cannot themselves be grasped intuitively (like irrational numbers).I myself have never been good at math. I might say I'm good at applying the math I know to solve problems, but there are lots and lots of mathematicians that can actually create new mathematical tools! I believe that having the need for real-world analogs was hindering me for years, until I understood and accepted that not everything has such, because they are more likeextensions; like using a waldo arm instead of your own arm to manipulate hazardous materials, except for your mind.

author: magic
author_rank: Super Contributor
timestamp: June 01, 2020, 07:39:01 am
content: Quote from: Nominal Animal on June 01, 2020, 04:57:46 amThat's what I meantAnd as it happens, this suffices to define arbitrary powers, not just ex. Then you can show the exp/log trick as a convenient way of calculating arbitrary powers to whatever precision that's provided by your log tables, but not as the definition.Defining abas exp(b·ln(a)) is justeditThere is another advantage to avoiding the exp/log madness: a direct definition gives a straightforward, constructive method for calculating arbitrary real powers to arbitrary precision. Take some integer powers and roots, in case of an irrational exponent calculate a limit (algebraically or numerically), done. A trained monkey could do that.With exp/log, you are entirely at the mercy of your log tables or calculator in terms of precision (and accuracy). You are not going to calculate exp yourself starting from your (f' = f, f(0)=1) definition and trying to use the exdefinition you will quickly realize why I insist that it's circular

author: Nominal Animal
author_rank: Super Contributor
timestamp: June 01, 2020, 10:01:46 am
content: Quote from: magic on June 01, 2020, 07:39:01 amI don't like that approach for two reasons. First is that it can give the impression that irrational exponents are somehow special; and we both know they're not. Second is thatNth root itself (root extraction) is a very nontrivial operation. Essentially, to calculateA1/n, you start with some guessx0, and then iteratexk+1= ((n-1)·xk+A/xkn-1, until you have a good enough approximation. (To explain what that is, one needs to know what recurrence formulae are, and about Newton's method of finding roots of a function; it opens up a whole another can of math tools.)Plus, when you do more than one approximation at different phases of your calculation, the error becomes very hard to estimate. Then, when you deal with a coincidence like eπ-π, and you do two or three or more approximations when calculating it, you can be tempted to second-guess yourself and claim eπ-π=20. It isn't, it's just a coincidence in decimal base; it's actually eπ-π ≃ 19.99909979.And don't even think about saying it's close enough, or we'll have to talk about how 640k is enough for everyone.Quote from: magic on June 01, 2020, 07:39:01 amNo, but I have used the series sum. It is the logarithm part that needs the tables, because they're too onerous to calculate by hand. On a computer, however, both base-2 exponent and logarithm are much simpler, when floating-point numbers are expressed asm·2b. I've actually done that by hand, too, I think. (To convert a real into binary, just convert the integer part first, successively dividing by two and adding the remainder in increasing order of significance (right to left, starting at just left of the decimal point). Then, for the fractional part, multiply it by two, and extract the integer part – it is always 0 or 1 – repeatedly, adding one binary digit (from left to right, starting at just right of the decimal point) per iteration. Then, apply the binary logarithm algorithm. In all, it isn't hard to do by hand, because both involve just halving or squaring a value, no other multiplications or divisions.)An aside: It is funny how some things are easier in binary than in decimal. For example, there is a known method for extracting an arbitrary hexadecimal digit of Pi, without knowing any of the preceding (more significant) digits; yet, no such method is (at least as of this writing) known for decimals.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: June 01, 2020, 03:57:33 pm
content: Quote from: magic on June 01, 2020, 07:39:01 amErm, can, and do?The definition is directly the conditions needed to apply Taylor's theorem. And as a theorem, it's simply an equivalent representation, it's nothing new.(Indeed this is a better application of computing truncated series, than the mentioned powers-and-roots approximation to irrational powers. Not in that it's wrong, just that this is a heck of a lot faster.)Tim

author: magic
author_rank: Super Contributor
timestamp: June 02, 2020, 10:21:28 pm
content: Okay, you guys would, but a monkey wouldn'tSorry for the confusing post yesterday.What I mean is that one definition essentiallyisan algorithm (fastest or not), the other is some differential equation which I am supposed to know how to solve before even thinking about calculating anything.Even if you make the obvious fix and simply define exp as the usual power series, that's still a nasty monstrosity which bears little resemblance to anything most people would consider a "power". If I ask what's exp(½ln(4)), you will produce quite a wall of text to arrive at the correct solution or use a proof by authority that your mysterious series somehow agrees with my definition and then use the properties that I enumerated. So much for eating your dog foodNow to the interesting stuffThere is something special about the irrationals: they are the limits of rational sequences which appear to be convergent despite having no limit among the rationalsThat's a somewhat informal statement of one of the many formal definitions in circulation; smart people some 150 years ago figured out that this is all we need to do anything that needs to be done with the irrationals. Others definitions aren't much better, before you ask.Conveniently, it means that any continuous function on the rationals can be uniquely extended to all reals. Including addition and multiplication, as it happens. Yes, you can write a power series like Σ(πn/n!) and your maths teacher promised you that such a real number exists, but that's all - this number is some infinite abomination which can't be computed and compared to 20+π. As soon as you try that, either analytically or numerically, you are replacing your neat formula with a contraption like limx→π(Σ(xn/n!)). And if you try numerically, once more you have an iterative approximation nested inside another iterative approximation and two sources of numerical error to worry about.QuoteThat looks like it could very well be 20

author: msuffidy
author_rank: Frequent Contributor
timestamp: June 03, 2020, 04:52:03 am
content: Pretty sure it is part of a logarithmic curve when you are between two exponents. There is some stuff on YouTube about weird ways to manipulate usual things like 0 to the 0 power something to the negative power, something to an non integer power etc. Most of them are either logical or undefined.

author: Nominal Animal
author_rank: Super Contributor
timestamp: June 03, 2020, 07:42:51 am
content: I understand your point, magic, but I disagree; not because I have a different opinion, but because I think your approach leads to problems when trying to understand more complex mathematical "stuff".If it was just a matter of opinion or different experiences, different opinions would be just useful, because people do think and learn in different ways.First, a couple of points:Quote from: magic on June 02, 2020, 10:21:28 pmUsing a ratio to approximate a real number, then calculating the power as the denominator'th root of the nominator'th power of the value,is itself an algorithm. Calculating an N'th root of a value is nontrivial; quite a lot of work, really.Quote from: magic on June 02, 2020, 10:21:28 pmNo, I did not, and would not. The intuitive or real-world definition of the exponential function is "the curve which has value 1 at x=0, and slope x at x". The power series is just one way to apply it orevaluate it: to calculate a specific point on that curve.Now, back to the core disagreement.OP asked how to intuitively graspab, whenbis not an integer. They intuitively grasp the case wherebis an integer, as multiplyingaby itselfbtimes.If I understood you correctly, your point is to just approximatebwith a ratio,c/d, so thatab≃ac/d, in which caseabis approximately equal to thed'th root ofac.I disagree with that, because it gives an incorrect intuition about the continuity and other properties of exponentials and real powers; intuitions, that will cause difficulty in understanding more in-depth mathematical concepts.(My objection is similar to the one when teachers tell kids that electrons orbit nuclei like planets orbit the sun. They do not. Electrons do have properties like angular momentum and orbital radius that make the orbit model one that gives a good intuitive grasp ofthe properties of such electrons, but the fact is, they're delocalized in a region around the nuclei in manner better examined using quantum mechanics, and are definitely not just whizzing around like a rock around a gravity well. It is an analog that works in one specific situation – when considering electron angular momentum and orbital properties – but is a hindrance when trying to understand anything else about atoms and molecules. Physicists like me don't get weirded about this, because we learn to use different analogs depending on the situation, and understand that those are just tools to help us think, and not a representation of reality.)My own suggestion is basically this:The "best" one (that makes any further math easier to integrate to ones understanding and mathematical toolbox), is to just consider non-integer powers as an"extension"of the integer ones, with exactly the same rules and behaviour. That is, to understand, that not every mathematical tool has an intuitive real-world analog; that requiring such intuition can hinder ones use of math. In math, it is perfectly okay to multiplyaby itself 2.1276352 times, because fractional "numbers of times" are just an extension of integer number of times, and have the exact same properties. The fact that 2.1276352 is not countable – that is, you cannot have 2.1276352 items, because it is not a natural integer – is just completely irrelevant in this context.The answer to exactlyhowto multiply something by itself a non-integer number of times, is via a mathematical identity:ab= eblogea, where ex≝ exp(x) is a curve that has slopexat x=x, and exp(0) = 1; and where logexis a curve that has slope 1/xat x=x, and loge1 = 0. We have several different tools for calculating any point on those curves.In fact, when you tell a current computer to calculateabfor you (in C,pow(a,b); in Python,a**b; and so on), it actually uses base-two exponent and logarithm:ab= 2blog2a. Mathematically, 2x= eCxand log2y= C logey, where C is a constant, C = 1 / loge2. It turns out there are very fast and efficient techniques, or algorithms, to calculate base-2 exponentials and logarithms, when numbers are expressed in binary floating-point format,m·2b. The IEEE-754 standard defines two, Binary32 and Binary64, that use exactly this form, and these are used by almost all current computer architectures (as "float" and "double" real types, typically). Intel x86 and AMD64 processor architectures include machine instructions that do these operations in hardware, and have had these for decades.See? I understand why one would see the root-of-power approach better, even more powerful, but I don't like it because of how itcanaffect ones further understanding of math. I like to separate thewhatand thehow, with an approach for understanding thewhatthat isn't likely to bite oneself in the ass later on.Of course, if one can take both models, and simply switch between them, they're way ahead of either of us already (since we're still here discussing which one to use), and can use such analogs themselves as tools, switching them as they need – if they need such analogs at all. But I suspect that those people are good at math anyway, and don't need our help!

author: magic
author_rank: Super Contributor
timestamp: June 03, 2020, 01:45:17 pm
content: Quote from: Nominal Animal on June 03, 2020, 07:42:51 amI agree, plus the particular rules and behaviors you want to generalize ought to be listed so that there is no doubt and confusion.Moreover, in any remotely serious mathematics, it is also considered a good idea to convince yourself and the reader that such a function is even possible in the first place, and there is no better way than defining it and verifying that it meets all the requirements.Quote from: Nominal Animal on June 03, 2020, 07:42:51 amYes, you can, but there is a problem: you typically cannot calculate exexactly unless x comes in the form x=ln(y). This complicates some simplest examples possible, like 4½. At some point it's convenient to just admit that fractional powers are simply roots.So yes, you have defined the function and provided the "how", but it's not even clear if it meets your own "what" criteria without bringing in some calculus heavy artillery, which no beginner would understand if you actually tried to explain. That's the Arduino approach to mathematics, I guess I'm just not a fan of ArduinoYou've got me on one point: I utterly glossed over the problem of continuity / monotonicity / etc. Why would my function be continuous on the rationals? Is it even true that a½<a⅔<a¾? I believe those problems are solvable by elementary means (like converting the fractions to a common denominator, and others), which means that if you want a truly honest definition, with no cheating, handwaving and appeals to authority, this looks like a promising direction.And yes, it will take limits to get to the irrationals. But limits are either explicit or implicit in pretty much everything dealing with the irrationals. The irrationals are pure cancer IMO and one shouldn't feel bad about treating them like they are some kind of cancer. Most of the time you too don't deal with the irrationals, you just compute e3.1415926536instead and call it a day.And no, I certainly didn't say to approximate an irrational with a fraction and leave it at that. That's not what limits are

author: GlennSprigg
author_rank: Super Contributor
timestamp: June 03, 2020, 02:18:48 pm
content: To me, simple INTEGERS are enough to bamboozle most!10^24 Approx number of atoms in an average adult human being.10^50 Approx number of atoms in our Earth.10^80 Approx number of atomic particles in the 'known' Universe!10^124 Approx number of Protons, if the 'known' Universe was aSOLID!!10^100 Was named a 'Googol' just for fun, by a scientists son.A 'GoogolPlex' was then decided to be 10^Googol... That's just beyond stupid!

author: Circlotron
author_rank: Super Contributor
timestamp: June 03, 2020, 10:48:49 pm
content: Googolplex in popular culture:Quote

author: T3sl4co1l
author_rank: Super Contributor
timestamp: June 03, 2020, 11:51:51 pm
content: This looks like a good point to add my "'real numbers' are the least real number system" rant...To know a trulyrealnumber, is to know the infinite madness that is darkness itself... to know the wisdom of The Old Ones...Rational numbers, within reason, we can conceive of -- as long as we can put a number to it, or an approximate range, that's fine. The algebraic numbers are a little more tricky, with more operations involved in their creation -- but still only finitely many operations, be it exponentiation (aha, see it's still on topic!) or what.The computables are even more difficult, with such monsters as Graham's number cropping up even from relatively simple criteria. Obviously the large numbers are quite sparse in the computables, but vastly more sparse is any other random real number -- to be able to compute a number, we must have some code, algorithm, proof, or even just proposition, which implies the existence of the number in question -- no such criterion is needed for a general real number.The few real numbers we know, are all constructed based on their relationships. Pi is very useful because it has many equivalent relationships, from geometry to complex analysis and beyond. It is well known, of course never exactly as we cannot enumerate all the decimals of a transcendental real number -- but its strength is only rarely in its numerical value, and more fundamentally among the many facets of mathematics it connects.Similarly for e, gamma, etc.One of the few truly real, non-computable numbers that we can even begin to grasp, is:https://en.wikipedia.org/wiki/Chaitin%27s_constantWhich, because we know [upper bounds] on the first few BB(n) numbers, we have an approximate value for already -- but it's patently clear that we can't know, really much more than that, like, even a decimal more, but perhaps proofs will be developed that give just a few and then it's provable that further development (even given universe-sized recursive proofs) is realistically impossible.Now consider that, for as many numbers as a googolplex, there are far more numbers than that, just among the rationals between 0 and 1; but compared to the number of uncomputable reals in the same range, even that infinity has measure zero, and not just laughably so, but trivially so!P.S. My spell check wants to correct "uncomputable" to "uncomfortable". That is understandable.Tim

author: hamster_nz
author_rank: Super Contributor
timestamp: June 04, 2020, 09:19:58 am
content: Quote from: T3sl4co1l on June 03, 2020, 11:51:51 pmThanks for that Wikipedia wormhole... I've never heard of it till now.

author: magic
author_rank: Super Contributor
timestamp: June 04, 2020, 10:06:37 pm
content: Quote from: T3sl4co1l on June 03, 2020, 11:51:51 pmScrew computability; most irrationals can't even be individually described and identified by any finite text or formula in any language in existence. Some people got quite upset when one Cantor raised this issue some 150 years agoYou can have sets of real numbers which can't be assigned any length/area/volume because every possible value from zero to infinity leads to one or another paradox. And many mathematicians will tell you with a straight face that from a few such unmeasurable sets in a 3D space it is possible to assemble various measurable sets of different volumes just by moving and rotating them around. Some others feel a bit uneasy about that idea, though.

author: CatalinaWOW
author_rank: Super Contributor
timestamp: June 04, 2020, 11:42:58 pm
content: There is so much esoterica in advanced mathematics. I find it challenging enough to understand and use the crumbs that very bright people pull out of that heap and show the real world applications to us mere mortals. Distributions, contour integrals and a whole list of other tools. But those people are made to pay for their sins. In grad school I took several advanced mathematics courses in aid of understanding the limits and applications of those crumbs. The courses were owned and taught be the mathematics department. But 80-90% populated by engineers and physicists. Which irked the mathematicians no end. And caused immense disdain for their colleagues who continued finding and disseminating those crumbs.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: June 05, 2020, 02:18:49 am
content: Tim

author: CatalinaWOW
author_rank: Super Contributor
timestamp: June 05, 2020, 03:49:53 am
content: Very good opening.