Skip to content

Instantly share code, notes, and snippets.

@bavardage
Created April 4, 2010 19:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bavardage/355632 to your computer and use it in GitHub Desktop.
Save bavardage/355632 to your computer and use it in GitHub Desktop.
;; This buffer is for notes you don't want to save, and for Lisp evaluation.
;; If you want to create a file, visit that file with C-x C-f,
;; then enter the text in that file's own buffer.
consider this as a graph.
Each pupil is a node.
When they've been on a trip, draw an edge between them.
since they can't go on a trip together twice, the total number of edges allowed in the graph is 30 + 29 + 28 + ... + 2 + 1 = (30/2)(30+1) = 15*31 = 465
now each time you choose 8 pupils, you draw edges between each of them, so you add 8 + 7 + ... + 1 = 36 edges.
So, total number of times you can choose 8 pupils is floor (465 / 36) = 12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment