Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Mathematics eq CompSci

by tilly (Archbishop)
on May 02, 2005 at 05:20 UTC ( [id://453135]=note: print w/replies, xml ) Need Help??


in reply to Mathematics eq CompSci

To understand the performance of algorithms, you need to count how many steps the algorithm will take to come up with an answer. People tend to think of that kind of counting operation as math.

There is no way to convey the concept of how to calculate the efficiency of an algorithm without actually going through how to count operations. In that sense the concepts are math.

That said, you certainly do not need to master all kinds of advanced math to be able to handle this kind of counting. For instance expertise in differential equations will not prepare you to understand why a quicksort is on average better than a bubblesort, and why a mergesort has better performance guarantees than quicksort, even though its average performance is worse (if all memory is equally fast to access).

Replies are listed 'Best First'.
Re^2: Mathematics eq CompSci
by demerphq (Chancellor) on May 02, 2005 at 08:33 UTC

    That said, you certainly do not need to master all kinds of advanced math to be able to handle this kind of counting. For instance expertise in differential equations will not prepare you to understand why a quicksort is on average better than a bubblesort, and why a mergesort has better performance guarantees than quicksort, even though its average performance is worse (if all memory is equally fast to access).

    Indeed. One might even go so far as to say that what most programmers do does not require this math at all as one is mostly selecting from a set of prewritten libraries (and thus algorithms) whose properties are reasonable well known and documented. For instance those writing software that is heavily DB based probably will never consider what sort algorithms are in use as its handled by the DB. And those that do need to use sorting algorithms rarely need to self-determine the algorithms performance as some clever math type already did it and wrote it down in such a way that we can make educated choices without requiring the math skills. Of course if you dont understandthe underlying principles you end up making bad decisions.... (Like maybe there are circumstances where its better to use bubble sort, or where using splays is extremely inefficient....)

    ---
    demerphq

      One might go so far, but I think that one would be wrong.

      I've solved enough real-world performance problems due to subtle algorithm issues that I firmly believe that there is real value in being able to estimate scaleability. Furthermore if you ever want to have hope of treating databases as more than magic black boxes, you'll need an understanding of algorithms to see how they work.

        I dont think it would be wrong, as I dont really consider someone like you (or to be honest even me) to be representative of the programming world. I do agree that the ability to estimate scalability is important, but simply reading a page on what big-oh notation is and then reviewing standard lists of algorithms and their performance will be sufficient for the vast majority of programmers out there. As for the comment about DB's I hope youll explain what you mean, I'm having difficulty thinking of how a knowledge of algorithms will help with the use of a DB. Sure it might explain why sometimes when you drop indexes and then recreate them the record order may change, but beyond that?

        ---
        demerphq

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://453135]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (2)
As of 2024-03-19 06:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found