Skip to content

Instantly share code, notes, and snippets.

@dokipen
Last active April 6, 2016 17:46
Show Gist options
  • Save dokipen/2e6628ea85034e549314 to your computer and use it in GitHub Desktop.
Save dokipen/2e6628ea85034e549314 to your computer and use it in GitHub Desktop.
total = 4768
unpledged = 717
pledged = total - unpledged
clinton = 1279 + 18 - 3
bernie = 1027 + 47 + 3
needed = pledged / 2
assigned = clinton + bernie
remaining = pledged - assigned
bernie_needed = needed - bernie
bernie_perc_needed = bernie_needed.to_f / remaining
hillary_perc_needed = 1 - bernie_perc_needed
puts "Percent needed for the rest of the primaries to win popular vote"
puts "----------------------------------------------------------------"
puts "bernie: %0.2f\nhillary: %0.2f" % [bernie_perc_needed * 100, hillary_perc_needed * 100]
@jdolan
Copy link

jdolan commented Apr 6, 2016

Nerd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment