Skip to content

Instantly share code, notes, and snippets.

@yoursunny
Created April 4, 2015 17:46
Show Gist options
  • Save yoursunny/f205767cb151ac39ef9f to your computer and use it in GitHub Desktop.
Save yoursunny/f205767cb151ac39ef9f to your computer and use it in GitHub Desktop.
How long would you need to kiss 1/20 of the student body at the University of Arizona?
#!/usr/bin/python2
# https://www.facebook.com/permalink.php?story_fbid=921147667906858&id=531306850224277
# My confession is that technically I have probably kissed 1/20th of the Student body here are U of A. It's truly embarrassing to say but I'm glad to get that off my chest. -EOS
# Number of students at U of A = 50,000; You claim to kiss: 1/20 x 50,000 = 2,500; Math, Bitch!!
# This script computes number of kisses necessary to kiss 2500 unique students, or the entire student body.
import random
nStudents = 50000
kissed = {}
nKisses = 0
while len(kissed) < nStudents:
nKisses += 1
student = random.randint(1, nStudents)
if not student in kissed:
kissed[student] = 1
print len(kissed), nKisses
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment