I should post back on this thread, because I said I would. Yeah, those lists of numbers you gave, Pascals Triangle, if you turned it into a table:

Code:

1 1 1 1 ...
1 2 3 4 ...
1 3 6 10 ...
1 4 10 20 ...
.. .. ... ....

the diagonals going from bottom-left to to right are the outputs of the binomial function (often said out loud as "n choose k"), so to get the entry from the r^{th} row and c^{th }column, its something like:

The denominator in the probability will always be an entry in that table, so you can find it that way. The challenge is the numerator in that probability. In Python, here's a recursive function that enumerates all the ways to put a total of t items in b boxes:

Code:

def enumerate(t, b):
"""enumerates a list of lists, each list being a different way to arrange t items into b boxes"""
if t==0: return [[0 for i in range(b)]] #base case 1: 0 items into b boxes
elif b==1: return [[t]] #base case 2: t items into 1 box
else: #must go deeper
out = []
for i in range(t+1): # for each item i from 0-t
#stick i on the front of each possibility returned from enumerate(t-i, b-1)
out += [[i] + j for j in enumerate(t-i, b-1)]
return out

So you can tweak that to get it running pretty fast for counting rows with an entry > or < than k, but if there is a simple elegant and fast mathematical solution, I have yet to find it. But I'm still poking around, learning things. I'm also still sure there's something simple I'm missing. If I find the breakthrough, I'll post it here though!