Combination 조합
토너먼트 : 5개의 팀이 있을 경우 각 팀은 4번의 경기를 치룬다. 즉 5*4번의 경기를 치룬다.
겹치는 경우를 제외해준다.
n(n-1)/2
게임의 종류 1. 첫번째 팀 포함 게임수 n-1 / 2. 첫 번째 팀 빼고 T(n)
-> T(n)=(n-1)+T(n-1)=(n-1)+(n-2)+....+2+1+0
from itertools import combinations
for c in combinations("abcdefgh", 2):
print("".join(c))
집합 S에 대하여 k-조합은 k크기의 S의 부분 집합이다.

파스칼의 삼각형



C=dict()
for n in range(8)
C[n, 0]=1
C[n, n]=1
for k in range(1,n:
C[n, k]=C[n-1, k-1]+C[n-1, k]
print(C[7,4])
Row sum=2^n

coursera Introduction to Discrete Mathematics for Computer Science 과정 중
Combinatorics and Probability 2주차 내용 정리
'Fundamentals > Discrete mathmatics' 카테고리의 다른 글
[이산수학] Combinatorics and Probability 조합론과 확률 4주차 (0) | 2023.09.19 |
---|---|
[이산수학] Combinatorics and Probability 조합론과 확률 3주차 (0) | 2023.09.13 |
[이산수학] Combinatorics and Probability 조합론과 확률 1주차 (1) | 2023.09.11 |
[이산수학] Mathematical Thinking in computer Science 수료증 (0) | 2023.09.09 |
[이산수학] Mathematical Thinking in computer Science 5주차 (0) | 2023.09.09 |