{"id":371145,"date":"2024-05-21T04:41:28","date_gmt":"2024-05-21T04:41:28","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=371145"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=371145","title":{"rendered":"<span>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439 \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/tk\/vh\/xn\/tkvhxnkdvxbkbnxldxpsfxck1pc.png\" data-src=\"https:\/\/habrastorage.org\/webt\/tk\/vh\/xn\/tkvhxnkdvxbkbnxldxpsfxck1pc.png\"\/><\/figure>\n<p>\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u044b \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043a\u0440\u0430\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u044b\u043c \u043a\u0430\u043c\u043d\u0435\u043c \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044f \u043b\u044e\u0431\u043e\u0439 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u044d\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432, \u0433\u0434\u0435 \u0443\u0447\u0451\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0432 \u0434\u0435\u043d\u044c, \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043d\u0430 \u0441\u0430\u0439\u0442\u0435, \u043d\u0430\u0436\u0430\u0442\u0438\u0439 \u043d\u0430 \u0446\u0435\u043b\u0435\u0432\u044b\u0435 \u043a\u043d\u043e\u043f\u043a\u0438, \u043f\u043e\u043a\u0443\u043f\u043e\u043a \u0442\u043e\u0432\u0430\u0440\u043e\u0432 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u044b\u0447\u043d\u044b\u043c \u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u043c \u044f\u0432\u043b\u0435\u043d\u0438\u0435\u043c. \u041b\u044e\u0431\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u043c \u043e\u043f\u044b\u0442\u0435 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 (\u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u0432\u0438\u0434, \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430, \u043a\u043e\u043d\u0442\u0435\u043d\u0442) \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0442 \u043a \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c \u0432 \u0440\u0430\u0431\u043e\u0442\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438, \u043a\u0430\u043a \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u044e\u0442\u0441\u044f \u0432 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u0412\u0430\u0436\u043d\u044b\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0435\u0433\u043e \u0444\u0443\u043d\u0434\u0430\u043c\u0435\u043d\u0442\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d, \u043e\u0442 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0446\u0435\u043d\u043a\u0438 \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u0438 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0441\u0434\u0435\u043b\u0430\u044e \u0443\u043f\u043e\u0440 \u043d\u0435 \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u0444\u043e\u0440\u043c\u0443\u043b\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0431\u044b\u0447\u043d\u043e \u0441\u043e\u043f\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f\u043c (<a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%A4%D1%83%D0%BD%D0%BA%D1%86%D0%B8%D1%8F_%D0%B2%D0%B5%D1%80%D0%BE%D1%8F%D1%82%D0%BD%D0%BE%D1%81%D1%82%D0%B8\" rel=\"noopener noreferrer nofollow\">\u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438<\/a>, <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%A4%D1%83%D0%BD%D0%BA%D1%86%D0%B8%D1%8F_%D1%80%D0%B0%D1%81%D0%BF%D1%80%D0%B5%D0%B4%D0%B5%D0%BB%D0%B5%D0%BD%D0%B8%D1%8F\" rel=\"noopener noreferrer nofollow\">\u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f<\/a>, <a href=\"https:\/\/en.wikipedia.org\/wiki\/Probability_mass_function\" rel=\"noopener noreferrer nofollow\">PMF<\/a>, <a href=\"https:\/\/en.wikipedia.org\/wiki\/Probability_density_function\" rel=\"noopener noreferrer nofollow\">PDF<\/a>, <a href=\"https:\/\/en.wikipedia.org\/wiki\/Cumulative_distribution_function\" rel=\"noopener noreferrer nofollow\">CDF<\/a>) &#8212; \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u043d\u0430\u0439\u0442\u0438 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e. \u0421\u043a\u043e\u0440\u0435\u0435 \u044f \u043f\u043e\u043f\u044b\u0442\u0430\u044e\u0441\u044c \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u0430\u043a \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0442\u0435 \u0438\u043b\u0438 \u0438\u043d\u044b\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445. \u042d\u0442\u043e, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u0435\u0435 \u0438 \u0432\u0430\u0436\u043d\u0435\u0435 \u0434\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0441\u0443\u0442\u0438 \u044d\u0442\u0438\u0445 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439 \u0438 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043e\u043d\u0438 \u0432 \u0438\u0442\u043e\u0433\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447 \u0430\u043d\u0430\u043b\u0438\u0437\u0430. \u0425\u043e\u0442\u0435\u043b \u0431\u044b \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0441\u0442\u0430\u0442\u044c\u044e <a href=\"https:\/\/habr.com\/ru\/companies\/skillfactory\/articles\/674880\/\" rel=\"noopener noreferrer nofollow\">&#171;\u041a\u0430\u043a \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f. \u041e\u0442 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u043e \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432&#187;<\/a>, \u0442. \u043a. \u044d\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u0440 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f\u043c\u0438 &#8212; \u0438\u0445 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043d\u0430 \u043f\u0440\u0435\u0434\u043c\u0435\u0442 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u0435\u0434\u0448\u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432. \u0422\u0430\u043a\u0436\u0435, \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0443\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0432\u044b\u0431\u043e\u0440\u043a\u043e\u0439 \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u043f\u0438\u0441\u0430\u043d \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 <a href=\"https:\/\/habr.com\/ru\/articles\/762648\/\" rel=\"noopener noreferrer nofollow\">&#171;\u0411\u0443\u0442\u0441\u0442\u0440\u0430\u043f \u0432 A\/B-\u0442\u0435\u0441\u0442\u0430\u0445: \u0448\u0432\u0435\u0439\u0446\u0430\u0440\u0441\u043a\u0438\u0439 \u043d\u043e\u0436 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0430&#187;<\/a><\/p>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435:<\/strong> \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u043d\u043e \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0443\u0436\u0435 \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d \u0438\u0437 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0445 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>scipy.stats.norm.rvs()<\/code>)<\/p>\n<p><a class=\"anchor\" name=\"contents\" id=\"contents\"><\/a><\/p>\n<h2>\u0421\u043f\u0438\u0441\u043e\u043a \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439<\/h2>\n<ol>\n<li>\n<p><a href=\"#distr-binomial\" rel=\"noopener noreferrer nofollow\">\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<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#distr-poisson\" rel=\"noopener noreferrer nofollow\">\u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u041f\u0443\u0430\u0441\u0441\u043e\u043d\u0430<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#distr-exponential\" rel=\"noopener noreferrer nofollow\">\u042d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#distr-weibull\" rel=\"noopener noreferrer nofollow\">\u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0412\u0435\u0439\u0431\u0443\u043b\u043b\u0430<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#distr-gamma\" rel=\"noopener noreferrer nofollow\">\u0413\u0430\u043c\u043c\u0430-\u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#distr-beta\" rel=\"noopener noreferrer nofollow\">\u0411\u0435\u0442\u0430-\u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#distr-hypergeometric\" rel=\"noopener noreferrer nofollow\">\u0413\u0438\u043f\u0435\u0440\u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#distr-normal\" rel=\"noopener noreferrer nofollow\">\u041d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#distr-t\" rel=\"noopener noreferrer nofollow\">\u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0421\u0442\u044c\u044e\u0434\u0435\u043d\u0442\u0430 (t-\u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435)<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#distr-chi-2\" rel=\"noopener noreferrer nofollow\">\u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0425\u0438-\u043a\u0432\u0430\u0434\u0440\u0430\u0442<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#distr-f\" rel=\"noopener noreferrer nofollow\">\u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0424\u0438\u0448\u0435\u0440\u0430<\/a><\/p>\n<\/li>\n<\/ol>\n<p><a class=\"anchor\" name=\"distr-binomial\" id=\"distr-binomial\"><\/a><\/p>\n<h2>1. \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<\/h2>\n<p><strong>\u0421\u0445\u0435\u043c\u0430 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u044b\u0431\u043e\u0440\u043e\u043a \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438\u0441\u043a\u043e\u043c\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d:<\/strong> \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c 1000 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c <img decoding=\"async\" class=\"formula inline\" source=\"n\" alt=\"n\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/7\/7b\/7b8\/7b8b965ad4bca0e41ab51de7b31363a1.svg\" width=\"auto\" height=\"auto\"\/> \u0435\u0434\u0438\u043d\u0438\u0446\u0430\u043c\u0438 \u0441 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e <img decoding=\"async\" class=\"formula inline\" source=\"p\" alt=\"p\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/83\/838\/83878c91171338902e0fe0fb97a8c47a.svg\" width=\"auto\" height=\"auto\"\/>, \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043d\u0443\u043b\u044f\u043c\u0438. \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 <strong>\u0435\u0434\u0438\u043d\u0438\u0446<\/strong> (\u0443\u0441\u043f\u0435\u0445\u043e\u0432) \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0438\u0441\u043a\u043e\u043c\u044b\u043c\u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c\u0438 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430\u043c\u0438, \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u044e\u0449\u0438\u043c\u0438 \u0411\u0438\u043d\u043e\u043c\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/3l\/hc\/ms\/3lhcms-wcfslbbd6cauwggls4-u.png\" data-src=\"https:\/\/habrastorage.org\/webt\/3l\/hc\/ms\/3lhcms-wcfslbbd6cauwggls4-u.png\"\/><\/figure>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0432\u044b\u0431\u043e\u0440\u043e\u043a \u0438 \u0438\u0441\u043a\u043e\u043c\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d (<a href=\"https:\/\/github.com\/nrsharip\/distributions\/blob\/336e1d8aa1f88cedb249a5b2b25a9c2992197839\/01-distribution-binomial.py\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/a>):<\/p>\n<pre><code class=\"python\">X_RANGE = 1000 Y_RANGE = 20 P_1 = 0.1 # \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0443\u0441\u043f\u0435\u0445\u0430 \u0434\u043b\u044f \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f P_2 = 0.5 # \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0443\u0441\u043f\u0435\u0445\u0430 \u0434\u043b\u044f \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f P_3 = 0.8 # \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0443\u0441\u043f\u0435\u0445\u0430 \u0434\u043b\u044f \u0442\u0440\u0435\u0442\u044c\u0435\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f ... for i in range(X_RANGE):      sample1 = [1 if r &lt; P_1 else 0 for r in [random.random() for i in range(Y_RANGE)]]     sample2 = [1 if r &lt; P_2 else 0 for r in [random.random() for i in range(Y_RANGE)]]     sample3 = [1 if r &lt; P_3 else 0 for r in [random.random() for i in range(Y_RANGE)]]      distr1.loc[i] = sample1.count(1)     distr2.loc[i] = sample2.count(1)     distr3.loc[i] = sample3.count(1)     ... <\/code><\/pre>\n<p><strong>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b:<\/strong><\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/el\/_a\/j4\/el_aj4dfdvbzpycymssuzpgpuly.gif\" data-src=\"https:\/\/habrastorage.org\/webt\/el\/_a\/j4\/el_aj4dfdvbzpycymssuzpgpuly.gif\"\/><\/figure>\n<p>(<a href=\"#contents\" rel=\"noopener noreferrer nofollow\">\u043a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e<\/a>)<\/p>\n<p><a class=\"anchor\" name=\"distr-poisson\" id=\"distr-poisson\"><\/a><\/p>\n<h2>2. \u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u041f\u0443\u0430\u0441\u0441\u043e\u043d\u0430<\/h2>\n<p><strong>\u0421\u0445\u0435\u043c\u0430 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u044b\u0431\u043e\u0440\u043e\u043a \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438\u0441\u043a\u043e\u043c\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d:<\/strong> \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c 1000 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c <img decoding=\"async\" class=\"formula inline\" source=\"n\" alt=\"n\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/7\/7b\/7b8\/7b8b965ad4bca0e41ab51de7b31363a1.svg\" width=\"auto\" height=\"auto\"\/> \u0435\u0434\u0438\u043d\u0438\u0446\u0430\u043c\u0438 \u0441 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e <img decoding=\"async\" class=\"formula inline\" source=\"p\" alt=\"p\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/83\/838\/83878c91171338902e0fe0fb97a8c47a.svg\" width=\"auto\" height=\"auto\"\/>, \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043d\u0443\u043b\u044f\u043c\u0438. <img decoding=\"async\" class=\"formula inline\" source=\"n\" alt=\"n\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/7\/7b\/7b8\/7b8b965ad4bca0e41ab51de7b31363a1.svg\" width=\"auto\" height=\"auto\"\/> \u0431\u0435\u0440\u0451\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u043c, \u0430 \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0435\u0434\u0438\u043d\u0438\u0446 (\u0443\u0441\u043f\u0435\u0445\u043e\u0432) <img decoding=\"async\" class=\"formula inline\" source=\"\\lambda=n \\times p\" alt=\"\\lambda=n \\times p\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/8e\/8e4\/8e45e7ba3eefdab63424e285de07a8c3.svg\" width=\"auto\" height=\"auto\"\/>. \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 <strong>\u0435\u0434\u0438\u043d\u0438\u0446<\/strong> (\u0443\u0441\u043f\u0435\u0445\u043e\u0432) \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0438\u0441\u043a\u043e\u043c\u044b\u043c\u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c\u0438 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430\u043c\u0438, \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u044e\u0449\u0438\u043c\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u041f\u0443\u0430\u0441\u0441\u043e\u043d\u0430.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/w7\/mj\/nq\/w7mjnqrgdlw0i_x_my-nu6q1igk.png\" data-src=\"https:\/\/habrastorage.org\/webt\/w7\/mj\/nq\/w7mjnqrgdlw0i_x_my-nu6q1igk.png\"\/><\/figure>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0432\u044b\u0431\u043e\u0440\u043e\u043a \u0438 \u0438\u0441\u043a\u043e\u043c\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d (<a href=\"https:\/\/github.com\/nrsharip\/distributions\/blob\/336e1d8aa1f88cedb249a5b2b25a9c2992197839\/02-distribution-poisson.py\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/a>):<\/p>\n<pre><code class=\"python\">X_RANGE = 1000 # 1000 \u0432\u044b\u0431\u043e\u0440\u043e\u043a Y_RANGE = 1000 # \u0440\u0430\u0437\u043c\u0435\u0440 \u043e\u0434\u043d\u043e\u0439 \u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0439 P1 = 0.001 # \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0443\u0441\u043f\u0435\u0445\u0430 \u0434\u043b\u044f \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f (\u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0443\u0441\u043f\u0435\u0445\u043e\u0432 \u0434\u043b\u044f 1000 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432 \u03bb = 1) P2 = 0.01 # \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0443\u0441\u043f\u0435\u0445\u0430 \u0434\u043b\u044f \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f (\u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0443\u0441\u043f\u0435\u0445\u043e\u0432 \u0434\u043b\u044f 1000 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432 \u03bb = 10) P3 = 0.03 # \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0443\u0441\u043f\u0435\u0445\u0430 \u0434\u043b\u044f \u0442\u0440\u0435\u0442\u044c\u0435\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f (\u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0443\u0441\u043f\u0435\u0445\u043e\u0432 \u0434\u043b\u044f 1000 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432 \u03bb = 30) ... for i in range(X_RANGE):      # https:\/\/numpy.org\/doc\/stable\/reference\/random\/generated\/numpy.random.poisson.html     # The Poisson distribution is the limit of the binomial distribution for large N.     sample_1 = [1 if r &lt; P1 else 0 for r in [random.random() for i in range(Y_RANGE)]]     sample_2 = [1 if r &lt; P2 else 0 for r in [random.random() for i in range(Y_RANGE)]]     sample_3 = [1 if r &lt; P3 else 0 for r in [random.random() for i in range(Y_RANGE)]]      distr_1.loc[i] = sample_1.count(1)     distr_2.loc[i] = sample_2.count(1)     distr_3.loc[i] = sample_3.count(1)     ... <\/code><\/pre>\n<p><strong>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b:<\/strong><\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/yq\/1p\/ec\/yq1pec2ovierwwm1pz_o8z12waq.gif\" data-src=\"https:\/\/habrastorage.org\/webt\/yq\/1p\/ec\/yq1pec2ovierwwm1pz_o8z12waq.gif\"\/><\/figure>\n<p>(<a href=\"#contents\" rel=\"noopener noreferrer nofollow\">\u043a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e<\/a>)<\/p>\n<p><a class=\"anchor\" name=\"distr-exponential\" id=\"distr-exponential\"><\/a><\/p>\n<h2>3. \u042d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435<\/h2>\n<p><strong>\u0421\u0445\u0435\u043c\u0430 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u044b\u0431\u043e\u0440\u043e\u043a \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438\u0441\u043a\u043e\u043c\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d:<\/strong> \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c 1000 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c <img decoding=\"async\" class=\"formula inline\" source=\"n\" alt=\"n\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/7\/7b\/7b8\/7b8b965ad4bca0e41ab51de7b31363a1.svg\" width=\"auto\" height=\"auto\"\/> \u0435\u0434\u0438\u043d\u0438\u0446\u0430\u043c\u0438 \u0441 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e <img decoding=\"async\" class=\"formula inline\" source=\"p\" alt=\"p\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/83\/838\/83878c91171338902e0fe0fb97a8c47a.svg\" width=\"auto\" height=\"auto\"\/> (\u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 <img decoding=\"async\" class=\"formula inline\" source=\"p = 0.1\" alt=\"p = 0.1\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/3\/3f\/3f7\/3f791087255fe8fa853c68d11a2576ff.svg\" width=\"auto\" height=\"auto\"\/>), \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043d\u0443\u043b\u044f\u043c\u0438. \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 <strong>\u043d\u0443\u043b\u0435\u0439<\/strong> \u043c\u0435\u0436\u0434\u0443 \u0435\u0434\u0438\u043d\u0438\u0446\u0430\u043c\u0438 (\u0443\u0441\u043f\u0435\u0445\u0430\u043c\u0438) \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0438\u0441\u043a\u043e\u043c\u044b\u043c\u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c\u0438 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430\u043c\u0438, \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u044e\u0449\u0438\u043c\u0438 \u042d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435. \u041d\u0443\u043b\u0438 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0433\u0440\u0430\u044e\u0442 \u0440\u043e\u043b\u044c &#171;\u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u0438&#187; \u043c\u0435\u0436\u0434\u0443 &#171;\u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c\u0438&#187; (&#171;\u0443\u0441\u043f\u0435\u0445\u0430\u043c\u0438&#187;, \u0435\u0434\u0438\u043d\u0438\u0446\u0430\u043c\u0438).<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/lc\/_r\/fp\/lc_rfp8ooupnlcofyqfx8ciuqza.png\" data-src=\"https:\/\/habrastorage.org\/webt\/lc\/_r\/fp\/lc_rfp8ooupnlcofyqfx8ciuqza.png\"\/><\/figure>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0432\u044b\u0431\u043e\u0440\u043e\u043a \u0438 \u0438\u0441\u043a\u043e\u043c\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d (<a href=\"https:\/\/github.com\/nrsharip\/distributions\/blob\/336e1d8aa1f88cedb249a5b2b25a9c2992197839\/03-distribution-exponential.py\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/a>):<\/p>\n<pre><code class=\"python\">X_RANGE = 1000 # 1000 \u0432\u044b\u0431\u043e\u0440\u043e\u043a Y_RANGE = 20   # \u0431\u0435\u0440\u0451\u043c \u0432\u044b\u0431\u043e\u0440\u043a\u0443 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c 20  LAMBDA_1 = 1 # \u0432 \u0441\u0440\u0435\u0434\u043d\u0435\u043c 1 \u0443\u0441\u043f\u0435\u0445 \u0437\u0430 \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0432\u0435\u0440\u0435\u043c\u0435\u043d\u0438 (\u0432\u044b\u0431\u043e\u0440\u043a\u0443) LAMBDA_2 = 2 # \u0432 \u0441\u0440\u0435\u0434\u043d\u0435\u043c 2 \u0443\u0441\u043f\u0435\u0445\u0430 \u0437\u0430 \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0432\u0435\u0440\u0435\u043c\u0435\u043d\u0438 (\u0432\u044b\u0431\u043e\u0440\u043a\u0443) LAMBDA_3 = 3 # \u0432 \u0441\u0440\u0435\u0434\u043d\u0435\u043c 3 \u0443\u0441\u043f\u0435\u0445\u0430 \u0437\u0430 \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0432\u0435\u0440\u0435\u043c\u0435\u043d\u0438 (\u0432\u044b\u0431\u043e\u0440\u043a\u0443)  P1 = LAMBDA_1 \/ Y_RANGE # \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0443\u0441\u043f\u0435\u0445\u0430 \u0434\u043b\u044f LAMBDA_1 P2 = LAMBDA_2 \/ Y_RANGE # \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0443\u0441\u043f\u0435\u0445\u0430 \u0434\u043b\u044f LAMBDA_2 P3 = LAMBDA_3 \/ Y_RANGE # \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0443\u0441\u043f\u0435\u0445\u0430 \u0434\u043b\u044f LAMBDA_3  THETA_1 = (Y_RANGE - LAMBDA_1)\/LAMBDA_1 # \u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043c\u0435\u0436\u0434\u0443 \u0443\u0441\u043f\u0435\u0445\u0430\u043c\u0438                                         # (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, 1 \u0443\u0441\u043f\u0435\u0445 \u0438\u0437 1000 \u0437\u0430\u043c\u0435\u0440\u043e\u0432 \u0434\u0430\u0451\u0442 \u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b 999) THETA_2 = (Y_RANGE - LAMBDA_2)\/LAMBDA_2 # \u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043c\u0435\u0436\u0434\u0443 \u0443\u0441\u043f\u0435\u0445\u0430\u043c\u0438                                          # (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, 2 \u0443\u0441\u043f\u0435\u0445\u0430 \u0438\u0437 1000 \u0437\u0430\u043c\u0435\u0440\u043e\u0432 \u0434\u0430\u0451\u0442 \u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b 499) THETA_3 = (Y_RANGE - LAMBDA_3)\/LAMBDA_3 # \u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043c\u0435\u0436\u0434\u0443 \u0443\u0441\u043f\u0435\u0445\u0430\u043c\u0438                                         # (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, 3 \u0443\u0441\u043f\u0435\u0445\u0430 \u0438\u0437 1000 \u0437\u0430\u043c\u0435\u0440\u043e\u0432 \u0434\u0430\u0451\u0442 \u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b ~332) ... # \u041f\u0440\u0438\u043c\u0435\u0440: 1 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 1 # \u0427\u0438\u0441\u043b\u043e \u0443\u0441\u043f\u0435\u0445\u043e\u0432: 4 # \u0412\u0440\u0435\u043c\u044f \u043c\u0435\u0436\u0434\u0443 \u0443\u0441\u043f\u0435\u0445\u0430\u043c\u0438: [3, 8, 4]  def calc_times(sample: list, df: pd.DataFrame, remainder: int):     time = remainder     for event in sample:         if event == 1:             df.loc[len(df), 'time'] = time             time = 0         elif event == 0:             time += 1     return df, time  remainder1 = 0 remainder2 = 0 remainder3 = 0 for i in range(X_RANGE):      # https:\/\/numpy.org\/doc\/stable\/reference\/random\/generated\/numpy.random.poisson.html     # The Poisson distribution is the limit of the binomial distribution for large N.     sample_1 = [1 if r &lt; P1 else 0 for r in [random.random() for i in range(Y_RANGE)]]     sample_2 = [1 if r &lt; P2 else 0 for r in [random.random() for i in range(Y_RANGE)]]     sample_3 = [1 if r &lt; P3 else 0 for r in [random.random() for i in range(Y_RANGE)]]      distr_1, remainder1 = calc_times(sample_1, distr_1, remainder1)     distr_2, remainder2 = calc_times(sample_2, distr_2, remainder2)     distr_3, remainder3 = calc_times(sample_3, distr_3, remainder3)     ... <\/code><\/pre>\n<p><strong>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b:<\/strong> <\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/1n\/hr\/xx\/1nhrxxkqlll8vedeskq8sz0h9xy.gif\" data-src=\"https:\/\/habrastorage.org\/webt\/1n\/hr\/xx\/1nhrxxkqlll8vedeskq8sz0h9xy.gif\"\/><\/figure>\n<p>(<a href=\"#contents\" rel=\"noopener noreferrer nofollow\">\u043a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e<\/a>)<\/p>\n<p><a class=\"anchor\" name=\"distr-weibull\" id=\"distr-weibull\"><\/a><\/p>\n<h2>4. \u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0412\u0435\u0439\u0431\u0443\u043b\u043b\u0430<\/h2>\n<p><strong>\u0421\u0445\u0435\u043c\u0430 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u044b\u0431\u043e\u0440\u043e\u043a \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438\u0441\u043a\u043e\u043c\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d:<\/strong> \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c 1000 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c <img decoding=\"async\" class=\"formula inline\" source=\"n\" alt=\"n\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/7\/7b\/7b8\/7b8b965ad4bca0e41ab51de7b31363a1.svg\" width=\"auto\" height=\"auto\"\/> \u0435\u0434\u0438\u043d\u0438\u0446\u0430\u043c\u0438 \u0441 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e <img decoding=\"async\" class=\"formula inline\" source=\"p\" alt=\"p\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/83\/838\/83878c91171338902e0fe0fb97a8c47a.svg\" width=\"auto\" height=\"auto\"\/> (\u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 <img decoding=\"async\" class=\"formula inline\" source=\"p = 0.1\" alt=\"p = 0.1\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/3\/3f\/3f7\/3f791087255fe8fa853c68d11a2576ff.svg\" width=\"auto\" height=\"auto\"\/>), \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043d\u0443\u043b\u044f\u043c\u0438. \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 <strong>\u043d\u0443\u043b\u0435\u0439<\/strong> \u043c\u0435\u0436\u0434\u0443 \u0435\u0434\u0438\u043d\u0438\u0446\u0430\u043c\u0438 (\u0443\u0441\u043f\u0435\u0445\u0430\u043c\u0438) \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0435, \u0432\u043e\u0437\u0432\u0435\u0434\u0451\u043d\u043d\u044b\u0435 \u0432 \u0441\u0442\u0435\u043f\u0435\u043d\u044c <img decoding=\"async\" class=\"formula inline\" source=\"k\" alt=\"k\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/8c\/8ce\/8ce4b16b22b58894aa86c421e8759df3.svg\" width=\"auto\" height=\"auto\"\/>, \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0438\u0441\u043a\u043e\u043c\u044b\u043c\u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c\u0438 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430\u043c\u0438, \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u044e\u0449\u0438\u043c\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0412\u0435\u0439\u0431\u0443\u043b\u043b\u0430. \u041d\u0443\u043b\u0438 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0433\u0440\u0430\u044e\u0442 \u0440\u043e\u043b\u044c &#171;\u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u0438&#187; \u043c\u0435\u0436\u0434\u0443 &#171;\u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c\u0438&#187; (&#171;\u0443\u0441\u043f\u0435\u0445\u0430\u043c\u0438&#187;, \u0435\u0434\u0438\u043d\u0438\u0446\u0430\u043c\u0438), \u0430 \u043c\u0435\u043d\u044f\u044e\u0449\u0430\u044f\u0441\u044f \u0438\u043d\u0442\u0435\u043d\u0441\u0438\u0432\u043d\u043e\u0441\u0442\u044c &#171;\u0441\u043e\u0431\u044b\u0442\u0438\u0439&#187; \u043e\u0442\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0441\u0442\u0435\u043f\u0435\u043d\u044c\u044e <img decoding=\"async\" class=\"formula inline\" source=\"k\" alt=\"k\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/8c\/8ce\/8ce4b16b22b58894aa86c421e8759df3.svg\" width=\"auto\" height=\"auto\"\/>.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/ab\/tn\/d6\/abtnd6ibcisklagdtozcfcztxom.png\" data-src=\"https:\/\/habrastorage.org\/webt\/ab\/tn\/d6\/abtnd6ibcisklagdtozcfcztxom.png\"\/><\/figure>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0432\u044b\u0431\u043e\u0440\u043e\u043a \u0438 \u0438\u0441\u043a\u043e\u043c\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d (<a href=\"https:\/\/github.com\/nrsharip\/distributions\/blob\/336e1d8aa1f88cedb249a5b2b25a9c2992197839\/04-distribution-weibull.py\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/a>):<\/p>\n<pre><code class=\"python\">X_RANGE = 1000 # 1000 \u0432\u044b\u0431\u043e\u0440\u043e\u043a Y_RANGE = 1000 # \u0431\u0435\u0440\u0451\u043c \u0432\u044b\u0431\u043e\u0440\u043a\u0443 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c 1000  LAMBDA_1 = 1 # \u0432 \u0441\u0440\u0435\u0434\u043d\u0435\u043c 1 \u0443\u0441\u043f\u0435\u0445 \u0437\u0430 \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0432\u0435\u0440\u0435\u043c\u0435\u043d\u0438 (\u0432\u044b\u0431\u043e\u0440\u043a\u0443) LAMBDA_2 = 2 # \u0432 \u0441\u0440\u0435\u0434\u043d\u0435\u043c 2 \u0443\u0441\u043f\u0435\u0445\u0430 \u0437\u0430 \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0432\u0435\u0440\u0435\u043c\u0435\u043d\u0438 (\u0432\u044b\u0431\u043e\u0440\u043a\u0443) LAMBDA_3 = 3 # \u0432 \u0441\u0440\u0435\u0434\u043d\u0435\u043c 3 \u0443\u0441\u043f\u0435\u0445\u0430 \u0437\u0430 \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0432\u0435\u0440\u0435\u043c\u0435\u043d\u0438 (\u0432\u044b\u0431\u043e\u0440\u043a\u0443)  P1 = LAMBDA_1 \/ Y_RANGE # \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0443\u0441\u043f\u0435\u0445\u0430 \u0434\u043b\u044f LAMBDA_1 P2 = LAMBDA_2 \/ Y_RANGE # \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0443\u0441\u043f\u0435\u0445\u0430 \u0434\u043b\u044f LAMBDA_2 P3 = LAMBDA_3 \/ Y_RANGE # \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0443\u0441\u043f\u0435\u0445\u0430 \u0434\u043b\u044f LAMBDA_3  THETA_1 = (Y_RANGE - LAMBDA_1)\/LAMBDA_1 # \u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043c\u0435\u0436\u0434\u0443 \u0443\u0441\u043f\u0435\u0445\u0430\u043c\u0438                                         # (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, 1 \u0443\u0441\u043f\u0435\u0445 \u0438\u0437 1000 \u0437\u0430\u043c\u0435\u0440\u043e\u0432 \u0434\u0430\u0451\u0442 \u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b 999) THETA_2 = (Y_RANGE - LAMBDA_2)\/LAMBDA_2 # \u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043c\u0435\u0436\u0434\u0443 \u0443\u0441\u043f\u0435\u0445\u0430\u043c\u0438                                          # (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, 2 \u0443\u0441\u043f\u0435\u0445\u0430 \u0438\u0437 1000 \u0437\u0430\u043c\u0435\u0440\u043e\u0432 \u0434\u0430\u0451\u0442 \u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b 499) THETA_3 = (Y_RANGE - LAMBDA_3)\/LAMBDA_3 # \u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043c\u0435\u0436\u0434\u0443 \u0443\u0441\u043f\u0435\u0445\u0430\u043c\u0438                                         # (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, 3 \u0443\u0441\u043f\u0435\u0445\u0430 \u0438\u0437 1000 \u0437\u0430\u043c\u0435\u0440\u043e\u0432 \u0434\u0430\u0451\u0442 \u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b ~332)  BETA_1 = 3.0 BETA_2 = 1.5  BETA_3 = 0.9   K_1 = 1\/BETA_1 # \u0441\u0442\u0435\u043f\u0435\u043d\u044c, \u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u0432\u0435\u0434\u0435\u043d\u043e \u043a\u0430\u0436\u0434\u043e\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 K_2 = 1\/BETA_2 # \u0441\u0442\u0435\u043f\u0435\u043d\u044c, \u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u0432\u0435\u0434\u0435\u043d\u043e \u043a\u0430\u0436\u0434\u043e\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 K_3 = 1\/BETA_3 # \u0441\u0442\u0435\u043f\u0435\u043d\u044c, \u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u0432\u0435\u0434\u0435\u043d\u043e \u043a\u0430\u0436\u0434\u043e\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 ... # \u041f\u0440\u0438\u043c\u0435\u0440: 1 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 1 # \u0427\u0438\u0441\u043b\u043e \u0443\u0441\u043f\u0435\u0445\u043e\u0432: 4 # \u0412\u0440\u0435\u043c\u044f \u043c\u0435\u0436\u0434\u0443 \u0443\u0441\u043f\u0435\u0445\u0430\u043c\u0438: [3, 8, 4]  def calc_times(sample: list, df: pd.DataFrame, remainder: int):     time = remainder     for event in sample:         if event == 1:             df.loc[len(df), 'time'] = time             time = 0         elif event == 0:             time += 1     return df, time  remainder1 = 0 remainder2 = 0 remainder3 = 0 for i in range(X_RANGE):      # https:\/\/numpy.org\/doc\/stable\/reference\/random\/generated\/numpy.random.poisson.html     # The Poisson distribution is the limit of the binomial distribution for large N.     sample_1 = [1 if r &lt; P1 else 0 for r in [random.random() for i in range(Y_RANGE)]]     sample_2 = [1 if r &lt; P2 else 0 for r in [random.random() for i in range(Y_RANGE)]]     sample_3 = [1 if r &lt; P3 else 0 for r in [random.random() for i in range(Y_RANGE)]]      distr_1, remainder1 = calc_times(sample_1, distr_1, remainder1)     distr_2, remainder2 = calc_times(sample_2, distr_2, remainder2)     distr_3, remainder3 = calc_times(sample_3, distr_3, remainder3)      # https:\/\/docs.scipy.org\/doc\/scipy\/reference\/generated\/scipy.stats.weibull_min.html     # Suppose X is an exponentially distributed random variable with scale s.      # Then Y = X**k is weibull_min distributed with shape c = 1\/k and scale s**k.     distr_1_pow_k = np.power(distr_1.values, K_1)     distr_2_pow_k = np.power(distr_2.values, K_2)     distr_3_pow_k = np.power(distr_3.values, K_3)     ... <\/code><\/pre>\n<p><strong>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b:<\/strong> <\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ge\/ly\/2m\/gely2mvgmlxy2l0bpldk94yhmls.gif\" data-src=\"https:\/\/habrastorage.org\/webt\/ge\/ly\/2m\/gely2mvgmlxy2l0bpldk94yhmls.gif\"\/><\/figure>\n<p>(<a href=\"#contents\" rel=\"noopener noreferrer nofollow\">\u043a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e<\/a>)<\/p>\n<p><a class=\"anchor\" name=\"distr-gamma\" id=\"distr-gamma\"><\/a><\/p>\n<h2>5. \u0413\u0430\u043c\u043c\u0430-\u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435<\/h2>\n<p><strong>\u0421\u0445\u0435\u043c\u0430 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u044b\u0431\u043e\u0440\u043e\u043a \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438\u0441\u043a\u043e\u043c\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d:<\/strong> \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c 1000 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c <img decoding=\"async\" class=\"formula inline\" source=\"n\" alt=\"n\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/7\/7b\/7b8\/7b8b965ad4bca0e41ab51de7b31363a1.svg\" width=\"auto\" height=\"auto\"\/> \u0435\u0434\u0438\u043d\u0438\u0446\u0430\u043c\u0438 \u0441 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e <img decoding=\"async\" class=\"formula inline\" source=\"p\" alt=\"p\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/83\/838\/83878c91171338902e0fe0fb97a8c47a.svg\" width=\"auto\" height=\"auto\"\/> (\u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 <img decoding=\"async\" class=\"formula inline\" source=\"p = 0.1\" alt=\"p = 0.1\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/3\/3f\/3f7\/3f791087255fe8fa853c68d11a2576ff.svg\" width=\"auto\" height=\"auto\"\/>), \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043d\u0443\u043b\u044f\u043c\u0438. \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 <strong>\u043d\u0443\u043b\u0435\u0439<\/strong> \u043c\u0435\u0436\u0434\u0443 <img decoding=\"async\" class=\"formula inline\" source=\"k\" alt=\"k\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/8c\/8ce\/8ce4b16b22b58894aa86c421e8759df3.svg\" width=\"auto\" height=\"auto\"\/> \u0435\u0434\u0438\u043d\u0438\u0446\u0430\u043c\u0438 (\u0443\u0441\u043f\u0435\u0445\u0430\u043c\u0438) \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0435, \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0438\u0441\u043a\u043e\u043c\u044b\u043c\u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c\u0438 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430\u043c\u0438, \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u044e\u0449\u0438\u043c\u0438 \u0413\u0430\u043c\u043c\u0430-\u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435. \u041d\u0443\u043b\u0438 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0433\u0440\u0430\u044e\u0442 \u0440\u043e\u043b\u044c &#171;\u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u0438&#187; \u043c\u0435\u0436\u0434\u0443 &#171;\u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c\u0438&#187; (&#171;\u0443\u0441\u043f\u0435\u0445\u0430\u043c\u0438&#187;, \u0435\u0434\u0438\u043d\u0438\u0446\u0430\u043c\u0438).<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/ey\/k_\/1r\/eyk_1rxiffxnkhob2rie23uuns4.png\" data-src=\"https:\/\/habrastorage.org\/webt\/ey\/k_\/1r\/eyk_1rxiffxnkhob2rie23uuns4.png\"\/><\/figure>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0432\u044b\u0431\u043e\u0440\u043e\u043a \u0438 \u0438\u0441\u043a\u043e\u043c\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d (<a href=\"https:\/\/github.com\/nrsharip\/distributions\/blob\/336e1d8aa1f88cedb249a5b2b25a9c2992197839\/05-distribution-gamma.py\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/a>):<\/p>\n<pre><code class=\"python\">X_RANGE = 1000 # 1000 \u0432\u044b\u0431\u043e\u0440\u043e\u043a Y_RANGE = 20   # \u0431\u0435\u0440\u0451\u043c \u0432\u044b\u0431\u043e\u0440\u043a\u0443 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c 20  LAMBDA_1 = 1 # \u0432 \u0441\u0440\u0435\u0434\u043d\u0435\u043c 1 \u0443\u0441\u043f\u0435\u0445 \u0437\u0430 \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0432\u0435\u0440\u0435\u043c\u0435\u043d\u0438 (\u0432\u044b\u0431\u043e\u0440\u043a\u0443) LAMBDA_2 = 2 # \u0432 \u0441\u0440\u0435\u0434\u043d\u0435\u043c 2 \u0443\u0441\u043f\u0435\u0445\u0430 \u0437\u0430 \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0432\u0435\u0440\u0435\u043c\u0435\u043d\u0438 (\u0432\u044b\u0431\u043e\u0440\u043a\u0443) LAMBDA_3 = 3 # \u0432 \u0441\u0440\u0435\u0434\u043d\u0435\u043c 3 \u0443\u0441\u043f\u0435\u0445\u0430 \u0437\u0430 \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0432\u0435\u0440\u0435\u043c\u0435\u043d\u0438 (\u0432\u044b\u0431\u043e\u0440\u043a\u0443)  P1 = LAMBDA_1 \/ Y_RANGE # \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0443\u0441\u043f\u0435\u0445\u0430 \u0434\u043b\u044f LAMBDA_1 P2 = LAMBDA_2 \/ Y_RANGE # \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0443\u0441\u043f\u0435\u0445\u0430 \u0434\u043b\u044f LAMBDA_2 P3 = LAMBDA_3 \/ Y_RANGE # \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0443\u0441\u043f\u0435\u0445\u0430 \u0434\u043b\u044f LAMBDA_3  THETA_1 = (Y_RANGE - LAMBDA_1)\/LAMBDA_1 # \u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043c\u0435\u0436\u0434\u0443 \u0443\u0441\u043f\u0435\u0445\u0430\u043c\u0438                                         # (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, 1 \u0443\u0441\u043f\u0435\u0445 \u0438\u0437 1000 \u0437\u0430\u043c\u0435\u0440\u043e\u0432 \u0434\u0430\u0451\u0442 \u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b 999) THETA_2 = (Y_RANGE - LAMBDA_2)\/LAMBDA_2 # \u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043c\u0435\u0436\u0434\u0443 \u0443\u0441\u043f\u0435\u0445\u0430\u043c\u0438                                          # (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, 2 \u0443\u0441\u043f\u0435\u0445\u0430 \u0438\u0437 1000 \u0437\u0430\u043c\u0435\u0440\u043e\u0432 \u0434\u0430\u0451\u0442 \u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b 499) THETA_3 = (Y_RANGE - LAMBDA_3)\/LAMBDA_3 # \u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043c\u0435\u0436\u0434\u0443 \u0443\u0441\u043f\u0435\u0445\u0430\u043c\u0438                                         # (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, 3 \u0443\u0441\u043f\u0435\u0445\u0430 \u0438\u0437 1000 \u0437\u0430\u043c\u0435\u0440\u043e\u0432 \u0434\u0430\u0451\u0442 \u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b ~332)  K_1 = 3 # \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \"\u0443\u0441\u043f\u0435\u0445\u043e\u0432\" \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0432\u0440\u0435\u043c\u0435\u043d\u0438 K_2 = 2 # \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \"\u0443\u0441\u043f\u0435\u0445\u043e\u0432\" \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0432\u0440\u0435\u043c\u0435\u043d\u0438 K_3 = 1 # \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \"\u0443\u0441\u043f\u0435\u0445\u043e\u0432\" \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0432\u0440\u0435\u043c\u0435\u043d\u0438 ... # \u041f\u0440\u0438\u043c\u0435\u0440: 1 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 1 # \u0427\u0438\u0441\u043b\u043e \u0443\u0441\u043f\u0435\u0445\u043e\u0432: 4 # \u0412\u0440\u0435\u043c\u044f \u043c\u0435\u0436\u0434\u0443 \u0443\u0441\u043f\u0435\u0445\u0430\u043c\u0438: [3, 8, 4]  def calc_times(sample: list, df: pd.DataFrame, remainder: int):     time = remainder     for event in sample:         if event == 1:             df.loc[len(df), 'time'] = time             time = 0         elif event == 0:             time += 1     return df, time  remainder1 = 0 remainder2 = 0 remainder3 = 0 for i in range(X_RANGE):      # https:\/\/numpy.org\/doc\/stable\/reference\/random\/generated\/numpy.random.poisson.html     # The Poisson distribution is the limit of the binomial distribution for large N.     sample_1 = [1 if r &lt; P1 else 0 for r in [random.random() for i in range(Y_RANGE)]]     sample_2 = [1 if r &lt; P2 else 0 for r in [random.random() for i in range(Y_RANGE)]]     sample_3 = [1 if r &lt; P3 else 0 for r in [random.random() for i in range(Y_RANGE)]]      distr_1, remainder1 = calc_times(sample_1, distr_1, remainder1)     distr_2, remainder2 = calc_times(sample_2, distr_2, remainder2)     distr_3, remainder3 = calc_times(sample_3, distr_3, remainder3)      distr_1_k = [np.sum(distr_1.values[K_1*i: K_1*i+K_1]) for i in range(int(len(distr_1)\/K_1))]     distr_2_k = [np.sum(distr_2.values[K_2*i: K_2*i+K_2]) for i in range(int(len(distr_2)\/K_2))]     distr_3_k = [np.sum(distr_3.values[K_3*i: K_3*i+K_3]) for i in range(int(len(distr_3)\/K_3))]     ... <\/code><\/pre>\n<p><strong>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b:<\/strong> <\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ol\/f3\/l6\/olf3l61prwqbzll3xgbcjjwgpns.gif\" data-src=\"https:\/\/habrastorage.org\/webt\/ol\/f3\/l6\/olf3l61prwqbzll3xgbcjjwgpns.gif\"\/><\/figure>\n<p>(<a href=\"#contents\" rel=\"noopener noreferrer nofollow\">\u043a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e<\/a>)<\/p>\n<p><a class=\"anchor\" name=\"distr-beta\" id=\"distr-beta\"><\/a><\/p>\n<h2>6. \u0411\u0435\u0442\u0430-\u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435<\/h2>\n<p><strong>\u0421\u0445\u0435\u043c\u0430 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u044b\u0431\u043e\u0440\u043e\u043a \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438\u0441\u043a\u043e\u043c\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d:<\/strong> \u0412\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0443\u0436\u0435 \u0433\u043e\u0442\u043e\u0432\u044b\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d \u0438\u0437 \u0413\u0430\u043c\u043c\u0430-\u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f <code>stats.gamma.rvs(a, size)<\/code>. \u041f\u043e\u043b\u0443\u0447\u0438\u043c 1000 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 <img decoding=\"async\" class=\"formula inline\" source=\"X \\sim Gamma(1,1)\" alt=\"X \\sim Gamma(1,1)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/87\/873\/873a0b0e79788209d00038a2e66e0142.svg\" width=\"auto\" height=\"auto\"\/> \u0438 1000 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 <img decoding=\"async\" class=\"formula inline\" source=\"Y \\sim Gamma(9,1)\" alt=\"Y \\sim Gamma(9,1)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/6\/67\/676\/676465c43c5568d777eab2e77465074d.svg\" width=\"auto\" height=\"auto\"\/>. \u0422\u043e\u0433\u0434\u0430 \u0438\u0441\u043a\u043e\u043c\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0437 \u0411\u0435\u0442\u0430-\u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0447\u0435\u0441\u043b\u0435\u043d\u044b \u043f\u043e \u0444\u043e\u0440\u043c\u0443\u043b\u0435:<\/p>\n<p><img decoding=\"async\" class=\"formula\" source=\"\\frac{X}{X+Y} \\sim Beta(1,9). \" alt=\"\\frac{X}{X+Y} \\sim Beta(1,9). \" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/e\/e8\/e8f\/e8fafed62e29c741e0319486e5f62947.svg\" width=\"auto\" height=\"auto\"\/><\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/kv\/3m\/u7\/kv3mu7cmp-vmts7aadw_vxzlvgk.png\" data-src=\"https:\/\/habrastorage.org\/webt\/kv\/3m\/u7\/kv3mu7cmp-vmts7aadw_vxzlvgk.png\"\/><\/figure>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0432\u044b\u0431\u043e\u0440\u043e\u043a \u0438 \u0438\u0441\u043a\u043e\u043c\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d (<a href=\"https:\/\/github.com\/nrsharip\/distributions\/blob\/336e1d8aa1f88cedb249a5b2b25a9c2992197839\/06-1-distribution-beta.py\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/a>):<\/p>\n<pre><code class=\"python\">X_RANGE = 1000  K_1 = 1 # 1-\u044f \u043f\u0430\u0440\u0430 K_2 = 9 # 1-\u044f \u043f\u0430\u0440\u0430 K_3 = 2 # 2-\u044f \u043f\u0430\u0440\u0430 K_4 = 4 # 2-\u044f \u043f\u0430\u0440\u0430 K_5 = 0.5 # 3-\u044f \u043f\u0430\u0440\u0430 K_6 = 0.5 # 3-\u044f \u043f\u0430\u0440\u0430 ... # \u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d \u0438\u0437 \u0413\u0430\u043c\u043c\u0430-\u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439 # 0: [0 .. 999] # 1: [0 .. 999] # .. # 7: [0 .. 999] gamma = [] gamma.append(stats.gamma.rvs(a=K_1, size=X_RANGE)) gamma.append(stats.gamma.rvs(a=K_2, size=X_RANGE)) gamma.append(stats.gamma.rvs(a=K_3, size=X_RANGE)) gamma.append(stats.gamma.rvs(a=K_4, size=X_RANGE)) gamma.append(stats.gamma.rvs(a=K_5, size=X_RANGE)) gamma.append(stats.gamma.rvs(a=K_6, size=X_RANGE)) # \u0422\u0440\u0430\u043d\u0441\u043f\u043e\u043d\u0438\u0440\u0443\u0435\u043c \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d - \u0441\u0442\u0440\u043e\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0435 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u044b \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438 \u0446\u0438\u043a\u043b\u0430 for # 0: [0 .. 7] # 1: [0 .. 7] # .. # 999: [0 .. 7] gamma = np.array(gamma).transpose().tolist()  for i in range(X_RANGE):     ###########      x00 = [gamma[i][0], gamma[i][1]]     beta_0 = (x00[0]) \/ (x00[0] + x00[1])     ...     ###########      x01 = [gamma[i][2], gamma[i][3]]     beta_1 = (x01[0]) \/ (x01[0] + x01[1])     ...     ###########      x02 = [gamma[i][4], gamma[i][5]]     beta_2 = (x02[0]) \/ (x02[0] + x02[1])     ...     ###########     betas_0.append(beta_0)     betas_1.append(beta_1)     betas_2.append(beta_2)     ... <\/code><\/pre>\n<p><strong>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b:<\/strong> <\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/rq\/lq\/-f\/rqlq-fwmg80g7lgtqckcgavbqf8.gif\" data-src=\"https:\/\/habrastorage.org\/webt\/rq\/lq\/-f\/rqlq-fwmg80g7lgtqckcgavbqf8.gif\"\/><\/figure>\n<p>(<a href=\"#contents\" rel=\"noopener noreferrer nofollow\">\u043a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e<\/a>)<\/p>\n<p><a class=\"anchor\" name=\"distr-hypergeometric\" id=\"distr-hypergeometric\"><\/a><\/p>\n<h2>7. \u0413\u0438\u043f\u0435\u0440\u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435<\/h2>\n<p><strong>\u0421\u0445\u0435\u043c\u0430 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u044b\u0431\u043e\u0440\u043e\u043a \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438\u0441\u043a\u043e\u043c\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d:<\/strong> \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043a\u043e\u043b\u043e\u0434\u044b \u043a\u0430\u0440\u0442. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c \u0435\u0441\u0442\u044c \u043a\u043e\u043b\u043e\u0434\u0430 \u0438\u0437 <img decoding=\"async\" class=\"formula inline\" source=\"N=52\" alt=\"N=52\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b\/b0\/b03\/b033da13d1ae21ffe3f3ed031bf723e4.svg\" width=\"auto\" height=\"auto\"\/> \u043a\u0430\u0440\u0442. \u041d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u044b\u0442\u044f\u043d\u0443\u0442\u044b\u0445 \u0447\u0435\u0440\u0432\u0435\u0439 \u0438 \u043f\u0438\u043a, \u0435\u0441\u043b\u0438 \u0432\u044b\u0442\u044f\u0433\u0438\u0432\u0430\u0442\u044c \u0438\u0437 \u043a\u043e\u043b\u043e\u0434\u044b \u043f\u043e <img decoding=\"async\" class=\"formula inline\" source=\"n=5\" alt=\"n=5\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/4\/44\/44d\/44d21af66b0874d9b45905ea79807cb3.svg\" width=\"auto\" height=\"auto\"\/> \u043a\u0430\u0440\u0442. \u041e\u0431\u0449\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0438\u0445 \u043d\u0430\u0441 \u043a\u0430\u0440\u0442 \u0432 \u043a\u043e\u043b\u043e\u0434\u0435 <img decoding=\"async\" class=\"formula inline\" source=\"K=26\" alt=\"K=26\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/a\/a6\/a69\/a691b37337098b90e99f9a6da6c56646.svg\" width=\"auto\" height=\"auto\"\/> (13 \u043a\u0430\u0440\u0442 \u0447\u0435\u0440\u0432\u043e\u0432\u043e\u0439 \u043c\u0430\u0441\u0442\u0438 \u0438 13 \u043a\u0430\u0440\u0442 \u043f\u0438\u043a\u043e\u0432\u043e\u0439). \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0432\u044b\u0442\u044f\u043d\u0443\u0442\u044b\u0445 \u0447\u0435\u0440\u0432\u0435\u0439 \u0438 \u043f\u0438\u043a \u043f\u0440\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445 &#8212; \u044d\u0442\u043e \u0438\u0441\u043a\u043e\u043c\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0437 \u0413\u0438\u043f\u0435\u0440\u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f <img decoding=\"async\" class=\"formula inline\" source=\"HG(52, 26, 5)\" alt=\"HG(52, 26, 5)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/2\/2c\/2c8\/2c8504f510628f316ce6215f67828093.svg\" width=\"auto\" height=\"auto\"\/>.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/wc\/_b\/zs\/wc_bzsjn9rii_ny9ab49yxd2kio.png\" data-src=\"https:\/\/habrastorage.org\/webt\/wc\/_b\/zs\/wc_bzsjn9rii_ny9ab49yxd2kio.png\"\/><\/figure>\n<p>\u041a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u0441 \u043a\u0430\u0440\u0442\u0430\u043c\u0438 \u0432\u0437\u044f\u0442\u044b \u0443 <a href=\"https:\/\/kenney.nl\/assets\/playing-cards-pack\" rel=\"noopener noreferrer nofollow\">Kenney<\/a> (CC0)<\/p>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0432\u044b\u0431\u043e\u0440\u043e\u043a \u0438 \u0438\u0441\u043a\u043e\u043c\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d (<a href=\"https:\/\/github.com\/nrsharip\/distributions\/blob\/336e1d8aa1f88cedb249a5b2b25a9c2992197839\/07-distribution-hypergeometric.py\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/a>):<\/p>\n<pre><code class=\"python\">cards = pd.DataFrame([     ['C', '2'], ['D', '2'], ['H', '2'], ['S', '2'],     ['C', '3'], ['D', '3'], ['H', '3'], ['S', '3'],     ['C', '4'], ['D', '4'], ['H', '4'], ['S', '4'],     ['C', '5'], ['D', '5'], ['H', '5'], ['S', '5'],     ['C', '6'], ['D', '6'], ['H', '6'], ['S', '6'],     ['C', '7'], ['D', '7'], ['H', '7'], ['S', '7'],     ['C', '8'], ['D', '8'], ['H', '8'], ['S', '8'],     ['C', '9'], ['D', '9'], ['H', '9'], ['S', '9'],     ['C', '10'], ['D', '10'], ['H', '10'], ['S', '10'],     ['C', 'J'], ['D', 'J'], ['H', 'J'], ['S', 'J'],     ['C', 'Q'], ['D', 'Q'], ['H', 'Q'], ['S', 'Q'],     ['C', 'K'], ['D', 'K'], ['H', 'K'], ['S', 'K'],     ['C', 'A'], ['D', 'A'], ['H', 'A'], ['S', 'A'], ], columns=['Suit', 'Rank'])  CARDS_1 = 5 # \u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c 5 \u043a\u0430\u0440\u0442 \u0438\u0437 \u043a\u043e\u043b\u043e\u0434\u044b CARDS_2 = 15 # \u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c 15 \u043a\u0430\u0440\u0442 \u0438\u0437 \u043a\u043e\u043b\u043e\u0434\u044b CARDS_3 = 25 # \u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c 25 \u043a\u0430\u0440\u0442 \u0438\u0437 \u043a\u043e\u043b\u043e\u0434\u044b  N = len(cards) # \u0420\u0430\u0437\u043c\u0435\u0440 \u0441\u043e\u0432\u043e\u043a\u0443\u043f\u043d\u043e\u0441\u0442\u0438 S_COUNT = cards['Suit'].values.tolist().count('S') # \u0427\u0438\u0441\u043b\u043e \u043f\u0438\u043a \u0432 \u043a\u043e\u043b\u043e\u0434\u0435 H_COUNT = cards['Suit'].values.tolist().count('H') # \u0427\u0438\u0441\u043b\u043e \u0447\u0435\u0440\u0432\u0435\u0439 \u0432 \u043a\u043e\u043b\u043e\u0434\u0435 X_RANGE = 1000 # \u0427\u0438\u0441\u043b\u043e \u0432\u044b\u0431\u043e\u0440\u043e\u043a ... for i in range(X_RANGE):     sample_1 = cards.sample(CARDS_1)     sample_2 = cards.sample(CARDS_2)     sample_3 = cards.sample(CARDS_3)      distr_1.loc[i] = sample_1['Suit'].values.tolist().count('S')     distr_1.loc[i] += sample_1['Suit'].values.tolist().count('H')     distr_2.loc[i] = sample_2['Suit'].values.tolist().count('S')     distr_2.loc[i] += sample_2['Suit'].values.tolist().count('H')     distr_3.loc[i] = sample_3['Suit'].values.tolist().count('S')     distr_3.loc[i] += sample_3['Suit'].values.tolist().count('H')     ... <\/code><\/pre>\n<p><strong>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b:<\/strong> <\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/cm\/g9\/2r\/cmg92riebv5dqdhfgtnsc_pmzku.gif\" data-src=\"https:\/\/habrastorage.org\/webt\/cm\/g9\/2r\/cmg92riebv5dqdhfgtnsc_pmzku.gif\"\/><\/figure>\n<p>(<a href=\"#contents\" rel=\"noopener noreferrer nofollow\">\u043a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e<\/a>)<\/p>\n<p><a class=\"anchor\" name=\"distr-normal\" id=\"distr-normal\"><\/a><\/p>\n<h2>8. \u041d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435<\/h2>\n<p><strong>\u0421\u0445\u0435\u043c\u0430 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u044b\u0431\u043e\u0440\u043e\u043a \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438\u0441\u043a\u043e\u043c\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d:<\/strong> \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%A6%D0%B5%D0%BD%D1%82%D1%80%D0%B0%D0%BB%D1%8C%D0%BD%D0%B0%D1%8F_%D0%BF%D1%80%D0%B5%D0%B4%D0%B5%D0%BB%D1%8C%D0%BD%D0%B0%D1%8F_%D1%82%D0%B5%D0%BE%D1%80%D0%B5%D0%BC%D0%B0\" rel=\"noopener noreferrer nofollow\">\u0426\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u043e\u0439 \u041f\u0440\u0435\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0422\u0435\u043e\u0440\u0435\u043c\u0435<\/a> &#171;\u0415\u0441\u043b\u0438 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0443\u043c\u043c\u043e\u0439 \u043c\u043d\u043e\u0433\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0441\u043b\u0430\u0431\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d, \u043a\u0430\u0436\u0434\u0430\u044f \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u043d\u043e\u0441\u0438\u0442 \u043c\u0430\u043b\u044b\u0439 \u0432\u043a\u043b\u0430\u0434 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0431\u0449\u0435\u0439 \u0441\u0443\u043c\u043c\u044b, \u0442\u043e \u0446\u0435\u043d\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0438 \u043d\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0442\u0430\u043a\u043e\u0439 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u044b \u043f\u0440\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u0445 \u0441\u0442\u0440\u0435\u043c\u0438\u0442\u0441\u044f \u043a \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044e.&#187; [<a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%9D%D0%BE%D1%80%D0%BC%D0%B0%D0%BB%D1%8C%D0%BD%D0%BE%D0%B5_%D1%80%D0%B0%D1%81%D0%BF%D1%80%D0%B5%D0%B4%D0%B5%D0%BB%D0%B5%D0%BD%D0%B8%D0%B5\" rel=\"noopener noreferrer nofollow\">\u0441\u0441\u044b\u043b\u043a\u0430<\/a>]. \u0415\u0441\u043b\u0438 \u0434\u043b\u044f \u043f\u043e\u043f\u0443\u043b\u044f\u0446\u0438\u0438 <code>raw_data<\/code> \u0441\u043e \u0441\u0440\u0435\u0434\u043d\u0438\u043c <img decoding=\"async\" class=\"formula inline\" source=\"\\mu\" alt=\"\\mu\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/c\/c9\/c9f\/c9faf6ead2cd2c2187bd943488de1d0a.svg\" width=\"auto\" height=\"auto\"\/> \u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435\u043c <img decoding=\"async\" class=\"formula inline\" source=\"\u03c3\" alt=\"\u03c3\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/3\/31\/312\/3122c41ebe889f745cb9bbe1c92165c3.svg\" width=\"auto\" height=\"auto\"\/> 1000 \u0440\u0430\u0437 \u0432\u0437\u044f\u0442\u044c \u0432\u044b\u0431\u043e\u0440\u043a\u0443 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 <img decoding=\"async\" class=\"formula inline\" source=\"n\" alt=\"n\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/7\/7b\/7b8\/7b8b965ad4bca0e41ab51de7b31363a1.svg\" width=\"auto\" height=\"auto\"\/> \u0438 \u0440\u0430\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <img decoding=\"async\" class=\"formula inline\" source=\"\\overline{x}\" alt=\"\\overline{x}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/90\/90d\/90d79af00b1e8a4722f418bd2fa0a839.svg\" width=\"auto\" height=\"auto\"\/> \u043a\u0430\u0436\u0434\u043e\u0439 \u0432\u044b\u0431\u043e\u0440\u043a\u0438, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u0443\u044e\u0442 \u041d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/w6\/yb\/ra\/w6ybraplv0qweq9spln0fvlm19w.png\" data-src=\"https:\/\/habrastorage.org\/webt\/w6\/yb\/ra\/w6ybraplv0qweq9spln0fvlm19w.png\"\/><\/figure>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0432\u044b\u0431\u043e\u0440\u043e\u043a \u0438 \u0438\u0441\u043a\u043e\u043c\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d (<a href=\"https:\/\/github.com\/nrsharip\/distributions\/blob\/336e1d8aa1f88cedb249a5b2b25a9c2992197839\/08-distribution-normal.py\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/a>):<\/p>\n<pre><code class=\"python\">mean = raw_data.mean() # \u03bc - \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0432\u0441\u0435\u0439 \u0441\u043e\u0432\u043e\u043a\u0443\u043f\u043d\u043e\u0441\u0442\u0438 std = raw_data.std()   # \u03c3 - \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u0432\u0441\u0435\u0439 \u0441\u043e\u0432\u043e\u043a\u0443\u043f\u043d\u043e\u0441\u0442\u0438  se_05 = std \/ math.sqrt(5)  # \u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 (SE05) \u0434\u043b\u044f \u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c 5 se_20 = std \/ math.sqrt(20) # \u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 (SE20) \u0434\u043b\u044f \u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c 20 ... for i in range(1000):      sample_05 = raw_data.sample(5)     sample_20 = raw_data.sample(20)     ...     sample_mean_05.loc[i] = [sample_05.mean()] # x\u0304 - \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c 5     sample_mean_20.loc[i] = [sample_20.mean()] # x\u0304 - \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c 20     ...     z_sample_mean_05 = (sample_mean_05['mean_05'] - mean) \/ se_05 - 1 # -1, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u0433\u0440\u0430\u0444\u0438\u043a\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439     z_sample_mean_20 = (sample_mean_20['mean_20'] - mean) \/ se_20 + 1 # +1, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u0433\u0440\u0430\u0444\u0438\u043a\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439     ... <\/code><\/pre>\n<p><strong>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b:<\/strong> <\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/bc\/wh\/as\/bcwhasyko7qdso_chiodr1jzp_o.gif\" data-src=\"https:\/\/habrastorage.org\/webt\/bc\/wh\/as\/bcwhasyko7qdso_chiodr1jzp_o.gif\"\/><\/figure>\n<p>(<a href=\"#contents\" rel=\"noopener noreferrer nofollow\">\u043a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e<\/a>)<\/p>\n<p><a class=\"anchor\" name=\"distr-t\" id=\"distr-t\"><\/a><\/p>\n<h2>9. \u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0421\u0442\u044c\u044e\u0434\u0435\u043d\u0442\u0430 (t-\u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435)<\/h2>\n<p><strong>\u0421\u0445\u0435\u043c\u0430 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u044b\u0431\u043e\u0440\u043e\u043a \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438\u0441\u043a\u043e\u043c\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d:<\/strong> \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0438 \u043e\u0442 \u041d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0421\u0442\u044c\u044e\u0434\u0435\u043d\u0442\u0430 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0446\u0438\u0438 <img decoding=\"async\" class=\"formula inline\" source=\"\u03c3\" alt=\"\u03c3\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/3\/31\/312\/3122c41ebe889f745cb9bbe1c92165c3.svg\" width=\"auto\" height=\"auto\"\/>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0430\u0441\u0447\u0451\u0442 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%A1%D1%82%D0%B0%D0%BD%D0%B4%D0%B0%D1%80%D1%82%D0%BD%D0%B0%D1%8F_%D0%BE%D1%88%D0%B8%D0%B1%D0%BA%D0%B0\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0438 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e<\/a> (<strong><abbr title=\"Standard Error\">SE<\/abbr><\/strong> \u0438\u043b\u0438 <strong><abbr title=\"Standard Error of the Mean\">SEM<\/abbr><\/strong>) \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u044f <img decoding=\"async\" class=\"formula inline\" source=\"s\" alt=\"s\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/0\/03\/03c\/03c7c0ace395d80182db07ae2c30f034.svg\" width=\"auto\" height=\"auto\"\/> \u0441\u0430\u043c\u043e\u0439 \u0432\u044b\u0431\u043e\u0440\u043a\u0438. \u0412 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0442\u0435 \u0436\u0435, \u0447\u0442\u043e \u0438 \u0434\u043b\u044f \u041d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f: \u0435\u0441\u043b\u0438 \u0434\u043b\u044f \u043f\u043e\u043f\u0443\u043b\u044f\u0446\u0438\u0438 <code>raw_data<\/code> \u0441\u043e \u0441\u0440\u0435\u0434\u043d\u0438\u043c <img decoding=\"async\" class=\"formula inline\" source=\"\\mu\" alt=\"\\mu\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/c\/c9\/c9f\/c9faf6ead2cd2c2187bd943488de1d0a.svg\" width=\"auto\" height=\"auto\"\/> 1000 \u0440\u0430\u0437 \u0432\u0437\u044f\u0442\u044c \u0432\u044b\u0431\u043e\u0440\u043a\u0443 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 <img decoding=\"async\" class=\"formula inline\" source=\"n\" alt=\"n\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/7\/7b\/7b8\/7b8b965ad4bca0e41ab51de7b31363a1.svg\" width=\"auto\" height=\"auto\"\/> \u0438 \u0440\u0430\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <img decoding=\"async\" class=\"formula inline\" source=\"\\overline{x}\" alt=\"\\overline{x}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/90\/90d\/90d79af00b1e8a4722f418bd2fa0a839.svg\" width=\"auto\" height=\"auto\"\/> \u043a\u0430\u0436\u0434\u043e\u0439 \u0432\u044b\u0431\u043e\u0440\u043a\u0438, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u0443\u044e\u0442 t-\u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0441\u043e \u0441\u0434\u0432\u0438\u0433\u043e\u043c <img decoding=\"async\" class=\"formula inline\" source=\"\\mu\" alt=\"\\mu\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/c\/c9\/c9f\/c9faf6ead2cd2c2187bd943488de1d0a.svg\" width=\"auto\" height=\"auto\"\/>, \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u043e\u043c \u0440\u0430\u0432\u043d\u044b\u043c <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%A1%D1%82%D0%B0%D0%BD%D0%B4%D0%B0%D1%80%D1%82%D0%BD%D0%B0%D1%8F_%D0%BE%D1%88%D0%B8%D0%B1%D0%BA%D0%B0\" rel=\"noopener noreferrer nofollow\">\u043e\u0446\u0435\u043d\u043a\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0438 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e<\/a> (<strong><abbr title=\"Standard Error Estimator\">SEE<\/abbr><\/strong>), \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d\u043d\u043e\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <img decoding=\"async\" class=\"formula inline\" source=\"s\" alt=\"s\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/0\/03\/03c\/03c7c0ace395d80182db07ae2c30f034.svg\" width=\"auto\" height=\"auto\"\/>, \u0438 \u0441\u0442\u0435\u043f\u0435\u043d\u044c\u044e \u0441\u0432\u043e\u0431\u043e\u0434\u044b <img decoding=\"async\" class=\"formula inline\" source=\"n-1\" alt=\"n-1\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/a\/a4\/a43\/a438673491daae8148eae77373b6a467.svg\" width=\"auto\" height=\"auto\"\/>.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/xc\/pd\/ms\/xcpdmsfv3vqmtwtco4ftm0suswu.png\" data-src=\"https:\/\/habrastorage.org\/webt\/xc\/pd\/ms\/xcpdmsfv3vqmtwtco4ftm0suswu.png\"\/><\/figure>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0432\u044b\u0431\u043e\u0440\u043e\u043a \u0438 \u0438\u0441\u043a\u043e\u043c\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d (<a href=\"https:\/\/github.com\/nrsharip\/distributions\/blob\/336e1d8aa1f88cedb249a5b2b25a9c2992197839\/09-distribution-t.py\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/a>):<\/p>\n<pre><code class=\"python\">mean = raw_data.mean() # \u03bc - \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0432\u0441\u0435\u0439 \u0441\u043e\u0432\u043e\u043a\u0443\u043f\u043d\u043e\u0441\u0442\u0438 ... SAMPLE_SIZE_1 = 3  # \u0440\u0430\u0437\u043c\u0435\u0440 \u043f\u0435\u0440\u0432\u043e\u0439 \u0432\u044b\u0431\u043e\u0440\u043a\u0438 SAMPLE_SIZE_2 = 50 # \u0440\u0430\u0437\u043c\u0435\u0440 \u0432\u0442\u043e\u0440\u043e\u0439 \u0432\u044b\u0431\u043e\u0440\u043a\u0438 ... for i in range(1000):      sample_1 = raw_data.sample(SAMPLE_SIZE_1)     sample_2 = raw_data.sample(SAMPLE_SIZE_2)      # https:\/\/en.wikipedia.org\/wiki\/Standard_error#Estimate     see_1 = sample_1.std() \/ math.sqrt(SAMPLE_SIZE_1) # \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0435\u043d\u0438\u0435 \u0432\u044b\u0431\u043e\u0440\u043a\u0438 (s) \u0432\u0437\u0430\u043c\u0435\u043d \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u044f \u0441\u043e\u0432\u043e\u043a\u0443\u043f\u043d\u043e\u0441\u0442\u0438 (\u03c3)     see_2 = sample_2.std() \/ math.sqrt(SAMPLE_SIZE_2) # \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0435\u043d\u0438\u0435 \u0432\u044b\u0431\u043e\u0440\u043a\u0438 (s) \u0432\u0437\u0430\u043c\u0435\u043d \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u044f \u0441\u043e\u0432\u043e\u043a\u0443\u043f\u043d\u043e\u0441\u0442\u0438 (\u03c3)     ...     sample_mean_1.loc[i] = [sample_1.mean()]     sample_mean_2.loc[i] = [sample_2.mean()]     ...     sample_see_1.loc[i] = [see_1] # \u043e\u0446\u0435\u043d\u043a\u0430 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0438 \u0434\u043b\u044f \u0432\u044b\u0431\u043e\u0440\u043a\u0438 n=3     sample_see_2.loc[i] = [see_2] # \u043e\u0446\u0435\u043d\u043a\u0430 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0438 \u0434\u043b\u044f \u0432\u044b\u0431\u043e\u0440\u043a\u0438 n=50     ...     # https:\/\/en.wikipedia.org\/wiki\/Student%27s_t-test#One-sample_t-test     t_sample_mean_1.loc[i] = ((sample_1.mean() - mean) \/ see_1) - 1 # -1, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u0433\u0440\u0430\u0444\u0438\u043a\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439     t_sample_mean_2.loc[i] = ((sample_2.mean() - mean) \/ see_2) + 1 # +1, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u0433\u0440\u0430\u0444\u0438\u043a\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439 <\/code><\/pre>\n<p><strong>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b:<\/strong> <\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/qb\/z-\/bb\/qbz-bbbex5kqskuqotoxuzrlmqc.gif\" data-src=\"https:\/\/habrastorage.org\/webt\/qb\/z-\/bb\/qbz-bbbex5kqskuqotoxuzrlmqc.gif\"\/><\/figure>\n<p>(<a href=\"#contents\" rel=\"noopener noreferrer nofollow\">\u043a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e<\/a>)<\/p>\n<p><a class=\"anchor\" name=\"distr-chi-2\" id=\"distr-chi-2\"><\/a><\/p>\n<h2>10. \u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0425\u0438-\u043a\u0432\u0430\u0434\u0440\u0430\u0442<\/h2>\n<p><strong>\u0421\u0445\u0435\u043c\u0430 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u044b\u0431\u043e\u0440\u043e\u043a \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438\u0441\u043a\u043e\u043c\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d:<\/strong> \u0412\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0443\u0436\u0435 \u0433\u043e\u0442\u043e\u0432\u044b\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d \u0438\u0437 \u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u041d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f <code>stats.norm.rvs(size)<\/code>. \u041f\u043e\u043b\u0443\u0447\u0438\u043c 1000 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e <img decoding=\"async\" class=\"formula inline\" source=\"Z_{i}\" alt=\"Z_{i}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/9d\/9d2\/9d27043dd55e80b1c6a5568749275d60.svg\" width=\"auto\" height=\"auto\"\/>, \u0433\u0434\u0435 <img decoding=\"async\" class=\"formula inline\" source=\"Z_{i} \\sim N(0,1), i \\in 0,...,k\" alt=\"Z_{i} \\sim N(0,1), i \\in 0,...,k\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/a\/a0\/a05\/a059b8fc0c7ddcff024006fb0c56419e.svg\" width=\"auto\" height=\"auto\"\/>, \u0433\u0434\u0435 <img decoding=\"async\" class=\"formula inline\" source=\"k\" alt=\"k\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/8c\/8ce\/8ce4b16b22b58894aa86c421e8759df3.svg\" width=\"auto\" height=\"auto\"\/> &#8212; \u044d\u0442\u043e \u0447\u0438\u0441\u043b\u043e \u0441\u0442\u0435\u043f\u0435\u043d\u0435\u0439 \u0441\u0432\u043e\u0431\u043e\u0434\u044b. \u0422\u043e\u0433\u0434\u0430 \u0438\u0441\u043a\u043e\u043c\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0437 \u0425\u0438-\u043a\u0432\u0430\u0434\u0440\u0430\u0442 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0447\u0435\u0441\u043b\u0435\u043d\u044b \u043f\u043e \u0444\u043e\u0440\u043c\u0443\u043b\u0435:<\/p>\n<p><img decoding=\"async\" class=\"formula\" source=\"Q = \\sum_{i=1}^k Z_i^2 \\sim \\chi^2(k).\" alt=\"Q = \\sum_{i=1}^k Z_i^2 \\sim \\chi^2(k).\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/3\/34\/347\/3478fa66d7c7b44ec47a4bee565207d1.svg\" width=\"auto\" height=\"auto\"\/><\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/gx\/qg\/dk\/gxqgdkdf9rknqe0ltx3r5s3pss8.png\" data-src=\"https:\/\/habrastorage.org\/webt\/gx\/qg\/dk\/gxqgdkdf9rknqe0ltx3r5s3pss8.png\"\/><\/figure>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0432\u044b\u0431\u043e\u0440\u043e\u043a \u0438 \u0438\u0441\u043a\u043e\u043c\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d (<a href=\"https:\/\/github.com\/nrsharip\/distributions\/blob\/336e1d8aa1f88cedb249a5b2b25a9c2992197839\/10-distribution-chi-squared.py\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/a>):<\/p>\n<pre><code class=\"python\">X_RANGE = 1000  DF_1 = 2 DF_2 = 3 DF_3 = 8 ... # \u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d # 0: [0 .. 999] # 1: [0 .. 999] # .. # 7: [0 .. 999] normal = [stats.norm.rvs(size=X_RANGE) for i in range(max(DF_1, DF_2, DF_3))] # \u0422\u0440\u0430\u043d\u0441\u043f\u043e\u043d\u0438\u0440\u0443\u0435\u043c \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d - \u0441\u0442\u0440\u043e\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0435 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u044b \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438 \u0446\u0438\u043a\u043b\u0430 for # 0: [0 .. 7] # 1: [0 .. 7] # .. # 999: [0 .. 7] normal = np.array(normal).transpose().tolist() for i in range(X_RANGE):     ########### \u0427\u0438\u0441\u043b\u043e \u0441\u0442\u0435\u043f\u0435\u043d\u0435\u0439 \u0441\u0432\u043e\u0431\u043e\u0434\u044b 1     x00 = normal[i][0: DF_1] # \u041c\u0430\u0441\u0441\u0438\u0432 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d [Z1, Z2]     chi_squared_0 = np.sum(np.square(x00)) # \u0411\u0435\u0440\u0451\u043c \u043a\u0432\u0430\u0434\u0440\u0430\u0442 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d \u0438 \u0441\u0443\u043c\u043c\u0438\u0440\u0443\u0435\u043c     ...     ########### \u0427\u0438\u0441\u043b\u043e \u0441\u0442\u0435\u043f\u0435\u043d\u0435\u0439 \u0441\u0432\u043e\u0431\u043e\u0434\u044b 2     x01 = normal[i][0: DF_2] # \u041c\u0430\u0441\u0441\u0438\u0432 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d [Z1, Z2, Z3]     chi_squared_1 = np.sum(np.square(x01)) # \u0411\u0435\u0440\u0451\u043c \u043a\u0432\u0430\u0434\u0440\u0430\u0442 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d \u0438 \u0441\u0443\u043c\u043c\u0438\u0440\u0443\u0435\u043c     ...     ########### \u0427\u0438\u0441\u043b\u043e \u0441\u0442\u0435\u043f\u0435\u043d\u0435\u0439 \u0441\u0432\u043e\u0431\u043e\u0434\u044b 3     x02 = normal[i][0: DF_3] # \u041c\u0430\u0441\u0441\u0438\u0432 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d [Z1, Z2, Z3, Z4, Z5, Z6, Z7, Z8]     chi_squared_2 = np.sum(np.square(x02)) # \u0411\u0435\u0440\u0451\u043c \u043a\u0432\u0430\u0434\u0440\u0430\u0442 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d \u0438 \u0441\u0443\u043c\u043c\u0438\u0440\u0443\u0435\u043c     ...     ###########     chis_0.append(chi_squared_0)     chis_1.append(chi_squared_1)     chis_2.append(chi_squared_2)     ... <\/code><\/pre>\n<p><strong>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b:<\/strong> <\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/rr\/hy\/eg\/rrhyegpteduueqqw4ohla5c-jvg.gif\" data-src=\"https:\/\/habrastorage.org\/webt\/rr\/hy\/eg\/rrhyegpteduueqqw4ohla5c-jvg.gif\"\/><\/figure>\n<p>(<a href=\"#contents\" rel=\"noopener noreferrer nofollow\">\u043a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e<\/a>)<\/p>\n<p><a class=\"anchor\" name=\"distr-f\" id=\"distr-f\"><\/a><\/p>\n<h2>11. \u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0424\u0438\u0448\u0435\u0440\u0430<\/h2>\n<p><strong>\u0421\u0445\u0435\u043c\u0430 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u044b\u0431\u043e\u0440\u043e\u043a \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438\u0441\u043a\u043e\u043c\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d:<\/strong> \u0412\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0443\u0436\u0435 \u0433\u043e\u0442\u043e\u0432\u044b\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d \u0438\u0437 \u0425\u0438-\u043a\u0432\u0430\u0434\u0440\u0430\u0442 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f <code>stats.chi2.rvs(df, size)<\/code>. \u041f\u043e\u043b\u0443\u0447\u0438\u043c 1000 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0434\u043b\u044f <img decoding=\"async\" class=\"formula inline\" source=\"S_{1} \\sim \\chi^2(d_{1})\" alt=\"S_{1} \\sim \\chi^2(d_{1})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/97\/970\/970c9ce420a8a1ca2db159d0287c9e2d.svg\" width=\"auto\" height=\"auto\"\/> \u0438 \u0434\u043b\u044f <img decoding=\"async\" class=\"formula inline\" source=\"S_{2} \\sim \\chi^2(d_{2})\" alt=\"S_{2} \\sim \\chi^2(d_{2})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/a\/ad\/ad9\/ad961ffeb661cfdd12bf89f8b33734d9.svg\" width=\"auto\" height=\"auto\"\/>. \u0422\u043e\u0433\u0434\u0430 \u0438\u0441\u043a\u043e\u043c\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0437 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0424\u0438\u0448\u0435\u0440\u0430 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0447\u0435\u0441\u043b\u0435\u043d\u044b \u043f\u043e \u0444\u043e\u0440\u043c\u0443\u043b\u0435:<\/p>\n<p><img decoding=\"async\" class=\"formula\" source=\"X = \\frac{S_1\/d_1}{S_2\/d_2} \\sim \\mathrm{F}(d_1,d_2).\" alt=\"X = \\frac{S_1\/d_1}{S_2\/d_2} \\sim \\mathrm{F}(d_1,d_2).\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/f\/f2\/f23\/f23b6363115ca48e7e2d44915fcaa92b.svg\" width=\"auto\" height=\"auto\"\/><\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/kl\/vo\/ex\/klvoexcfzgtuderawblj-ahbrm0.png\" data-src=\"https:\/\/habrastorage.org\/webt\/kl\/vo\/ex\/klvoexcfzgtuderawblj-ahbrm0.png\"\/><\/figure>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0432\u044b\u0431\u043e\u0440\u043e\u043a \u0438 \u0438\u0441\u043a\u043e\u043c\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d (<a href=\"https:\/\/github.com\/nrsharip\/distributions\/blob\/336e1d8aa1f88cedb249a5b2b25a9c2992197839\/11-distribution-f.py\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/a>):<\/p>\n<pre><code class=\"python\">X_RANGE = 1000  DF_1 = 1 # 1-\u044f \u043f\u0430\u0440\u0430 DF_2 = 9 # 1-\u044f \u043f\u0430\u0440\u0430 DF_3 = 2 # 2-\u044f \u043f\u0430\u0440\u0430 DF_4 = 4 # 2-\u044f \u043f\u0430\u0440\u0430 DF_5 = 3 # 3-\u044f \u043f\u0430\u0440\u0430 DF_6 = 5 # 3-\u044f \u043f\u0430\u0440\u0430 ... # \u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d \u0438\u0437 \u0425\u0438-\u043a\u0432\u0430\u0434\u0440\u0430\u0442 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439 # 0: [0 .. 999] # 1: [0 .. 999] # .. # 7: [0 .. 999] chi2 = [] chi2.append(stats.chi2.rvs(df=DF_1, size=X_RANGE)) chi2.append(stats.chi2.rvs(df=DF_2, size=X_RANGE)) chi2.append(stats.chi2.rvs(df=DF_3, size=X_RANGE)) chi2.append(stats.chi2.rvs(df=DF_4, size=X_RANGE)) chi2.append(stats.chi2.rvs(df=DF_5, size=X_RANGE)) chi2.append(stats.chi2.rvs(df=DF_6, size=X_RANGE)) # \u0422\u0440\u0430\u043d\u0441\u043f\u043e\u043d\u0438\u0440\u0443\u0435\u043c \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d - \u0441\u0442\u0440\u043e\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0435 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u044b \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438 \u0446\u0438\u043a\u043b\u0430 for # 0: [0 .. 7] # 1: [0 .. 7] # .. # 999: [0 .. 7] chi2 = np.array(chi2).transpose().tolist()  for i in range(X_RANGE):     ###########      x00 = [chi2[i][0], chi2[i][1]]     f_0 = (x00[0] \/ DF_1) \/ (x00[1] \/ DF_2)     ...     ###########      x01 = [chi2[i][2], chi2[i][3]]     f_1 = (x01[0] \/ DF_3) \/ (x01[1] \/ DF_4)     ...     ###########      x02 = [chi2[i][4], chi2[i][5]]     f_2 = (x02[0] \/ DF_5) \/ (x02[1] \/ DF_6)     ...     ###########     fs_0.append(f_0)     fs_1.append(f_1)     fs_2.append(f_2)     ... <\/code><\/pre>\n<p><strong>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b:<\/strong> <\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/l5\/t2\/bi\/l5t2bisd7qx2r1jtmgma2c6zejg.gif\" data-src=\"https:\/\/habrastorage.org\/webt\/l5\/t2\/bi\/l5t2bisd7qx2r1jtmgma2c6zejg.gif\"\/><\/figure>\n<p>(<a href=\"#contents\" rel=\"noopener noreferrer nofollow\">\u043a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e<\/a>)<\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0439 \u0438 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u043e\u0432 \u043f\u0440\u043e\u0448\u043b\u044b\u0445 \u0441\u0442\u043e\u043b\u0435\u0442\u0438\u0439. \u042d\u0442\u043e \u0432\u0430\u0436\u043d\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0442. \u043a. \u0440\u0430\u0441\u0447\u0451\u0442\u044b \u0442\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u043b\u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0432\u0441\u044f\u043a\u043e\u0433\u043e \u0440\u043e\u0434\u0430 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0442\u0435\u0445\u043d\u0438\u043a\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0433\u043b\u0430\u0432\u043d\u0430\u044f \u0440\u043e\u043b\u044c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439 \u0441\u0442\u0430\u043b\u0430 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%90%D0%BF%D0%BF%D1%80%D0%BE%D0%BA%D1%81%D0%B8%D0%BC%D0%B0%D1%86%D0%B8%D1%8F\" rel=\"noopener noreferrer nofollow\">\u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u044f<\/a> \u043b\u044e\u0431\u043e\u0433\u043e \u0440\u043e\u0434\u0430 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d. \u0414\u043b\u044f \u0441\u0430\u043c\u044b\u0445 \u0440\u0430\u0437\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447 \u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%A1%D1%82%D0%B0%D1%82%D0%B8%D1%81%D1%82%D0%B8%D1%87%D0%B5%D1%81%D0%BA%D0%B8%D0%B9_%D0%BA%D1%80%D0%B8%D1%82%D0%B5%D1%80%D0%B8%D0%B9\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u0438 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0435\u0432<\/a>, \u0432 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043b\u0435\u0436\u0430\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f. \u041f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u0438\u0437 \u043d\u0438\u0445 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/ru.wikipedia.org\/wiki\/Z-%D1%82%D0%B5%D1%81%D1%82\" rel=\"noopener noreferrer nofollow\">Z-\u0442\u0435\u0441\u0442<\/a>, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 <a href=\"#distr-normal\" rel=\"noopener noreferrer nofollow\">\u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/ru.wikipedia.org\/wiki\/T-%D0%BA%D1%80%D0%B8%D1%82%D0%B5%D1%80%D0%B8%D0%B9_%D0%A1%D1%82%D1%8C%D1%8E%D0%B4%D0%B5%D0%BD%D1%82%D0%B0\" rel=\"noopener noreferrer nofollow\">t-\u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0439 \u0421\u0442\u044c\u044e\u0434\u0435\u043d\u0442\u0430<\/a>, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 <a href=\"#distr-t\" rel=\"noopener noreferrer nofollow\">\u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u0421\u0442\u044c\u044e\u0434\u0435\u043d\u0442\u0430<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%9A%D1%80%D0%B8%D1%82%D0%B5%D1%80%D0%B8%D0%B9_%D1%85%D0%B8-%D0%BA%D0%B2%D0%B0%D0%B4%D1%80%D0%B0%D1%82\" rel=\"noopener noreferrer nofollow\">\u041a\u0440\u0438\u0442\u0435\u0440\u0438\u0439 \u0445\u0438-\u043a\u0432\u0430\u0434\u0440\u0430\u0442<\/a>, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0439 \u0441 <a href=\"#distr-chi-2\" rel=\"noopener noreferrer nofollow\">\u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u0425\u0438-\u043a\u0432\u0430\u0434\u0440\u0430\u0442<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/ru.wikipedia.org\/wiki\/F-%D1%82%D0%B5%D1%81%D1%82\" rel=\"noopener noreferrer nofollow\">F-\u0442\u0435\u0441\u0442<\/a>, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 <a href=\"#distr-f\" rel=\"noopener noreferrer nofollow\">\u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u0424\u0438\u0448\u0435\u0440\u0430 (F-\u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438)<\/a><\/p>\n<\/li>\n<\/ul>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u044c\u044e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u044d\u0442\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%9F%D1%80%D0%BE%D0%B2%D0%B5%D1%80%D0%BA%D0%B0_%D1%81%D1%82%D0%B0%D1%82%D0%B8%D1%81%D1%82%D0%B8%D1%87%D0%B5%D1%81%D0%BA%D0%B8%D1%85_%D0%B3%D0%B8%D0%BF%D0%BE%D1%82%D0%B5%D0%B7\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0433\u0438\u043f\u043e\u0442\u0435\u0437<\/a>, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043e\u043d\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u043e\u0446\u0435\u043d\u043a\u0443 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u0441\u044b\u0440\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043d\u0430\u0431\u043e\u0440\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u0438 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f (\u0433\u0438\u043f\u043e\u0442\u0435\u0437).<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \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\/801101\/\"> https:\/\/habr.com\/ru\/articles\/801101\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"\"><\/figure>\n<p>\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u044b \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043a\u0440\u0430\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u044b\u043c \u043a\u0430\u043c\u043d\u0435\u043c \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044f \u043b\u044e\u0431\u043e\u0439 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u044d\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432, \u0433\u0434\u0435 \u0443\u0447\u0451\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0432 \u0434\u0435\u043d\u044c, \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043d\u0430 \u0441\u0430\u0439\u0442\u0435, \u043d\u0430\u0436\u0430\u0442\u0438\u0439 \u043d\u0430 \u0446\u0435\u043b\u0435\u0432\u044b\u0435 \u043a\u043d\u043e\u043f\u043a\u0438, \u043f\u043e\u043a\u0443\u043f\u043e\u043a \u0442\u043e\u0432\u0430\u0440\u043e\u0432 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u044b\u0447\u043d\u044b\u043c \u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u043c \u044f\u0432\u043b\u0435\u043d\u0438\u0435\u043c. \u041b\u044e\u0431\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u043c \u043e\u043f\u044b\u0442\u0435 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 (\u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u0432\u0438\u0434, \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430, \u043a\u043e\u043d\u0442\u0435\u043d\u0442) \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0442 \u043a \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c \u0432 \u0440\u0430\u0431\u043e\u0442\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438, \u043a\u0430\u043a \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u044e\u0442\u0441\u044f \u0432 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u0412\u0430\u0436\u043d\u044b\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0435\u0433\u043e \u0444\u0443\u043d\u0434\u0430\u043c\u0435\u043d\u0442\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d, \u043e\u0442 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0446\u0435\u043d\u043a\u0438 \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u0438 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0441\u0434\u0435\u043b\u0430\u044e \u0443\u043f\u043e\u0440 \u043d\u0435 \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u0444\u043e\u0440\u043c\u0443\u043b\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0431\u044b\u0447\u043d\u043e \u0441\u043e\u043f\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f\u043c (<a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%A4%D1%83%D0%BD%D0%BA%D1%86%D0%B8%D1%8F_%D0%B2%D0%B5%D1%80%D0%BE%D1%8F%D1%82%D0%BD%D0%BE%D1%81%D1%82%D0%B8\" rel=\"noopener noreferrer nofollow\">\u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438<\/a>, <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%A4%D1%83%D0%BD%D0%BA%D1%86%D0%B8%D1%8F_%D1%80%D0%B0%D1%81%D0%BF%D1%80%D0%B5%D0%B4%D0%B5%D0%BB%D0%B5%D0%BD%D0%B8%D1%8F\" rel=\"noopener noreferrer nofollow\">\u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f<\/a>, <a href=\"https:\/\/en.wikipedia.org\/wiki\/Probability_mass_function\" rel=\"noopener noreferrer nofollow\">PMF<\/a>, <a href=\"https:\/\/en.wikipedia.org\/wiki\/Probability_density_function\" rel=\"noopener noreferrer nofollow\">PDF<\/a>, <a href=\"https:\/\/en.wikipedia.org\/wiki\/Cumulative_distribution_function\" rel=\"noopener noreferrer nofollow\">CDF<\/a>) &#8212; \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u043d\u0430\u0439\u0442\u0438 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e. \u0421\u043a\u043e\u0440\u0435\u0435 \u044f \u043f\u043e\u043f\u044b\u0442\u0430\u044e\u0441\u044c \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u0430\u043a \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0442\u0435 \u0438\u043b\u0438 \u0438\u043d\u044b\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445. \u042d\u0442\u043e, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u0435\u0435 \u0438 \u0432\u0430\u0436\u043d\u0435\u0435 \u0434\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0441\u0443\u0442\u0438 \u044d\u0442\u0438\u0445 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439 \u0438 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043e\u043d\u0438 \u0432 \u0438\u0442\u043e\u0433\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447 \u0430\u043d\u0430\u043b\u0438\u0437\u0430. \u0425\u043e\u0442\u0435\u043b \u0431\u044b \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0441\u0442\u0430\u0442\u044c\u044e <a href=\"https:\/\/habr.com\/ru\/companies\/skillfactory\/articles\/674880\/\" rel=\"noopener noreferrer nofollow\">&#171;\u041a\u0430\u043a \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f. \u041e\u0442 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u043e \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432&#187;<\/a>, \u0442. \u043a. \u044d\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u0440 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f\u043c\u0438 &#8212; \u0438\u0445 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043d\u0430 \u043f\u0440\u0435\u0434\u043c\u0435\u0442 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u0435\u0434\u0448\u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432. \u0422\u0430\u043a\u0436\u0435, \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0443\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0432\u044b\u0431\u043e\u0440\u043a\u043e\u0439 \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u043f\u0438\u0441\u0430\u043d \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 <a href=\"https:\/\/habr.com\/ru\/articles\/762648\/\" rel=\"noopener noreferrer nofollow\">&#171;\u0411\u0443\u0442\u0441\u0442\u0440\u0430\u043f \u0432 A\/B-\u0442\u0435\u0441\u0442\u0430\u0445: \u0448\u0432\u0435\u0439\u0446\u0430\u0440\u0441\u043a\u0438\u0439 \u043d\u043e\u0436 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0430&#187;<\/a><\/p>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435:<\/strong> \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u043d\u043e \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0443\u0436\u0435 \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d \u0438\u0437 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0445 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>scipy.stats.norm.rvs()<\/code>)<\/p>\n<p><a class=\"anchor\" name=\"contents\" id=\"contents\"><\/a><\/p>\n<h2>\u0421\u043f\u0438\u0441\u043e\u043a \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439<\/h2>\n<ol>\n<li>\n<p><a href=\"#distr-binomial\" rel=\"noopener noreferrer nofollow\">\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<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#distr-poisson\" rel=\"noopener noreferrer nofollow\">\u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u041f\u0443\u0430\u0441\u0441\u043e\u043d\u0430<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#distr-exponential\" rel=\"noopener noreferrer nofollow\">\u042d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#distr-weibull\" rel=\"noopener noreferrer nofollow\">\u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0412\u0435\u0439\u0431\u0443\u043b\u043b\u0430<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#distr-gamma\" rel=\"noopener noreferrer nofollow\">\u0413\u0430\u043c\u043c\u0430-\u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#distr-beta\" rel=\"noopener noreferrer nofollow\">\u0411\u0435\u0442\u0430-\u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#distr-hypergeometric\" rel=\"noopener noreferrer nofollow\">\u0413\u0438\u043f\u0435\u0440\u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#distr-normal\" rel=\"noopener noreferrer nofollow\">\u041d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#distr-t\" rel=\"noopener noreferrer nofollow\">\u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0421\u0442\u044c\u044e\u0434\u0435\u043d\u0442\u0430 (t-\u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435)<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#distr-chi-2\" rel=\"noopener noreferrer nofollow\">\u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0425\u0438-\u043a\u0432\u0430\u0434\u0440\u0430\u0442<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#distr-f\" rel=\"noopener noreferrer nofollow\">\u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0424\u0438\u0448\u0435\u0440\u0430<\/a><\/p>\n<\/li>\n<\/ol>\n<p><a class=\"anchor\" name=\"distr-binomial\" id=\"distr-binomial\"><\/a><\/p>\n<h2>1. \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<\/h2>\n<p><strong>\u0421\u0445\u0435\u043c\u0430 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u044b\u0431\u043e\u0440\u043e\u043a \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438\u0441\u043a\u043e\u043c\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d:<\/strong> \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c 1000 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c  \u0435\u0434\u0438\u043d\u0438\u0446\u0430\u043c\u0438 \u0441 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e , \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043d\u0443\u043b\u044f\u043c\u0438. \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 <strong>\u0435\u0434\u0438\u043d\u0438\u0446<\/strong> (\u0443\u0441\u043f\u0435\u0445\u043e\u0432) \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0438\u0441\u043a\u043e\u043c\u044b\u043c\u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c\u0438 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430\u043c\u0438, \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u044e\u0449\u0438\u043c\u0438 \u0411\u0438\u043d\u043e\u043c\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435.<\/p>\n<figure class=\"\"><\/figure>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0432\u044b\u0431\u043e\u0440\u043e\u043a \u0438 \u0438\u0441\u043a\u043e\u043c\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d (<a href=\"https:\/\/github.com\/nrsharip\/distributions\/blob\/336e1d8aa1f88cedb249a5b2b25a9c2992197839\/01-distribution-binomial.py\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/a>):<\/p>\n<pre><code class=\"python\">X_RANGE = 1000 Y_RANGE = 20 P_1 = 0.1 # \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0443\u0441\u043f\u0435\u0445\u0430 \u0434\u043b\u044f \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f P_2 = 0.5 # \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0443\u0441\u043f\u0435\u0445\u0430 \u0434\u043b\u044f \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f P_3 = 0.8 # \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0443\u0441\u043f\u0435\u0445\u0430 \u0434\u043b\u044f \u0442\u0440\u0435\u0442\u044c\u0435\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f ... for i in range(X_RANGE):      sample1 = [1 if r &lt; P_1 else 0 for r in [random.random() for i in range(Y_RANGE)]]     sample2 = [1 if r &lt; P_2 else 0 for r in [random.random() for i in range(Y_RANGE)]]     sample3 = [1 if r &lt; P_3 else 0 for r in [random.random() for i in range(Y_RANGE)]]      distr1.loc[i] = sample1.count(1)     distr2.loc[i] = sample2.count(1)     distr3.loc[i] = sample3.count(1)     ... <\/code><\/pre>\n<p><strong>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b:<\/strong><\/p>\n<figure class=\"\"><\/figure>\n<p>(<a href=\"#contents\" rel=\"noopener noreferrer nofollow\">\u043a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e<\/a>)<\/p>\n<p><a class=\"anchor\" name=\"distr-poisson\" id=\"distr-poisson\"><\/a><\/p>\n<h2>2. \u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u041f\u0443\u0430\u0441\u0441\u043e\u043d\u0430<\/h2>\n<p><strong>\u0421\u0445\u0435\u043c\u0430 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u044b\u0431\u043e\u0440\u043e\u043a \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438\u0441\u043a\u043e\u043c\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d:<\/strong> \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c 1000 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c  \u0435\u0434\u0438\u043d\u0438\u0446\u0430\u043c\u0438 \u0441 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e , \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043d\u0443\u043b\u044f\u043c\u0438.  \u0431\u0435\u0440\u0451\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u043c, \u0430 \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0435\u0434\u0438\u043d\u0438\u0446 (\u0443\u0441\u043f\u0435\u0445\u043e\u0432) . \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 <strong>\u0435\u0434\u0438\u043d\u0438\u0446<\/strong> (\u0443\u0441\u043f\u0435\u0445\u043e\u0432) \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0438\u0441\u043a\u043e\u043c\u044b\u043c\u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c\u0438 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430\u043c\u0438, \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u044e\u0449\u0438\u043c\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u041f\u0443\u0430\u0441\u0441\u043e\u043d\u0430.<\/p>\n<figure class=\"\"><\/figure>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0432\u044b\u0431\u043e\u0440\u043e\u043a \u0438 \u0438\u0441\u043a\u043e\u043c\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d (<a href=\"https:\/\/github.com\/nrsharip\/distributions\/blob\/336e1d8aa1f88cedb249a5b2b25a9c2992197839\/02-distribution-poisson.py\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/a>):<\/p>\n<pre><code class=\"python\">X_RANGE = 1000 # 1000 \u0432\u044b\u0431\u043e\u0440\u043e\u043a Y_RANGE = 1000 # \u0440\u0430\u0437\u043c\u0435\u0440 \u043e\u0434\u043d\u043e\u0439 \u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0439 P1 = 0.001 # \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0443\u0441\u043f\u0435\u0445\u0430 \u0434\u043b\u044f \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f (\u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0443\u0441\u043f\u0435\u0445\u043e\u0432 \u0434\u043b\u044f 1000 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432 \u03bb = 1) P2 = 0.01 # \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0443\u0441\u043f\u0435\u0445\u0430 \u0434\u043b\u044f \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f (\u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0443\u0441\u043f\u0435\u0445\u043e\u0432 \u0434\u043b\u044f 1000 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432 \u03bb = 10) P3 = 0.03 # \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0443\u0441\u043f\u0435\u0445\u0430 \u0434\u043b\u044f \u0442\u0440\u0435\u0442\u044c\u0435\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f (\u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0443\u0441\u043f\u0435\u0445\u043e\u0432 \u0434\u043b\u044f 1000 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432 \u03bb = 30) ... for i in range(X_RANGE):      # https:\/\/numpy.org\/doc\/stable\/reference\/random\/generated\/numpy.random.poisson.html     # The Poisson distribution is the limit of the binomial distribution for large N.     sample_1 = [1 if r &lt; P1 else 0 for r in [random.random() for i in range(Y_RANGE)]]     sample_2 = [1 if r &lt; P2 else 0 for r in [random.random() for i in range(Y_RANGE)]]     sample_3 = [1 if r &lt; P3 else 0 for r in [random.random() for i in range(Y_RANGE)]]      distr_1.loc[i] = sample_1.count(1)     distr_2.loc[i] = sample_2.count(1)     distr_3.loc[i] = sample_3.count(1)     ... <\/code><\/pre>\n<p><strong>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b:<\/strong><\/p>\n<figure class=\"\"><\/figure>\n<p>(<a href=\"#contents\" rel=\"noopener noreferrer nofollow\">\u043a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e<\/a>)<\/p>\n<p><a class=\"anchor\" name=\"distr-exponential\" id=\"distr-exponential\"><\/a><\/p>\n<h2>3. \u042d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435<\/h2>\n<p><strong>\u0421\u0445\u0435\u043c\u0430 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u044b\u0431\u043e\u0440\u043e\u043a \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438\u0441\u043a\u043e\u043c\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d:<\/strong> \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c 1000 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c  \u0435\u0434\u0438\u043d\u0438\u0446\u0430\u043c\u0438 \u0441 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e  (\u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 ), \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043d\u0443\u043b\u044f\u043c\u0438. \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 <strong>\u043d\u0443\u043b\u0435\u0439<\/strong> \u043c\u0435\u0436\u0434\u0443 \u0435\u0434\u0438\u043d\u0438\u0446\u0430\u043c\u0438 (\u0443\u0441\u043f\u0435\u0445\u0430\u043c\u0438) \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0438\u0441\u043a\u043e\u043c\u044b\u043c\u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c\u0438 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430\u043c\u0438, \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u044e\u0449\u0438\u043c\u0438 \u042d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435. \u041d\u0443\u043b\u0438 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0433\u0440\u0430\u044e\u0442 \u0440\u043e\u043b\u044c &#171;\u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u0438&#187; \u043c\u0435\u0436\u0434\u0443 &#171;\u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c\u0438&#187; (&#171;\u0443\u0441\u043f\u0435\u0445\u0430\u043c\u0438&#187;, \u0435\u0434\u0438\u043d\u0438\u0446\u0430\u043c\u0438).<\/p>\n<figure class=\"\"><\/figure>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0432\u044b\u0431\u043e\u0440\u043e\u043a \u0438 \u0438\u0441\u043a\u043e\u043c\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d (<a href=\"https:\/\/github.com\/nrsharip\/distributions\/blob\/336e1d8aa1f88cedb249a5b2b25a9c2992197839\/03-distribution-exponential.py\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/a>):<\/p>\n<pre><code class=\"python\">X_RANGE = 1000 # 1000 \u0432\u044b\u0431\u043e\u0440\u043e\u043a Y_RANGE = 20   # \u0431\u0435\u0440\u0451\u043c \u0432\u044b\u0431\u043e\u0440\u043a\u0443 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c 20  LAMBDA_1 = 1 # \u0432 \u0441\u0440\u0435\u0434\u043d\u0435\u043c 1 \u0443\u0441\u043f\u0435\u0445 \u0437\u0430 \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0432\u0435\u0440\u0435\u043c\u0435\u043d\u0438 (\u0432\u044b\u0431\u043e\u0440\u043a\u0443) LAMBDA_2 = 2 # \u0432 \u0441\u0440\u0435\u0434\u043d\u0435\u043c 2 \u0443\u0441\u043f\u0435\u0445\u0430 \u0437\u0430 \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0432\u0435\u0440\u0435\u043c\u0435\u043d\u0438 (\u0432\u044b\u0431\u043e\u0440\u043a\u0443) LAMBDA_3 = 3 # \u0432 \u0441\u0440\u0435\u0434\u043d\u0435\u043c 3 \u0443\u0441\u043f\u0435\u0445\u0430 \u0437\u0430 \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0432\u0435\u0440\u0435\u043c\u0435\u043d\u0438 (\u0432\u044b\u0431\u043e\u0440\u043a\u0443)  P1 = LAMBDA_1 \/ Y_RANGE # \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0443\u0441\u043f\u0435\u0445\u0430 \u0434\u043b\u044f LAMBDA_1 P2 = LAMBDA_2 \/ Y_RANGE # \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0443\u0441\u043f\u0435\u0445\u0430 \u0434\u043b\u044f LAMBDA_2 P3 = LAMBDA_3 \/ Y_RANGE # \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0443\u0441\u043f\u0435\u0445\u0430 \u0434\u043b\u044f LAMBDA_3  THETA_1 = (Y_RANGE - LAMBDA_1)\/LAMBDA_1 # \u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043c\u0435\u0436\u0434\u0443 \u0443\u0441\u043f\u0435\u0445\u0430\u043c\u0438                                         # (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, 1 \u0443\u0441\u043f\u0435\u0445 \u0438\u0437 1000 \u0437\u0430\u043c\u0435\u0440\u043e\u0432 \u0434\u0430\u0451\u0442 \u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b 999) THETA_2 = (Y_RANGE - LAMBDA_2)\/LAMBDA_2 # \u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043c\u0435\u0436\u0434\u0443 \u0443\u0441\u043f\u0435\u0445\u0430\u043c\u0438                                          # (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, 2 \u0443\u0441\u043f\u0435\u0445\u0430 \u0438\u0437 1000 \u0437\u0430\u043c\u0435\u0440\u043e\u0432 \u0434\u0430\u0451\u0442 \u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b 499) THETA_3 = (Y_RANGE - LAMBDA_3)\/LAMBDA_3 # \u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043c\u0435\u0436\u0434\u0443 \u0443\u0441\u043f\u0435\u0445\u0430\u043c\u0438                                         # (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, 3 \u0443\u0441\u043f\u0435\u0445\u0430 \u0438\u0437 1000 \u0437\u0430\u043c\u0435\u0440\u043e\u0432 \u0434\u0430\u0451\u0442 \u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b ~332) ... # \u041f\u0440\u0438\u043c\u0435\u0440: 1 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 1 # \u0427\u0438\u0441\u043b\u043e \u0443\u0441\u043f\u0435\u0445\u043e\u0432: 4 # \u0412\u0440\u0435\u043c\u044f \u043c\u0435\u0436\u0434\u0443 \u0443\u0441\u043f\u0435\u0445\u0430\u043c\u0438: [3, 8, 4]  def calc_times(sample: list, df: pd.DataFrame, remainder: int):     time = remainder     for event in sample:         if event == 1:             df.loc[len(df), 'time'] = time             time = 0         elif event == 0:             time += 1     return df, time  remainder1 = 0 remainder2 = 0 remainder3 = 0 for i in range(X_RANGE):      # https:\/\/numpy.org\/doc\/stable\/reference\/random\/generated\/numpy.random.poisson.html     # The Poisson distribution is the limit of the binomial distribution for large N.     sample_1 = [1 if r &lt; P1 else 0 for r in [random.random() for i in range(Y_RANGE)]]     sample_2 = [1 if r &lt; P2 else 0 for r in [random.random() for i in range(Y_RANGE)]]     sample_3 = [1 if r &lt; P3 else 0 for r in [random.random() for i in range(Y_RANGE)]]      distr_1, remainder1 = calc_times(sample_1, distr_1, remainder1)     distr_2, remainder2 = calc_times(sample_2, distr_2, remainder2)     distr_3, remainder3 = calc_times(sample_3, distr_3, remainder3)     ... <\/code><\/pre>\n<p><strong>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b:<\/strong> <\/p>\n<figure class=\"\"><\/figure>\n<p>(<a href=\"#contents\" rel=\"noopener noreferrer nofollow\">\u043a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e<\/a>)<\/p>\n<p><a class=\"anchor\" name=\"distr-weibull\" id=\"distr-weibull\"><\/a><\/p>\n<h2>4. \u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0412\u0435\u0439\u0431\u0443\u043b\u043b\u0430<\/h2>\n<p><strong>\u0421\u0445\u0435\u043c\u0430 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u044b\u0431\u043e\u0440\u043e\u043a \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438\u0441\u043a\u043e\u043c\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d:<\/strong> \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c 1000 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c  \u0435\u0434\u0438\u043d\u0438\u0446\u0430\u043c\u0438 \u0441 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e  (\u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 ), \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043d\u0443\u043b\u044f\u043c\u0438. \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 <strong>\u043d\u0443\u043b\u0435\u0439<\/strong> \u043c\u0435\u0436\u0434\u0443 \u0435\u0434\u0438\u043d\u0438\u0446\u0430\u043c\u0438 (\u0443\u0441\u043f\u0435\u0445\u0430\u043c\u0438) \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0435, \u0432\u043e\u0437\u0432\u0435\u0434\u0451\u043d\u043d\u044b\u0435 \u0432 \u0441\u0442\u0435\u043f\u0435\u043d\u044c , \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0438\u0441\u043a\u043e\u043c\u044b\u043c\u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c\u0438 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430\u043c\u0438, \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u044e\u0449\u0438\u043c\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0412\u0435\u0439\u0431\u0443\u043b\u043b\u0430. \u041d\u0443\u043b\u0438 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0433\u0440\u0430\u044e\u0442 \u0440\u043e\u043b\u044c &#171;\u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u0438&#187; \u043c\u0435\u0436\u0434\u0443 &#171;\u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c\u0438&#187; (&#171;\u0443\u0441\u043f\u0435\u0445\u0430\u043c\u0438&#187;, \u0435\u0434\u0438\u043d\u0438\u0446\u0430\u043c\u0438), \u0430 \u043c\u0435\u043d\u044f\u044e\u0449\u0430\u044f\u0441\u044f \u0438\u043d\u0442\u0435\u043d\u0441\u0438\u0432\u043d\u043e\u0441\u0442\u044c &#171;\u0441\u043e\u0431\u044b\u0442\u0438\u0439&#187; \u043e\u0442\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0441\u0442\u0435\u043f\u0435\u043d\u044c\u044e .<\/p>\n<figure class=\"\"><\/figure>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0432\u044b\u0431\u043e\u0440\u043e\u043a \u0438 \u0438\u0441\u043a\u043e\u043c\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d (<a href=\"https:\/\/github.com\/nrsharip\/distributions\/blob\/336e1d8aa1f88cedb249a5b2b25a9c2992197839\/04-distribution-weibull.py\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/a>):<\/p>\n<pre><code class=\"python\">X_RANGE = 1000 # 1000 \u0432\u044b\u0431\u043e\u0440\u043e\u043a Y_RANGE = 1000 # \u0431\u0435\u0440\u0451\u043c \u0432\u044b\u0431\u043e\u0440\u043a\u0443 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c 1000  LAMBDA_1 = 1 # \u0432 \u0441\u0440\u0435\u0434\u043d\u0435\u043c 1 \u0443\u0441\u043f\u0435\u0445 \u0437\u0430 \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0432\u0435\u0440\u0435\u043c\u0435\u043d\u0438 (\u0432\u044b\u0431\u043e\u0440\u043a\u0443) LAMBDA_2 = 2 # \u0432 \u0441\u0440\u0435\u0434\u043d\u0435\u043c 2 \u0443\u0441\u043f\u0435\u0445\u0430 \u0437\u0430 \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0432\u0435\u0440\u0435\u043c\u0435\u043d\u0438 (\u0432\u044b\u0431\u043e\u0440\u043a\u0443) LAMBDA_3 = 3 # \u0432 \u0441\u0440\u0435\u0434\u043d\u0435\u043c 3 \u0443\u0441\u043f\u0435\u0445\u0430 \u0437\u0430 \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0432\u0435\u0440\u0435\u043c\u0435\u043d\u0438 (\u0432\u044b\u0431\u043e\u0440\u043a\u0443)  P1 = LAMBDA_1 \/ Y_RANGE # \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0443\u0441\u043f\u0435\u0445\u0430 \u0434\u043b\u044f LAMBDA_1 P2 = LAMBDA_2 \/ Y_RANGE # \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0443\u0441\u043f\u0435\u0445\u0430 \u0434\u043b\u044f LAMBDA_2 P3 = LAMBDA_3 \/ Y_RANGE # \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0443\u0441\u043f\u0435\u0445\u0430 \u0434\u043b\u044f LAMBDA_3  THETA_1 = (Y_RANGE - LAMBDA_1)\/LAMBDA_1 # \u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043c\u0435\u0436\u0434\u0443 \u0443\u0441\u043f\u0435\u0445\u0430\u043c\u0438                                         # (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, 1 \u0443\u0441\u043f\u0435\u0445 \u0438\u0437 1000 \u0437\u0430\u043c\u0435\u0440\u043e\u0432 \u0434\u0430\u0451\u0442 \u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b 999) THETA_2 = (Y_RANGE - LAMBDA_2)\/LAMBDA_2 # \u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043c\u0435\u0436\u0434\u0443 \u0443\u0441\u043f\u0435\u0445\u0430\u043c\u0438                                          # (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, 2 \u0443\u0441\u043f\u0435\u0445\u0430 \u0438\u0437 1000 \u0437\u0430\u043c\u0435\u0440\u043e\u0432 \u0434\u0430\u0451\u0442 \u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b 499) THETA_3 = (Y_RANGE - LAMBDA_3)\/LAMBDA_3 # \u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043c\u0435\u0436\u0434\u0443 \u0443\u0441\u043f\u0435\u0445\u0430\u043c\u0438                                         # (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, 3 \u0443\u0441\u043f\u0435\u0445\u0430 \u0438\u0437 1000 \u0437\u0430\u043c\u0435\u0440\u043e\u0432 \u0434\u0430\u0451\u0442 \u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b ~332)  BETA_1 = 3.0 BETA_2 = 1.5  BETA_3 = 0.9   K_1 = 1\/BETA_1 # \u0441\u0442\u0435\u043f\u0435\u043d\u044c, \u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u0432\u0435\u0434\u0435\u043d\u043e \u043a\u0430\u0436\u0434\u043e\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 K_2 = 1\/BETA_2 # \u0441\u0442\u0435\u043f\u0435\u043d\u044c, \u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u0432\u0435\u0434\u0435\u043d\u043e \u043a\u0430\u0436\u0434\u043e\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 K_3 = 1\/BETA_3 # \u0441\u0442\u0435\u043f\u0435\u043d\u044c, \u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u0432\u0435\u0434\u0435\u043d\u043e \u043a\u0430\u0436\u0434\u043e\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 ... # \u041f\u0440\u0438\u043c\u0435\u0440: 1 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 1 # \u0427\u0438\u0441\u043b\u043e \u0443\u0441\u043f\u0435\u0445\u043e\u0432: 4 # \u0412\u0440\u0435\u043c\u044f \u043c\u0435\u0436\u0434\u0443 \u0443\u0441\u043f\u0435\u0445\u0430\u043c\u0438: [3, 8, 4]  def calc_times(sample: list, df: pd.DataFrame, remainder: int):     time = remainder     for event in sample:         if event == 1:             df.loc[len(df), 'time'] = time             time = 0         elif event == 0:             time += 1     return df, time  remainder1 = 0 remainder2 = 0 remainder3 = 0 for i in range(X_RANGE):      # https:\/\/numpy.org\/doc\/stable\/reference\/random\/generated\/numpy.random.poisson.html     # The Poisson distribution is the limit of the binomial distribution for large N.     sample_1 = [1 if r &lt; P1 else 0 for r in [random.random() for i in<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-371145","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/371145","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=371145"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/371145\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=371145"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=371145"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=371145"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}