From: James Edward Gray II Date: 2006-10-13T00:51:25+09:00 Subject: Re: [QUIZ] Posix Pangrams (#97) On Oct 12, 2006, at 10:25 AM, Ken Bloom wrote: > On Thu, 12 Oct 2006 17:06:26 +0900, Martin Coxall wrote: > >>> I suspect that the other optimization problem here may also be NP- >>> Hard. >>> I'm not sure (in all of the 5 minutes that I'm writing this post) >>> how to do >>> a simple reduction to that problem though. >> >> True, but in this case the set to cover was small enough to make it >> computationally feasible without having to rewrite it in Fortran. >> Phew. >> >> Martin > > There's also the matter of program structure. When dealing with an > NP-Hard problem, you know that any solution geared to do a heuristic > search quickly is not guaranteed to find the minimum. We haven't talked a lot about this in the past, but I take a pretty relaxed approach to tough quiz problems. Find a good heuristic and get close. That's fine with me. To me, Ruby Quiz is all about keeping the brain sharp. I think programmers are often susceptible to the "That's not possible!" mentality and we have to fight against that. MJD once gave a neat speech about how when Alchemy was as old as our profession is now, they were still actively trying to turn lead into gold but we seem content to bury ourselves in rules about what we can't do. Was this week's quiz solvable beyond a shadow of a doubt in all cases? No. Does that mean we shouldn't do it? No way. The solution I talked up in the summary finds a darn good pangram in under a second! It's within 7 characters of perfect. It maybe guesswork, but it's damn good guesswork. I have a great respect for those who can think outside the box like that. I think we should cultivate that skill in ourselves. Even at work, I'm the company's resident language geek, so I often see a problem and launch into a detailed plan of how we can solve it to death. Luckily, my two far more practical coworkers usually just politely point out the simple fix that is plenty good enough for our purposes. If it wasn't for them I would never accomplish a complete anything. I'm all about thinking outside the box. I think we should all learn to love the guesswork! There's my two cents on this issue. James Edward Gray II