1
Wisecrack
77d

is this what they call an identity?

log(n, n**(1/n)) == n

first argument in log is the value
second argument is the base

Comments
  • 2
    Identity is usually denoted by a single =, and compares two expressions.

    A+B=B+A (associative identity)
  • 0
    @SortOfTested

    Ah, thanks.

    Yeah, was trying to make it clear I was comparing the two not setting the left equal to the right or something.

    But it is an identity?
  • 1
    Pass in a series of n and prove it. If there is any n where the left expression does not equal the right, it's not an identity.
  • 0
    @SortOfTested

    Ah, so I would have to prove it for all N.

    That would be uh a bit of a task...

    Uh..can I use derivatives or integrals for that? I heard they're use for computing series that approach a limit or something? I really don't know.

    Fails on 0, 1, and negative numbers, so I guess not.

    Also, only approaches n.

    In practice you have to round. May be a floating point error though.
  • 1
    @Wisecrack in this case you don't need proof by induction, that's only necessary for recursive expressions and number series.
    You can easily prove this identity by simplifying the left hand expression.
    (n^(1/n))^n = n^(n/n) = n^1 = n

    Therefore, log(n, n^(1/n)) = n

    (I'm aware this proof is skipping a logical step, but I just woke up and my proof skills are a bit rusty so I can't think of how to do it properly)
  • 1
    @Wisecrack also
    > fails on 0 and 1 and negative numbers

    That's because logarithms only work with strictly positive numbers (for the first argument), and excluding 0 and 1 as a base.
    Logarithms are the opposite of exponentiation, and 1^x = 1 for any x and 0^x = 0 for any x, so those expressions fail unless your values are 1 and 0 respectively.
    Also, log(0, x) - log base x of zero - is impossible, because there is no x such that x^whatever = 0.
    Bonus: 0^0 is undefined, so log(0, 0) is undefined too.

    Yes, derivatives and integrals are useful for calculating properties of number series - but you're not dealing with those in this specific case, so you don't need those tools.

    Btw, if you want to dive deeper into these topics, may I suggest an introductory course/book to calculus? These topics (exponentiation and logarithms, derivatives and integrals, number series, basic proofs) were a large part of my Calc 1 course in the first year of university.
  • 1
    @Wisecrack
    > also, only approaches n, in practice you have to round

    Yep, that's precisely a floating point error. The analytical solution presented above is exact, so if you needed to evaluate your original expression with integers you would know you could safely round to get the correct result - assuming your inputs belong to the domain of the log function, which is (0, +Inf).
  • 1
    log_a(b) = c => a^c = b

    Given your equation, a = n^(1/n), b = n, c = n. Substitute that, and you get (n^(1/n))^n = n. This holds true for positive numbers, but it's undefined for 0 as 1/0 doesn't make sense, and for negative numbers you get an imaginary component added so |(n^(1/n))^n| = |n| (only absolute values are equal).
  • 1
    @hitko

    I would love to explore what the imaginary part means in relation to everything else but I'm completely unfamiliar with complex numbers other than the fact that they relate to trig and 'rotation' some how.

    Thats cool though hitko. Just learned about that formula last night.

    @endor

    Thanks for your insight endor. Thats really interesting what you posted. Calculus is probably outside my ken but it alays sounded fun. Eighth grade and GED is my educational limit. Was moving around too much and dealing with a bunch of other shit at the time. You make do with the opportunities you were given. lol. Do you recommend any particular book, series, or site for it?

    Also we can't use 0, but what about numbers arbitrarily close to 0?
  • 1
    @Wisecrack I don't know of any english material for learning calculus, but if I had to start somewhere I'd probably look into Khan Academy or Coursera. And considering the depth of interest you've been showing on the subject in your posts, I think you're fit enough to learn about these things. Basic calculus is much easier than it seems once you wrap your head around it.

    > Numbers arbitrarily close to 0

    Yes, they are valid. In fact, that's exactly what I wrote with the (0, +inf) notation: the round brackets mean "up to but not including the bounds"; for real numbers, this means that you can get infinitely close to the bound (the lower one, in this example).
    If I had used square brackets, like [1, 5], it would have meant to include the bounds in the domain.
    Note that infinity is not a finite number, so it will always be noted with a round bracket.

    https://stackoverflow.com/a/4396303
Add Comment