patternMinor
Order Mistake Definition in CLRS
Viewed 0 times
definitionorderclrsmistake
Problem
On page 53 or CLRS it has said :
We can extend our notation to the case of two parameters n and m that can go to infinity independently at different rates. For a given function $g(n,m)$, we denote by $O(g(n,m))$ the set of functions
$$\begin{align}
O(g(n,m)) = \{ f(n,m) : &\text{there exist positive constants }c,
n_0,\text{ and } m_0 \\
&\text{ such that } 0 \le f(n,m) \le cg(n,m)\\
&\text{ for all } n\ge n_0\text{ or } m \ge m_0 \}
\end{align}$$
I think this definition has a problem cause if $n \ge n_0$ for some constant $n$ then we don't need to grow $m$! I feel something is Wrong! It must be the word "and" instead of "or" for example :
$f(x , y ) = x^2 + y^2$
$g_2(x,y) = x^2 + y$
$g_1(x,y) = x^2 + x*y$
by the definition $f(x,y)$ is $O(g_1(x,y))$ !
or even $f(x,y)$ is $O(g_2(x,y))$ ?
please guide me .
We can extend our notation to the case of two parameters n and m that can go to infinity independently at different rates. For a given function $g(n,m)$, we denote by $O(g(n,m))$ the set of functions
$$\begin{align}
O(g(n,m)) = \{ f(n,m) : &\text{there exist positive constants }c,
n_0,\text{ and } m_0 \\
&\text{ such that } 0 \le f(n,m) \le cg(n,m)\\
&\text{ for all } n\ge n_0\text{ or } m \ge m_0 \}
\end{align}$$
I think this definition has a problem cause if $n \ge n_0$ for some constant $n$ then we don't need to grow $m$! I feel something is Wrong! It must be the word "and" instead of "or" for example :
$f(x , y ) = x^2 + y^2$
$g_2(x,y) = x^2 + y$
$g_1(x,y) = x^2 + x*y$
by the definition $f(x,y)$ is $O(g_1(x,y))$ !
or even $f(x,y)$ is $O(g_2(x,y))$ ?
please guide me .
Solution
Well, there is not really a completely satisfying way to have the big-O Notation with multiple variables. Therefore CLRS present one way of a generalization. Putting an and instead of the or would give a new definition with other problems.
See this article for a discussion on the subject.
See this article for a discussion on the subject.
Context
StackExchange Computer Science Q#105280, answer score: 2
Revisions (0)
No revisions yet.