logarithm

What is the big-O of the function (log n)^k

﹥>﹥吖頭↗ 提交于 2019-12-03 05:17:13
What is the big-O complexity of the function (log n) k for any k? Any function whose runtime has the form (log n) k is O((log n) k ). This expression isn't reducable to any other primitive function using simple transformations, and it's fairly common to see algorithms with runtimes like O(n (log n) 2 ). Functions with this growth rate are called polylogarithmic. By the way, typically (log n) k is written as log k n, so the above algorithm would have runtime O(n log 2 n. In your case, the function log 2 n + log n would be O(log 2 n). However, any function with runtime of the form log (n k ) has

Logarithm Calculation with Windows 7 Calculator [closed]

会有一股神秘感。 提交于 2019-12-03 04:43:35
I would like to use the Windows Calculator in Scientific Mode in order solve a very basic Logarithm equation but, unfortunately, I couldn't do that. Here is the problem: log_5 125=? Thank you very much for your help... Well, I know it equals to "3", but, how can I use the Windows Calculator to get computed that equation for example? Shay You can calculate a logarithm in a given base by calculating two logarithms in an arbitrary base, using the following equation: log_b (x) = log_k (x) / log_k (b) As the windows calculator got a ln button, which stands for the natural logarithm (that is, log in

Is there an FFT that uses a logarithmic division of frequency?

瘦欲@ 提交于 2019-12-03 04:25:10
问题 Wikipedia's Wavelet article contains this text: The discrete wavelet transform is also less computationally complex, taking O(N) time as compared to O(N log N) for the fast Fourier transform. This computational advantage is not inherent to the transform, but reflects the choice of a logarithmic division of frequency, in contrast to the equally spaced frequency divisions of the FFT. Does this imply that there's also an FFT-like algorithm that uses a logarithmic division of frequency instead of

python: scatter plot logarithmic scale

时光怂恿深爱的人放手 提交于 2019-12-03 04:16:39
In my code, I take the logarithm of two data series and plot them. I would like to change each tick value of the x-axis by raising it to the power of e (anti-log of natural logarithm). In other words. I want to graph the logarithms of both series but have x-axis in levels. Here is the code that I'm using. from pylab import scatter import pylab import matplotlib.pyplot as plt import pandas as pd from pandas import Series, DataFrame import numpy as np file_name = '/Users/joedanger/Desktop/Python/scatter_python.csv' data = DataFrame(pd.read_csv(file_name)) y = np.log(data['o_value'], dtype=

How do you do natural logs (e.g. “ln()”) with numpy in Python?

一个人想着一个人 提交于 2019-12-03 01:58:47
Using numpy, how can I do the following: ln(x) Is it equivalent to: np.log(x) I apologise for such a seemingly trivial question, but my understanding of the difference between log and ln is that ln is logspace e? JoshAdel np.log is ln , whereas np.log10 is your standard base 10 log. Relevant documentation: http://docs.scipy.org/doc/numpy/reference/generated/numpy.log.html http://docs.scipy.org/doc/numpy/reference/generated/numpy.log10.html Correct, np.log(x) is the Natural Log (base e log) of x . For other bases, remember this law of logs: log-b(x) = log-k(x) / log-k(b) where log-b is the log

Displaying minor logarithmic ticks in x-axis in R

血红的双手。 提交于 2019-12-02 20:50:58
I have a normal distribution plot and a histogram plot with x axis in log scale displaying 0, 10^0, 10^1 ... I want to include minor ticks between the major ones. Actually I was able to change the major ticks format from 1, 2, 3 and so on to 10^0, 10^1, 10^2, 10^3 using the solution given to me in my previous question . I used the following code for the major ticks : major.ticks <- axTicks(1) labels <- sapply(major.ticks,function(i) as.expression(bquote(10^ .(i))) ) axis(1,at=major.ticks,labels=labels) Can this be edited to just mark the minor ticks without labeling them? There is a function

Is there an FFT that uses a logarithmic division of frequency?

浪子不回头ぞ 提交于 2019-12-02 18:43:16
Wikipedia's Wavelet article contains this text: The discrete wavelet transform is also less computationally complex, taking O(N) time as compared to O(N log N) for the fast Fourier transform . This computational advantage is not inherent to the transform, but reflects the choice of a logarithmic division of frequency, in contrast to the equally spaced frequency divisions of the FFT. Does this imply that there's also an FFT-like algorithm that uses a logarithmic division of frequency instead of linear? Is it also O(N)? This would obviously be preferable for a lot of applications. Jason Harrison

Matlab: making the grid in plot logarithmic

僤鯓⒐⒋嵵緔 提交于 2019-12-02 14:53:03
问题 I have plotted to vectors against each other, and they are already logarithmic and everything is fine with that. But now that I have my plot i want the grid to be logarithmic. I write "grid on" in my code, and I think there should be a way to do this in the plot, but I can't remember how. How do I make the grid logarithmic? 回答1: If you use loglog, semilogx or semilogy instead of plot , the grid will automatically be on a log scale for the corresponding axes when using grid on . 回答2: If you

Matplotlib - rotating text on log scale where angles are incorrectly rounded

本小妞迷上赌 提交于 2019-12-02 06:27:20
I am trying to have text rotate onto a plot which is shown on log scale. When I compute the angles (based on the solution in this answer ) the angles are getting incorrectly rounded to 0 or 90 degrees . This is because the angles are computed on a linear scale first, and then transformed. This calculation in linear space is the cause of the trouble. Even in a situation where I know the gradient, (either in a linear or logarithmic scale), I am not sure how I can put this onto the graph correctly. MWE import matplotlib as mpl rc_fonts = { "text.usetex": True, 'text.latex.preview': True, "font

How to put a logarithmic scale with rows represented in logarithm on chart in C # [duplicate]

帅比萌擦擦* 提交于 2019-12-02 05:04:19
This question already has an answer here: Logarithmic Vertical and Horizontal Axes lines in MS Chart Control 1 answer I'm developing a chart in C # and I need the graph lines to be represented in logarithm, the scale can already put, just missing the vertical lines in logarithmic scale according to the image below: My chart currently looks like this: Update: To get those additional lines between the periods you need to turn on the MinorGrid for the x-axis of your chartArea: chart.ChartAreas[0].AxisX.MinorGrid.Enabled = true; chart.ChartAreas[0].AxisX.MinorGrid.Interval = 1; This is obviosly a