mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Miscellaneous Math (https://www.mersenneforum.org/forumdisplay.php?f=56)
-   -   Probability that n is a semi-prime or prime (https://www.mersenneforum.org/showthread.php?t=21946)

a1call 2017-01-18 00:54

[QUOTE=CRGreathouse;451105]

Also, here (as usual) log means base e.[/QUOTE]
I think that's only usual to Pari/GP, but I could be wrong. I thought ln was the proper notation for natural log and log without a base specified, was base 10 not e.
I haven't seen the log convention for base e anywhere else but then again I am no mathematician.:smile:
But on my defense, I did stay at Holiday Inn once. :jokedrum:

CRGreathouse 2017-01-18 02:36

[QUOTE=danaj;451132]Thanks for the code link. Now you're making me think about implementing it, not because I have anything useful to add, but because it looks like a fun bit of optimization for smaller inputs. For larger ones, yes -- some heuristics trying to weed out easier results common with random inputs, but for the harder ones there's not an easy answer.[/QUOTE]

I hope you do code it, because I think that more can be done than the simple code I linked to, and I find that I use what I wrote reasonably often.

I feel bad, because I often write "issemi(n)=bigomega(n)==2" in the OEIS, knowing that I don't use that code but not wanting to bloat the entry with a full version of my code. Of course there's not all that much that can be done in GP -- the most you have access to are the flags of factorint. It's much nicer with access to the PARI internals.

CRGreathouse 2017-01-18 02:45

[QUOTE=a1call;451136]I thought ln was the proper notation for natural log and log without a base specified, was base 10 not e.[/QUOTE]

Mathematicians don't use log to represent the base-10 log, only engineers and (some) high-school teachers do. :smile: Computer scientists sometimes use log to mean natural log and sometimes to mean binary log, but most often they don't mean any particular base (as in big-O notation). Other mathematicians rarely use log for anything but the natural log.

Antonio 2017-01-18 08:02

[QUOTE=CRGreathouse;451142]Mathematicians don't use log to represent the base-10 log, only engineers and (some) high-school teachers do. :smile: Computer scientists sometimes use log to mean natural log and sometimes to mean binary log, but most often they don't mean any particular base (as in big-O notation). Other mathematicians rarely use log for anything but the natural log.[/QUOTE]

ISO 31-11 defines:-

lb - binary log (base 2)
ln - natural log (base e)
lg - common log (base 10)

also, all the books of mathematical tables from my youth used:-
log - common logarithm (base 10)
ln - natural logarithm (base e)
as did/do all electronic calculators I have used.
I am also pretty sure that my slide rule used log for common logarithm. :smile:

Dubslow 2017-01-18 08:26

[QUOTE=Antonio;451153]ISO 31-11 defines:-

lb - binary log (base 2)
ln - natural log (base e)
lg - common log (base 10)

also, all the books of mathematical tables from my youth used:-
log - common logarithm (base 10)
ln - natural logarithm (base e)
as did/do all electronic calculators I have used.
I am also pretty sure that my slide rule used log for common logarithm. :smile:[/QUOTE]
Mathematical tables, at least of logarithms, no longer have relevance to the modern mathematician, and not really to the modern engineer either really.

ISO defines tons of standards that aren't really respected... and I would qualify the one you list of one such standard.

danaj 2017-01-18 09:00

I'll agree with Charles on this one. In number theory books and papers in particular, "log" means the natural logarithm unless otherwise specified. I've seen base 2 specified, e.g. the AKS paper, where they still use "log" throughout the paper but mention in one early sentence that it means base 2 since that is not the normal expectation. As Charles notes, many times it doesn't matter such as in big-O.

Paraphrasing someone's quip, once you get out of high school you find the common logarithm is very uncommon.

I will occasionally use "log[sub]2[/sub](n)" to make it readily apparent this is base 2. Confusingly, a few authors have decided to use the subscript to denote iteration, sometimes combined with a superscript to denote exponentiation of the whole thing. So "[tex]\log_2^3(n)[/tex]" means log(log(n))^3 to them. I do not like this notation (especially when one has to work it out from previous equations rather than being explained), and fortunately rarely see it. Oh -- they of course mean the natural log, since that goes without saying. :)

Antonio 2017-01-18 11:37

[Joking on]
log means log[SUB]10[/SUB], anything else is just another extremist minority group trying to impose their views on the rest of the world.
[Joking off]

I don't mind either I just wish the world was consistent, being an engineer using log[SUB]e[/SUB] doesn't come naturally :smile:
I always have to think about it, usually after the first couple of wrong calculations (and it doesn't help that my(all) calculators were designed for engineers/high school students).

CRGreathouse 2017-01-18 14:43

[QUOTE=danaj;451155]I've seen base 2 specified, e.g. the AKS paper, where they still use "log" throughout the paper but mention in one early sentence that it means base 2 since that is not the normal expectation.[/QUOTE]

Right. The culture in computer science is different and they often use log for the binary logarithm (though in all cases where I've seen this they call it out).

[QUOTE=danaj;451155]Paraphrasing someone's quip, once you get out of high school you find the common logarithm is very uncommon.[/QUOTE]

Right. It was in use in the slide rule era but since electronic calculators in the 70s and 80s it's fallen into disuse in mathematics (but as I understand, it's still in use in engineering).

[QUOTE=danaj;451155]I will occasionally use "log[sub]2[/sub](n)" to make it readily apparent this is base 2. Confusingly, a few authors have decided to use the subscript to denote iteration, sometimes combined with a superscript to denote exponentiation of the whole thing. So "[tex]\log_2^3(n)[/tex]" means log(log(n))^3 to them.[/QUOTE]

Right. I see subscripted logs used much more often to denote iteration than base. But that's probably just in analytic number theory and allied fields; probably mathematicians in other areas write log_b to mean log base b. I agree, it can be confusing.

science_man_88 2017-01-18 14:59

[QUOTE=a1call;451136]I think that's only usual to Pari/GP, but I could be wrong. I thought ln was the proper notation for natural log and log without a base specified, was base 10 not e.
I haven't seen the log convention for base e anywhere else but then again I am no mathematician.:smile:
But on my defense, I did stay at Holiday Inn once. :jokedrum:[/QUOTE]

working in log base e is simpler potentially though see numberphile:

[YOUTUBE]AuA2EAgAegE[/YOUTUBE]

danaj 2017-01-18 20:04

Pari/GP: log(x): natural logarithm of x

Mathematica: Log[x] gives the natural logarithm of x

C: log(x) from math.h gives the natural log of x

Perl: log(x) gives the natural log of x

Python: math.log(x) gives the natural log of x

Julia: log(x) gives the natural log of x

Go: math.log(x) gives the natural log of x

Maple: ln(x) is the natural log, log[b](x) is the log to base b. If left out, b=e. Hence log(x) is the natural log of x

This sure doesn't look isolated to Pari. It seems highly unusual to use base 10 without calling it out via log10 or an argument. The natural log is pretty useful, the others not as much. A function like digits() covers a fairly common and special case of base 10 log, and similarly for base 2 for getting the number of bits.

a1call 2017-01-18 23:20

[QUOTE=danaj;451179]
This sure doesn't look isolated to Pari. It seems highly unusual to use base 10 without calling it out via log10 or an argument. The natural log is pretty useful, the others not as much. [/QUOTE]

It's a bit exaggerated to call the notion used by the rest (from mathematicians and programmers ) of the world "highly unusual".

[QUOTE]Because the notation log [I]x[/I] has been used for all three bases (or when the base is indeterminate or immaterial), the intended base must often be inferred based on context or discipline. In computer science and mathematics, log usually refers to log2 and log[I]e[/I], respectively.[URL="https://en.wikipedia.org/wiki/Logarithm#cite_note-12"][11][/URL] In [B]other[/B] contexts log often means log10.[URL="https://en.wikipedia.org/wiki/Logarithm#cite_note-13"][12][/URL][/QUOTE][URL]https://en.wikipedia.org/wiki/Logarithm#Particular_bases[/URL]

It is arguable that the logarithm function predates the discovery of e as well as computers, so chances are that log, unspecific must have referred to base 10 originally by all.
Base 10 log is still quite useful in logarithmic scales and units.
[URL]https://en.wikipedia.org/wiki/Logarithmic_scale[/URL]


All times are UTC. The time now is 23:22.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.