CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 2 FirstFirst 12
Results 16 to 20 of 20
  1. #16
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,125

    Re: matrix algorithm

    The above comments are all 100% correct.

    MY point simply is that too many people thing that

    O(1) <= O(n) <= O(nLogn) < O(n^2) < O(n^3)

    This in fact has NO actual basis in fact. I have seen many O(n^2) that are so much simpler than an O(nLogn) that for all reasonable values of n, the higher order of complexity is much faster.

    Yet people persist in making comments about "efficiency" in terms of "big-O".
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009,2010
    In theory, there is no difference between theory and practice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

  2. #17
    Join Date
    Jun 2002
    Location
    Moscow, Russia.
    Posts
    2,176

    Re: matrix algorithm

    Quote Originally Posted by kiuhnm
    Neither of you noticed that if n<m that kind of matrix cannot exist ;-)
    Right...
    "Programs must be written for people to read, and only incidentally for machines to execute."

  3. #18
    Join Date
    Jun 2008
    Posts
    5

    Re: matrix algorithm

    Quote Originally Posted by TheCPUWizard
    The above comments are all 100% correct.

    MY point simply is that too many people thing that

    O(1) <= O(n) <= O(nLogn) < O(n^2) < O(n^3)

    This in fact has NO actual basis in fact. I have seen many O(n^2) that are so much simpler than an O(nLogn) that for all reasonable values of n, the higher order of complexity is much faster.

    Yet people persist in making comments about "efficiency" in terms of "big-O".
    Agreed.
    But note that "O(1) <= O(n)" is true by definition (if n->inf). You can't say it's false.
    To be consistent, you should get rid of the big-O notation and use something else.

  4. #19
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,125

    Re: matrix algorithm

    Quote Originally Posted by kiuhnm
    Agreed.
    But note that "O(1) <= O(n)" is true by definition (if n->inf). You can't say it's false.
    To be consistent, you should get rid of the big-O notation and use something else.
    1) Duh... Smacking Self... Of course with the "=" sign there it is tru, and even just as a "<" it would be true in all but the parasitic cases.

    2) Internally (here at my firm) we have minimized the use of big O, and created our own concept of big P [deliberately opening up lots of puns]. In this case we actually use a polynomail with rough estimates [typically one of a set of predefined values] for the constant multipliers for each term. While this is not as simple as the conventional approaqch, simple ignorng the multipliers reduces the "equation" to a big-O expression.

    This allows us to model different solutions based on additional factors.
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009,2010
    In theory, there is no difference between theory and practice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

  5. #20
    Join Date
    Feb 2008
    Posts
    966

    Re: matrix algorithm

    And nobody is disputing that constant factors can make a huge difference when considering an algorithm, depending of course on the size of the data set. However, when discussing algorithms in general and talking about their asymptotic behavior nobody gives a crap about the 'a'.


    In real world practice: yes you need to consider the size of the data set and the actual run time. Nobody was saying that the 'a' didn't matter in the real world.

    You are getting all worked up about this. Did you have a hard time in your algorithms class at school? Did you hate the fact that most of it was theorhetical?

    Personally it pissed me off at first. I would tell the teacher 'why the f*ck don't we care about the constant factor, it matters!!!'. And I was right, we just didn't cover that aspect of algorithm analysis until the second semester

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured