{"id":408552,"date":"2024-06-29T20:14:10","date_gmt":"2024-06-29T20:14:10","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=408552"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=408552","title":{"rendered":"<span>\u041b\u0443\u0447\u0448\u0438\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0432\u044b\u0431\u043e\u0440\u0430 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0432 \u043a\u0440\u0443\u0433\u0435<\/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-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/ug\/az\/yc\/ugazyczs_99q3hmdam2r_mxna20.png\" alt=\"image\" data-src=\"https:\/\/habrastorage.org\/webt\/ug\/az\/yc\/ugazyczs_99q3hmdam2r_mxna20.png\"\/><\/div>\n<p>  \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443 \u0441 \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u044b\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u0432 \u043a\u0440\u0443\u0433\u0435. \u041a\u0430\u043a \u0436\u0435 \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435\u0433\u043e? \u041a\u043e\u0433\u0434\u0430 \u044f \u0432\u043f\u0435\u0440\u0432\u044b\u0435 \u043d\u0430\u0447\u0430\u043b \u0438\u0437\u0443\u0447\u0430\u0442\u044c \u044d\u0442\u0443 \u0437\u0430\u0434\u0430\u0447\u0443, \u044f \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u043d\u0430\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c, \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0432\u0448\u0438\u043c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432 \u043a\u0440\u0443\u0433\u0435, \u043d\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u044f \u0441\u043f\u0443\u0441\u0442\u0438\u043b\u0441\u044f \u0432 \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u043e \u0433\u043b\u0443\u0431\u043e\u043a\u0443\u044e \u043a\u0440\u043e\u043b\u0438\u0447\u044c\u044e \u043d\u043e\u0440\u0443, \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u0443\u044e \u043b\u044e\u0431\u043e\u043f\u044b\u0442\u043d\u043e\u0439 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u043e\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0435\u0448\u0438\u043b \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u0432\u0441\u0435 \u0441\u0432\u043e\u0438 \u043d\u0430\u0445\u043e\u0434\u043a\u0438 \u0432 \u043e\u0434\u043d\u0443 \u0441\u0442\u0430\u0442\u044c\u044e.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043a \u043a\u0440\u0443\u0433\u0443, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u043c \u0437\u0430\u0434\u0430\u0447\u0443 \u0438 \u0432\u044b\u0431\u0435\u0440\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443 \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0430. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/4cc\/fd4\/32e\/4ccfd432ea4f2a64f3a5c8c7378517af.svg\" alt=\"$x$\" data-tex=\"inline\"\/> \u0438 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8f8\/c2f\/a70\/8f8c2fa70a7019d42baacce3ac56acd3.svg\" alt=\"$y$\" data-tex=\"inline\"\/> \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0430. \u0412 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u044d\u0442\u043e\u0442 \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0438 \u043a \u043a\u0440\u0443\u0433\u0430\u043c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u043e\u0447\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043f\u0430\u0434\u0430\u0442\u044c \u0432 \u043a\u0440\u0443\u0433, \u043d\u043e \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u044d\u0442\u0430\u043f \u2014 \u0435\u0441\u043b\u0438 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u0430\u043c\u0438 \u043a\u0440\u0443\u0433\u0430, \u0442\u043e \u043c\u044b \u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u043d\u043e\u0432\u0430 \u0438 \u0441\u043d\u043e\u0432\u0430, \u043f\u043e\u043a\u0430 \u0442\u043e\u0447\u043a\u0430 \u043d\u0435 \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0432 \u043a\u0440\u0443\u0433\u0435. \u042d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u0441 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435\u043c (rejection sampling) \u2014 \u0432\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435, \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0442\u043a\u043b\u043e\u043d\u044f\u0435\u043c \u0432\u0441\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u0435\u0441\u044f \u0432\u043d\u0435 \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u043d\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430.<\/p>\n<p>  \u0421\u043f\u043e\u0441\u043e\u0431 \u0432\u043f\u043e\u043b\u043d\u0435 \u0440\u0430\u0431\u043e\u0447\u0438\u0439, \u043d\u043e \u043c\u043d\u0435 \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0442\u043e, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0438\u043d\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0437. \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c \u0440\u0430\u0434\u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b, \u0447\u0442\u043e \u0440\u0430\u0434\u0438\u0443\u0441 \u043d\u0430\u0448\u0435\u0439 \u043e\u043a\u0440\u0443\u0436\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0432\u0435\u043d <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d4a\/c7f\/4b6\/d4ac7f4b6821aecb794f61695d169e22.svg\" alt=\"$1$\" data-tex=\"inline\"\/> (\u043d\u043e \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c\u044b \u043a \u043a\u0440\u0443\u0433\u0430\u043c \u043b\u044e\u0431\u043e\u0433\u043e \u0440\u0430\u0434\u0438\u0443\u0441\u0430). \u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u0430\u044f \u044d\u0442\u0438\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u043c \u0442\u043e\u0447\u043a\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u0440\u0443\u0433\u0430, \u0440\u0430\u0432\u043d\u0430 \u043f\u043b\u043e\u0449\u0430\u0434\u0438 \u043a\u0440\u0443\u0433\u0430, \u0440\u0430\u0437\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0439 \u043d\u0430 \u043f\u043b\u043e\u0449\u0430\u0434\u044c \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0430, \u0438\u043b\u0438 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/4a2\/2d7\/df5\/4a22d7df5480ab752635de38c7fd774e.svg\" alt=\"$\\pi$\" data-tex=\"inline\"\/>, \u0434\u0435\u043b\u0451\u043d\u043d\u0430\u044f \u043d\u0430 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/fdf\/c7e\/70a\/fdfc7e70a9b5c10b0346a160163699c8.svg\" alt=\"$4$\" data-tex=\"inline\"\/>, \u0447\u0442\u043e \u043f\u0440\u0438\u0431\u043b\u0438\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0432\u043d\u043e <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/848\/328\/acf\/848328acfbca0c47b38daf6a468a8984.svg\" alt=\"$0,785$\" data-tex=\"inline\"\/>. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0431\u043e\u0440\u0430 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u043c \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/35b\/a56\/5f3\/35ba565f36734f3a55aa01ac67868762.svg\" alt=\"$n$\" data-tex=\"inline\"\/> \u0440\u0430\u0437 \u0440\u0430\u0432\u043d\u0430 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/49c\/c2d\/423\/49cc2d423a9d6237b57f1b2b27f99841.svg\" alt=\"$1 - pi\/4$\" data-tex=\"inline\"\/> \u0432 \u0441\u0442\u0435\u043f\u0435\u043d\u0438 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/35b\/a56\/5f3\/35ba565f36734f3a55aa01ac67868762.svg\" alt=\"$n$\" data-tex=\"inline\"\/>, \u0433\u0434\u0435 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/35b\/a56\/5f3\/35ba565f36734f3a55aa01ac67868762.svg\" alt=\"$n$\" data-tex=\"inline\"\/> \u2014 \u043d\u0435\u043a\u043e\u0435 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e. \u0421 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0435\u043c <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/35b\/a56\/5f3\/35ba565f36734f3a55aa01ac67868762.svg\" alt=\"$n$\" data-tex=\"inline\"\/> \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043e\u0447\u0435\u043d\u044c \u0431\u044b\u0441\u0442\u0440\u043e \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u043c\u0430\u043b\u044b\u043c. \u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0447\u0435\u0442\u044b\u0440\u0451\u0445\u043a\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u043c\u0435\u043d\u044c\u0448\u0435 \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u0438 \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u0430. \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u043f\u043e\u043f\u044b\u0442\u043e\u043a, \u0438\u043b\u0438 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/35b\/a56\/5f3\/35ba565f36734f3a55aa01ac67868762.svg\" alt=\"$n$\" data-tex=\"inline\"\/>, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u0443 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0433\u043e \u0432\u044b\u0431\u043e\u0440\u0430, \u0442\u043e \u0435\u0441\u0442\u044c <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/cbc\/f89\/95c\/cbcf8995c2c74c8e94fa0a526095e038.svg\" alt=\"$4\/pi$\" data-tex=\"inline\"\/>, \u0447\u0442\u043e \u043f\u0440\u0438\u0431\u043b\u0438\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0432\u043d\u043e <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/f0b\/a53\/20b\/f0ba5320bc56df408c47e2b8a5aff615.svg\" alt=\"$1,273$\" data-tex=\"inline\"\/>. \u0422\u043e \u0435\u0441\u0442\u044c \u0432 \u0441\u0440\u0435\u0434\u043d\u0435\u043c \u043d\u0430\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0443 \u043f\u043e\u043f\u044b\u0442\u043a\u0443. \u0412\u0441\u0435 \u044d\u0442\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0434\u0430\u044e\u0442 \u043d\u0430\u043c \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0431\u0435\u0441\u043f\u043e\u043a\u043e\u0438\u0442\u044c\u0441\u044f \u043e \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0434\u043e\u043b\u0433\u043e\u043c \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430.<\/p>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043d\u0430 Python.<\/p>\n<pre><code class=\"python\">def rejection_sampling():     while True:         x = random() * 2 - 1         y = random() * 2 - 1         if x * x + y * y &lt; 1:             return x, y<\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044e \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043a\u0440\u0430\u0441\u0438\u0432\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0437 (<img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/877\/8db\/b66\/8778dbb66221b013510527828a60fc29.svg\" alt=\"$3141$\" data-tex=\"inline\"\/>), \u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0443 \u0436\u0435\u043b\u0430\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u2014 \u0442\u043e\u0447\u043a\u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e, \u043d\u043e \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u043f\u043e \u043a\u0440\u0443\u0433\u0443.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/in\/xm\/2z\/inxm2zyi-vksvf0yvx6tzlohamo.png\" data-src=\"https:\/\/habrastorage.org\/webt\/in\/xm\/2z\/inxm2zyi-vksvf0yvx6tzlohamo.png\"\/><\/div>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f, \u043d\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0430\u044f \u0442\u043e\u0447\u043a\u0430 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e \u0432\u044b\u0431\u0438\u0440\u0430\u043b\u0430\u0441\u044c \u0441 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0440\u0430\u0437\u0430. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 (\u0434\u0435\u043a\u0430\u0440\u0442\u043e\u0432\u0443), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u043d\u0430\u0441, \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u044f \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u0434\u0432\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0435 \u0441\u043e\u0431\u043e\u0439 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043d\u0430 \u043f\u0435\u0440\u043f\u0435\u043d\u0434\u0438\u043a\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u043e\u0441\u044f\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/4cc\/fd4\/32e\/4ccfd432ea4f2a64f3a5c8c7378517af.svg\" alt=\"$x$\" data-tex=\"inline\"\/> \u0438 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8f8\/c2f\/a70\/8f8c2fa70a7019d42baacce3ac56acd3.svg\" alt=\"$y$\" data-tex=\"inline\"\/>. \u0413\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0430\u0448\u0438\u043c \u0446\u0435\u043b\u044f\u043c \u043f\u043e\u0434\u043e\u0439\u0434\u0451\u0442 \u043f\u043e\u043b\u044f\u0440\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0437\u0430\u0434\u0430\u044e\u0442\u0441\u044f \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c \u043e\u0442 \u0442\u043e\u0447\u043a\u0438 \u043d\u0430\u0447\u0430\u043b\u0430 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0438 \u0443\u0433\u043b\u043e\u043c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0442\u043e\u0447\u043a\u0443 (<img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/c37\/24c\/45a\/c3724c45ab9dcf8945e6bcece2165788.svg\" alt=\"$2$\" data-tex=\"inline\"\/>, <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/c4b\/4c8\/ed4\/c4b4c8ed46dd33990c7a70b36e807ec7.svg\" alt=\"$pi\/3$\" data-tex=\"inline\"\/>). \u0412 \u0434\u0435\u043a\u0430\u0440\u0442\u043e\u0432\u044b\u0445 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u0445 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0442\u043e\u0447\u043a\u0430 \u043d\u0430 \u043f\u0435\u0440\u0435\u0441\u0435\u0447\u0435\u043d\u0438\u0438 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/f01\/719\/fd7\/f01719fd78e800486b5a83a485d7ba7c.svg\" alt=\"$x = 2$\" data-tex=\"inline\"\/> \u0438 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/e34\/8b2\/96d\/e348b296d34bca25895d56f06e172cfa.svg\" alt=\"$y = pi\/3$\" data-tex=\"inline\"\/>, \u043d\u043e \u0432 \u043f\u043e\u043b\u044f\u0440\u043d\u044b\u0445 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u0445 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0442\u043e\u0447\u043a\u0430, \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u0430\u044f \u0432 \u0434\u0432\u0443\u0445 \u0435\u0434\u0438\u043d\u0438\u0446\u0430\u0445 \u043e\u0442 \u0442\u043e\u0447\u043a\u0438 \u043d\u0430\u0447\u0430\u043b\u0430 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0438 \u043f\u043e\u0432\u0451\u0440\u043d\u0443\u0442\u0430\u044f \u043d\u0430 \u0443\u0433\u043e\u043b <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/c4b\/4c8\/ed4\/c4b4c8ed46dd33990c7a70b36e807ec7.svg\" alt=\"$pi\/3$\" data-tex=\"inline\"\/> \u0440\u0430\u0434\u0438\u0430\u043d.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/qb\/qr\/kg\/qbqrkght7hi_2uetgyygfkctp-c.png\" data-src=\"https:\/\/habrastorage.org\/webt\/qb\/qr\/kg\/qbqrkght7hi_2uetgyygfkctp-c.png\"\/><\/div>\n<p>  \u0414\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u0437\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u043d\u0430 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u044d\u0442\u0438\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c, \u043f\u043e\u0447\u0435\u043c\u0443 \u043f\u043e\u043b\u044f\u0440\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043a\u0440\u0443\u0433\u0430\u043c\u0438. \u0418\u0442\u0430\u043a, \u0432\u0441\u0451, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u2014 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0439 \u0440\u0430\u0434\u0438\u0443\u0441 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b88\/ce3\/99f\/b88ce399fda6c8123ab168cb507210f2.svg\" alt=\"$r$\" data-tex=\"inline\"\/> \u0432 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0435 \u043e\u0442 0 \u0434\u043e 1 \u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0439 \u0443\u0433\u043e\u043b <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/1f5\/40a\/1b5\/1f540a1b5c23e4c90dffe9f2cb495a76.svg\" alt=\"$\\theta$\" data-tex=\"inline\"\/> (\u0442\u0435\u0442\u0430) \u043e\u0442 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/502\/f96\/0ea\/502f960ea92bcba31646e66cccd41554.svg\" alt=\"$0$\" data-tex=\"inline\"\/> \u0434\u043e <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/add\/8b5\/4ea\/add8b54ea56919b2cfafafc53d675f11.svg\" alt=\"$2 \\pi$\" data-tex=\"inline\"\/>. \u0414\u043b\u044f \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \u044d\u0442\u0438 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432 \u0434\u0435\u043a\u0430\u0440\u0442\u043e\u0432\u044b, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u0443\u043c\u043d\u043e\u0436\u0438\u0432 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b88\/ce3\/99f\/b88ce399fda6c8123ab168cb507210f2.svg\" alt=\"$r$\" data-tex=\"inline\"\/> \u043d\u0430 \u043a\u043e\u0441\u0438\u043d\u0443\u0441 \u0438\u043b\u0438 \u0441\u0438\u043d\u0443\u0441 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/1f5\/40a\/1b5\/1f540a1b5c23e4c90dffe9f2cb495a76.svg\" alt=\"$\\theta$\" data-tex=\"inline\"\/> \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/4cc\/fd4\/32e\/4ccfd432ea4f2a64f3a5c8c7378517af.svg\" alt=\"$x$\" data-tex=\"inline\"\/> \u0438 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8f8\/c2f\/a70\/8f8c2fa70a7019d42baacce3ac56acd3.svg\" alt=\"$y$\" data-tex=\"inline\"\/><\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/kl\/xn\/iv\/klxnivje06jqnczdivrq8vs8ome.png\" data-src=\"https:\/\/habrastorage.org\/webt\/kl\/xn\/iv\/klxnivje06jqnczdivrq8vs8ome.png\"\/><\/div>\n<p>  \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u043d\u0430 Python \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d92\/af5\/060\/d92af5060afacc395b54ff937b9c83b7.svg\" alt=\"$theta$\" data-tex=\"inline\"\/> \u043e\u0442 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/502\/f96\/0ea\/502f960ea92bcba31646e66cccd41554.svg\" alt=\"$0$\" data-tex=\"inline\"\/> \u0434\u043e <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/add\/8b5\/4ea\/add8b54ea56919b2cfafafc53d675f11.svg\" alt=\"$2 \\pi$\" data-tex=\"inline\"\/> \u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b88\/ce3\/99f\/b88ce399fda6c8123ab168cb507210f2.svg\" alt=\"$r$\" data-tex=\"inline\"\/> \u043e\u0442 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/502\/f96\/0ea\/502f960ea92bcba31646e66cccd41554.svg\" alt=\"$0$\" data-tex=\"inline\"\/> \u0434\u043e <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d4a\/c7f\/4b6\/d4ac7f4b6821aecb794f61695d169e22.svg\" alt=\"$1$\" data-tex=\"inline\"\/>, \u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b88\/ce3\/99f\/b88ce399fda6c8123ab168cb507210f2.svg\" alt=\"$r$\" data-tex=\"inline\"\/>, \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u043d\u0430 \u043a\u043e\u0441\u0438\u043d\u0443\u0441 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d92\/af5\/060\/d92af5060afacc395b54ff937b9c83b7.svg\" alt=\"$theta$\" data-tex=\"inline\"\/> \u0438 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b88\/ce3\/99f\/b88ce399fda6c8123ab168cb507210f2.svg\" alt=\"$r$\" data-tex=\"inline\"\/>, \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u043d\u0430 \u0441\u0438\u043d\u0443\u0441 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d92\/af5\/060\/d92af5060afacc395b54ff937b9c83b7.svg\" alt=\"$theta$\" data-tex=\"inline\"\/>.<\/p>\n<pre><code class=\"python\">def random_polar():     theta = random() * 2 * pi     r = random()     return r * cos(theta), r * sin(theta)<\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u043c\u044b \u0441\u043d\u043e\u0432\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u044d\u0442\u043e\u0442 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c 3141 \u0440\u0430\u0437, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043f\u043e\u0445\u043e\u0436\u0438\u043c\u0438 \u043d\u0430 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u0441 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435\u043c\u2026 \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u0442\u0430\u043a.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/sn\/xx\/ow\/snxxowuhnuqnr8dp4sadmyswqu0.png\" data-src=\"https:\/\/habrastorage.org\/webt\/sn\/xx\/ow\/snxxowuhnuqnr8dp4sadmyswqu0.png\"\/><\/div>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u0442\u043e\u0447\u043a\u0438 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043f\u043b\u043e\u0442\u043d\u0435\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u044e\u0442\u0441\u044f \u0432 \u0446\u0435\u043d\u0442\u0440\u0435 \u043a\u0440\u0443\u0433\u0430. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c\u0441\u044f, \u043f\u043e\u0447\u0435\u043c\u0443. \u041c\u044b \u0437\u043d\u0430\u0435\u043c, \u0447\u0442\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043d\u0435 \u0432 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/1f5\/40a\/1b5\/1f540a1b5c23e4c90dffe9f2cb495a76.svg\" alt=\"$\\theta$\" data-tex=\"inline\"\/>, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0442\u043e\u0447\u043a\u0438 \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u043f\u043e \u043a\u0440\u0443\u0433\u0443, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0438\u043d\u043e\u0432\u0430\u0442 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0441\u043f\u043e\u0441\u043e\u0431 \u0432\u044b\u0431\u043e\u0440\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b88\/ce3\/99f\/b88ce399fda6c8123ab168cb507210f2.svg\" alt=\"$r$\" data-tex=\"inline\"\/>. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u043d\u0430\u043c\u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \u0438\u043c\u0435\u0435\u0442 \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435, \u0442\u043e \u0435\u0441\u0442\u044c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0431\u043e\u0440\u0430 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0433\u043e \u0440\u0430\u0434\u0438\u0443\u0441\u0430 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u0430. \u0418\u0437 \u044d\u0442\u043e\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442, \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u043e\u0435 \u043a\u043e\u043b\u044c\u0446\u043e \u0432 \u043a\u0440\u0443\u0433\u0435 \u0432 \u0441\u0440\u0435\u0434\u043d\u0435\u043c \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0442\u043e\u0447\u0435\u043a. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u044b \u0443\u0436\u0435 \u0432\u0438\u0434\u0438\u0442\u0435 \u0432 \u0447\u0451\u043c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u2014 \u0441 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0435\u043c \u0434\u043b\u0438\u043d\u044b \u043e\u043a\u0440\u0443\u0436\u043d\u043e\u0441\u0442\u0438 \u043a\u043e\u043b\u044c\u0446\u0430 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0442\u043e\u0447\u0435\u043a \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u043c, \u0442\u043e \u0435\u0441\u0442\u044c \u0432 \u043d\u0430\u0440\u0443\u0436\u043d\u044b\u0445 \u043a\u043e\u043b\u044c\u0446\u0430\u0445 \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0440\u0430\u0434\u0438\u0443\u0441\u043e\u043c \u0442\u043e\u0447\u043a\u0438 \u0438\u043c\u0435\u044e\u0442 \u043c\u0435\u043d\u044c\u0448\u0443\u044e \u043f\u043b\u043e\u0442\u043d\u043e\u0441\u0442\u044c, \u0447\u0435\u043c \u0432\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/70\/m8\/3-\/70m83-zbhvn4mkcudf3640wirqs.png\" data-src=\"https:\/\/habrastorage.org\/webt\/70\/m8\/3-\/70m83-zbhvn4mkcudf3640wirqs.png\"\/><\/div>\n<p>  \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0432\u044b\u0431\u043e\u0440\u0430 \u0440\u0430\u0434\u0438\u0443\u0441\u0430 \u0438\u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b88\/ce3\/99f\/b88ce399fda6c8123ab168cb507210f2.svg\" alt=\"$r$\" data-tex=\"inline\"\/> \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043b\u043e\u0442\u043d\u043e\u0441\u0442\u0438 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 (probability density function, PDF) \u2014 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442 \u043d\u0430\u043c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u044f \u043d\u0435\u043f\u0440\u0435\u0440\u044b\u0432\u043d\u043e\u0439 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/4cc\/fd4\/32e\/4ccfd432ea4f2a64f3a5c8c7378517af.svg\" alt=\"$x$\" data-tex=\"inline\"\/> \u0432 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b. \u0421\u0435\u0439\u0447\u0430\u0441 \u0433\u0440\u0430\u0444\u0438\u043a \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0439 \u043b\u0438\u043d\u0438\u0435\u0439 \u043e\u0442 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/502\/f96\/0ea\/502f960ea92bcba31646e66cccd41554.svg\" alt=\"$0$\" data-tex=\"inline\"\/> \u0434\u043e <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d4a\/c7f\/4b6\/d4ac7f4b6821aecb794f61695d169e22.svg\" alt=\"$1$\" data-tex=\"inline\"\/>, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0431\u043e\u0440\u0430 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b88\/ce3\/99f\/b88ce399fda6c8123ab168cb507210f2.svg\" alt=\"$r$\" data-tex=\"inline\"\/> \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u0430.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/zm\/dk\/so\/zmdksozo3wgfwevytryrq8olwjg.png\" data-src=\"https:\/\/habrastorage.org\/webt\/zm\/dk\/so\/zmdksozo3wgfwevytryrq8olwjg.png\"\/><\/div>\n<p>  \u0418\u0442\u0430\u043a, \u043c\u044b \u0437\u043d\u0430\u0435\u043c, \u0447\u0442\u043e \u044d\u0442\u0430 PDF \u043d\u0430\u043c \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u044b\u044f\u0441\u043d\u0438\u043c, \u043a\u0430\u043a \u043e\u043d\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0442\u043e\u0447\u043a\u0438 \u0431\u044b\u043b\u0438 \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u0432 \u043a\u0440\u0443\u0433\u0435. \u0422\u0430\u043a \u043a\u0430\u043a \u0434\u043b\u0438\u043d\u0430 \u043e\u043a\u0440\u0443\u0436\u043d\u043e\u0441\u0442\u0438 \u043b\u0438\u043d\u0435\u0439\u043d\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0440\u0430\u0434\u0438\u0443\u0441\u0430, \u0434\u043b\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0439 \u043f\u043b\u043e\u0442\u043d\u043e\u0441\u0442\u0438 \u0442\u043e\u0447\u0435\u043a \u0438\u0445 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0442\u043e\u0436\u0435 \u043b\u0438\u043d\u0435\u0439\u043d\u043e \u0437\u0430\u0432\u0438\u0441\u0435\u0442\u044c \u043e\u0442 \u0440\u0430\u0434\u0438\u0443\u0441\u0430. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u0430\u0448\u0430 PDF \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u044b \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u043c \u043a\u0430\u043a <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/0ca\/699\/2c1\/0ca6992c11718758fe5a28daf1027e6c.svg\" alt=\"$f(r) = m * r$\" data-tex=\"inline\"\/>, \u0433\u0434\u0435 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/0cb\/e1e\/2f4\/0cbe1e2f42f5e6bea0caffa1997a24d8.svg\" alt=\"$m$\" data-tex=\"inline\"\/> \u2014 \u043d\u0435\u043a\u0438\u0439 \u043d\u0430\u043a\u043b\u043e\u043d. \u041d\u043e \u043a\u0430\u043a \u043d\u0430\u043c \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/0cb\/e1e\/2f4\/0cbe1e2f42f5e6bea0caffa1997a24d8.svg\" alt=\"$m$\" data-tex=\"inline\"\/>? \u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b88\/ce3\/99f\/b88ce399fda6c8123ab168cb507210f2.svg\" alt=\"$r$\" data-tex=\"inline\"\/> \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0435 \u043e\u0442 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/502\/f96\/0ea\/502f960ea92bcba31646e66cccd41554.svg\" alt=\"$0$\" data-tex=\"inline\"\/> \u0434\u043e <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d4a\/c7f\/4b6\/d4ac7f4b6821aecb794f61695d169e22.svg\" alt=\"$1$\" data-tex=\"inline\"\/>, \u0440\u0430\u0432\u043d\u0430 100% \u0438\u043b\u0438 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d4a\/c7f\/4b6\/d4ac7f4b6821aecb794f61695d169e22.svg\" alt=\"$1$\" data-tex=\"inline\"\/>. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b \u0438\u043b\u0438 \u043f\u043b\u043e\u0449\u0430\u0434\u044c \u043f\u043e\u0434 \u043a\u0440\u0438\u0432\u043e\u0439 \u043d\u0430\u0448\u0435\u0439 PDF \u043e\u0442 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/502\/f96\/0ea\/502f960ea92bcba31646e66cccd41554.svg\" alt=\"$0$\" data-tex=\"inline\"\/> \u0434\u043e <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d4a\/c7f\/4b6\/d4ac7f4b6821aecb794f61695d169e22.svg\" alt=\"$1$\" data-tex=\"inline\"\/> \u0442\u043e\u0436\u0435 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0440\u0430\u0432\u043d\u0430 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d4a\/c7f\/4b6\/d4ac7f4b6821aecb794f61695d169e22.svg\" alt=\"$1$\" data-tex=\"inline\"\/>. \u0418\u0437 \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0432\u044b\u0441\u043e\u0442\u0443 \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0430, \u0430 \u0437\u0430\u0442\u0435\u043c \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u043d\u0430\u043a\u043b\u043e\u043d \u0433\u0438\u043f\u043e\u0442\u0435\u043d\u0443\u0437\u044b, \u0438\u043b\u0438 \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b. \u0418\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a \u044f \u0438 \u0441\u0434\u0435\u043b\u0430\u044e. \u041f\u0440\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u0430 \u0432\u044b\u044f\u0441\u043d\u044f\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043d\u0430\u043a\u043b\u043e\u043d \u043d\u0430\u0448\u0435\u0439 PDF \u0440\u0430\u0432\u0435\u043d <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/c37\/24c\/45a\/c3724c45ab9dcf8945e6bcece2165788.svg\" alt=\"$2$\" data-tex=\"inline\"\/>, \u0442\u043e \u0435\u0441\u0442\u044c \u0435\u0451 \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0438\u043c\u0435\u0435\u0442 \u0432\u0438\u0434 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/c01\/86f\/add\/c0186fadd79054a9ed16cad12e5a1be9.svg\" alt=\"$f(r) = 2r$\" data-tex=\"inline\"\/>.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/ok\/lr\/vg\/oklrvgqyhahpwrikfmoesehbdng.png\" data-src=\"https:\/\/habrastorage.org\/webt\/ok\/lr\/vg\/oklrvgqyhahpwrikfmoesehbdng.png\"\/><\/div>\n<p>  \u041b\u044e\u0431\u043e\u043f\u044b\u0442\u043d\u043e \u0442\u043e, \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u0430\u044f PDF \u0438\u043c\u0435\u0435\u0442 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d4a\/c7f\/4b6\/d4ac7f4b6821aecb794f61695d169e22.svg\" alt=\"$1$\" data-tex=\"inline\"\/>, \u0442\u043e \u0435\u0441\u0442\u044c \u044d\u0442\u043e\u0442 \u0442\u0440\u044e\u043a \u0431\u0443\u0434\u0435\u0442 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0432\u0441\u0435\u0433\u0434\u0430. \u0422\u0435\u043f\u0435\u0440\u044c \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0437\u043d\u0430\u0435\u043c, \u043a\u0430\u043a \u0434\u043e\u043b\u0436\u043d\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435, \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\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 \u0447\u0438\u0441\u0435\u043b. \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0430\u0439\u0442\u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435, \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043a \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e\u043c\u0443 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044e, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0443\u0436\u043d\u043e\u0435 \u043d\u0430\u043c \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f (cumulative distribution function, CDF), \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0443 \u043a\u0430\u043a <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/82c\/7ca\/1fb\/82c7ca1fbb02dee6eac06e8734f58e0e.svg\" alt=\"$F(r)$\" data-tex=\"inline\"\/>. \u041e\u043d\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b PDF, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0430\u0432\u0435\u043d <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/a4e\/ea6\/7a3\/a4eea67a3d583081cf4b4eb9d6534e72.svg\" alt=\"$r^2$\" data-tex=\"inline\"\/>. CDF \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/4cc\/fd4\/32e\/4ccfd432ea4f2a64f3a5c8c7378517af.svg\" alt=\"$x$\" data-tex=\"inline\"\/> \u0431\u0443\u0434\u0435\u0442 \u043c\u0435\u043d\u044c\u0448\u0435 \u0438\u043b\u0438 \u0440\u0430\u0432\u043d\u0430 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/va\/j3\/ai\/vaj3aind87-mkhqvsqpimwtf-gu.png\" data-src=\"https:\/\/habrastorage.org\/webt\/va\/j3\/ai\/vaj3aind87-mkhqvsqpimwtf-gu.png\"\/><\/div>\n<p>  \u041f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u044d\u0442\u043e\u0439 CDF \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0435\u0439 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c \u00ab\u043c\u0435\u0442\u043e\u0434 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f\u00bb (inverse transform sampling): \u0431\u0435\u0440\u0451\u0442\u0441\u044f \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u0430\u0448\u0435\u0433\u043e \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b, \u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442\u0441\u044f \u0442\u0430\u043a, \u0447\u0442\u043e \u0445\u043e\u0442\u044f \u043d\u0430\u0448\u0430 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f x \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f, \u0441\u0430\u043c\u0438 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438, \u043e\u0442\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u043d\u0430 \u043e\u0441\u0438 y, \u0431\u0443\u0434\u0443\u0442 \u0438\u043c \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u044c. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442, \u0435\u0441\u043b\u0438 \u043c\u044b \u0432\u043e\u0437\u044c\u043c\u0451\u043c \u044d\u0442\u0438 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043f\u043e \u0441\u0443\u0442\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043e\u0431\u0440\u0430\u0442\u043d\u0443\u044e \u043d\u0430\u0448\u0435\u0439 CDF. \u0415\u0441\u043b\u0438 \u043c\u044b \u0432\u043e\u0437\u044c\u043c\u0451\u043c \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u0447\u0438\u0441\u043b\u043e \u0438\u0437 \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8f8\/c2f\/a70\/8f8c2fa70a7019d42baacce3ac56acd3.svg\" alt=\"$y$\" data-tex=\"inline\"\/>, \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0438\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/4cc\/fd4\/32e\/4ccfd432ea4f2a64f3a5c8c7378517af.svg\" alt=\"$x$\" data-tex=\"inline\"\/>, \u0442\u043e \u0443\u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043d\u0443\u0436\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0442\u0430\u043c, \u0433\u0434\u0435 \u0442\u043e\u0447\u043a\u0438 \u0431\u043e\u043b\u0435\u0435 \u043f\u043b\u043e\u0442\u043d\u043e \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u044b \u043f\u0440\u0438 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u0445 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b88\/ce3\/99f\/b88ce399fda6c8123ab168cb507210f2.svg\" alt=\"$r$\" data-tex=\"inline\"\/> \u0438 \u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u0441\u0441\u0435\u044f\u043d\u044b \u043f\u0440\u0438 \u043c\u0435\u043d\u044c\u0448\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u0445.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/ch\/b8\/eq\/chb8eqadlfoesbt7join5jyk0oa.png\" data-src=\"https:\/\/habrastorage.org\/webt\/ch\/b8\/eq\/chb8eqadlfoesbt7join5jyk0oa.png\"\/><\/div>\n<p>  \u0422\u0430\u043a\u043e\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0443\u0436\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0446\u0435\u043d\u043d\u043e, \u043d\u043e \u044f \u043f\u043e\u043a\u0430\u0436\u0443 \u0432\u0430\u043c \u0431\u043e\u043b\u0435\u0435 \u0441\u0442\u0440\u043e\u0433\u043e\u0435 \u0434\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043f\u043e\u0434\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0441 \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u044b\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043e\u0431\u0440\u0430\u0442\u043d\u0443\u044e \u043d\u0430\u0448\u0435\u0439 CDF, \u0434\u0430\u0441\u0442 \u043d\u0443\u0436\u043d\u043e\u0435 \u043d\u0430\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435. \u041f\u043e\u043a\u0430 \u043c\u044b \u0437\u043d\u0430\u0435\u043c, \u0447\u0442\u043e CDF \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/4cc\/fd4\/32e\/4ccfd432ea4f2a64f3a5c8c7378517af.svg\" alt=\"$x$\" data-tex=\"inline\"\/> \u0431\u0443\u0434\u0435\u0442 \u043c\u0435\u043d\u044c\u0448\u0435 \u0438\u043b\u0438 \u0440\u0430\u0432\u043d\u0430 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b88\/ce3\/99f\/b88ce399fda6c8123ab168cb507210f2.svg\" alt=\"$r$\" data-tex=\"inline\"\/>, \u043d\u043e \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0435\u0440\u043d\u0451\u043c\u0441\u044f \u043a \u0442\u043e\u043c\u0443, \u043a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 PDF \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f. \u042f \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0443 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0441 \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u044b\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u043e\u0442 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/502\/f96\/0ea\/502f960ea92bcba31646e66cccd41554.svg\" alt=\"$0$\" data-tex=\"inline\"\/> \u0434\u043e <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d4a\/c7f\/4b6\/d4ac7f4b6821aecb794f61695d169e22.svg\" alt=\"$1$\" data-tex=\"inline\"\/> \u043a\u0430\u043a <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/1d6\/e3d\/c60\/1d6e3dc60633569bb3f51249e1a4ee2c.svg\" alt=\"$u$\" data-tex=\"inline\"\/>. \u0413\u0440\u0430\u0444\u0438\u043a \u2014 \u044d\u0442\u043e \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u0430\u044f \u043b\u0438\u043d\u0438\u044f \u043e\u0442 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/502\/f96\/0ea\/502f960ea92bcba31646e66cccd41554.svg\" alt=\"$0$\" data-tex=\"inline\"\/> \u0434\u043e <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d4a\/c7f\/4b6\/d4ac7f4b6821aecb794f61695d169e22.svg\" alt=\"$1$\" data-tex=\"inline\"\/> \u043f\u0440\u0438 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8f8\/c2f\/a70\/8f8c2fa70a7019d42baacce3ac56acd3.svg\" alt=\"$y$\" data-tex=\"inline\"\/> \u0440\u0430\u0432\u043d\u043e\u043c <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d4a\/c7f\/4b6\/d4ac7f4b6821aecb794f61695d169e22.svg\" alt=\"$1$\" data-tex=\"inline\"\/>. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 CDF (\u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b PDF) \u0431\u0443\u0434\u0435\u0442 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/662\/770\/e9b\/662770e9bccd4b2031e1503471f37234.svg\" alt=\"$F_U(r) = r$\" data-tex=\"inline\"\/>. \u0418\u0437 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f CDF \u0441\u043b\u0435\u0434\u0443\u0435\u0442, \u0447\u0442\u043e \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/cbc\/d88\/d91\/cbcd88d913e77d8fb723a9a58fd21cc7.svg\" alt=\"$U$\" data-tex=\"inline\"\/> \u0431\u0443\u0434\u0435\u0442 \u043c\u0435\u043d\u044c\u0448\u0435 \u0438\u043b\u0438 \u0440\u0430\u0432\u043d\u0430 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b88\/ce3\/99f\/b88ce399fda6c8123ab168cb507210f2.svg\" alt=\"$r$\" data-tex=\"inline\"\/>, \u0440\u0430\u0432\u043d\u0430 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b88\/ce3\/99f\/b88ce399fda6c8123ab168cb507210f2.svg\" alt=\"$r$\" data-tex=\"inline\"\/>. \u0415\u0441\u043b\u0438 \u043c\u044b \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u0438\u043c <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/03d\/b8f\/756\/03db8f756498a92d90cb59c44f3fff2c.svg\" alt=\"$0,5$\" data-tex=\"inline\"\/> \u0432\u043c\u0435\u0441\u0442\u043e <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b88\/ce3\/99f\/b88ce399fda6c8123ab168cb507210f2.svg\" alt=\"$r$\" data-tex=\"inline\"\/>, \u0442\u043e \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u044f\u0441\u043d\u043e, \u0447\u0442\u043e \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0441 \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u044b\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u0431\u0443\u0434\u0435\u0442 \u043c\u0435\u043d\u044c\u0448\u0435 \u0438\u043b\u0438 \u0440\u0430\u0432\u043d\u043e <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/03d\/b8f\/756\/03db8f756498a92d90cb59c44f3fff2c.svg\" alt=\"$0,5$\" data-tex=\"inline\"\/>, \u0440\u0430\u0432\u043d\u043e <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/03d\/b8f\/756\/03db8f756498a92d90cb59c44f3fff2c.svg\" alt=\"$0,5$\" data-tex=\"inline\"\/>, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043e\u043d\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e\u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0435 \u043c\u0435\u0436\u0434\u0443 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/502\/f96\/0ea\/502f960ea92bcba31646e66cccd41554.svg\" alt=\"$0$\" data-tex=\"inline\"\/> \u0438 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d4a\/c7f\/4b6\/d4ac7f4b6821aecb794f61695d169e22.svg\" alt=\"$1$\" data-tex=\"inline\"\/>. \u0412\u0435\u0440\u043d\u0443\u0432\u0448\u0438\u0441\u044c \u043a \u043c\u0435\u0442\u043e\u0434\u0443 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/4bb\/92f\/b46\/4bb92fb46cf1e0a34735340a5f94051a.svg\" alt=\"$F_X(r)$\" data-tex=\"inline\"\/> \u0440\u0430\u0432\u043d\u0430 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/1d6\/e3d\/c60\/1d6e3dc60633569bb3f51249e1a4ee2c.svg\" alt=\"$u$\" data-tex=\"inline\"\/> \u0431\u0443\u0434\u0435\u0442 \u043c\u0435\u043d\u044c\u0448\u0435 \u0438\u043b\u0438 \u0440\u0430\u0432\u043d\u0430 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/4bb\/92f\/b46\/4bb92fb46cf1e0a34735340a5f94051a.svg\" alt=\"$F_X(r)$\" data-tex=\"inline\"\/>. \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043a \u043e\u0431\u043e\u0438\u043c \u0441\u0442\u043e\u0440\u043e\u043d\u0430\u043c \u043d\u0435\u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0435 \u043d\u0430\u0448\u0435\u0439 CDF, \u0447\u0442\u043e \u0434\u0430\u0441\u0442 \u043d\u0430\u043c \u0434\u0432\u0430 \u043d\u0435\u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u0430, \u043c\u0435\u043d\u044c\u0448\u0438\u0445 \u0438\u043b\u0438 \u0440\u0430\u0432\u043d\u044b\u0445 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b88\/ce3\/99f\/b88ce399fda6c8123ab168cb507210f2.svg\" alt=\"$r$\" data-tex=\"inline\"\/>. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/4cc\/fd4\/32e\/4ccfd432ea4f2a64f3a5c8c7378517af.svg\" alt=\"$x$\" data-tex=\"inline\"\/>, \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0441 \u043d\u0443\u0436\u043d\u044b\u043c \u043d\u0430\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c, \u0440\u0430\u0432\u043d\u0430 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u043c\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e CDF, \u043f\u0440\u0438\u043c\u0435\u043d\u0451\u043d\u043d\u043e\u043c\u0443 \u043a \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0441 \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u044b\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c, \u0430 \u043c\u044b \u0437\u043d\u0430\u0435\u043c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043e\u0431\u0440\u0430\u0442\u043d\u0430\u044f CDF, \u2014 \u044d\u0442\u043e <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/003\/875\/c43\/003875c434e9b2f2fe34ce6b3a6594d7.svg\" alt=\"$\\sqrt{r}$\" data-tex=\"inline\"\/>. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0432\u0441\u0451 \u044d\u0442\u043e \u043d\u0430 Python.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/4u\/ao\/sm\/4uaosm-7veasnzgmaolx5m0sbtq.png\" data-src=\"https:\/\/habrastorage.org\/webt\/4u\/ao\/sm\/4uaosm-7veasnzgmaolx5m0sbtq.png\"\/><\/div>\n<p>  <\/p>\n<pre><code class=\"python\">def sqrt_dist():     theta = random * 2 * pi     r = sqrt(random())     return r * cos(theta), r * sin(theta)<\/code><\/pre>\n<p>  \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u044d\u0442\u043e\u0439 \u0438 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b88\/ce3\/99f\/b88ce399fda6c8123ab168cb507210f2.svg\" alt=\"$r$\" data-tex=\"inline\"\/> \u044f \u0442\u0435\u043f\u0435\u0440\u044c \u0431\u0435\u0440\u0443 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u044b\u0439 \u043a\u043e\u0440\u0435\u043d\u044c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430. \u0421\u043d\u043e\u0432\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0432 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c 3141 \u0440\u0430\u0437, \u043c\u044b \u043e\u043f\u044f\u0442\u044c \u0443\u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0442\u043e\u0447\u043a\u0438 \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b\u0438\u0441\u044c \u043f\u043e \u043a\u0440\u0443\u0433\u0443.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/1g\/xt\/hy\/1gxthy_sacu8-fr_iyzpojn7ai4.png\" data-src=\"https:\/\/habrastorage.org\/webt\/1g\/xt\/hy\/1gxthy_sacu8-fr_iyzpojn7ai4.png\"\/><\/div>\n<p>  \u0418\u0442\u0430\u043a, \u0442\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u043f\u0440\u0438\u0435\u043c\u043b\u0435\u043c\u044b\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0432\u044b\u0431\u043e\u0440\u0430 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0441 \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u044b\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u0440\u0443\u0433\u0430, \u043d\u043e \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f. \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0438 \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u043e\u0447\u0435\u043d\u044c \u043b\u044e\u0431\u043e\u043f\u044b\u0442\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431, \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0449\u0438\u0439 \u0442\u043e\u0447\u043d\u043e \u043a \u0442\u0430\u043a\u043e\u043c\u0443 \u0436\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0443.<\/p>\n<p>  \u041a\u0440\u0443\u0433 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u043d\u0430\u0431\u043e\u0440 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0433\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0443\u0437\u043a\u0438\u0445 \u0440\u0430\u0432\u043d\u043e\u0431\u0435\u0434\u0440\u0435\u043d\u043d\u044b\u0445 \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u043e\u0432, \u043f\u043e\u0432\u0451\u0440\u043d\u0443\u0442\u044b\u0445 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0442\u043e\u0447\u043a\u0438. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0439 \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a, \u0430 \u0437\u0430\u0442\u0435\u043c \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0432 \u044d\u0442\u043e\u043c \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0435 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443 \u0441 \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u044b\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u0432 \u043a\u0440\u0443\u0433\u0435.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/ug\/az\/yc\/ugazyczs_99q3hmdam2r_mxna20.png\" data-src=\"https:\/\/habrastorage.org\/webt\/ug\/az\/yc\/ugazyczs_99q3hmdam2r_mxna20.png\"\/><\/div>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0435\u0440\u043d\u0451\u043c\u0441\u044f \u043a \u0442\u043e\u043c\u0443, \u043a\u0430\u043a \u043c\u044b \u0432\u044b\u0431\u0438\u0440\u0430\u043b\u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443 \u0432 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0435 \u2014 \u044d\u0442\u043e\u0442 \u0441\u043f\u043e\u0441\u043e\u0431 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0438 \u043a \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u043e\u0433\u0440\u0430\u043c\u043c\u0430\u043c. \u0422\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0434\u0435\u043b\u043e \u0441 \u0440\u0430\u0432\u043d\u043e\u0431\u0435\u0434\u0440\u0435\u043d\u043d\u044b\u043c\u0438 \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0430\u043c\u0438, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0440\u043e\u043c\u0431\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439, \u043a\u0430\u043a \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0434\u0432\u0443\u0445 \u0440\u0430\u0432\u043d\u043e\u0431\u0435\u0434\u0440\u0435\u043d\u043d\u044b\u0445 \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u043e\u0432, \u0441\u043e\u0435\u0434\u0438\u043d\u0451\u043d\u043d\u044b\u0445 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u044f\u043c\u0438. \u041f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0431\u0435\u0440\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443 \u043d\u0430 \u0434\u0432\u0443\u0445 \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u0445 \u0441\u0442\u043e\u0440\u043e\u043d\u0430\u0445, \u0430 \u0437\u0430\u0442\u0435\u043c \u0438\u0437 \u043a\u0430\u0436\u0434\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u043f\u0440\u043e\u0432\u0435\u0434\u0451\u043c \u043b\u0438\u043d\u0438\u044e, \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u0443\u044e \u0441\u043e\u0441\u0435\u0434\u043d\u0435\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u0435, \u0438 \u043d\u0430\u0439\u0434\u0451\u043c \u0442\u043e\u0447\u043a\u0443 \u0438\u0445 \u043f\u0435\u0440\u0435\u0441\u0435\u0447\u0435\u043d\u0438\u044f. \u0427\u0442\u043e\u0431\u044b \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u043e\u043c, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u0434\u0438\u0430\u0433\u043e\u043d\u0430\u043b\u044c \u0438 \u043e\u0442\u0440\u0430\u0436\u0430\u0442\u044c \u0432\u0441\u0435 \u0442\u043e\u0447\u043a\u0438, \u043f\u043e\u043f\u0430\u0432\u0448\u0438\u0435 \u043d\u0435 \u0432 \u0442\u0443 \u0447\u0430\u0441\u0442\u044c \u0440\u043e\u043c\u0431\u0430. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u043c \u0447\u0435\u0442\u044b\u0440\u0435 \u0432\u0435\u0440\u0448\u0438\u043d\u044b \u0440\u043e\u043c\u0431\u0430 \u043a\u0430\u043a <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8f4\/5ac\/495\/8f45ac4953a8010207f0f92306982b3b.svg\" alt=\"$a$\" data-tex=\"inline\"\/>, <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/39d\/180\/62d\/39d18062d6d75592f56b1b38409a5e10.svg\" alt=\"$b$\" data-tex=\"inline\"\/>, <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/862\/7c5\/d62\/8627c5d6237711cee51f5574ed6e9914.svg\" alt=\"$c$\" data-tex=\"inline\"\/> \u0438 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d81\/2be\/8e1\/d812be8e1b8469648cf351d53b239957.svg\" alt=\"$d$\" data-tex=\"inline\"\/>, \u0434\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0435 \u0442\u043e\u0447\u043a\u0438 \u043d\u0430 \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u0445 \u0441\u0442\u043e\u0440\u043e\u043d\u0430\u0445 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/827\/6a3\/55d\/8276a355d254a55b0c1ba5d9cba3ff61.svg\" alt=\"$x_1$\" data-tex=\"inline\"\/> \u0438 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/305\/222\/c13\/305222c1343fb7aa2b5f93e3809a3059.svg\" alt=\"$x_2$\" data-tex=\"inline\"\/>, \u0430 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/915\/acb\/b16\/915acbb16ed63f15541d3e0bda30d453.svg\" alt=\"$t$\" data-tex=\"inline\"\/>. \u0422\u0430\u043a \u043a\u0430\u043a \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0438 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0442\u043e\u043d\u043a\u0438\u0435, \u0443\u0433\u043e\u043b \u043f\u0440\u0438 \u0432\u0435\u0440\u0448\u0438\u043d\u0435 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/862\/7c5\/d62\/8627c5d6237711cee51f5574ed6e9914.svg\" alt=\"$c$\" data-tex=\"inline\"\/> \u0431\u0443\u0434\u0435\u0442 \u0441\u0442\u0440\u0435\u043c\u0438\u0442\u044c\u0441\u044f \u043a \u043d\u0443\u043b\u044e, \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u044b\u0441\u043e\u0442\u0430 \u0440\u043e\u043c\u0431\u0430 \u0442\u043e\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u0442\u0440\u0435\u043c\u0438\u0442\u044c\u0441\u044f \u043a \u043d\u0443\u043b\u044e. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u0432\u0441\u0435 \u0435\u0433\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u043f\u043e \u0441\u0443\u0442\u0438, \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u043c\u0438. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043e\u0442 \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/862\/7c5\/d62\/8627c5d6237711cee51f5574ed6e9914.svg\" alt=\"$c$\" data-tex=\"inline\"\/> \u0434\u043e \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/915\/acb\/b16\/915acbb16ed63f15541d3e0bda30d453.svg\" alt=\"$t$\" data-tex=\"inline\"\/> \u0440\u0430\u0432\u043d\u0430 \u0441\u0443\u043c\u043c\u0435 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/827\/6a3\/55d\/8276a355d254a55b0c1ba5d9cba3ff61.svg\" alt=\"$x_1$\" data-tex=\"inline\"\/> \u0438 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/305\/222\/c13\/305222c1343fb7aa2b5f93e3809a3059.svg\" alt=\"$x_2$\" data-tex=\"inline\"\/>.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/bo\/q2\/9d\/boq29d0z0o58odw2wm5-sew7-go.png\" data-src=\"https:\/\/habrastorage.org\/webt\/bo\/q2\/9d\/boq29d0z0o58odw2wm5-sew7-go.png\"\/><\/div>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u043c\u043e\u0436\u0435\u043c \u043e\u0442\u0440\u0430\u0437\u0438\u0442\u044c \u0442\u043e\u0447\u043a\u0443 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u0438\u0430\u0433\u043e\u043d\u0430\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e\u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0435 \u043c\u0435\u0436\u0434\u0443 \u0442\u043e\u0447\u043a\u0430\u043c\u0438 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/862\/7c5\/d62\/8627c5d6237711cee51f5574ed6e9914.svg\" alt=\"$c$\" data-tex=\"inline\"\/> \u0438 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8f4\/5ac\/495\/8f45ac4953a8010207f0f92306982b3b.svg\" alt=\"$a$\" data-tex=\"inline\"\/>.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/cw\/d-\/jj\/cwd-jjqofq8wc7axsxat4ulciki.png\" data-src=\"https:\/\/habrastorage.org\/webt\/cw\/d-\/jj\/cwd-jjqofq8wc7axsxat4ulciki.png\"\/><\/div>\n<p>  \u0412\u0441\u0451 \u044d\u0442\u043e \u0443\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u043e\u0434 \u043d\u0430 Python. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d92\/af5\/060\/d92af5060afacc395b54ff937b9c83b7.svg\" alt=\"$theta$\" data-tex=\"inline\"\/> \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e, \u043d\u043e \u044d\u0442\u043e \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u0432\u044b\u0431\u043e\u0440 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0433\u043e \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0430, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d\u0438 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0442\u043e\u043d\u043a\u0438\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043a\u0430\u0436\u0434\u044b\u0439 \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0443\u0433\u043e\u043b. \u0417\u0430\u0442\u0435\u043c \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0434\u0432\u0443\u0445 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/827\/6a3\/55d\/8276a355d254a55b0c1ba5d9cba3ff61.svg\" alt=\"$x_1$\" data-tex=\"inline\"\/> \u0438 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/305\/222\/c13\/305222c1343fb7aa2b5f93e3809a3059.svg\" alt=\"$x_2$\" data-tex=\"inline\"\/> \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/4cc\/fd4\/32e\/4ccfd432ea4f2a64f3a5c8c7378517af.svg\" alt=\"$x$\" data-tex=\"inline\"\/>. \u0415\u0441\u043b\u0438 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b88\/ce3\/99f\/b88ce399fda6c8123ab168cb507210f2.svg\" alt=\"$r$\" data-tex=\"inline\"\/> \u0431\u043e\u043b\u044c\u0448\u0435 \u0438\u043b\u0438 \u0440\u0430\u0432\u0435\u043d \u0435\u0434\u0438\u043d\u0438\u0446\u0435, \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u0442\u043e\u0447\u043a\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0441 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u0440\u043e\u043c\u0431\u0430 \u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0435\u0451 \u043e\u0442\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432\u044b\u0447\u0438\u0442\u0430\u043d\u0438\u0435\u043c <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/065\/678\/c67\/065678c678a7703ae1a1ea7bb245b039.svg\" alt=\"$r - 2$\" data-tex=\"inline\"\/>. \u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/68f\/d45\/e4a\/68fd45e4a329826bbdb07e590a5b191c.svg\" alt=\"$return$\" data-tex=\"inline\"\/> \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u0442\u0430\u043a\u043e\u0439 \u0436\u0435.<\/p>\n<pre><code class=\"python\">def sum_dist():     theta = random() * 2 * pi     r = random() + random()     if r >= 1:         r = 2 - r;     return r * cos(theta), r * sin(theta)<\/code><\/pre>\n<p>  \u041c\u044b \u0441\u043d\u043e\u0432\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c 3141 \u0440\u0430\u0437 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0442\u043e\u0447\u0435\u043a \u043f\u043e \u043a\u0440\u0443\u0433\u0443.<\/p>\n<p>  \u041e\u0434\u043d\u0430\u043a\u043e \u0443 \u043c\u0435\u043d\u044f \u0432\u043e\u0437\u043d\u0438\u043a \u0432\u043e\u043f\u0440\u043e\u0441: \u043f\u043e\u0447\u0435\u043c\u0443 \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u0432\u0443\u0445 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d \u043d\u0435 \u0440\u0430\u0432\u043d\u043e \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044e \u043e\u0434\u043d\u043e\u0439 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043d\u0430 \u0434\u0432\u0430? \u041f\u0440\u043e\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0430\u0442\u044c \u043d\u0430\u0434 \u044d\u0442\u0438\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0438\u0433\u0440\u043e\u0432\u044b\u0445 \u043a\u043e\u0441\u0442\u0435\u0439. \u0415\u0441\u043b\u0438 \u043c\u044b \u0432\u043e\u0437\u044c\u043c\u0451\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0431\u0440\u043e\u0441\u043a\u0430 \u043e\u0434\u043d\u043e\u0439 \u0447\u0435\u0441\u0442\u043d\u043e\u0439 \u043a\u043e\u0441\u0442\u0438 \u0438 \u0443\u043c\u043d\u043e\u0436\u0438\u043c \u0435\u0433\u043e \u043d\u0430 \u0434\u0432\u0430, \u0442\u043e \u0443\u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0451\u0442\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430 \u0438 \u0447\u0442\u043e \u043a\u043e\u0441\u0442\u044c \u0438\u043c\u0435\u0435\u0442 \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435. \u041e\u0434\u043d\u0430\u043a\u043e \u0435\u0441\u043b\u0438 \u0441\u043b\u043e\u0436\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0434\u0432\u0443\u0445 \u0447\u0435\u0441\u0442\u043d\u044b\u0445 \u043a\u043e\u0441\u0442\u0435\u0439, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u0447\u0442\u043e \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b8a\/3eb\/5f7\/b8a3eb5f701a5d16d12d4b8f5b1b568c.svg\" alt=\"$7$\" data-tex=\"inline\"\/> \u0432\u044b\u0448\u0435, \u0447\u0435\u043c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043b\u044e\u0431\u043e\u0433\u043e \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u0443\u043c\u043c\u0443 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b8a\/3eb\/5f7\/b8a3eb5f701a5d16d12d4b8f5b1b568c.svg\" alt=\"$7$\" data-tex=\"inline\"\/> \u043d\u0430 \u0434\u0432\u0443\u0445 \u043a\u043e\u0441\u0442\u044f\u0445 \u043c\u043e\u0436\u043d\u043e \u0448\u0435\u0441\u0442\u044c\u044e \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438. \u0421\u0443\u043c\u043c\u0443 \u0436\u0435 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/c37\/24c\/45a\/c3724c45ab9dcf8945e6bcece2165788.svg\" alt=\"$2$\" data-tex=\"inline\"\/> \u0438 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/561\/841\/5ee\/5618415eed6ce4ee0229cb5d1a13b3aa.svg\" alt=\"$12$\" data-tex=\"inline\"\/> \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0438\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c, \u0438\u0437-\u0437\u0430 \u0447\u0435\u0433\u043e \u0438\u0445 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043d\u0438\u0436\u0435. \u0415\u0441\u043b\u0438 \u043c\u044b \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0433\u0440\u0430\u0444\u0438\u043a \u0447\u0430\u0441\u0442\u043e\u0442\u044b \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430, \u0442\u043e \u043f\u0440\u0438 \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0435\u043d\u0438\u0438 \u0441\u0443\u043c\u043c\u044b \u043a <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b8a\/3eb\/5f7\/b8a3eb5f701a5d16d12d4b8f5b1b568c.svg\" alt=\"$7$\" data-tex=\"inline\"\/>, \u0447\u0442\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0440\u0435\u0434\u043d\u0438\u043c <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/c37\/24c\/45a\/c3724c45ab9dcf8945e6bcece2165788.svg\" alt=\"$2$\" data-tex=\"inline\"\/> \u0438 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/561\/841\/5ee\/5618415eed6ce4ee0229cb5d1a13b3aa.svg\" alt=\"$12$\" data-tex=\"inline\"\/>, \u0447\u0430\u0441\u0442\u043e\u0442\u044b \u0441\u0443\u043c\u043c \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u044e\u0442\u0441\u044f.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/q3\/vy\/qb\/q3vyqbnagor00vwowzbj3i6rwuk.png\" data-src=\"https:\/\/habrastorage.org\/webt\/q3\/vy\/qb\/q3vyqbnagor00vwowzbj3i6rwuk.png\"\/><\/div>\n<p>  \u0415\u0441\u043b\u0438 \u043c\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c, \u0447\u0442\u043e \u043e\u0442\u0440\u0430\u0436\u0430\u0435\u043c \u043f\u0440\u0430\u0432\u0443\u044e \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0443 \u0433\u0440\u0430\u0444\u0438\u043a\u0430, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0445\u043e\u0436\u0438\u043c \u043d\u0430 \u0436\u0435\u043b\u0430\u0435\u043c\u0443\u044e PDF, \u043d\u043e \u043d\u0430 \u044d\u0442\u043e\u043c \u044f \u0437\u0430\u043c\u0435\u0442\u0438\u043b \u043a\u043e\u0435-\u0447\u0442\u043e \u0441\u0442\u0440\u0430\u043d\u043d\u043e\u0435. \u041e\u0431\u0430 \u044d\u0442\u0438\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u044e\u0442 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b88\/ce3\/99f\/b88ce399fda6c8123ab168cb507210f2.svg\" alt=\"$r$\" data-tex=\"inline\"\/> \u043a\u0430\u043a \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u044b\u0439 \u043a\u043e\u0440\u0435\u043d\u044c \u043e\u0442 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430, \u0430 \u043e\u0442\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0441\u0443\u043c\u043c\u044b \u0434\u0432\u0443\u0445 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \u0434\u043e\u043b\u0436\u043d\u043e \u0438\u043c\u0435\u0442\u044c \u0442\u043e \u0436\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0441 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 PDF, \u0440\u0430\u0432\u043d\u043e\u0439 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/7a2\/f22\/bdf\/7a2f22bdf326c8d5972920be7cf65712.svg\" alt=\"$2r$\" data-tex=\"inline\"\/> \u0438 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u043e\u0439 CDF <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/a4e\/ea6\/7a3\/a4eea67a3d583081cf4b4eb9d6534e72.svg\" alt=\"$r^2$\" data-tex=\"inline\"\/>. \u041f\u043e\u043d\u0430\u0447\u0430\u043b\u0443 \u044d\u0442\u043e \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u043c: \u043a\u0430\u043a \u044d\u0442\u0438 \u0434\u0432\u0435 \u043a\u0430\u0436\u0443\u0449\u0438\u0435\u0441\u044f \u043d\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u043c\u0438 \u0434\u0440\u0443\u0433 \u0441 \u0434\u0440\u0443\u0433\u043e\u043c \u0438 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u0440\u0430\u0437\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u043e\u0433\u0443\u0442 \u0438\u043c\u0435\u0442\u044c \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435? \u041c\u044b \u0437\u043d\u0430\u0435\u043c, \u0447\u0442\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0441 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u044b\u043c \u043a\u043e\u0440\u043d\u0435\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0435, \u0432\u0435\u0434\u044c \u043c\u044b \u0432\u044b\u0432\u0435\u043b\u0438 \u0435\u0433\u043e \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438\u0437 \u043d\u0443\u0436\u043d\u043e\u0439 CDF. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0434\u043e\u043a\u0430\u0436\u0435\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0441 \u0441\u0443\u043c\u043c\u0430\u043c\u0438.<\/p>\n<p>  \u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0418\u0440\u0432\u0438\u043d\u0430-\u0425\u043e\u043b\u043b\u0430, \u0441\u043e\u043e\u0431\u0449\u0430\u044e\u0449\u0435\u0435 \u043d\u0430\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0441\u0443\u043c\u043c\u044b <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/35b\/a56\/5f3\/35ba565f36734f3a55aa01ac67868762.svg\" alt=\"$n$\" data-tex=\"inline\"\/> \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \u043e\u0442 0 \u0434\u043e 1. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/ea6\/3b7\/a46\/ea63b7a46a31b4b6270f78e03a29b2ac.svg\" alt=\"$n = 2$\" data-tex=\"inline\"\/>. \u0412\u043e\u0442 \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0434\u043b\u044f PDF \u0438 CDF.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/pb\/jd\/wu\/pbjdwumgxijeahkqjrvbyrwl7p0.png\" data-src=\"https:\/\/habrastorage.org\/webt\/pb\/jd\/wu\/pbjdwumgxijeahkqjrvbyrwl7p0.png\"\/><\/div>\n<p>  \u041c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0445, \u043d\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u044d\u0442\u043e \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u0438\u0437\u044f\u0449\u043d\u044b\u0439 \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0432\u044b\u0432\u043e\u0434, \u0445\u043e\u0440\u043e\u0448\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0439 \u0441 \u043d\u0438\u0437\u043a\u0438\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/35b\/a56\/5f3\/35ba565f36734f3a55aa01ac67868762.svg\" alt=\"$n$\" data-tex=\"inline\"\/>. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043b\u043e\u0436\u0438\u0442\u044c \u0434\u0432\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/827\/6a3\/55d\/8276a355d254a55b0c1ba5d9cba3ff61.svg\" alt=\"$x_1$\" data-tex=\"inline\"\/> \u0438 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/305\/222\/c13\/305222c1343fb7aa2b5f93e3809a3059.svg\" alt=\"$x_2$\" data-tex=\"inline\"\/> \u043d\u0430 \u043e\u0441\u044f\u0445 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/4cc\/fd4\/32e\/4ccfd432ea4f2a64f3a5c8c7378517af.svg\" alt=\"$x$\" data-tex=\"inline\"\/> \u0438 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8f8\/c2f\/a70\/8f8c2fa70a7019d42baacce3ac56acd3.svg\" alt=\"$y$\" data-tex=\"inline\"\/>, \u0447\u0442\u043e\u0431\u044b \u043b\u0443\u0447\u0448\u0435 \u0438\u0445 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u041c\u043e\u0436\u043d\u043e \u043d\u0430\u0447\u0435\u0440\u0442\u0438\u0442\u044c \u043b\u0438\u043d\u0438\u044e, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0443\u044e \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0441\u0443\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/827\/6a3\/55d\/8276a355d254a55b0c1ba5d9cba3ff61.svg\" alt=\"$x_1$\" data-tex=\"inline\"\/> \u0438 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/305\/222\/c13\/305222c1343fb7aa2b5f93e3809a3059.svg\" alt=\"$x_2$\" data-tex=\"inline\"\/> \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u0435\u043a\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/915\/acb\/b16\/915acbb16ed63f15541d3e0bda30d453.svg\" alt=\"$t$\" data-tex=\"inline\"\/> \u043e\u0442 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/502\/f96\/0ea\/502f960ea92bcba31646e66cccd41554.svg\" alt=\"$0$\" data-tex=\"inline\"\/> \u0434\u043e <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/c37\/24c\/45a\/c3724c45ab9dcf8945e6bcece2165788.svg\" alt=\"$2$\" data-tex=\"inline\"\/>. \u0423\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u044f\u043c\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0432\u0438\u0434 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/f34\/8c0\/201\/f348c020141fd510be7b5c040cf659da.svg\" alt=\"$x_1 + x_2 = t$\" data-tex=\"inline\"\/>. \u0414\u043b\u0438\u043d\u0430 \u044d\u0442\u043e\u0439 \u043b\u0438\u043d\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u0430 PDF, \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u044e\u0449\u0435\u0439 \u0432 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0435 \u043e\u0442 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/502\/f96\/0ea\/502f960ea92bcba31646e66cccd41554.svg\" alt=\"$0$\" data-tex=\"inline\"\/> \u0434\u043e <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d4a\/c7f\/4b6\/d4ac7f4b6821aecb794f61695d169e22.svg\" alt=\"$1$\" data-tex=\"inline\"\/> \u0438 \u0441\u043d\u0438\u0436\u0430\u044e\u0449\u0435\u0439\u0441\u044f \u0432 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0435 \u043e\u0442 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d4a\/c7f\/4b6\/d4ac7f4b6821aecb794f61695d169e22.svg\" alt=\"$1$\" data-tex=\"inline\"\/> \u0434\u043e <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/c37\/24c\/45a\/c3724c45ab9dcf8945e6bcece2165788.svg\" alt=\"$2$\" data-tex=\"inline\"\/>. \u041f\u043b\u043e\u0449\u0430\u0434\u044c \u043f\u043e\u0434 \u044d\u0442\u043e\u0439 \u043f\u0440\u044f\u043c\u043e\u0439 \u0438 \u0432 \u0433\u0440\u0430\u043d\u0438\u0446\u0430\u0445 \u044d\u0442\u043e\u0433\u043e \u0435\u0434\u0438\u043d\u0438\u0447\u043d\u043e\u0433\u043e \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 CDF.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/61\/jd\/s9\/61jds9ys0xzyqb84vg6sbv0zizw.png\" data-src=\"https:\/\/habrastorage.org\/webt\/61\/jd\/s9\/61jds9ys0xzyqb84vg6sbv0zizw.png\"\/><\/div>\n<p>  \u041d\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043c\u043d\u0438\u0442\u044c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043b\u044e\u0431\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/915\/acb\/b16\/915acbb16ed63f15541d3e0bda30d453.svg\" alt=\"$t$\" data-tex=\"inline\"\/> \u043e\u0442 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d4a\/c7f\/4b6\/d4ac7f4b6821aecb794f61695d169e22.svg\" alt=\"$1$\" data-tex=\"inline\"\/> \u0434\u043e <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/c37\/24c\/45a\/c3724c45ab9dcf8945e6bcece2165788.svg\" alt=\"$2$\" data-tex=\"inline\"\/> \u043e\u0442\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0438 \u0434\u0430\u0451\u0442 \u043d\u0430\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b88\/ce3\/99f\/b88ce399fda6c8123ab168cb507210f2.svg\" alt=\"$r$\" data-tex=\"inline\"\/>. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e CDF \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043a\u0430\u043a \u043f\u043b\u043e\u0449\u0430\u0434\u044c \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0430 \u0441 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0438 \u0432\u044b\u0441\u043e\u0442\u043e\u0439 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b88\/ce3\/99f\/b88ce399fda6c8123ab168cb507210f2.svg\" alt=\"$r$\" data-tex=\"inline\"\/>, \u0442\u043e \u0435\u0441\u0442\u044c <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/afe\/7db\/681\/afe7db6812e17e360ffba1bc40a415af.svg\" alt=\"$r^2\/2$\" data-tex=\"inline\"\/>. \u041e\u0434\u043d\u0430\u043a\u043e \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432\u0441\u0435 \u0442\u043e\u0447\u043a\u0438 \u0432 \u044d\u0442\u043e\u043c \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0435 \u043f\u043e \u0441\u0443\u0442\u0438 \u0443\u0434\u0432\u0430\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043e\u0442\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u044d\u0442\u0443 \u043f\u043b\u043e\u0449\u0430\u0434\u044c \u043d\u0443\u0436\u043d\u043e \u0443\u043c\u043d\u043e\u0436\u0438\u0442\u044c \u043d\u0430 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/c37\/24c\/45a\/c3724c45ab9dcf8945e6bcece2165788.svg\" alt=\"$2$\" data-tex=\"inline\"\/> \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0443\u0436\u043d\u0443\u044e \u043d\u0430\u043c CDF (<img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/a4e\/ea6\/7a3\/a4eea67a3d583081cf4b4eb9d6534e72.svg\" alt=\"$r^2$\" data-tex=\"inline\"\/>).<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/ze\/ey\/ky\/zeeykyl_-y4fpmx8yxaisr0rcsg.png\" data-src=\"https:\/\/habrastorage.org\/webt\/ze\/ey\/ky\/zeeykyl_-y4fpmx8yxaisr0rcsg.png\"\/><\/div>\n<p>  \u041d\u043e \u0437\u0430\u0447\u0435\u043c \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u044d\u0442\u043e\u043c? \u041b\u044e\u0431\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0438\u043c\u0435\u044e\u0449\u0430\u044f \u0442\u0430\u043a\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435, \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0434\u043e\u043b\u0436\u043d\u0430 \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b88\/ce3\/99f\/b88ce399fda6c8123ab168cb507210f2.svg\" alt=\"$r$\" data-tex=\"inline\"\/>, \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0449\u0435\u0435 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443 \u0441 \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u044b\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u0440\u0443\u0433\u0430.<\/p>\n<p>  \u042f \u043f\u043e\u043a\u0430\u0436\u0443 \u0432\u0430\u043c \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u0441\u043f\u043e\u0441\u043e\u0431, \u043d\u043e \u043f\u0440\u0438\u0437\u044b\u0432\u0430\u044e \u0432\u0430\u0441 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0439\u0442\u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u044f \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0438\u043b \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u0432\u0441\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b. \u0412 \u044d\u0442\u043e\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u0435 \u0432\u044b\u0431\u043e\u0440 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b88\/ce3\/99f\/b88ce399fda6c8123ab168cb507210f2.svg\" alt=\"$r$\" data-tex=\"inline\"\/> \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0432\u0437\u044f\u0442\u0438\u0435\u043c \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c\u0430 \u043e\u0442 \u0434\u0432\u0443\u0445 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445. \u042f \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0443\u044e \u0432 Python \u0444\u0443\u043d\u043a\u0446\u0438\u044e <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/132\/34a\/346\/13234a34681e5d9167483fd9f035f25d.svg\" alt=\"$max$\" data-tex=\"inline\"\/>, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0435\u0451 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043d\u0438\u0436\u0435 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0432\u044b \u0432\u0438\u0434\u0438\u0442\u0435 \u0432 \u043c\u043e\u0451\u043c \u043a\u043e\u0434\u0435.<\/p>\n<pre><code class=\"python\">def max_dist():     theta = random() * 2 * pi     r = random()     x = random()     if x > r:         r = x     return r * cos(theta), r * sin(theta)<\/code><\/pre>\n<p>  \u041c\u044b \u0441\u043d\u043e\u0432\u0430 \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c 3141 \u0442\u043e\u0447\u043a\u0443 \u0432 \u043a\u0440\u0443\u0433\u0435, \u043d\u043e \u044d\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u043a\u0430\u0437\u0430\u0442\u044c. \u0414\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0441\u0445\u043e\u0436\u0438\u043c \u0441 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u0418\u0440\u0432\u0438\u043d\u0430-\u0425\u043e\u043b\u043b\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u2014 \u043e\u0442\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u043d\u0438\u0435\u043c \u0432\u0435\u043b\u0438\u0447\u0438\u043d <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/827\/6a3\/55d\/8276a355d254a55b0c1ba5d9cba3ff61.svg\" alt=\"$x_1$\" data-tex=\"inline\"\/> \u0438 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/305\/222\/c13\/305222c1343fb7aa2b5f93e3809a3059.svg\" alt=\"$x_2$\" data-tex=\"inline\"\/>. \u041a\u0430\u043a \u0438 \u0440\u0430\u043d\u0435\u0435, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b88\/ce3\/99f\/b88ce399fda6c8123ab168cb507210f2.svg\" alt=\"$r$\" data-tex=\"inline\"\/> \u0440\u0430\u0432\u0435\u043d \u0438\u0445 \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c\u0443, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u043a\u0432\u0430\u0434\u0440\u0430\u0442 \u043f\u043e \u0434\u0438\u0430\u0433\u043e\u043d\u0430\u043b\u0438. \u041b\u044e\u0431\u0430\u044f \u0442\u043e\u0447\u043a\u0430, \u043e\u043a\u0430\u0437\u0430\u0432\u0448\u0430\u044f\u0441\u044f \u0432 \u043a\u0440\u0430\u0441\u043d\u043e\u0439 \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0435 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0430, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/827\/6a3\/55d\/8276a355d254a55b0c1ba5d9cba3ff61.svg\" alt=\"$x_1$\" data-tex=\"inline\"\/>, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043e\u043d \u0431\u043e\u043b\u044c\u0448\u0435 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/305\/222\/c13\/305222c1343fb7aa2b5f93e3809a3059.svg\" alt=\"$x_2$\" data-tex=\"inline\"\/>. \u041b\u044e\u0431\u0430\u044f \u0442\u043e\u0447\u043a\u0430, \u043e\u043a\u0430\u0437\u0430\u0432\u0448\u0430\u044f\u0441\u044f \u0432 \u0441\u0438\u043d\u0435\u0439 \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0435 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0430, \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/305\/222\/c13\/305222c1343fb7aa2b5f93e3809a3059.svg\" alt=\"$x_2$\" data-tex=\"inline\"\/>. CDF \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043e\u043c \u0441 \u0434\u043b\u0438\u043d\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b88\/ce3\/99f\/b88ce399fda6c8123ab168cb507210f2.svg\" alt=\"$r$\" data-tex=\"inline\"\/>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043a\u0430\u0436\u0434\u0430\u044f \u0442\u043e\u0447\u043a\u0430 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/827\/6a3\/55d\/8276a355d254a55b0c1ba5d9cba3ff61.svg\" alt=\"$x_1$\" data-tex=\"inline\"\/> \u0438 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/305\/222\/c13\/305222c1343fb7aa2b5f93e3809a3059.svg\" alt=\"$x_2$\" data-tex=\"inline\"\/> \u043c\u0435\u043d\u044c\u0448\u0435 \u0438\u043b\u0438 \u0440\u0430\u0432\u043d\u0430 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b88\/ce3\/99f\/b88ce399fda6c8123ab168cb507210f2.svg\" alt=\"$r$\" data-tex=\"inline\"\/>, \u0430 \u043f\u043b\u043e\u0449\u0430\u0434\u044c \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0430 \u0441\u043d\u043e\u0432\u0430 \u0434\u0430\u0451\u0442 \u043d\u0430\u043c CDF, \u0440\u0430\u0432\u043d\u0443\u044e <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/a4e\/ea6\/7a3\/a4eea67a3d583081cf4b4eb9d6534e72.svg\" alt=\"$r^2$\" data-tex=\"inline\"\/>.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/yd\/d_\/tn\/ydd_tn2ltrksilrwyxlujck3hgw.png\" data-src=\"https:\/\/habrastorage.org\/webt\/yd\/d_\/tn\/ydd_tn2ltrksilrwyxlujck3hgw.png\"\/><\/div>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0440\u0430\u0437\u0431\u043e\u0440\u0430 \u044d\u0442\u0438\u0445 \u0447\u0435\u0442\u044b\u0440\u0451\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u043d\u0430\u043c \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0445, \u0447\u0442\u043e\u0431\u044b \u0443\u0437\u043d\u0430\u0442\u044c, \u043a\u0430\u043a\u043e\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e. \u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0432 \u043a\u0430\u0436\u0434\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e 3 142 592 \u0440\u0430\u0437\u0430, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0442\u0430\u043a\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u0438:<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/zf\/kj\/zs\/zfkjzsxfpf6dz7vjhe8je3sbkzq.png\" data-src=\"https:\/\/habrastorage.org\/webt\/zf\/kj\/zs\/zfkjzsxfpf6dz7vjhe8je3sbkzq.png\"\/><\/div>\n<p>  <i>\u041f\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u044e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f: \u043f\u0435\u0440\u0432\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 (rejection_sampling), \u0447\u0435\u0442\u0432\u0451\u0440\u0442\u044b\u0439 (max_dist), \u0432\u0442\u043e\u0440\u043e\u0439 (sqrt_dist) \u0438 \u0442\u0440\u0435\u0442\u0438\u0439 (sum_dist)<\/i><\/p>\n<p>  \u0417\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u0432\u044b\u0431\u043e\u0440\u043a\u0430 \u0441 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435\u043c (rejection sampling), \u0438 \u044d\u0442\u043e \u043b\u043e\u0433\u0438\u0447\u043d\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0442\u0440\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0437\u0430\u0442\u0440\u0430\u0442\u044b \u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0441\u0438\u043d\u0443\u0441\u0430 \u0438 \u043a\u043e\u0441\u0438\u043d\u0443\u0441\u0430. \u0417\u043d\u0430\u0447\u0438\u0442 \u043b\u0438 \u044d\u0442\u043e, \u0447\u0442\u043e \u0431\u041e\u043b\u044c\u0448\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043d\u0430\u0448\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0431\u044b\u043b\u0430 \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u043d\u0430 \u043d\u0430\u043f\u0440\u0430\u0441\u043d\u043e \u0438 \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u0440\u0430\u043d\u044c\u0448\u0435? \u042f \u0442\u0430\u043a \u043d\u0435 \u0441\u0447\u0438\u0442\u0430\u044e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0431\u044b \u043d\u0435 \u044d\u0442\u0430 \u0437\u0430\u0434\u0430\u0447\u0430, \u043c\u043d\u0435 \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u0431\u044b \u043d\u0435 \u0434\u043e\u0432\u0435\u043b\u043e\u0441\u044c \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 PDF \u0438 CDF, \u0434\u0430 \u0438 \u0441 \u0446\u0435\u043b\u044b\u043c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0434\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432.<\/p><\/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\/583838\/\"> https:\/\/habr.com\/ru\/articles\/583838\/<\/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-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/ug\/az\/yc\/ugazyczs_99q3hmdam2r_mxna20.png\" alt=\"image\" data-src=\"https:\/\/habrastorage.org\/webt\/ug\/az\/yc\/ugazyczs_99q3hmdam2r_mxna20.png\"\/><\/div>\n<p>  \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443 \u0441 \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u044b\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u0432 \u043a\u0440\u0443\u0433\u0435. \u041a\u0430\u043a \u0436\u0435 \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435\u0433\u043e? \u041a\u043e\u0433\u0434\u0430 \u044f \u0432\u043f\u0435\u0440\u0432\u044b\u0435 \u043d\u0430\u0447\u0430\u043b \u0438\u0437\u0443\u0447\u0430\u0442\u044c \u044d\u0442\u0443 \u0437\u0430\u0434\u0430\u0447\u0443, \u044f \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u043d\u0430\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c, \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0432\u0448\u0438\u043c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432 \u043a\u0440\u0443\u0433\u0435, \u043d\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u044f \u0441\u043f\u0443\u0441\u0442\u0438\u043b\u0441\u044f \u0432 \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u043e \u0433\u043b\u0443\u0431\u043e\u043a\u0443\u044e \u043a\u0440\u043e\u043b\u0438\u0447\u044c\u044e \u043d\u043e\u0440\u0443, \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u0443\u044e \u043b\u044e\u0431\u043e\u043f\u044b\u0442\u043d\u043e\u0439 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u043e\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0435\u0448\u0438\u043b \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u0432\u0441\u0435 \u0441\u0432\u043e\u0438 \u043d\u0430\u0445\u043e\u0434\u043a\u0438 \u0432 \u043e\u0434\u043d\u0443 \u0441\u0442\u0430\u0442\u044c\u044e.  <\/p>\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-408552","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/408552","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=408552"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/408552\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=408552"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=408552"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=408552"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}