S2<-stirling2(4,4)$SM[4,] #indicates in how many ways 4 objects
#can be placed, respectively, into 1, 2,
#3 or 4 non-empty subsets.
CardConstr<-factorial(c(1,2,3,4))*S2 #the cardinality of rankings
#constrained into 1, 2, 3 and 4
#buckets
Card<-sum(CardConstr) #Cardinality of the universe of rankings with 4
#objects
U<-univranks(4)$Runiv #the universe of rankings with four objects
# we know that the universe counts 75
#different rankings
Uk<-univranks(4,2)$Runiv #the universe of rankings of four objects
#constrained into k=2 buckets, we know they are 14
Up<-univranks(c(1,4,3,1))$Runiv #the universe of rankings with 4 objects
#for which the first and the fourth item
#are tied
Run the code above in your browser using DataLab