I get pleasing results with this formula:
sub tension {
my ($hi, $lo) = @_;
$lo or return 0;
2 * log($lo)/log($hi + .1);
}
where $hi is the higher number of votes (whichever direction) and $lo is the number of votes in the other direction. Any result above 1 represents an interesting amount of tension, IMO. Here's a table of results:
Hi # | Lo # | Tension |
3 | 3 | 1.9420 |
8 | 3 | 1.0504 |
8 | 8 | 1.9881 |
20 | 3 | 0.7322 |
20 | 8 | 1.3860 |
20 | 20 | 1.9967 |
50 | 3 | 0.5614 |
50 | 8 | 1.0626 |
50 | 20 | 1.5308 |
50 | 50 | 1.9990 |
90 | 3 | 0.4882 |
90 | 8 | 0.9240 |
90 | 20 | 1.3312 |
90 | 50 | 1.7383 |
90 | 90 | 1.9995 |
Caution: Contents may have been coded under pressure.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|