Is O(5n) = 5*O(n) ? From what I understand , O(5n) == O(n). Thus they are not equal? Please correct me if I am wrong.

You only care the asymptotic behavior of the function and if `f(x)/g(x)`

converges to a constant the two functions are defined to belong to the same big-O class. So as `5*n / n`

is always 5. So `O(n) = O(5*n)`

.

As for your question: `O(f(x))`

is defined as the set of functions having the same asymptotic behavior as f(x) and thus `5*O(N)`

is not defined. There is no such thing.

what matters in variables growth rates. Adding, Substracting, Multiplying or divising by any Constant number doent change them.

Thus any constant is insignificant and can be ommited without losing accuracy.

Regarding your question - `O(5n) = O(n) = 5*O(n)`

You're correct, `O(5n)`

is indeed equal to `O(n)`

. 5*O(n) doesn't make sense, `O`

doesn't return a result, it is a notation. So you can't multiply it with a number.

Although there are some definitions where Big O is used inside formulas, for example error terms. But it has to be defined like this beforehand.

Here the wikipedia link describing `O(c*n) = O(n)`

.

What is `5 * { Droider }`

?

Without special definition of `operator *`

for *sets* (or for big O notations at least), the two questions (your and mine) both does not make any sense.

Of course you can define `g(n)*O(f(n)) = O(f(n) * g(n))`

, and then it makes perfect sense, but you have to first define it.

AFAIK, there is no standard definition for this operation.

With the above definition we get `5*O(n) = O(5*n) = O(n)`

, and your assumption is correct.

Mathematically O(5N) != O(N) but when it comes to algorithms your care about effeciency or in other words the complexity of the algorithm, so you care more about the varaible N so O(5N) == O(N) as in equally effecient (or complex).

O(5n) = 5*O(n)

As stated, this is not defined.

I suggest you (re)read at least the Wikipedia article on the subject.

"f(x) = O(g(x)) as x -> infinite" means (informal intuitive definition): "f is bounded above by g asymptotically up to a constant factor". See the article above for a formal definition.

O(5n) == O(n).

I think this is more correct ("as x -> infinite" implied): f(x) = O(x) <=> f(x) = O(5x)

Cheers!

Similar Questions

What are some examples where Big-O notation[1] fails in practice? That is to say: when will the Big-O running time of algorithms predict algorithm A to be faster than algorithm B, yet in practice algo

I just have problem with subneting network address in CIDR notaion ,can anyone explain it for me? for example how can I solve this question: Give the subnet addresses in CIDR notation if the network a

In an array of n elements, if n/2 are repeated elements and the rest are distinct, we could use the Las Vegas algorithm to get the repeated element in o(logn) time. There is this other question which

Rules Write a function that accepts string as a parameter, returning evaluated value of expression in dice notation, including addition and multiplication. To clear the things up, here comes EBNF defi

It seems to be a searching algorithm based off of Mergesort. It is to be used on a sorted array of numbers. Is the Big-O complexity still O(n log n)? public static boolean fastSearch(int[] data, int m

int I(int i, int j, int n) { return n * i + j; >1 } int DotProduct( int A[], int B[], int i, int j, int n ) { int t=0; >1 for(int k=0; k<n; k++ ) > n+1 t += A[ I(i,k,n) ] * B[ I(k,j,n) ];

I was wondering what the complexity of a graph search algorithm would be for determining a checkmate in chess in Big O notation.

I'm trying to help a friend analyze the complexity of his algorithm but my understanding of Big-O notation is quite limited. The code goes like this: int SAMPLES = 2000; int K_SAMPLES = 5000; int i =

I would like to find out all the IPv4 networks in CIDR notation between those two networks: 10.11.3.64-10.11.3.127 10.11.52.0-10.11.52.255 IPv4 networks should have as short subnet-mask as possible.

I'm studying asymptotic notations from the book and I can't understand what the author means. I know that if f(n) = Θ(n^2) then f(n) = O(n^2). However, I understand from the author's words that for in

If I want to compute the n-th hexadecimal digit of Pi with http://en.wikipedia.org/wiki/Bailey-Borwein-Plouffe_formula what is the big O notation http://en.wikipedia.org/wiki/Big_O_notation for the Ba

I'm parsing .h and .cpp files and I need to find/replace all non-Hungarian notated variables with their Hungarian equivalents. Augh, why?! you ask? My employer requires Hungarian notation, 'nuff sai

while performing sentiment analysis, how can I make the machine understand that I'm referring apple (the iphone), instead of apple (the fruit)? Thanks for the advise !

Next in my series of Big O questions that I can't find the answer to Take the following example for(int i = 0; i < someNumber; i++) { for(int j = i; j < someNumber; j++) { DoSomething(); } } Wo

Do you have a good reference on Python's slice notation? To me, this notation needs a bit of picking up. It looks extremely powerful, but I haven't quite got my head around it and am looking for a goo

I am revising for my exams of sorting and algorithm analysis and one of the past exam papers has the following question: I would like to be able to take all the letters in some arbitrarily long word

It's a well-known isssue with Quicksort that when the data set is in or almost in sort order, performance degrades horribly. In this case, Insertion Sort, which is normally very slow, is easily the be

I want to write a java program that searches through a cipher text and returns a frequency count of the characters in the cipher, for example the cipher: jshddllpkeldldwgbdpked will have a result li

I have a question regarding sentiment analysis that i need help with. Right now, I have a bunch of tweets I've gathered through the twitter search api. Because I used my search terms, I know what are

I'm having trouble finding a formula that explains the size requirement of my data model. I will have a list of tags. In the example the tags are simply numbers. Tags are always sorted and duplicates

I'm considering about adding semantic analysis to my Solr installation, but I don't exactly know where to start. Basically, I'd like Solr to be able to find similar words (taken from the body of the

Writing the code below without dot notation, do I have this right? FROM: if(self.yellowViewController.view.superview == nil) { } TO: if([[[self yellowViewController] view] superview] == nil) { } gar

I am wondering, if there is a analysis class for ruby? Analysis as in being able to derive and integrate and such things. Can be numeric if it cant handle the analytic way. Google search hasn't turne

Is there something like Matlab's procrustes function in NumPy/SciPy or related libraries? For reference. Procrustes analysis aims to align 2 sets of points (in other words, 2 shapes) to minimize squa

Could anyone explain the Probabilistic Analysis of Algorithm in simple words? Couldn't find much info in Wiki page.

I am reading an analysis of a fibanocci number program, shown below. It is mentioned that this implementation is inefficient. Indeed, the number of recursive calls to compute Fn is F(n+1). My question

In javascript you can reference an object's properties using either dot notation, or bracket notation. This can be useful by using a string variable such as: var myObject = { hello: world }; var pro

Just need a confirmation on something real quick. If an algorithm takes n(n-1)/2 tests to run, is the big oh O(n^2)?

Usually colors in hexadecimal notation are presented with a hashtag following 6 hexadecimal characters. What color does the value #AAA produce? Are the other characters derived from the existing ones?

why we always consider large value of input in analysis of algorithm for eg:in big-oh notation ?

I am creating an UML class diagram on Papyrus but I can't understand the notation used for associations. When an association is set to be navigable, the tool adds a black dot on the tip of the arrow a

Greetings I may have imagined this but does anyone know if Last.fm previously used some form of open source project to perform analysis on music to determine similar music. As its now moved to a pay

I was just remembering back my university classes and was wondering to know if anyone out here even used the Z notation in a professional environment. I honestly must say that it was the single most

I'm taking a course related to Algorithm Analysis. The thing is the course is more focused on the theoretical part. By that I mean we don't actually take real algorithms and study them, we just take r

So I'm trying to create an algorithm to perform symbolic differentiation to get the exact derivatives of a given function. I've chosen the Reverse Polish Notation to store the expression because it sa

JSON web site uses very clear notation to describe JSON's syntax: What is the name of such notation? Is this is just a graphical presentation of BNF or it has it's own name?

I am trying to understand the worst case analysis of Insertion sort and I have a problem with the math involved on slide 21 (ppt). I understand the first formula: But these I'm struggling with: Why

Problem Description I am implementing a link-analysis algorithm over a huge graph-database. The graph database is constructed of entities (vertexes) and relationships (edges). Each entity type has pro

I'm trying to solve a question about comparing 2 algorithms in terms of their worst case running times and finding the input size for which one algorithm would have a faster running time than the othe

I have some session initialization code that loads Notation package for each session. This brings up Notation Palette. Any idea how to prevent it, or add code to get rid of it automatically? OK, bel

I was wondering whether Jade has an equivalent shorthand syntax like $!variable_name in Velocity? $!variable_name is the quiet reference notation of velocity which means that when variable_name has a

Do you think the pseudocode below is correct for calculating pascal's triangle? What would its time and space complexity be like? and how can I calculate it? pascal triangle(n){ list<list<int>

I'm studying a degree in computer science and at class we're using big-theta notation much more often than big-O notation. Although while reading articles about algorithms and its running times, I har

I'm writing a bit of code for use in an Xpath query which is causing a problem. I'm trying to read a random name from a list, however the float (x) occasionally returns exponential notation. Random r

As the title states im having some difficulties analzying the average-case memory usage of a memory allocator (quick-fit). My goal is to determine the average-case internal fragmentation of an allocat

I was wondering if there are any opensource libraries that are geared towards transportation ben/cost analysis. I currently use microBENCOST and would like to build my own solution. I'm most comforta

I have to do some maintenance on legacy code that uses Hungarian notation (and Systems Hungarian at that). Unfortunately, it's not practical for me to just clean it all out of the codebase. Local Ecli

I've read % notation but I could not find the explanation about the followings. Example 1: The following code with % outputs i. Obviously % changes i to a string. But I am not sure what actually % is

I wonder how sites like yahoomail or gmail move the messages, which we click as spam into the spam folder. As far as I concerned Bayesian analysis algorithm checks the messages, if it is spam based on

What is the use of process option in Analysis service Database,Cube,Dimension seperately?If we process database alone,it will process the cube and dimensions inside of that right?