{"id":9956,"date":"2020-05-05T11:19:54","date_gmt":"2020-05-05T15:19:54","guid":{"rendered":"https:\/\/spinor.info\/weblog\/?p=9956"},"modified":"2020-05-05T16:27:46","modified_gmt":"2020-05-05T20:27:46","slug":"some-probability-distributions","status":"publish","type":"post","link":"https:\/\/spinor.info\/weblog\/?p=9956","title":{"rendered":"Some probability distributions"},"content":{"rendered":"<p>So here I am, reading about some trivial yet not-so-trivial probability distributions.<\/p>\n<p>Let&#8217;s start with the uniform distribution. Easy-peasy, isn&#8217;t it: a random number, between 0 and 1, with an equal probability assigned to any value within this range.<\/p>\n<p>So&#8230; what happens if I take two such random numbers and add them? Why, I get a random number between 0 and 2 of course. But the probability distribution will no longer be uniform. There are more ways to get a value in the vicinity of 1 than near 0 or 2.<\/p>\n<p>And what happens if I add three such random numbers? Or four? And so on?<\/p>\n<p>The statistics of this result are captured by the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Irwin%E2%80%93Hall_distribution\">Irwin-Hall distribution<\/a>, defined as<\/p>\n<p>$$f_{\\rm IH}(x,n)=\\dfrac{1}{2(n-1)!}\\sum\\limits_{k=1}^n(-1)^k\\begin{pmatrix}n\\\\k\\end{pmatrix}(x-k)^{n-1}{\\rm sgn}(x-k).$$<\/p>\n<p><a href=\"https:\/\/en.wikipedia.org\/wiki\/Irwin%E2%80%93Hall_distribution\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-9957\" src=\"https:\/\/spinor.info\/weblog\/wp-content\/uploads\/2020\/05\/irwin-hall.png\" alt=\"\" width=\"642\" height=\"465\" srcset=\"https:\/\/spinor.info\/weblog\/wp-content\/uploads\/2020\/05\/irwin-hall.png 642w, https:\/\/spinor.info\/weblog\/wp-content\/uploads\/2020\/05\/irwin-hall-300x217.png 300w\" sizes=\"(max-width: 642px) 100vw, 642px\" \/><\/a><\/p>\n<p>OK, so that&#8217;s what happens when we add these uniformly generated random values. What happens when we average them? This, in turn, is captured by the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Bates_distribution\">Bates distribution<\/a>, which, unsurprisingly, is just the Irwin-Hall distribution, scaled by the factor \\(n\\):<\/p>\n<p>$$f_{\\rm B}(x,n)=\\dfrac{n}{2(n-1)!}\\sum\\limits_{k=1}^n(-1)^k\\begin{pmatrix}n\\\\k\\end{pmatrix}(nx-k)^{n-1}{\\rm sgn}(nx-k).$$<\/p>\n<p><a href=\"https:\/\/en.wikipedia.org\/wiki\/Bates_distribution\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-9958\" src=\"https:\/\/spinor.info\/weblog\/wp-content\/uploads\/2020\/05\/bates.png\" alt=\"\" width=\"642\" height=\"465\" srcset=\"https:\/\/spinor.info\/weblog\/wp-content\/uploads\/2020\/05\/bates.png 642w, https:\/\/spinor.info\/weblog\/wp-content\/uploads\/2020\/05\/bates-300x217.png 300w\" sizes=\"(max-width: 642px) 100vw, 642px\" \/><\/a><\/p>\n<p>How about that.<\/p>\n<p>For what it&#8217;s worth, here is the <a href=\"http:\/\/maxima.sourceforge.net\/\">Maxima<\/a> script to generate the Irwin-Hall plot:<\/p>\n<pre style=\"margin-left: 0.5in; margin-right: 1.25in; background-color: #eee; font-size: 9pt;\">fI(x,n):=1\/2\/(n-1)!*sum((-1)^k*n!\/k!\/(n-k)!*(x-k)^(n-1)*signum(x-k),k,0,n);\r\nplot2d([fI(x,1),fI(x,2),fI(x,4),fI(x,8),fI(x,16)],[x,-2,18],[box,false],\r\n       [legend,\"n=1\",\"n=2\",\"n=4\",\"n=8\",\"n=16\"],[y,-0.1,1.1]);<\/pre>\n<p>And this one for the Bates plot:<\/p>\n<pre style=\"margin-left: 0.5in; margin-right: 1.25in; background-color: #eee; font-size: 9pt;\">fB(x,n):=n\/2\/(n-1)!*sum((-1)^k*n!\/k!\/(n-k)!*(n*x-k)^(n-1)*signum(n*x-k),k,0,n);\r\nplot2d([fB(x,1),fB(x,2),fB(x,4),fB(x,8),fB(x,16)],[x,-0.1,1.1],[box,false],\r\n       [legend,\"n=1\",\"n=2\",\"n=4\",\"n=8\",\"n=16\"],[y,-0.1,5.9]);<\/pre>\n<p>Yes, I am still a little bit of a math geek at heart.<\/p>\n<fb:like href='https:\/\/spinor.info\/weblog\/?p=9956' send='true' layout='standard' show_faces='true' width='450' height='65' action='like' colorscheme='light' font='lucida grande'><\/fb:like>","protected":false},"excerpt":{"rendered":"<p>So here I am, reading about some trivial yet not-so-trivial probability distributions. Let&#8217;s start with the uniform distribution. Easy-peasy, isn&#8217;t it: a random number, between 0 and 1, with an equal probability assigned to any value within this range. So&#8230; what happens if I take two such random numbers and add them? Why, I get <a href='https:\/\/spinor.info\/weblog\/?p=9956' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30],"tags":[],"class_list":["post-9956","post","type-post","status-publish","format-standard","hentry","category-mathematics","category-30-id","post-seq-1","post-parity-odd","meta-position-corners","fix"],"_links":{"self":[{"href":"https:\/\/spinor.info\/weblog\/index.php?rest_route=\/wp\/v2\/posts\/9956","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/spinor.info\/weblog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/spinor.info\/weblog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/spinor.info\/weblog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/spinor.info\/weblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9956"}],"version-history":[{"count":11,"href":"https:\/\/spinor.info\/weblog\/index.php?rest_route=\/wp\/v2\/posts\/9956\/revisions"}],"predecessor-version":[{"id":9969,"href":"https:\/\/spinor.info\/weblog\/index.php?rest_route=\/wp\/v2\/posts\/9956\/revisions\/9969"}],"wp:attachment":[{"href":"https:\/\/spinor.info\/weblog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9956"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/spinor.info\/weblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9956"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/spinor.info\/weblog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9956"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}