https://docs.python.org/3/tutorial/stdlib.html#mathematics
Python 표준 라이브러리:
- math: C 수학 함수 래퍼, 라디안 사용.
- 예) math.cos(math.pi/4) → 0.7071, math.log(x, base)로 밑 지정 가능.
- random: 의사난수(Mersenne Twister).
- random()은 [0,1) 실수, choice는 하나 뽑기, sample은 중복 없는 n개, randrange(6)은 0~5 중 정수. 재현성 필요하면 random.seed(…) 호출.
- statistics: 기본 통계. mean, median, variance(표본분산). 모분산은 pvariance 사용.
더 고급 수치/과학 계산(선형대수, 최적화 등)은 SciPy/NumPy 같은 외부 라이브러리 활용.