독일 V2 로켓과 런던 폭격 - 푸아송 분포와 카이제곱 검정 아래 자료들을 참고하면서 실습을 하였습니다. AN APPLICATION OF THE POISSON DISTRIBUTION , by R. D. CLARKE The flying bomb and the actuary - Royal Statistical Society , Wiley 푸아송 분포 실제값 n_squares = 576 n_bombs = 537 # 구역당 떨어진 폭탄 수의 평균 m = n_bombs / n_squares print ( f '{m:.3f}' ) 0.932 # 구역당 떨어진 폭탄 수 n_bombs_per_square = [ 0 , 1 , 2 , 3 , 4 , 5 ] # 해당 구역 수 (관찰도수) observed_num_of_squares = [ 229 , 211 , 93 , 35 , 7 , 1 ] print ( f '# of squares: {sum(observed_num_of_squares)}' ) # of squares: 576 기댓값 import math def poisson_distribution ( m , k ) : return pow ( m , k ) / math . factorial ( k ) * pow ( math . e , - m ) # 푸아송 분포에 따른 기대 구역 수 (기대도수) expected_num_of_squares = [ n_squares * poisson_distribution ( m , k ) for k in n_bombs_per_square ] print ( [ round ( v , 2 ) for v in expected_num_of_squares ] ) n_expected_squares = sum ( expected_num_of_squares ) expect...