从n个元素中取出k个的组合数量:
julia> binomial(2,1)
2
julia> binomial(3,2)
3
具体的组合明细:
julia> using Combinatorics
julia> collect(combinations(1:3,2))
3-element Array{Array{Int64,1},1}:
[1, 2]
[1, 3]
[2, 3]
从n个元素中取出k个的组合数量:
julia> binomial(2,1)
2
julia> binomial(3,2)
3
具体的组合明细:
julia> using Combinatorics
julia> collect(combinations(1:3,2))
3-element Array{Array{Int64,1},1}:
[1, 2]
[1, 3]
[2, 3]
本文标题:What is the Julia function to co
本文链接:https://www.haomeiwen.com/subject/rblihltx.html
网友评论