Skip to content

Instantly share code, notes, and snippets.

View Brandonmchu's full-sized avatar

Brandon Brandonmchu

  • FreshBooks
  • Toronto
View GitHub Profile
@Brandonmchu
Brandonmchu / gist:c77a70b9fdb309f2728d
Last active October 12, 2019 19:03
Number of possible meetings in a 20-person company
1,048,555
“The greatest shortcoming of the human race is our inability to understand the exponential function.” — Al Bartlett
##Math
General Formula: http://stats.stackexchange.com/questions/27266/simplify-sum-of-combinations-with-same-n-all-possible-values-of-k
In this case we deviate from the general formula ∑k=1n(nck)=2^n−1 by also subtracting an additional nc1(20c1), since there are no meetings of one.
#controller
def index
@bikes = Bike.order('created_at DESC').limit(50).all
@bikesnew = @bikes.find_all { |bike| bike.created_at > "2013-07-01 17:58:14" }
respond_to do |format|
format.js { render :bike_post_ajax }
format.html
end
end