>>11666Nope. Please post some quotations that supports your case the best.
>>11692>And our computers are now very, very fast.Still no excuses for sloppy algorithms. Consider Pascal's triangle. One of the things it is a representation of possible combinations (foobar) of participants (bar) and those who show up (bar).
When foo is 0, then bar must be 0 and foobar is 1, and so on:
foo 1, bar 1, foobar 1
foo 3, bar 2, foobar 3 etc...
One atrociously sloppy way to calculate foobar is to let foo be the bit length of a digit and bar the amount of 1:s. Then you decide the largest foo-length binary number with bar 1:s and start to count down to the smallest number with bar 1:s:
foo 3, bar 1
100 - foobar++
011
010 - foobar++
001 - foobar++
This was just a simple case with only one negative hit. But if foo = 20 20 and bar = 5, then the amount of negatives are just too much.
The simplest way to decide foobar is to use a binominal equation (something that I can't do yet). One middle way is to use a matrix that simply creates a Pascal triangle. Not as efficient as that equation, but far better than than wading trough lots of negative hits.
My 2 cents? A C-64 using the matrix method can probably calculate the foobar of really high foos better than a modern computer using the "bit-method".
>>11706Well, I'm taught that there's no excuses for bad algorithms. Consider this:
foobar = foo + 1 + bar - 1
Any middle school pupil realizes that the +-1 is just filling and will simplify it to:
foobar = foo + bar
But this simplification won't happen in the compiling, because the compiler can't decide that "This is just soykaf, I'll disregard it."
And of course programming is lots of other things than applied mathematics. But the fact that I prefer to sit on a comfy chair by my desk when I program doesn't make programming applied mathematics + a comfy chair.