3 ms·
His point is correct. There are usually efficient and inefficient ways to attack each problem. It's better to solve the math problem first, before the coding pr
by mathattack 9y ago
His point is correct. There are usually efficient and inefficient ways to attack each problem. It's better to solve the math problem first, before the coding problem.
- tedmiston 9y agoOnly when the scale truly matters is the most efficient algorithm the best choice though. For a lot of problems, especially in early stage startups, the brute force solution is more than sufficient and avoids premature optimization. Having perfect algorithms for everything comes with an opportunity cost in startup land that isn't aligned with whether or not your business succeeds most of the time. (This really only applies when the efficient implementation doesn't already exist in the standard library or a package.)
- sixstringtheory 9y agoSome problems simply will never return the result if you brute force it. I've run a brute-force solver and written the elegant approach while I waited for a result that'd never come. Most of the elegant solutions do exist in libraries out there, but the point is to pass down the underlying knowledge. I don't think it's really fair to liken something like mathematics to the startup world, something that has all sorts of nondeterministic factors involved.
- jacquesm 9y agoSome of the answers are explicitly formulated in such a way that your brute force mechanism will not work even though in a practical setting that brute force answer would be more than accurate enough for use. So project Euler does not always steer you simply to a correct answer, they also want you to achieve that answer in a particular way.
- mathattack 9y agoThe context here is Project Euler though. (Math problems)