what is the big O complexity of the functions involving log - algorithm

what is the big O complexity of the function 1005 n^1.75 + 100 n^1.5 + 10nlogn ?
I know that the big O complexity of logn is equal to O(logn)^2) but can't figure out this riddle: 1005 n^1.75 + 100 n^1.5 + 10nlogn

f(n) = 1005 n^1.75 + 100 n^1.5 + 10nlogn
Now, in O notation, we only need to consider the highest order terms, also constants can be ignored.
Therefore,
f(n) = n^1.75
Hence,
O(f(n)) = O(n^1.75) or O(n^7/4)

the complexity of that function is:
O(N^(7/4))

Related

What is the exact runtime in Big-O of those functions

I wanted to ask if someone could answer this questions and also check my solutions. I don't really get the Big-O of these functions.
e(n)= n! + 2^n
f(n)= log10(n) * n/2 + n
g(n) = n2 + n * log(n)
h(n) = 2^30n * 4^log2(n)
I thought that:
e(n) n! because n! is exponentially rising.
f(n) n(log)n but I don't really know why
g(n) n^2
h(n) n
I would appreciate any answer. Thanks.
Big O notation allows us to evaluate the growth of a function with respect to some quantity as it tends towards a infinity.
The Big O notation of a function is that of it's fastest growing constituent. Big O notation bounds the growth of a function.
For example if a function is said to be O(n).
There exists some k such that f(n) <= k * n for all n.
We ignore all other constituents of the equation as we are looking at values that tend towards infinity. As n tends towards infinity the other constituents of the equation are drowned out.
We ignore any constants as we are describing the general relationship of the function as it tends towards some value. Constants make things harder to analyze.
e(n) = n! + 2^n. A factorial is the fastest growing constituent in the equation so the Big O notation is O(n!).
f(n) = log10(n) * n/2 + n. The fast growing constituent is log10(n) * n/2. we say that the Big O notation is O(nlogn). It does not matter what base of log we use as we can convert between log bases by using a constant factor.
g(n) = n^2 + n * log(n). The Big O notation is n^2. This is because n^2 grows faster than n * log(n) with respect to n.
h(n) = (2^30) * n * 4 ^ log2(n). The time complexity is O(nlogn). The constants in this equation are 2^30 and 4 so we ignore these values. When doing this you can clearly see that the time complexity is O(nlogn).

Data Structures and Algorithms Asypmtotic Notation

I'm currently in the progress of getting familiar with asymptotic notations for Big Theta, and I was wondering if I could have someone double check my practice.
Problem: f(n)=2(3n^3+2n+1)^3, find big theta notation, assume conditions have been met for big O and omega.
My solution: 2 * (3n^(3+3) + 2n^3 + 1^3), I add the exponent 3 to the power inside
6n^6 + 2n^3 + 2, I multiply the constant 2 to the values in parenthesis
n^6, f(n)= theta(n^6), I take the highest power and drop the constants
Can anyone please let me know if I did this correctly? Thanks.
It is quiet simple.
We say that f(n) is O(g(n)) if exists a constant C that the limit of C * g(n) / f(n) is constant.
We say that f(n) is Big Omega(g(n)) (sorry, no LaTeX here) if if exists a constant C that the limit of C * f(n) / g(n) is a constant (kind of "the opposite" of the big O notation)
We say that a function is theta(g(n)) if both (1) and (2) co-exist.
Now, we need to find a function that behaves almost as f(n), that will suppress it from above with a constant C, and will be suppressed by it with another constant D.
It is easy to prove that when talking about f(n) that is a polynomial function, it is always theta(n^k) where k is the degree ("the highest power") of that polynomial.
However, you need to know how to prove it!
Anyhow, you were wrong when expanding f(n). The real expansion is:
f(n) = 54 n^9 + 108 n^7 + 54 n^6 + 72 n^5 + 72 n^4 + 34 n^3 + 24 n^2 + 12 n + 2
with C = 55 and D = 53 you get 53 * n^9 <= f(n) <= 55 * n^9 when n is large enough, (or, the two limits (1) and (2) are constants)

How to prove using big-O

Im currently having a problem with big O notation. I have the following question which I am trying to figure out.
I currently have the formula: T(n) is O(f(n)) and I must use this to prove directly from the definition of big O that 3n^2+11n+6 is O(n^2).
I was wondering if anybody could possibly help me figure out this problem as I am having trouble working it out.
I think this may help:
For n≥k, there is a constant, let's name it "c" which satisfies 3n^2 + 11n + 6 ≤ c∗n^2.
Let's say we pick k = 1.
We know that n^2 ≥ n^2 ≥ n ≥ 1
So :
3n^2 + 11n + 6 ≤ 3n^2 + 11n^2 + 6n^2 =>3n^2 + 11n + 6 ≤ 20n^2
Now, let c = 20.
=>complexity is O(n2).

what is the big O notation for (logn + 3n)

whats is the big O notation of this function f(x) = logn + 3n i have ridden big o notation but i am confuse in this function so please help me
It is simply O(n).
When you have a composite of multiple parts in big O notation which are added, you have to choose the biggest one. In this case it is O(3n), but there is no need to include constants inside parentheses, so we are left with O(n).
https://en.wikipedia.org/wiki/Big_O_notation
It's O(n).
Proof:
lim n->inf f(n)/3n = lim n->inf (logn + 3n) / 3n = [0 + 1] = 1
so f(n) and 3n have the same asimptotic behavior
according to the "O" notation constants are dropped so f(n) is O(3n) = O(n)

How do i check the big O for complexity function

I have this:
a) f(n) = n
b) f(n) = 1045n
c) f(n) = n2 + 70
d) f(n) = 7n + 3
e) f(n) = Cn + D (where C and D are both constants)
f) f(n) = 8
g) f(n) = n3 + n + 1
h) f(n) = 4n + 2log n + 5
I want to check if the Big O notation of them is O(n).
How can I determinate it?
And how to find the Big-O notation for the functions below:
a) f(n) = 3n3 + n
b) f(n) = 3 log n + 5n
c) f(n) = 3n2 + 5n + 4
d) f(n) = 3n3 + n2 + 5n + 99
f(x) is O(g(x)) if there exists a constant c such that f(x) < c*g(x)
You should look at the "biggest" asymptoticall factor in your function (highest exponent or something like that) and that would be your big O
Example: f(n) = 2^n + n^5 + n^2 + n*log(n) + n
This function has 5 different factors that influence big O, sorted from biggest to smallest, so this one would be O(2^n). Drop the 2^n and now f(n) is O(n^5).
Constants are O(1).
Hope I explained it well
Generally the Big O notation of a function is measured by the largest power of n that appears. In your case, this would be n², since the only other factor is the 70 which is constant.
Edit: Original post only contained the function f(n) = n² + 70.
See this answer.
In short, there's no set way to determine Big O results. Strictly speaking any function which eventually (for some n) will always be bigger than your function, is Big O of it. In practice you're looking for as tight a bound as you can get. If the only components of the function are polynomial in n, then the Big O will just be the largest power of n that appears (or rather, n to that power). Another useful thing to know is that log n is of a lower order than n (but higher than constant).

Resources