combination python
[Combination] 조합을 생성하는 다양한 방법
서로 다른 n개의 원소 중에 r개를 순서없이 골라낸 것을 조합(Combination)이라고 부른다. $$ {\displaystyle {n}C{r}\;}= {\displaystyle {n \choose r}={\frac {P(n,r)}{r!}}={\frac {n!}{r!\cdot (n-r)!}}}$$ $$ {\displaystyle {n}C{r}\;}= {\displaystyle {n-1}C{r-1}\;} + {\displaystyle {n-1}C{r}\;}$$ $$ {\displaystyle {n}C{0}\;}= 1$$ 조합의 수식 활용 arr = [3, 6, 7, 1, 5, 4] n = len(arr) tr = [0] * n def combination(n, r): if r == 0: print(tr)..