{"id":483174,"date":"2026-06-10T12:40:46","date_gmt":"2026-06-10T12:40:46","guid":{"rendered":"https:\/\/savepearlharbor.com\/?p=483174"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=483174","title":{"rendered":"\u041c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439"},"content":{"rendered":"<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/207\/9a3\/bdd\/2079a3bdd20a79aeb1de73b79ea04cc9.jpg\" width=\"1360\" height=\"768\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/207\/9a3\/bdd\/2079a3bdd20a79aeb1de73b79ea04cc9.jpg 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/207\/9a3\/bdd\/2079a3bdd20a79aeb1de73b79ea04cc9.jpg 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440\u043e\u0436\u0438\u0442\u0435\u043b\u0438!<\/p>\n<p>\u041c\u044b \u043e\u0442\u043a\u0440\u044b\u043b\u0438 \u043f\u0440\u0435\u0434\u0437\u0430\u043a\u0430\u0437 \u043d\u0430 \u043a\u043d\u0438\u0433\u0443 \u00ab\u0414\u0443\u043c\u0430\u0439 \u043a\u0430\u043a \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a. \u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u043d\u0430 Python. 3-\u0435 \u0438\u0437\u0434.\u00bb, \u0445\u043e\u0442\u0438\u043c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0430\u043c \u043e \u043d\u0435\u0439 \u0438 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c \u043e\u0442\u0440\u044b\u0432\u043a\u043e\u043c.   <\/p>\n<p>\u041c\u043d\u043e\u0433\u0438\u0435 \u0431\u0440\u043e\u0441\u0430\u044e\u0442 Data Science \u0438\u0437-\u0437\u0430 \u0430\u043a\u0430\u0434\u0435\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u0441 \u0435\u0451 \u0433\u0440\u043e\u043c\u043e\u0437\u0434\u043a\u0438\u043c\u0438 \u0444\u043e\u0440\u043c\u0443\u043b\u0430\u043c\u0438. \u041d\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u0443\u0436\u0435 \u0437\u043d\u0430\u0435\u0442\u0435 Python, \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e. \u041a\u043e\u0434 \u2014 \u044d\u0442\u043e \u0432\u0441\u0451, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438.<\/p>\n<p>\u0412 \u043a\u043d\u0438\u0433\u0435 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u043d\u0435 \u043a\u0430\u043a \u0441\u0443\u0445\u0430\u044f \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0430, \u0430 \u043a\u0430\u043a \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0439 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441.<\/p>\n<p><strong>\u0427\u0442\u043e \u0432\u043d\u0443\u0442\u0440\u0438?<\/strong><\/p>\n<ul>\n<li>\n<p><strong>\u0420\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u043f\u044b\u0442:<\/strong> \u0412\u0435\u0441\u044c \u0446\u0438\u043a\u043b \u0440\u0430\u0437\u0432\u0435\u0434\u043e\u0447\u043d\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 (EDA) \u043e\u0442 \u043e\u0447\u0438\u0441\u0442\u043a\u0438 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u043e\u0432 \u0434\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0433\u0438\u043f\u043e\u0442\u0435\u0437 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445.<\/p>\n<\/li>\n<li>\n<p><strong>\u0410\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0442\u0435\u043a:<\/strong> \u0411\u044b\u0441\u0442\u0440\u043e\u0435 \u043f\u043e\u0433\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0432 Pandas, NumPy, SciPy \u0438 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<\/li>\n<li>\n<p><strong>\u0418\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c:<\/strong> \u0412\u0441\u0435 \u0433\u043b\u0430\u0432\u044b \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0432 \u0432\u0438\u0434\u0435 Jupyter-\u0431\u043b\u043e\u043a\u043d\u043e\u0442\u043e\u0432 \u2014 \u043c\u043e\u0436\u043d\u043e \u0447\u0438\u0442\u0430\u0442\u044c, \u0441\u0440\u0430\u0437\u0443 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043a\u043e\u0434 \u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u0443\u043f\u0440\u0430\u0436\u043d\u0435\u043d\u0438\u044f \u0432 \u043e\u0434\u043d\u043e\u043c \u043e\u043a\u043d\u0435.<\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u043d\u0438\u0433\u0430 \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c, \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0430\u043c \u0438 \u0432\u0441\u0435\u043c, \u043a\u0442\u043e \u0445\u043e\u0447\u0435\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0446\u0438\u0444\u0440, \u0430 \u043d\u0435 \u0438\u043d\u0442\u0443\u0438\u0446\u0438\u0438.<\/p>\n<hr\/>\n<p>\u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043c\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440, \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u044d\u043c\u043f\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u043d\u0438 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u044b \u043d\u0430 \u044d\u043c\u043f\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f\u0445, \u0438\u043b\u0438, \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0445. \u041c\u043d\u043e\u0433\u0438\u0435 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u044b, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043c\u044b \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u043c\u0441\u044f \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435, \u043c\u043e\u0436\u043d\u043e \u0442\u043e\u0447\u043d\u043e \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439, \u043e\u0431\u044b\u0447\u043d\u043e \u0437\u0430\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0445 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0444\u043e\u0440\u043c\u0443\u043b\u043e\u0439. \u0412 \u044d\u0442\u043e\u0439 \u0433\u043b\u0430\u0432\u0435 \u0432\u044b \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u0435\u0441\u044c \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0438\u0437 \u0442\u0430\u043a\u0438\u0445 \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439 \u0438 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441 \u0438\u0445 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043e\u0436\u043d\u043e \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c.<\/p>\n<p>\u0412\u044b \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u0443\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c:<\/p>\n<ul>\n<li>\n<p>\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u0439 \u0438 \u043f\u0440\u043e\u043c\u0430\u0445\u043e\u0432 \u0432 \u0441\u043e\u0440\u0435\u0432\u043d\u043e\u0432\u0430\u043d\u0438\u044f\u0445 \u043f\u043e \u0441\u0442\u0435\u043d\u0434\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0435\u043b\u044c\u0431\u0435 \u0445\u043e\u0440\u043e\u0448\u043e \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p>\u0412 \u0442\u0430\u043a\u0438\u0445 \u0441\u043f\u043e\u0440\u0442\u0438\u0432\u043d\u044b\u0445 \u0438\u0433\u0440\u0430\u0445, \u043a\u0430\u043a \u0445\u043e\u043a\u043a\u0435\u0439 \u0438 \u0444\u0443\u0442\u0431\u043e\u043b, \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0433\u043e\u043b\u043e\u0432 \u0437\u0430 \u0438\u0433\u0440\u0443 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u041f\u0443\u0430\u0441\u0441\u043e\u043d\u0430, \u0430 \u0432\u0440\u0435\u043c\u044f \u043c\u0435\u0436\u0434\u0443 \u0433\u043e\u043b\u0430\u043c\u0438 \u2014 \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c.<\/p>\n<\/li>\n<li>\n<p>\u0412\u0435\u0441 \u043d\u043e\u0432\u043e\u0440\u043e\u0436\u0434\u0435\u043d\u043d\u044b\u0445 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044e, \u0442\u0430\u043a\u0436\u0435 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u043c\u0443 \u0433\u0430\u0443\u0441\u0441\u043e\u0432\u044b\u043c, \u0430 \u0432\u0435\u0441 \u0432\u0437\u0440\u043e\u0441\u043b\u043e\u0433\u043e \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043b\u043e\u0433\u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c.<\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u0430 \u0441\u043b\u0443\u0447\u0430\u0439 \u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u044b \u0441 \u044d\u0442\u0438\u043c\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u0438\u043b\u0438 \u0441 \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u0438\u0437 \u0432\u0438\u0434\u043e\u0432 \u0441\u043f\u043e\u0440\u0442\u0430, \u044f \u0434\u0430\u043c \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0440\u0430\u0437\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u044f. \u041a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u043c\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0441 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u0445\u0435\u043c\u044b \u0438 \u0434\u0430\u043b\u0435\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0447\u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c\u0443 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044e, \u0430 \u0437\u0430\u0442\u0435\u043c \u2014 \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u0447\u043d\u043e \u0441 \u043c\u043e\u0434\u0435\u043b\u044c\u044e \u0441\u043e\u0433\u043b\u0430\u0441\u0443\u044e\u0442\u0441\u044f \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435.<\/p>\n<h4>\u0411\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435<\/h4>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0442\u0430\u043a\u043e\u0439 \u0432\u0438\u0434 \u0441\u043f\u043e\u0440\u0442\u0430, \u043a\u0430\u043a \u0441\u0442\u0435\u043d\u0434\u043e\u0432\u0430\u044f \u0441\u0442\u0440\u0435\u043b\u044c\u0431\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0433\u043b\u0430\u0434\u043a\u043e\u0441\u0442\u0432\u043e\u043b\u044c\u043d\u044b\u0435 \u0440\u0443\u0436\u044c\u044f \u0434\u043b\u044f \u0441\u0442\u0440\u0435\u043b\u044c\u0431\u044b \u043f\u043e \u0433\u043b\u0438\u043d\u044f\u043d\u044b\u043c \u0442\u0430\u0440\u0435\u043b\u043e\u0447\u043a\u0430\u043c, \u043f\u043e\u0434\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u043c\u044b\u043c \u0432 \u0432\u043e\u0437\u0434\u0443\u0445. \u041d\u0430 \u043c\u0435\u0436\u0434\u0443\u043d\u0430\u0440\u043e\u0434\u043d\u044b\u0445 \u0441\u043e\u0440\u0435\u0432\u043d\u043e\u0432\u0430\u043d\u0438\u044f\u0445, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u041e\u043b\u0438\u043c\u043f\u0438\u0439\u0441\u043a\u0438\u0445 \u0438\u0433\u0440\u0430\u0445, \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u044f\u0442\u044c \u0440\u0430\u0443\u043d\u0434\u043e\u0432 \u043f\u043e 25 \u043c\u0438\u0448\u0435\u043d\u0435\u0439 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c. \u041f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u0431\u0435\u0434\u0438\u0442\u0435\u043b\u044f \u043f\u0440\u043e\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0440\u0430\u0443\u043d\u0434\u044b.<\/p>\n<p>\u0412 \u043e\u0441\u043d\u043e\u0432\u0443 \u043c\u043e\u0434\u0435\u043b\u0438 \u0442\u0430\u043a\u0438\u0445 \u0441\u043e\u0440\u0435\u0432\u043d\u043e\u0432\u0430\u043d\u0438\u0439 \u043f\u043e\u043b\u043e\u0436\u0438\u043c \u0434\u043e\u043f\u0443\u0449\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a \u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e, p, \u043f\u043e\u0440\u0430\u0436\u0430\u0435\u0442 \u043a\u0430\u0436\u0434\u0443\u044e \u0438\u0437 \u043c\u0438\u0448\u0435\u043d\u0435\u0439. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u0435\u043c: \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0443 \u043e\u0434\u043d\u0438\u0445 \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u043e\u0432 \u043e\u043d\u0430 \u0432\u044b\u0448\u0435, \u0447\u0435\u043c \u0443 \u0434\u0440\u0443\u0433\u0438\u0445, \u0438 \u0434\u0430\u0436\u0435 \u0443 \u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u0430 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043c\u043e\u0436\u0435\u0442 \u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u043e\u0442 \u043f\u043e\u043f\u044b\u0442\u043a\u0438 \u043a \u043f\u043e\u043f\u044b\u0442\u043a\u0435. \u041d\u043e \u0434\u0430\u0436\u0435 \u043f\u0440\u0438 \u0442\u0430\u043a\u0438\u0445 \u0434\u043e\u043f\u0443\u0449\u0435\u043d\u0438\u044f\u0445 \u044d\u0442\u0430 \u043c\u043e\u0434\u0435\u043b\u044c, \u043a\u0430\u043a \u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435, \u0434\u0435\u043b\u0430\u0435\u0442 \u0443\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0442\u043e\u0447\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u044f.<\/p>\n<p>\u0414\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0446\u0435\u043b\u0435\u0439 (n) \u0438 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u044f \u0432 \u043a\u0430\u0436\u0434\u0443\u044e \u0438\u0437 \u043d\u0438\u0445 (p), \u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438\u0437 \u0435\u0434\u0438\u043d\u0438\u0446 \u0438 \u043d\u0443\u043b\u0435\u0439, \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u044e\u0449\u0438\u0445 \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u044f \u0438 \u043f\u0440\u043e\u043c\u0430\u0445\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e:<\/p>\n<pre><code>def flip(n, p):    choices = [1, 0]    probs = [p, 1 - p]    return np.random.choice(choices, n, p=probs)<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:87px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0440\u0430\u0443\u043d\u0434\u0430 \u0438\u0437 25 \u043c\u0438\u0448\u0435\u043d\u0435\u0439, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u044f \u0432 \u043a\u0430\u0436\u0434\u0443\u044e \u0438\u0437 \u043d\u0438\u0445 \u0440\u0430\u0432\u043d\u0430 90 %:<\/p>\n<pre><code>flip(25, 0.9)array([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,      1, 1, 1])<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0434\u043b\u0438\u043d\u043d\u0443\u044e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 Pmf \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0434\u043e\u043b\u0438 \u0435\u0434\u0438\u043d\u0438\u0446 \u0438 \u043d\u0443\u043b\u0435\u0439 \u0432 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u0432\u0435\u0440\u043d\u044b, \u043f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435 \u043f\u0440\u0438\u0431\u043b\u0438\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u043e:<\/p>\n<pre><code>from empiricaldist import Pmfseq = flip(1000, 0.9)pmf = Pmf.from_seq(seq)pmf<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">\n<\/td>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">0<\/p>\n<\/td>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">0.101<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">1<\/p>\n<\/td>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">0.899<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f (simulate) \u0440\u0430\u0443\u043d\u0434\u0430 \u0441\u0442\u0435\u043d\u0434\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0435\u043b\u044c\u0431\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u043d\u043e\u0432\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0449\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e flip \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0443\u044e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u0439:<\/p>\n<pre><code>def simulate_round(n, p):    seq = flip(n, p)    return seq.sum()<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e \u0432 \u043a\u0440\u0443\u043f\u043d\u043e\u043c \u0441\u043e\u0440\u0435\u0432\u043d\u043e\u0432\u0430\u043d\u0438\u0438 200 \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u043e\u0432 \u0441\u0442\u0440\u0435\u043b\u044f\u044e\u0442 \u043f\u043e 5 \u0440\u0430\u0443\u043d\u0434\u043e\u0432 \u043a\u0430\u0436\u0434\u044b\u0439 \u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u044f \u0432 \u0446\u0435\u043b\u044c, p=0.9. \u041c\u043e\u0436\u0435\u043c \u0441\u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435 \u0441\u043e\u0440\u0435\u0432\u043d\u043e\u0432\u0430\u043d\u0438\u0435, \u0432\u044b\u0437\u0432\u0430\u0432 simulate_round 1000 \u0440\u0430\u0437:<\/p>\n<pre><code>n = 25\u0440 = 0.9results_sim = [simulate_round(n, p) for i in range(1000)]<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0421\u0440\u0435\u0434\u043d\u0438\u0439 \u0431\u0430\u043b\u043b \u0431\u043b\u0438\u0437\u043e\u043a \u043a 22.5 \u2014 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044e n \u043d\u0430 p:<\/p>\n<pre><code>np.mean(results_sim), n * p(22.522, 22.5)<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0412\u043e\u0442 \u043a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432:<\/p>\n<pre><code>from empiricaldist import Pmfpmf_sim = Pmf.from_seq(results_sim, name=\"\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f\")pmf_sim.bar()decorate(xlabel=\"\u041f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u044f\", ylabel=\"\u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\")<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b37\/deb\/62d\/b37deb62d5184cd9d62b77e06744916d.png\" width=\"1094\" height=\"548\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/b37\/deb\/62d\/b37deb62d5184cd9d62b77e06744916d.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b37\/deb\/62d\/b37deb62d5184cd9d62b77e06744916d.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u041c\u0430\u043a\u0441\u0438\u043c\u0443\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0431\u043b\u0438\u0437\u043e\u043a \u043a \u0441\u0440\u0435\u0434\u043d\u0435\u043c\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e, \u0430 \u0441\u0430\u043c\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0441\u043a\u043e\u0448\u0435\u043d\u043e \u0432\u043b\u0435\u0432\u043e.<\/p>\n<p>\u0412\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u044d\u0442\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435. \u041c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u044d\u0442\u0438\u0445 \u0438\u0441\u0445\u043e\u0434\u043e\u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0431\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044e \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043b\u0435\u0433\u043a\u043e \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0442\u044c:<\/p>\n<pre><code>from scipy.special import combdef binomial_pmf(k, n, p):    return comb(n, k) * (p**k) * ((1 - p) ** (n - k))<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0412 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 SciPy \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f comb, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0439 (combinations) \u0438\u0437 n \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0432\u0437\u044f\u0442\u044b\u0445 \u043f\u043e k \u0437\u0430 \u0440\u0430\u0437, \u0447\u0442\u043e \u0447\u0430\u0441\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a\u0430\u043a \u00ab\u0438\u0437 n \u043f\u043e k\u00bb.<\/p>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f binomial_pmf \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c p, \u043f\u043e\u043f\u0430\u0441\u0442\u044c k \u0440\u0430\u0437, \u0441\u0434\u0435\u043b\u0430\u0432 n \u043f\u043e\u043f\u044b\u0442\u043e\u043a. \u0415\u0441\u043b\u0438 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043f\u043e\u0434\u0430\u0432 \u043d\u0430 \u0432\u0445\u043e\u0434 \u043c\u0430\u0441\u0441\u0438\u0432 \u0438\u0437 k \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 Pmf, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0439 \u0441\u043e\u0431\u043e\u0439 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439 \u0438\u0441\u0445\u043e\u0434\u043e\u0432:<\/p>\n<pre><code>ks = np.arange(16, n + 1)ps = binomial_pmf(ks, n, p)pmf_binom = Pmf(ps, ks, name=\"\u0431\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c\")<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0418 \u0432\u043e\u0442 \u043a\u0430\u043a \u043e\u043d\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u0441 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c\u0438 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f:<\/p>\n<pre><code>from thinkstats import two_bar_plotstwo_bar_plots(pmf_sim, pmf_binom)decorate(xlabel=\"\u041f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u044f\", ylabel=\"\u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\")<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/79c\/fe6\/e43\/79cfe6e439349bf61f56d3c8da2e8983.png\" width=\"1087\" height=\"547\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/79c\/fe6\/e43\/79cfe6e439349bf61f56d3c8da2e8983.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/79c\/fe6\/e43\/79cfe6e439349bf61f56d3c8da2e8983.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0441\u0445\u043e\u0434\u043d\u044b, \u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u044f \u0432\u044b\u0437\u0432\u0430\u043d\u044b \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c\u0438 \u0432\u0430\u0440\u0438\u0430\u0446\u0438\u044f\u043c\u0438 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u0445 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u042d\u0442\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0443\u0434\u0438\u0432\u043b\u0435\u043d\u0438\u044f, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0438 \u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0435 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u0438 \u0431\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u043e\u043f\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u043e\u0434\u043d\u0438 \u0438 \u0442\u0435 \u0436\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u0430\u044f \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u0438\u043c\u0435\u0435\u0442 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u0443\u044e \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0443\u0441\u043f\u0435\u0445\u0430. \u0411\u043e\u043b\u0435\u0435 \u0441\u0442\u0440\u043e\u0433\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0431\u0443\u0434\u0435\u0442 \u0435\u0435 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438.<\/p>\n<p>\u041d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0432\u0438\u043a\u0438\u043f\u0435\u0434\u0438\u0438, \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u043d\u043e\u0439 \u0441\u043e\u0440\u0435\u0432\u043d\u043e\u0432\u0430\u043d\u0438\u044f\u043c \u043f\u043e \u0441\u0442\u0435\u043d\u0434\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0435\u043b\u044c\u0431\u0435 \u0441\u0440\u0435\u0434\u0438 \u043c\u0443\u0436\u0447\u0438\u043d \u043d\u0430 \u043b\u0435\u0442\u043d\u0438\u0445 \u041e\u043b\u0438\u043c\u043f\u0438\u0439\u0441\u043a\u0438\u0445 \u0438\u0433\u0440\u0430\u0445 2020 \u0433\u043e\u0434\u0430, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0441 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c\u0438 \u043a\u0432\u0430\u043b\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0440\u0430\u0443\u043d\u0434\u043e\u0432. \u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043f\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u0432 Jupyter-\u0431\u043b\u043e\u043a\u043d\u043e\u0442\u0435 \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u0433\u043b\u0430\u0432\u044b.<\/p>\n<pre><code>filename = \"Shooting_at_the_2020_Summer_Olympics_Mens_skeet\"<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<pre><code>tables = pd.read_html(filename)table = tables[6]table.head()<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">\n<\/td>\n<td data-colwidth=\"95\" width=\"95\">\n<p>Rank (\u041c\u0435\u0441\u0442\u043e)<\/p>\n<\/td>\n<td>\n<p>Athlete (\u0421\u043f\u043e\u0440\u0442\u0441\u043c\u0435\u043d)<\/p>\n<\/td>\n<td data-colwidth=\"102\" width=\"102\">\n<p>Country (\u0421\u0442\u0440\u0430\u043d\u0430)<\/p>\n<\/td>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">1<\/p>\n<\/td>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">2<\/p>\n<\/td>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">3<\/p>\n<\/td>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">4<\/p>\n<\/td>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">5<\/p>\n<\/td>\n<td data-colwidth=\"89\" width=\"89\">\n<p>Total[3] (\u0418\u0442\u043e\u0433\u043e)<\/p>\n<\/td>\n<td data-colwidth=\"100\" width=\"100\">\n<p>Shoot-off (\u041f\u0435\u0440\u0435\u0441\u0442\u0440\u0435\u043b\u043a\u0430)<\/p>\n<\/td>\n<td>\n<p>Notes (\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u044f)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">0<\/p>\n<\/td>\n<td data-colwidth=\"95\" width=\"95\">\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u00c9ric Delaunay<\/p>\n<\/td>\n<td data-colwidth=\"102\" width=\"102\">\n<p align=\"left\">France<\/p>\n<\/td>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">25<\/p>\n<\/td>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">25<\/p>\n<\/td>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">25<\/p>\n<\/td>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">24<\/p>\n<\/td>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">25<\/p>\n<\/td>\n<td data-colwidth=\"89\" width=\"89\">\n<p align=\"left\">124<\/p>\n<\/td>\n<td data-colwidth=\"100\" width=\"100\">\n<p align=\"left\">+6<\/p>\n<\/td>\n<td>\n<p align=\"left\">Q, OR<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">1<\/p>\n<\/td>\n<td data-colwidth=\"95\" width=\"95\">\n<p align=\"left\">2<\/p>\n<\/td>\n<td>\n<p align=\"left\">Tammaro Cassandro<\/p>\n<\/td>\n<td data-colwidth=\"102\" width=\"102\">\n<p align=\"left\">Italy<\/p>\n<\/td>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">24<\/p>\n<\/td>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">25<\/p>\n<\/td>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">25<\/p>\n<\/td>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">25<\/p>\n<\/td>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">25<\/p>\n<\/td>\n<td data-colwidth=\"89\" width=\"89\">\n<p align=\"left\">124<\/p>\n<\/td>\n<td data-colwidth=\"100\" width=\"100\">\n<p align=\"left\">+5<\/p>\n<\/td>\n<td>\n<p align=\"left\">Q, OR<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">2<\/p>\n<\/td>\n<td data-colwidth=\"95\" width=\"95\">\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">Eetu Kallioinen<\/p>\n<\/td>\n<td data-colwidth=\"102\" width=\"102\">\n<p align=\"left\">Finland<\/p>\n<\/td>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">25<\/p>\n<\/td>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">25<\/p>\n<\/td>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">24<\/p>\n<\/td>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">25<\/p>\n<\/td>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">24<\/p>\n<\/td>\n<td data-colwidth=\"89\" width=\"89\">\n<p align=\"left\">123<\/p>\n<\/td>\n<td data-colwidth=\"100\" width=\"100\">\n<p align=\"left\">NaN<\/p>\n<\/td>\n<td>\n<p align=\"left\">Q<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">3<\/p>\n<\/td>\n<td data-colwidth=\"95\" width=\"95\">\n<p align=\"left\">4<\/p>\n<\/td>\n<td>\n<p align=\"left\">Vincent Hancock<\/p>\n<\/td>\n<td data-colwidth=\"102\" width=\"102\">\n<p>United<\/p>\n<p>States<\/p>\n<\/td>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">25<\/p>\n<\/td>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">25<\/p>\n<\/td>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">25<\/p>\n<\/td>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">25<\/p>\n<\/td>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">22<\/p>\n<\/td>\n<td data-colwidth=\"89\" width=\"89\">\n<p align=\"left\">122<\/p>\n<\/td>\n<td data-colwidth=\"100\" width=\"100\">\n<p align=\"left\">+8<\/p>\n<\/td>\n<td>\n<p align=\"left\">Q<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">4<\/p>\n<\/td>\n<td data-colwidth=\"95\" width=\"95\">\n<p align=\"left\">5<\/p>\n<\/td>\n<td>\n<p align=\"left\">Abdullah Al-Rashidi<\/p>\n<\/td>\n<td data-colwidth=\"102\" width=\"102\">\n<p align=\"left\">Kuwait<\/p>\n<\/td>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">25<\/p>\n<\/td>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">25<\/p>\n<\/td>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">24<\/p>\n<\/td>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">25<\/p>\n<\/td>\n<td data-colwidth=\"50\" width=\"50\">\n<p align=\"left\">23<\/p>\n<\/td>\n<td data-colwidth=\"89\" width=\"89\">\n<p align=\"left\">122<\/p>\n<\/td>\n<td data-colwidth=\"100\" width=\"100\">\n<p align=\"left\">+7<\/p>\n<\/td>\n<td>\n<p align=\"left\">Q<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0412 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u043f\u043e \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u0430 \u0438 \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u0441\u0442\u043e\u043b\u0431\u0446\u0443 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u043f\u044f\u0442\u0438 \u0440\u0430\u0443\u043d\u0434\u043e\u0432. \u0412\u044b\u0431\u0435\u0440\u0435\u043c \u0441\u0442\u043e\u043b\u0431\u0446\u044b \u0441 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c\u0438 \u0440\u0430\u0443\u043d\u0434\u043e\u0432 \u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e NumPy-\u0444\u0443\u043d\u043a\u0446\u0438\u0438 flatten \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043e\u0434\u043d\u043e\u043c\u0435\u0440\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432:<\/p>\n<pre><code>columns = [\"1\", \"2\", \"3\", \"4\", \"5\"]results = table[columns].values.flatten()<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0414\u043b\u044f 30 \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u043e\u0432 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b 150 \u0440\u0430\u0443\u043d\u0434\u043e\u0432, \u043f\u043e 25 \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u043e\u0432 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u2014 \u0432\u0441\u0435\u0433\u043e 3574 \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u0439 (hits) \u043f\u0440\u0438 3750 \u043f\u043e\u043f\u044b\u0442\u043a\u0430\u0445 (shots):<\/p>\n<pre><code>total_shots = 25 * len(results)total_hits = results.sum()n, total_shots, total_hits(25, 3750, 3575)<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0434\u043e\u043b\u044f \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u0445 \u043f\u043e\u043f\u044b\u0442\u043e\u043a \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 95,3 %:<\/p>\n<pre><code>p = total_hits \/ total_shotsp0.9533333333333334<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043e\u0431\u044a\u0435\u043a\u0442 Pmf \u0434\u043b\u044f \u0431\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0441 n = 25 \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c p:<\/p>\n<pre><code>ps = binomial_pmf(ks, n, p)pmf_binom = Pmf(ps, ks, name=\"\u0431\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c\")<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0441 Pmf \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432:<\/p>\n<pre><code>pmf_results = Pmf.from_seq(results, name=\"\u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b\")two_bar_plots(pmf_results, pmf_binom)decorate(xlabel=\"\u041f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u044f\", ylabel=\"\u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\")<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/729\/df9\/df3\/729df9df3f871e14a387566b0dca7f19.png\" width=\"1083\" height=\"539\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/729\/df9\/df3\/729df9df3f871e14a387566b0dca7f19.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/729\/df9\/df3\/729df9df3f871e14a387566b0dca7f19.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0431\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0445\u043e\u0440\u043e\u0448\u0435\u0439 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0435\u0439 \u0434\u0430\u043d\u043d\u044b\u0445, \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u043d\u0435\u0440\u0435\u0430\u043b\u0438\u0441\u0442\u0438\u0447\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0432\u0441\u0435\u0445 \u0441\u043f\u043e\u0440\u0442\u0441\u043c\u0435\u043d\u043e\u0432 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b \u0438 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b.<\/p>\n<h4>\u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u041f\u0443\u0430\u0441\u0441\u043e\u043d\u0430<\/h4>\n<p>\u0414\u0440\u0443\u0433\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u0441\u043f\u043e\u0440\u0442\u0438\u0432\u043d\u044b\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432, \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043b\u0435\u0433\u043a\u043e \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0441\u043b\u0443\u0436\u0438\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0448\u0430\u0439\u0431, \u0437\u0430\u0431\u0438\u0442\u044b\u0445 \u0432 \u0445\u043e\u043a\u043a\u0435\u0439\u043d\u044b\u0445 \u043c\u0430\u0442\u0447\u0430\u0445.<\/p>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u0433\u0440\u044b \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e 60 \u043c\u0438\u043d\u0443\u0442 (3600 \u0441\u0435\u043a\u0443\u043d\u0434), \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0447\u0442\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0437\u0430\u0431\u0438\u0432\u0430\u044e\u0442 \u0432 \u0441\u0440\u0435\u0434\u043d\u0435\u043c \u043f\u043e 6 \u0448\u0430\u0439\u0431 \u0437\u0430 \u0438\u0433\u0440\u0443 \u0438 \u0447\u0442\u043e \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u0431\u0440\u043e\u0448\u0435\u043d\u043d\u043e\u0439 \u0448\u0430\u0439\u0431\u044b \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443, p, \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u0430 \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438:<\/p>\n<pre><code>n = 3600m = 6p = m \/ 3600p0.0016666666666666668<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0422\u043e\u0433\u0434\u0430 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f n \u0441\u0435\u043a\u0443\u043d\u0434 \u0438\u0433\u0440\u044b \u0438 \u043f\u043e\u0434\u0441\u0447\u0435\u0442\u0430 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0437\u0430\u0431\u0440\u043e\u0448\u0435\u043d\u043d\u044b\u0445 \u0437\u0430 \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u0448\u0430\u0439\u0431 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e:<\/p>\n<pre><code>def simulate_goals(n, p):    return flip(n, p).sum()<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 \u0438\u0433\u0440, \u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442, \u0447\u0442\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0448\u0430\u0439\u0431 \u0437\u0430 \u0438\u0433\u0440\u0443 \u0431\u043b\u0438\u0437\u043a\u043e \u043a 6:<\/p>\n<pre><code>goals = [simulate_goals(n, p) for i in range(1001)]np.mean(goals)6.021978021978022<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0414\u043b\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u044d\u0442\u0438\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435, \u043d\u043e, \u043a\u043e\u0433\u0434\u0430 n \u0432\u0435\u043b\u0438\u043a\u043e, \u0430 p \u043c\u0430\u043b\u043e, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0442\u0430\u043a\u0436\u0435 \u0445\u043e\u0440\u043e\u0448\u043e \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u041f\u0443\u0430\u0441\u0441\u043e\u043d\u0430. \u041e\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c, \u043e\u0431\u044b\u0447\u043d\u043e \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u043c\u044b\u043c \u0433\u0440\u0435\u0447\u0435\u0441\u043a\u043e\u0439 \u0431\u0443\u043a\u0432\u043e\u0439 \u03bb (\u00ab\u043b\u044f\u043c\u0431\u0434\u0430\u00bb). \u0412 \u043a\u043e\u0434\u0435 \u043d\u0438\u0436\u0435 \u044d\u0442\u043e\u043c\u0443 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0443 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f lam (lambda \u043d\u0435\u043b\u044c\u0437\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u043c\u0435\u043d\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0432 Python, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u044d\u0442\u043e \u0437\u0430\u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0441\u043b\u043e\u0432\u043e). lam \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438, \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0439 6 \u0433\u043e\u043b\u043e\u0432 \u0437\u0430 \u0438\u0433\u0440\u0443.<\/p>\n<p>\u0424\u0412 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u041f\u0443\u0430\u0441\u0441\u043e\u043d\u0430 \u043b\u0435\u0433\u043a\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c. \u0418\u043c\u0435\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 lam, \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0432 \u0438\u0433\u0440\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0431\u0438\u0442\u043e k \u0433\u043e\u043b\u043e\u0432, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e:<\/p>\n<pre><code>from scipy.special import factorialdef poisson_pmf(k, lam):    return (lam**k) * np.exp(-lam) \/ factorial(k)<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0412 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 SciPy \u0435\u0441\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044f factorial, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \u043e\u0442 1 \u0434\u043e k.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b\u0437\u0432\u0430\u0442\u044c poisson_pmf, \u0443\u043a\u0430\u0437\u0430\u0432 \u043c\u0430\u0441\u0441\u0438\u0432 k \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 Pmf, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0439 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0438\u0441\u0445\u043e\u0434\u043e\u0432:<\/p>\n<pre><code>lam = 6ks = np.arange(20)ps = poisson_pmf(ks, lam)pmf_poisson = Pmf(ps, ks, name=\"\u043f\u0443\u0430\u0441\u0441\u043e\u043d\u043e\u0432\u0441\u043a\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c\")<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0410 \u0442\u0430\u043a\u0436\u0435 \u043b\u0435\u0433\u043a\u043e \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044c, \u0447\u0442\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0431\u043b\u0438\u0437\u043a\u043e \u043a 6:<\/p>\n<pre><code>pmf_poisson.normalize()pmf_poisson.mean()5.999925498375129<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u0440\u0430\u0432\u043d\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u041f\u0443\u0430\u0441\u0441\u043e\u043d\u0430 \u0441 \u0442\u0435\u043c \u0436\u0435 \u0441\u0440\u0435\u0434\u043d\u0438\u043c:<\/p>\n<pre><code>pmf_sim = Pmf.from_seq(goals, name=\"\u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\")two_bar_plots(pmf_sim, pmf_poisson)decorate(xlabel=\"\u0428\u0430\u0439\u0431\u044b\", ylabel=\"\u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\")<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/815\/26f\/9e8\/81526f9e88105af2150a8430a8747d0a.png\" width=\"1073\" height=\"547\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/815\/26f\/9e8\/81526f9e88105af2150a8430a8747d0a.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/815\/26f\/9e8\/81526f9e88105af2150a8430a8747d0a.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u0445\u043e\u0436\u0438, \u0435\u0441\u043b\u0438 \u043d\u0435 \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u0439 \u0438\u0437-\u0437\u0430 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0439 \u0438\u0437\u043c\u0435\u043d\u0447\u0438\u0432\u043e\u0441\u0442\u0438. \u0418 \u044d\u0442\u043e\u043d\u0435 \u0443\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0432\u0435\u0434\u044c \u0432 \u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u041f\u0443\u0430\u0441\u0441\u043e\u043d\u0430 \u043b\u0435\u0436\u0438\u0442 \u043e\u0434\u043d\u043e \u0438 \u0442\u043e \u0436\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u0448\u0430\u0439\u0431\u0430 \u0441 \u0440\u0430\u0432\u043d\u043e\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e \u0437\u0430\u0431\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0437\u0430 \u043b\u044e\u0431\u0443\u044e \u0441\u0435\u043a\u0443\u043d\u0434\u0443 \u0438\u0433\u0440\u044b. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u043e\u043b\u0435\u0435 \u0441\u0442\u0440\u043e\u0433\u0438\u043c \u0442\u0435\u0441\u0442\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0442\u043e\u0433\u043e, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u0447\u043d\u043e \u043c\u043e\u0434\u0435\u043b\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u043c \u0434\u0430\u043d\u043d\u044b\u043c.<\/p>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u044f \u0441\u043a\u0430\u0447\u0430\u043b \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432\u0441\u0435\u0445 \u0438\u0433\u0440 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0433\u043e \u0447\u0435\u043c\u043f\u0438\u043e\u043d\u0430\u0442\u0430 \u041d\u0430\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0445\u043e\u043a\u043a\u0435\u0439\u043d\u043e\u0439 \u043b\u0438\u0433\u0438 (\u041d\u0425\u041b) 2023\u20132024 \u0433\u043e\u0434\u043e\u0432 (\u0431\u0435\u0437 \u0438\u0433\u0440 \u043f\u043b\u0435\u0439-\u043e\u0444\u0444) \u0441 \u0441\u0430\u0439\u0442\u0430 HockeyReference. \u0414\u0430\u043b\u0435\u0435 \u044f \u0438\u0437\u0432\u043b\u0435\u043a \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0448\u0430\u0439\u0431\u0430\u0445, \u0437\u0430\u0431\u0438\u0442\u044b\u0445 \u0437\u0430 60 \u043c\u0438\u043d\u0443\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043c\u0430\u0442\u0447\u0430, \u0431\u0435\u0437 \u0443\u0447\u0435\u0442\u0430 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u0441\u0435\u0440\u0438\u0438 \u0431\u0443\u043b\u043b\u0438\u0442\u043e\u0432. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u0444\u0430\u0439\u043b\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u0430 HDF, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u0434\u0438\u043d \u043a\u043b\u044e\u0447 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043e\u0434\u043d\u043e\u0439 \u0438\u0433\u0440\u0435. \u041f\u043e \u043a\u043b\u044e\u0447\u0443 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u0432 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0430\u0445 \u0441 \u043d\u0430\u0447\u0430\u043b\u0430 \u0438\u0433\u0440\u044b, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u043b\u0438 \u0437\u0430\u0431\u0440\u043e\u0448\u0435\u043d\u044b \u0448\u0430\u0439\u0431\u044b. \u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043f\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u0432 Jupyter-\u0431\u043b\u043e\u043a\u043d\u043e\u0442\u0435 \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u0433\u043b\u0430\u0432\u044b.<\/p>\n<p>\u0412\u043e\u0442 \u043a\u0430\u043a \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u043a\u043b\u044e\u0447\u0438 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430:<\/p>\n<pre><code>filename = \"nhl_2023_2024.hdf\"with pd.HDFStore(filename, \"r\") as store:    keys = store.keys()len(keys), keys[0](1312, '\/202310100PIT')<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0412 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u043c \u0441\u0435\u0437\u043e\u043d\u0435 \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u043e 1312 \u0438\u0433\u0440. \u041a\u0430\u0436\u0434\u044b\u0439 \u043a\u043b\u044e\u0447 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0434\u0430\u0442\u0443 \u0438\u0433\u0440\u044b \u0438 \u0430\u0431\u0431\u0440\u0435\u0432\u0438\u0430\u0442\u0443\u0440\u0443 \u0438\u0437 \u0442\u0440\u0435\u0445 \u0431\u0443\u043a\u0432, \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u044e\u0449\u0443\u044e \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443. \u0424\u0443\u043d\u043a\u0446\u0438\u044f read_hdf \u043f\u043e \u043a\u043b\u044e\u0447\u0443 \u0432\u044b\u0434\u0430\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u0432 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0434\u043b\u044f \u0437\u0430\u0431\u0438\u0442\u044b\u0445 \u0448\u0430\u0439\u0431:<\/p>\n<pre><code>times = pd.read_hdf(filename, key=keys[0])times0     4241    19162    21373    30054    33295    3513dtype: int64<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0412 \u043f\u0435\u0440\u0432\u043e\u0439 \u0438\u0433\u0440\u0435 \u0441\u0435\u0437\u043e\u043d\u0430 \u0431\u044b\u043b\u043e \u0437\u0430\u0431\u0438\u0442\u043e \u0448\u0435\u0441\u0442\u044c \u0448\u0430\u0439\u0431: \u043f\u0435\u0440\u0432\u0430\u044f \u2014 \u043f\u043e\u0441\u043b\u0435 424 \u0441\u0435\u043a\u0443\u043d\u0434 \u0438\u0433\u0440\u044b, \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u2014 \u043f\u043e\u0441\u043b\u0435 3513 \u0441\u0435\u043a\u0443\u043d\u0434, \u0432\u0441\u0435\u0433\u043e \u0437\u0430 87 \u0441\u0435\u043a\u0443\u043d\u0434 \u0434\u043e \u043a\u043e\u043d\u0446\u0430 \u0438\u0433\u0440\u044b.<\/p>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0446\u0438\u043a\u043b \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432\u0441\u0435\u0445 \u0438\u0433\u0440, \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0448\u0430\u0439\u0431 \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0437 \u043d\u0438\u0445 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432 \u0432\u0438\u0434\u0435 \u0441\u043f\u0438\u0441\u043a\u0430:<\/p>\n<pre><code>goals = []for key in keys:    times = pd.read_hdf(filename, key=key)    n = len(times)    goals.append(n)<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0421\u0440\u0435\u0434\u043d\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0448\u0430\u0439\u0431 \u0437\u0430 \u0438\u0433\u0440\u0443 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0435\u0442 6:<\/p>\n<pre><code>lam = np.mean(goals)lam6.0182926829268295<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0412\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 poisson_pmf \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430 Pmf, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0435\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u041f\u0443\u0430\u0441\u0441\u043e\u043d\u0430 \u0441 \u0442\u0435\u043c \u0436\u0435 \u0441\u0440\u0435\u0434\u043d\u0438\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c, \u0447\u0442\u043e \u0438 \u0434\u0430\u043d\u043d\u044b\u0435:<\/p>\n<pre><code>ps = poisson_pmf(ks, lam)pmf_poisson = Pmf(ps, ks, name=\"\u043f\u0443\u0430\u0441\u0441\u043e\u043d\u043e\u0432\u0441\u043a\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c\")<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0418 \u0432\u043e\u0442 \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u0441 \u0424\u0412 \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<pre><code>pmf_goals = Pmf.from_seq(goals, name=\"\u0437\u0430\u0431\u0438\u0442\u044b\u0435 \u0448\u0430\u0439\u0431\u044b\")two_bar_plots(pmf_goals, pmf_poisson)decorate(xlabel=\"\u0428\u0430\u0439\u0431\u044b\", ylabel=\"\u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\")<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c47\/b7d\/794\/c47b7d7940458fe19d0b3e00afe182bb.png\" width=\"1085\" height=\"551\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/c47\/b7d\/794\/c47b7d7940458fe19d0b3e00afe182bb.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c47\/b7d\/794\/c47b7d7940458fe19d0b3e00afe182bb.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u041f\u0443\u0430\u0441\u0441\u043e\u043d\u0430 \u0445\u043e\u0440\u043e\u0448\u043e \u0441\u043e\u0433\u043b\u0430\u0441\u0443\u0435\u0442\u0441\u044f \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u0447\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u044d\u0442\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u0442\u043e\u0447\u043d\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0437\u0430\u0431\u0438\u0432\u0430\u043d\u0438\u044f \u0448\u0430\u0439\u0431 \u0432 \u0445\u043e\u043a\u043a\u0435\u0435.<\/p>\n<hr\/>\n<p>\u041e\u0444\u043e\u0440\u043c\u0438\u0442\u044c \u043f\u0440\u0435\u0434\u0437\u0430\u043a\u0430\u0437 \u043d\u0430 \u043a\u043d\u0438\u0433\u0443: \u00ab\u0414\u0443\u043c\u0430\u0439 \u043a\u0430\u043a \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a. \u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u043d\u0430 Python. 3-\u0435 \u0438\u0437\u0434.\u00bb \u043c\u043e\u0436\u043d\u043e\u00a0<a href=\"https:\/\/www.piter.com\/collection\/soon\/product\/dumay-kak-analitik-statistika-i-dannye-s-primerami-na-python-3-e-izd\">\u043d\u0430 \u043d\u0430\u0448\u0435\u043c \u0441\u0430\u0439\u0442\u0435.<\/a><\/p>\n<p>\u0421\u043a\u0438\u0434\u043a\u0430 35% \u043f\u043e \u043f\u0440\u043e\u043c\u043e\u043a\u043e\u0434\u0443 &#8212;<strong>\u00a0\u041f\u0440\u0435\u0434\u0437\u0430\u043a\u0430\u0437<\/strong><\/p>\n<\/div>\n<p>\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/1045935\/\">https:\/\/habr.com\/ru\/articles\/1045935\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440\u043e\u0436\u0438\u0442\u0435\u043b\u0438!\u041c\u044b \u043e\u0442\u043a\u0440\u044b\u043b\u0438 \u043f\u0440\u0435\u0434\u0437\u0430\u043a\u0430\u0437 \u043d\u0430 \u043a\u043d\u0438\u0433\u0443 \u00ab\u0414\u0443\u043c\u0430\u0439 \u043a\u0430\u043a \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a. \u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u043d\u0430 Python. 3-\u0435 \u0438\u0437\u0434.\u00bb, \u0445\u043e\u0442\u0438\u043c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0430\u043c \u043e \u043d\u0435\u0439 \u0438 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c \u043e\u0442\u0440\u044b\u0432\u043a\u043e\u043c.   \u041c\u043d\u043e\u0433\u0438\u0435 \u0431\u0440\u043e\u0441\u0430\u044e\u0442 Data Science \u0438\u0437-\u0437\u0430 \u0430\u043a\u0430\u0434\u0435\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u0441 \u0435\u0451 \u0433\u0440\u043e\u043c\u043e\u0437\u0434\u043a\u0438\u043c\u0438 \u0444\u043e\u0440\u043c\u0443\u043b\u0430\u043c\u0438. \u041d\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u0443\u0436\u0435 \u0437\u043d\u0430\u0435\u0442\u0435 Python, \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e. \u041a\u043e\u0434 \u2014 \u044d\u0442\u043e \u0432\u0441\u0451, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438.\u0412 \u043a\u043d\u0438\u0433\u0435 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u043d\u0435 \u043a\u0430\u043a \u0441\u0443\u0445\u0430\u044f \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0430, \u0430 \u043a\u0430\u043a \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0439 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441.\u0427\u0442\u043e \u0432\u043d\u0443\u0442\u0440\u0438?\u0420\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u043f\u044b\u0442: \u0412\u0435\u0441\u044c \u0446\u0438\u043a\u043b \u0440\u0430\u0437\u0432\u0435\u0434\u043e\u0447\u043d\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 (EDA) \u043e\u0442 \u043e\u0447\u0438\u0441\u0442\u043a\u0438 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u043e\u0432 \u0434\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0433\u0438\u043f\u043e\u0442\u0435\u0437 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445.\u0410\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0442\u0435\u043a: \u0411\u044b\u0441\u0442\u0440\u043e\u0435 \u043f\u043e\u0433\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0432 Pandas, NumPy, SciPy \u0438 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0434\u0430\u043d\u043d\u044b\u0445.\u0418\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c: \u0412\u0441\u0435 \u0433\u043b\u0430\u0432\u044b \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0432 \u0432\u0438\u0434\u0435 Jupyter-\u0431\u043b\u043e\u043a\u043d\u043e\u0442\u043e\u0432 \u2014 \u043c\u043e\u0436\u043d\u043e \u0447\u0438\u0442\u0430\u0442\u044c, \u0441\u0440\u0430\u0437\u0443 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043a\u043e\u0434 \u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u0443\u043f\u0440\u0430\u0436\u043d\u0435\u043d\u0438\u044f \u0432 \u043e\u0434\u043d\u043e\u043c \u043e\u043a\u043d\u0435.\u041a\u043d\u0438\u0433\u0430 \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c, \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0430\u043c \u0438 \u0432\u0441\u0435\u043c, \u043a\u0442\u043e \u0445\u043e\u0447\u0435\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0446\u0438\u0444\u0440, \u0430 \u043d\u0435 \u0438\u043d\u0442\u0443\u0438\u0446\u0438\u0438.\u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043c\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440, \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u044d\u043c\u043f\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u043d\u0438 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u044b \u043d\u0430 \u044d\u043c\u043f\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f\u0445, \u0438\u043b\u0438, \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0445. \u041c\u043d\u043e\u0433\u0438\u0435 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u044b, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043c\u044b \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u043c\u0441\u044f \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435, \u043c\u043e\u0436\u043d\u043e \u0442\u043e\u0447\u043d\u043e \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439, \u043e\u0431\u044b\u0447\u043d\u043e \u0437\u0430\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0445 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0444\u043e\u0440\u043c\u0443\u043b\u043e\u0439. \u0412 \u044d\u0442\u043e\u0439 \u0433\u043b\u0430\u0432\u0435 \u0432\u044b \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u0435\u0441\u044c \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0438\u0437 \u0442\u0430\u043a\u0438\u0445 \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439 \u0438 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441 \u0438\u0445 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043e\u0436\u043d\u043e \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c.\u0412\u044b \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u0443\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c:\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u0439 \u0438 \u043f\u0440\u043e\u043c\u0430\u0445\u043e\u0432 \u0432 \u0441\u043e\u0440\u0435\u0432\u043d\u043e\u0432\u0430\u043d\u0438\u044f\u0445 \u043f\u043e \u0441\u0442\u0435\u043d\u0434\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0435\u043b\u044c\u0431\u0435 \u0445\u043e\u0440\u043e\u0448\u043e \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f.\u0412 \u0442\u0430\u043a\u0438\u0445 \u0441\u043f\u043e\u0440\u0442\u0438\u0432\u043d\u044b\u0445 \u0438\u0433\u0440\u0430\u0445, \u043a\u0430\u043a \u0445\u043e\u043a\u043a\u0435\u0439 \u0438 \u0444\u0443\u0442\u0431\u043e\u043b, \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0433\u043e\u043b\u043e\u0432 \u0437\u0430 \u0438\u0433\u0440\u0443 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u041f\u0443\u0430\u0441\u0441\u043e\u043d\u0430, \u0430 \u0432\u0440\u0435\u043c\u044f \u043c\u0435\u0436\u0434\u0443 \u0433\u043e\u043b\u0430\u043c\u0438 \u2014 \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c.\u0412\u0435\u0441 \u043d\u043e\u0432\u043e\u0440\u043e\u0436\u0434\u0435\u043d\u043d\u044b\u0445 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044e, \u0442\u0430\u043a\u0436\u0435 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u043c\u0443 \u0433\u0430\u0443\u0441\u0441\u043e\u0432\u044b\u043c, \u0430 \u0432\u0435\u0441 \u0432\u0437\u0440\u043e\u0441\u043b\u043e\u0433\u043e \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043b\u043e\u0433\u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c.\u041d\u0430 \u0441\u043b\u0443\u0447\u0430\u0439 \u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u044b \u0441 \u044d\u0442\u0438\u043c\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u0438\u043b\u0438 \u0441 \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u0438\u0437 \u0432\u0438\u0434\u043e\u0432 \u0441\u043f\u043e\u0440\u0442\u0430, \u044f \u0434\u0430\u043c \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0440\u0430\u0437\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u044f. \u041a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u043c\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0441 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u0445\u0435\u043c\u044b \u0438 \u0434\u0430\u043b\u0435\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0447\u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c\u0443 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044e, \u0430 \u0437\u0430\u0442\u0435\u043c \u2014 \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u0447\u043d\u043e \u0441 \u043c\u043e\u0434\u0435\u043b\u044c\u044e \u0441\u043e\u0433\u043b\u0430\u0441\u0443\u044e\u0442\u0441\u044f \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435.\u0411\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0442\u0430\u043a\u043e\u0439 \u0432\u0438\u0434 \u0441\u043f\u043e\u0440\u0442\u0430, \u043a\u0430\u043a \u0441\u0442\u0435\u043d\u0434\u043e\u0432\u0430\u044f \u0441\u0442\u0440\u0435\u043b\u044c\u0431\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0433\u043b\u0430\u0434\u043a\u043e\u0441\u0442\u0432\u043e\u043b\u044c\u043d\u044b\u0435 \u0440\u0443\u0436\u044c\u044f \u0434\u043b\u044f \u0441\u0442\u0440\u0435\u043b\u044c\u0431\u044b \u043f\u043e \u0433\u043b\u0438\u043d\u044f\u043d\u044b\u043c \u0442\u0430\u0440\u0435\u043b\u043e\u0447\u043a\u0430\u043c, \u043f\u043e\u0434\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u043c\u044b\u043c \u0432 \u0432\u043e\u0437\u0434\u0443\u0445. \u041d\u0430 \u043c\u0435\u0436\u0434\u0443\u043d\u0430\u0440\u043e\u0434\u043d\u044b\u0445 \u0441\u043e\u0440\u0435\u0432\u043d\u043e\u0432\u0430\u043d\u0438\u044f\u0445, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u041e\u043b\u0438\u043c\u043f\u0438\u0439\u0441\u043a\u0438\u0445 \u0438\u0433\u0440\u0430\u0445, \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u044f\u0442\u044c \u0440\u0430\u0443\u043d\u0434\u043e\u0432 \u043f\u043e 25 \u043c\u0438\u0448\u0435\u043d\u0435\u0439 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c. \u041f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u0431\u0435\u0434\u0438\u0442\u0435\u043b\u044f \u043f\u0440\u043e\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0440\u0430\u0443\u043d\u0434\u044b.\u0412 \u043e\u0441\u043d\u043e\u0432\u0443 \u043c\u043e\u0434\u0435\u043b\u0438 \u0442\u0430\u043a\u0438\u0445 \u0441\u043e\u0440\u0435\u0432\u043d\u043e\u0432\u0430\u043d\u0438\u0439 \u043f\u043e\u043b\u043e\u0436\u0438\u043c \u0434\u043e\u043f\u0443\u0449\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a \u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e, p, \u043f\u043e\u0440\u0430\u0436\u0430\u0435\u0442 \u043a\u0430\u0436\u0434\u0443\u044e \u0438\u0437 \u043c\u0438\u0448\u0435\u043d\u0435\u0439. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u0435\u043c: \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0443 \u043e\u0434\u043d\u0438\u0445 \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u043e\u0432 \u043e\u043d\u0430 \u0432\u044b\u0448\u0435, \u0447\u0435\u043c \u0443 \u0434\u0440\u0443\u0433\u0438\u0445, \u0438 \u0434\u0430\u0436\u0435 \u0443 \u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u0430 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043c\u043e\u0436\u0435\u0442 \u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u043e\u0442 \u043f\u043e\u043f\u044b\u0442\u043a\u0438 \u043a \u043f\u043e\u043f\u044b\u0442\u043a\u0435. \u041d\u043e \u0434\u0430\u0436\u0435 \u043f\u0440\u0438 \u0442\u0430\u043a\u0438\u0445 \u0434\u043e\u043f\u0443\u0449\u0435\u043d\u0438\u044f\u0445 \u044d\u0442\u0430 \u043c\u043e\u0434\u0435\u043b\u044c, \u043a\u0430\u043a \u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435, \u0434\u0435\u043b\u0430\u0435\u0442 \u0443\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0442\u043e\u0447\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u044f.\u0414\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0446\u0435\u043b\u0435\u0439 (n) \u0438 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u044f \u0432 \u043a\u0430\u0436\u0434\u0443\u044e \u0438\u0437 \u043d\u0438\u0445 (p), \u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438\u0437 \u0435\u0434\u0438\u043d\u0438\u0446 \u0438 \u043d\u0443\u043b\u0435\u0439, \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u044e\u0449\u0438\u0445 \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u044f \u0438 \u043f\u0440\u043e\u043c\u0430\u0445\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e:def flip(n, p):    choices = [1, 0]    probs = [p, 1 &#8212; p]    return np.random.choice(choices, n, p=probs)\u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0440\u0430\u0443\u043d\u0434\u0430 \u0438\u0437 25 \u043c\u0438\u0448\u0435\u043d\u0435\u0439, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u044f \u0432 \u043a\u0430\u0436\u0434\u0443\u044e \u0438\u0437 \u043d\u0438\u0445 \u0440\u0430\u0432\u043d\u0430 90 %:flip(25, 0.9)array([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,      1, 1, 1])\u0415\u0441\u043b\u0438 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0434\u043b\u0438\u043d\u043d\u0443\u044e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 Pmf \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0434\u043e\u043b\u0438 \u0435\u0434\u0438\u043d\u0438\u0446 \u0438 \u043d\u0443\u043b\u0435\u0439 \u0432 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u0432\u0435\u0440\u043d\u044b, \u043f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435 \u043f\u0440\u0438\u0431\u043b\u0438\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u043e:from empiricaldist import Pmfseq = flip(1000, 0.9)pmf = Pmf.from_seq(seq)pmf\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c00.10110.899\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f (simulate) \u0440\u0430\u0443\u043d\u0434\u0430 \u0441\u0442\u0435\u043d\u0434\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0435\u043b\u044c\u0431\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u043d\u043e\u0432\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0449\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e flip \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0443\u044e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u0439:def simulate_round(n, p):    seq = flip(n, p)    return seq.sum()\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e \u0432 \u043a\u0440\u0443\u043f\u043d\u043e\u043c \u0441\u043e\u0440\u0435\u0432\u043d\u043e\u0432\u0430\u043d\u0438\u0438 200 \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u043e\u0432 \u0441\u0442\u0440\u0435\u043b\u044f\u044e\u0442 \u043f\u043e 5 \u0440\u0430\u0443\u043d\u0434\u043e\u0432 \u043a\u0430\u0436\u0434\u044b\u0439 \u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u044f \u0432 \u0446\u0435\u043b\u044c, p=0.9. \u041c\u043e\u0436\u0435\u043c \u0441\u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435 \u0441\u043e\u0440\u0435\u0432\u043d\u043e\u0432\u0430\u043d\u0438\u0435, \u0432\u044b\u0437\u0432\u0430\u0432 simulate_round 1000 \u0440\u0430\u0437:n = 25\u0440 = 0.9results_sim = [simulate_round(n, p) for i in range(1000)]\u0421\u0440\u0435\u0434\u043d\u0438\u0439 \u0431\u0430\u043b\u043b \u0431\u043b\u0438\u0437\u043e\u043a \u043a 22.5 \u2014 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044e n \u043d\u0430 p:np.mean(results_sim), n * p(22.522, 22.5)\u0412\u043e\u0442 \u043a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432:from empiricaldist import Pmfpmf_sim = Pmf.from_seq(results_sim, name=&#187;\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f&#187;)pmf_sim.bar()decorate(xlabel=&#187;\u041f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u044f&#187;, ylabel=&#187;\u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c&#187;)\u041c\u0430\u043a\u0441\u0438\u043c\u0443\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0431\u043b\u0438\u0437\u043e\u043a \u043a \u0441\u0440\u0435\u0434\u043d\u0435\u043c\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e, \u0430 \u0441\u0430\u043c\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0441\u043a\u043e\u0448\u0435\u043d\u043e \u0432\u043b\u0435\u0432\u043e.\u0412\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u044d\u0442\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435. \u041c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u044d\u0442\u0438\u0445 \u0438\u0441\u0445\u043e\u0434\u043e\u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0431\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044e \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043b\u0435\u0433\u043a\u043e \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0442\u044c:from scipy.special import combdef binomial_pmf(k, n, p):    return comb(n, k) * (p**k) * ((1 &#8212; p) ** (n &#8212; k))\u0412 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 SciPy \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f comb, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0439 (combinations) \u0438\u0437 n \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0432\u0437\u044f\u0442\u044b\u0445 \u043f\u043e k \u0437\u0430 \u0440\u0430\u0437, \u0447\u0442\u043e \u0447\u0430\u0441\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a\u0430\u043a \u00ab\u0438\u0437 n \u043f\u043e k\u00bb.\u0424\u0443\u043d\u043a\u0446\u0438\u044f binomial_pmf \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c p, \u043f\u043e\u043f\u0430\u0441\u0442\u044c k \u0440\u0430\u0437, \u0441\u0434\u0435\u043b\u0430\u0432 n \u043f\u043e\u043f\u044b\u0442\u043e\u043a. \u0415\u0441\u043b\u0438 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043f\u043e\u0434\u0430\u0432 \u043d\u0430 \u0432\u0445\u043e\u0434 \u043c\u0430\u0441\u0441\u0438\u0432 \u0438\u0437 k \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 Pmf, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0439 \u0441\u043e\u0431\u043e\u0439 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439 \u0438\u0441\u0445\u043e\u0434\u043e\u0432:ks = np.arange(16, n + 1)ps = binomial_pmf(ks, n, p)pmf_binom = Pmf(ps, ks, name=&#187;\u0431\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c&#187;)\u0418 \u0432\u043e\u0442 \u043a\u0430\u043a \u043e\u043d\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u0441 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c\u0438 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f:from thinkstats import two_bar_plotstwo_bar_plots(pmf_sim, pmf_binom)decorate(xlabel=&#187;\u041f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u044f&#187;, ylabel=&#187;\u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c&#187;)\u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0441\u0445\u043e\u0434\u043d\u044b, \u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u044f \u0432\u044b\u0437\u0432\u0430\u043d\u044b \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c\u0438 \u0432\u0430\u0440\u0438\u0430\u0446\u0438\u044f\u043c\u0438 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u0445 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u042d\u0442\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0443\u0434\u0438\u0432\u043b\u0435\u043d\u0438\u044f, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0438 \u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0435 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u0438 \u0431\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u043e\u043f\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u043e\u0434\u043d\u0438 \u0438 \u0442\u0435 \u0436\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u0430\u044f \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u0438\u043c\u0435\u0435\u0442 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u0443\u044e \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0443\u0441\u043f\u0435\u0445\u0430. \u0411\u043e\u043b\u0435\u0435 \u0441\u0442\u0440\u043e\u0433\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0431\u0443\u0434\u0435\u0442 \u0435\u0435 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438.\u041d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0432\u0438\u043a\u0438\u043f\u0435\u0434\u0438\u0438, \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u043d\u043e\u0439 \u0441\u043e\u0440\u0435\u0432\u043d\u043e\u0432\u0430\u043d\u0438\u044f\u043c \u043f\u043e \u0441\u0442\u0435\u043d\u0434\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0435\u043b\u044c\u0431\u0435 \u0441\u0440\u0435\u0434\u0438 \u043c\u0443\u0436\u0447\u0438\u043d \u043d\u0430 \u043b\u0435\u0442\u043d\u0438\u0445 \u041e\u043b\u0438\u043c\u043f\u0438\u0439\u0441\u043a\u0438\u0445 \u0438\u0433\u0440\u0430\u0445 2020 \u0433\u043e\u0434\u0430, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0441 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c\u0438 \u043a\u0432\u0430\u043b\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0440\u0430\u0443\u043d\u0434\u043e\u0432. \u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043f\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u0432 Jupyter-\u0431\u043b\u043e\u043a\u043d\u043e\u0442\u0435 \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u0433\u043b\u0430\u0432\u044b.filename = &#171;Shooting_at_the_2020_Summer_Olympics_Mens_skeet&#187;tables = pd.read_html(filename)table = tables[6]table.head()Rank (\u041c\u0435\u0441\u0442\u043e)Athlete (\u0421\u043f\u043e\u0440\u0442\u0441\u043c\u0435\u043d)Country (\u0421\u0442\u0440\u0430\u043d\u0430)12345Total[3] (\u0418\u0442\u043e\u0433\u043e)Shoot-off (\u041f\u0435\u0440\u0435\u0441\u0442\u0440\u0435\u043b\u043a\u0430)Notes (\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u044f)01\u00c9ric DelaunayFrance2525252425124+6Q, OR12Tammaro CassandroItaly2425252525124+5Q, OR23Eetu KallioinenFinland2525242524123NaNQ34Vincent HancockUnitedStates2525252522122+8Q45Abdullah Al-RashidiKuwait2525242523122+7Q\u0412 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u043f\u043e \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u0430 \u0438 \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u0441\u0442\u043e\u043b\u0431\u0446\u0443 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u043f\u044f\u0442\u0438 \u0440\u0430\u0443\u043d\u0434\u043e\u0432. \u0412\u044b\u0431\u0435\u0440\u0435\u043c \u0441\u0442\u043e\u043b\u0431\u0446\u044b \u0441 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c\u0438 \u0440\u0430\u0443\u043d\u0434\u043e\u0432 \u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e NumPy-\u0444\u0443\u043d\u043a\u0446\u0438\u0438 flatten \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043e\u0434\u043d\u043e\u043c\u0435\u0440\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432:columns = [&#171;1&#187;, &#171;2&#187;, &#171;3&#187;, &#171;4&#187;, &#171;5&#187;]results = table[columns].values.flatten()\u0414\u043b\u044f 30 \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u043e\u0432 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b 150 \u0440\u0430\u0443\u043d\u0434\u043e\u0432, \u043f\u043e 25 \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u043e\u0432 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u2014 \u0432\u0441\u0435\u0433\u043e 3574 \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u0439 (hits) \u043f\u0440\u0438 3750 \u043f\u043e\u043f\u044b\u0442\u043a\u0430\u0445 (shots):total_shots = 25 * len(results)total_hits = results.sum()n, total_shots, total_hits(25, 3750, 3575)\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0434\u043e\u043b\u044f \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u0445 \u043f\u043e\u043f\u044b\u0442\u043e\u043a \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 95,3 %:p = total_hits \/ total_shotsp0.9533333333333334\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043e\u0431\u044a\u0435\u043a\u0442 Pmf \u0434\u043b\u044f \u0431\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0441 n = 25 \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c p:ps = binomial_pmf(ks, n, p)pmf_binom = Pmf(ps, ks, name=&#187;\u0431\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c&#187;)\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0441 Pmf \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432:pmf_results = Pmf.from_seq(results, name=&#187;\u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b&#187;)two_bar_plots(pmf_results, pmf_binom)decorate(xlabel=&#187;\u041f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u044f&#187;, ylabel=&#187;\u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c&#187;)\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0431\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0445\u043e\u0440\u043e\u0448\u0435\u0439 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0435\u0439 \u0434\u0430\u043d\u043d\u044b\u0445, \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u043d\u0435\u0440\u0435\u0430\u043b\u0438\u0441\u0442\u0438\u0447\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0432\u0441\u0435\u0445 \u0441\u043f\u043e\u0440\u0442\u0441\u043c\u0435\u043d\u043e\u0432 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b \u0438 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b.\u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u041f\u0443\u0430\u0441\u0441\u043e\u043d\u0430\u0414\u0440\u0443\u0433\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u0441\u043f\u043e\u0440\u0442\u0438\u0432\u043d\u044b\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432, \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043b\u0435\u0433\u043a\u043e \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0441\u043b\u0443\u0436\u0438\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0448\u0430\u0439\u0431, \u0437\u0430\u0431\u0438\u0442\u044b\u0445 \u0432 \u0445\u043e\u043a\u043a\u0435\u0439\u043d\u044b\u0445 \u043c\u0430\u0442\u0447\u0430\u0445.\u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u0433\u0440\u044b \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e 60 \u043c\u0438\u043d\u0443\u0442 (3600 \u0441\u0435\u043a\u0443\u043d\u0434), \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0447\u0442\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0437\u0430\u0431\u0438\u0432\u0430\u044e\u0442 \u0432 \u0441\u0440\u0435\u0434\u043d\u0435\u043c \u043f\u043e 6 \u0448\u0430\u0439\u0431 \u0437\u0430 \u0438\u0433\u0440\u0443 \u0438 \u0447\u0442\u043e \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u0431\u0440\u043e\u0448\u0435\u043d\u043d\u043e\u0439 \u0448\u0430\u0439\u0431\u044b \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443, p, \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u0430 \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438:n = 3600m = 6p = m \/ 3600p0.0016666666666666668\u0422\u043e\u0433\u0434\u0430 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f n \u0441\u0435\u043a\u0443\u043d\u0434 \u0438\u0433\u0440\u044b \u0438 \u043f\u043e\u0434\u0441\u0447\u0435\u0442\u0430 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0437\u0430\u0431\u0440\u043e\u0448\u0435\u043d\u043d\u044b\u0445 \u0437\u0430 \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u0448\u0430\u0439\u0431 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e:def simulate_goals(n, p):    return flip(n, p).sum()\u0415\u0441\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 \u0438\u0433\u0440, \u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442, \u0447\u0442\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0448\u0430\u0439\u0431 \u0437\u0430 \u0438\u0433\u0440\u0443 \u0431\u043b\u0438\u0437\u043a\u043e \u043a 6:goals = [simulate_goals(n, p) for i in range(1001)]np.mean(goals)6.021978021978022\u0414\u043b\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u044d\u0442\u0438\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435, \u043d\u043e, \u043a\u043e\u0433\u0434\u0430 n \u0432\u0435\u043b\u0438\u043a\u043e, \u0430 p \u043c\u0430\u043b\u043e, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0442\u0430\u043a\u0436\u0435 \u0445\u043e\u0440\u043e\u0448\u043e \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u041f\u0443\u0430\u0441\u0441\u043e\u043d\u0430. \u041e\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c, \u043e\u0431\u044b\u0447\u043d\u043e \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u043c\u044b\u043c \u0433\u0440\u0435\u0447\u0435\u0441\u043a\u043e\u0439 \u0431\u0443\u043a\u0432\u043e\u0439 \u03bb (\u00ab\u043b\u044f\u043c\u0431\u0434\u0430\u00bb). \u0412 \u043a\u043e\u0434\u0435 \u043d\u0438\u0436\u0435 \u044d\u0442\u043e\u043c\u0443 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0443 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f lam (lambda \u043d\u0435\u043b\u044c\u0437\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u043c\u0435\u043d\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0432 Python, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u044d\u0442\u043e \u0437\u0430\u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0441\u043b\u043e\u0432\u043e). lam \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438, \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0439 6 \u0433\u043e\u043b\u043e\u0432 \u0437\u0430 \u0438\u0433\u0440\u0443.\u0424\u0412 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u041f\u0443\u0430\u0441\u0441\u043e\u043d\u0430 \u043b\u0435\u0433\u043a\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c. \u0418\u043c\u0435\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 lam, \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0432 \u0438\u0433\u0440\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0431\u0438\u0442\u043e k \u0433\u043e\u043b\u043e\u0432, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e:from scipy.special import factorialdef poisson_pmf(k, lam):    return (lam**k) * np.exp(-lam) \/ factorial(k)\u0412 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 SciPy \u0435\u0441\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044f factorial, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \u043e\u0442 1 \u0434\u043e k.\u0415\u0441\u043b\u0438 \u0432\u044b\u0437\u0432\u0430\u0442\u044c poisson_pmf, \u0443\u043a\u0430\u0437\u0430\u0432 \u043c\u0430\u0441\u0441\u0438\u0432 k \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 Pmf, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0439 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0438\u0441\u0445\u043e\u0434\u043e\u0432:lam = 6ks = np.arange(20)ps =&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-483174","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/483174","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=483174"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/483174\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=483174"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=483174"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=483174"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}