Daily dose of the absurd

Because I'm bored; I was thinking a bit about score generation, and how you'd go about working out all the possible permutations of votes which would give you a score of, say, 4.87 given N votes. And because I'm boring and it's saturday evening I hacked together a very first-order approximation of something that converges on a score:

Ruby:
# subset sum program
# calculate how many different ways

# given v : number of votes
#       s : average vote
# generate possible combinations to generate the resultant vote
# use convergeance

# possible scores
A = [1,2,3,4,5]
N = [0,0,0,0,0]

TARGET = 4.87
TOTAL = 3247

def gt(v)
  A.select{ |x| x >= TARGET.ceil }.sample
end

def lt(v)
  A.select{ |x| x <= TARGET.floor }.sample
end

s = 5

[]

debug = false

(1..TOTAL).each do |idx|
  # puts s/(idx.to_f)

  if s/(idx.to_f)  < TARGET
    i = gt(TARGET)
    puts "+ [%d] -> %#f, %#f, %4f, %4f" % [i, s / (idx.to_f), TARGET, s / (idx.to_f) * TOTAL, TARGET * TOTAL] if debug
  else
    i = lt(TARGET)
    puts "- [%d] -> %#f, %#f, %4f, %4f" % [i, s / (idx.to_f), TARGET, s / (idx.to_f) * TOTAL, TARGET * TOTAL] if debug
  end

  N[i-1] += 1
  s += i
end

puts "\nPotential voting combination to give score %.2f from %d votes" % [TARGET, TOTAL]
puts " -----------------------------------------------------------------------"
puts " [    *] : %d" % N[0]
puts " [   **] : %d" % N[1]
puts " [  ***] : %d" % N[2]
puts " [ ****] : %d" % N[3]
puts " [*****] : %d" % N[4]

it gives interesting results like this:
Ruby:
    Potential voting combination to give score 4.87 from 3247 votes
     -----------------------------------------------------------------------
     [    *] : 47
     [   **] : 42
     [  ***] : 35
     [ ****] : 39
     [*****] : 3084

absolutely useless, of course, and takes no notice of the skewing towards 1 and 5 that we see, but I found it fun anyway.
 
[ *] : 47
[ **] : 42
[ ***] : 35
[ ****] : 39
[*****] : 3084[/CODE]

absolutely useless, of course, and takes no notice of the skewing towards 1 and 5 that we see, but I found it fun anyway.
It absolutely demonstrates the skew. It might be quite representative. Scores obviously can't be all fives and ones.

I didn't know you did stuff like this, Wanda. One of your hidden talents?
 
I am more amused by the fact that she is coding in Ruby :p
Language is irrelevant, but the style... Simple, clean, elegant, easy to follow, and with comments...Comments!!!
As is the author, truly a thing of beauty, and I only know her by her words..
 
[ ***] : 35

It was a stormy and dark night; the votes dropping at occasional intervals as I tallied the latest into my meager spreadsheet, scantily lit by the tepid LED backlight set to night mode.

“Three stars?” I exclaimed. “Who the fuck gives three-star votes?”

A fierce agitation impaired deliberations. This was neither a mainstream selector or fours or fives, nor the one or two stars of the vexatious 'bomber'. This was something betwixt the two. Some new kind of demon who taints with the most horrid of marks; average.

-

The above is a dramatization, but I definitely received a three-star vote once. Possibly my only one.

I suspect many authors here also have a bi-modal frequency distribution of votes, with 3 and then 2 stars being the least likely selections.
 
The first vote for my latest submission was a 3. I was confused because I didn't think anyone actually voted with the three. It would've been less confusing if they'd voted 1 or 2. Especially since every vote I've gotten after that has done nothing but raise the score. I've only gotten 5 votes though so I dunno what the others actually voted.
 
Let's decode this bickering over language lest we RP the Tower of Babble. We should UNIX in a common effort!
 
Back
Top