📜  SymPy | Python中的 Subset.unrank_binary()

📅  最后修改于: 2022-05-13 01:55:08.732000             🧑  作者: Mango

SymPy | Python中的 Subset.unrank_binary()

Subset.unrank_binary() :unrank_binary()是一个 sympy Python库函数,它返回指定等级的二进制有序子集。

代码 #1:unrank_binary() 示例

# Python code explaining
# SymPy.Subset.unrank_binary()
  
# importing SymPy libraries
from sympy.combinatorics import Permutation, Cycle
from sympy.combinatorics.subsets import Subset
  
# Using from 
# sympy.combinatorics.subset.Subsets.unrank_binary()
  
# Creating Subset
a = Subset.unrank_binary(4, (['geek', 'for', 'c', 'd']))
  
# unrank_binary value
print ("Subset a unrank_binary : ", a.subset)

输出 :

代码 #2:unrank_binary() 示例

# Python code explaining
# SymPy.Subset.unrank_binary()
  
# importing SymPy libraries
from sympy.combinatorics import Permutation, Cycle
from sympy.combinatorics.subsets import Subset
  
# Using from 
# sympy.combinatorics.subset.Subsets.unrank_binary()
  
# Creating Subset
a = Subset.unrank_binary(4, ([2, 3, 4]))
  
# unrank_binary value
print ("Subset a unrank_binary : ", a.subset)

输出 :