Last active
April 6, 2016 17:46
-
-
Save dokipen/2e6628ea85034e549314 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nerd.