assign_lib.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:mpeds-coder 作者: MPEDS 项目源码 文件源码
def generateSampleNumberForBins(num_per_coder, n, k):
    """
        Generate the number of articles necessary to assign each coder * number
        of articles, given the bin size.
        Formula is: (n - 1)! / (k - 1)! (n - 1)!
    """

    a = factorial(n - 1) / ( factorial( k - 1 ) * factorial(n - k) )

    ## the number per coder doesn't divide evenly into the number of appearances
    ## subtract the remainder
    remainder = num_per_coder % a
    num_per_coder -= remainder

    ## get number of bins
    num_bins = len(list(combinations(range(0,n), k)))

    return int(num_bins * num_per_coder / a)

#####
### DUPE HANDLING
#####
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号