fundamental principles of counting - 2nd try, correction



sorry, the last line of function Events_nOwR was corrupted:

(%i281) Events_nOwR (n,k) := block(
ElEr : makelist([i],i,1,n),
for j:2 thru k do (
  ElErNew: [],
  for m:1 thru length(ElEr) do
    for r : ElEr[m][j-1] thru n do
        ElErNew: append( ElErNew, [append(ElEr[m],[r])] ),
  ElEr : ElErNew
  ),
  sublist(ElEr, lambda ([x], x[1]<x[2]));

best
Wolfgang