0

What does the ln mean here?

Equation

It's from this page.

https://en.wikipedia.org/wiki/Universally_unique_identifier#Collisions

Finally, what could I have done to find out for myself? (What did I miss?) I know so little I can even tag the question!


Just because it might be useful for someone working on database identifiers, here's the code I ended up with.

    public static double HappyBirthday(double charCount, double keyLength = 9)
    {
        // Computes the number of IDs that would need to exist in a set
        // before there's a 50% chance of a collision.
    const double chanceOfCollision = 0.5;
    double spaceLength = Math.Pow(charCount, keyLength);

    var spacesConsumed = Math.Sqrt(2 * spaceLength * Math.Log(1 / (1 - chanceOfCollision)));

    return spacesConsumed;
}

  • 1
    Natural logarithm. $\ln(x) \equiv \log_e (x)$ – 19aksh Oct 13 '20 at 12:39
  • 1
    And to clarify, that is the letter $\ell$, not the number one. Read more about logarithms here. (It is for that reason that $l$ and $1$ look so similar that you rarely see the variable $l$ used by itself written that way, using instead \ell $\ell$ or even if handwriting using $\ell\text{n}(x)$) – JMoravitz Oct 13 '20 at 12:44
  • Thanks. I feel the world would be a more math-literate place if math was communicated in a regular programming language. – Luke Puplett Oct 13 '20 at 12:59
  • 1
    Since you mention programming, it is worth pointing out that in some programming contexts and even combinatorial contexts it is sometimes possible that the author uses $\ln$ or $\log$ not as the natural base logarithm ("base $e$") or base-10 logarithm, but rather as the base-2 logarithm. Knuth's Art of Computer Programming for example does this. It doesn't really matter what base logarithm it is if referring to asymptotics and big-oh notation, but still it is worth confirming the notation for the specific context in which you are working. The specific usage here was still base-$e$. – JMoravitz Oct 13 '20 at 13:04
  • Thank you. Please add a proper answer and I can award it and close it off :) – Luke Puplett Oct 13 '20 at 13:09
  • I feel the world would be a more math-literate place if programmers actually studied math... :) – Raffaele Oct 13 '20 at 13:43
  • 1
    "Finally, what could I have done to find out for myself?" review a list of math notation like this one by the Math Centre, and/or search for something like "mathematical notation "ln"" in a search engine. – Mark S. Oct 13 '20 at 18:32
  • "Finally, what could I have done to find out for myself?" Alternatively, click "edit" on the Wikipedia page to see that the LaTeX/TeX command used was "\ln" and search for something like "\ln latex" in a search engine to find a page like this tutorialspoint page which mentions it's the "natural logarithm symbol". – Mark S. Oct 13 '20 at 18:39

1 Answers1

1

It is the natural logarithm. It is defined as $$\ln x =\log_e x$$ Where $e$ is the Euler's number, defined as $$e=\sum_{k\geq 0}\frac{1}{k!}=\lim_{n\to\infty}\left(1+\frac{1}{n}\right)^n$$ Sometimes l looks like $1$ in Calibri font.