Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!


Forgot your password?

Comment Tail recursion (Score 1) 242

You've stated (http://neopythonic.blogspot.com/2009/04/tail-recursion-elimination.html) that you consider tail recursion to be "unpythonic." Could you elaborate on that a little more. What about algorithms that are by their very nature recusive? I've found that a combination of memoization and tail recursion can, under the right circumstance, provide wonderfully clear code without taking too much of a performance hit, and Python's decorator facility always seemed more or less ideal to me for that sort of application.

Comment Multi-line lambdas (Score 3, Interesting) 242

One of the most common complaints about Python is the limitations of its lambdas, namely being one line only without the ability to do assignments. Obviously, Python's whitespace treatment is a major part of that (and, IIRC, I've read comments from you to that effect). I've spent quite a bit of time thinking about possible syntax for a multi-line lambda, and the best I've come up with is trying to shoehorn some unused (or little used) symbol into a C-style curly brace, but that's messy at best. Is there a better way, and do you see this functionality ever being added?

Comment Not a good voting system (Score 1) 128

That's really a terrible voting algorithm. For many, many reasons:
  • First, there's the whole issue of averaging 1-10 ratings. First, those number will not be uniformly distributed. Rather, they'll be clustered in the 1-2, 5, 8-10. Second they aren't ratio quantities, so you just can't average them. By this I mean that 1/10+2*10/10 = 21/30 scores the same as 3*7/10. That really doesn't make sense. A reddit style voting system will address this, but requires a larger sample size.
  • Ignoring the first issue, your first round has fairly low confidence of selecting the best stories for review. Let's be generous and assume that of your initial 20 reviewers half actually review it. Let's further assume none of them lie and just call it e.g. a 7/10 without reading it. You still have a sample size of 10. By terribly misusing the CLT because the sample is too small, we would assume the results are normally distributed about the "true" mean with a standard deviation of approximately 1.68. That means that if a score averages 8/10 after 10 reviews, there's a 17% chance that it's really 6.3 or worse. Similarly, a 6/10 average has 17% chance of really being 7.68. Not very encouraging.
  • The above makes some very, very bad assumptions (e.g. nobody just says "Screw it; i'm putting down 7.") and misapplies the CLT. In reality, you have no idea what your confidence interval is, other than that it's not tight.
  • You can increase the sample size for part 1, but that loses the benefits of your scheme and, as people are bothered to review more, they'll participate more rarely unless you reward them well.

In short, it's a pretty meaningless system based on a flawed average with unknown, but low, confidence in the scores.

Slashdot Top Deals

In any formula, constants (especially those obtained from handbooks) are to be treated as variables.