{"id":2496,"date":"2023-07-22T00:51:41","date_gmt":"2023-07-22T00:51:41","guid":{"rendered":"https:\/\/statorials.org\/nl\/python-uniforme-distributie\/"},"modified":"2023-07-22T00:51:41","modified_gmt":"2023-07-22T00:51:41","slug":"python-uniforme-distributie","status":"publish","type":"post","link":"https:\/\/statorials.org\/nl\/python-uniforme-distributie\/","title":{"rendered":"Hoe uniforme distributie in python te gebruiken"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">Een <a href=\"https:\/\/statorials.org\/nl\/uniforme-verdeling\/\" target=\"_blank\" rel=\"noopener\">uniforme verdeling<\/a> is een kansverdeling waarbij elke waarde tussen een interval van <em>a<\/em> tot en met <em>b<\/em> dezelfde kans heeft om gekozen te worden.<\/span><\/p>\n<p> <span style=\"color: #000000;\">De kans op het verkrijgen van een waarde tussen x <sub>1<\/sub> en x <sub>2<\/sub> op een interval van <em>a<\/em> tot <em>b<\/em> kan worden gevonden met behulp van de formule:<\/span><\/p>\n<p> <span style=\"color: #000000;\">P(verkrijg een waarde tussen x <sub>1<\/sub> en x <sub>2<\/sub> ) = (x <sub>2<\/sub> \u2013 x <sub>1<\/sub> ) \/ (b \u2013 a)<\/span> <\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-1565 size-full\" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/uniforme_pic.jpg\" sizes=\"auto, \" srcset=\"\" alt=\"Voorbeeld van uniforme distributie\" width=\"336\" height=\"203\"><\/p>\n<p> <span style=\"color: #000000;\">Om de kansen met betrekking tot de uniforme verdeling in Python te berekenen, kunnen we de functie <a href=\"https:\/\/docs.scipy.org\/doc\/scipy\/reference\/generated\/scipy.stats.uniform.html\" target=\"_blank\" rel=\"noopener\">scipy.stats.uniform()<\/a> gebruiken, die de volgende basissyntaxis gebruikt:<\/span><\/p>\n<p> <strong><span style=\"color: #000000;\">scipy.stats.uniform(x, loc, schaal)<\/span><\/strong><\/p>\n<p> <span style=\"color: #000000;\">Goud:<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\"><strong>x<\/strong> : De waarde van de uniforme verdeling<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>loc<\/strong> : De minimaal mogelijke waarde<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>loc + schaal<\/strong> : De maximaal mogelijke waarde<\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\">De volgende voorbeelden laten zien hoe u deze functie in de praktijk kunt gebruiken.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>voorbeeld 1<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">Stel dat er iedere 20 minuten een bus bij een bushalte aankomt. Als u bij de bushalte aankomt, hoe groot is dan de kans dat de bus binnen 8 minuten of minder arriveert?<\/span><\/p>\n<p> <span style=\"color: #000000;\">We kunnen de volgende code in Python gebruiken om deze waarschijnlijkheid te berekenen:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008000;\">from<\/span> scipy. <span style=\"color: #3366ff;\">stats<\/span> <span style=\"color: #008000;\">import<\/span> uniform\n\n<span style=\"color: #008080;\">#calculate uniform probability\n<\/span>uniform. <span style=\"color: #3366ff;\">cdf<\/span> (x=8, loc=0, scale=20) - uniform. <span style=\"color: #3366ff;\">cdf<\/span> (x=0, loc=0, scale=20)\n\n0.4<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">De kans dat de bus binnen 8 minuten of minder arriveert is <strong>0,4<\/strong> .<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Voorbeeld 2<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">Het gewicht van een bepaalde kikkersoort is gelijkmatig verdeeld tussen 15 en 25 gram. Als je willekeurig een kikker selecteert, hoe groot is dan de kans dat deze tussen de 17 en 19 gram weegt?<\/span><\/p>\n<p> <span style=\"color: #000000;\">We kunnen de volgende code in Python gebruiken om deze waarschijnlijkheid te berekenen:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008000;\">from<\/span> scipy. <span style=\"color: #3366ff;\">stats<\/span> <span style=\"color: #008000;\">import<\/span> uniform\n\n<span style=\"color: #008080;\">#calculate uniform probability\n<\/span>uniform. <span style=\"color: #3366ff;\">cdf<\/span> (x=19, loc=15, scale=10) - uniform. <span style=\"color: #3366ff;\">cdf<\/span> (x=17, loc=15, scale=10)\n\n0.2<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">De kans dat de kikker tussen de 17 en 19 gram weegt is <strong>0,2<\/strong> .<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Voorbeeld 3<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">De duur van een NBA-wedstrijd is gelijkmatig verdeeld tussen 120 en 170 minuten. Hoe groot is de kans dat een willekeurig gekozen NBA-spel langer dan 150 minuten duurt?<\/span><\/p>\n<p> <span style=\"color: #000000;\">We kunnen de volgende code in Python gebruiken om deze waarschijnlijkheid te berekenen:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\"><span style=\"color: #000000;\">from scipy. <span style=\"color: #3366ff;\">stats<\/span> <span style=\"color: #008000;\">import<\/span> uniform<\/span>\n\n#calculate uniform probability \n<span style=\"color: #000000;\">uniform. <span style=\"color: #3366ff;\">cdf<\/span> (x=170, loc=120, scale=50) - uniform. <span style=\"color: #3366ff;\">cdf<\/span> (x=150, loc=120, scale=50)\n\n0.4<\/span><\/span><\/strong><\/pre>\n<p> <span style=\"color: #000000;\">De kans dat een willekeurig gekozen NBA-wedstrijd langer dan 150 minuten duurt is <strong>0,4<\/strong> .<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>Bonus:<\/strong> u kunt de oplossing voor elk voorbeeld controleren met behulp van de Uniforme Verdelingscalculator.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Aanvullende bronnen<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">In de volgende tutorials wordt uitgelegd hoe u andere veelgebruikte distributies in Python kunt gebruiken:<\/span><\/p>\n<p> <a href=\"https:\/\/statorials.org\/nl\/binominale-distributiepython\/\" target=\"_blank\" rel=\"noopener\">Hoe binomiale distributie in Python te gebruiken<\/a><br \/> <a href=\"https:\/\/statorials.org\/nl\/visverspreidingspython\/\" target=\"_blank\" rel=\"noopener\">Hoe de Poisson-distributie in Python te gebruiken<\/a><br \/> <a href=\"https:\/\/statorials.org\/nl\/t-python-distributie\/\" target=\"_blank\" rel=\"noopener\">Hoe t-distributie in Python te gebruiken<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Een uniforme verdeling is een kansverdeling waarbij elke waarde tussen een interval van a tot en met b dezelfde kans heeft om gekozen te worden. De kans op het verkrijgen van een waarde tussen x 1 en x 2 op een interval van a tot b kan worden gevonden met behulp van de formule: P(verkrijg [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-2496","post","type-post","status-publish","format-standard","hentry","category-gids"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Uniforme distributie gebruiken in Python - Statorials<\/title>\n<meta name=\"description\" content=\"In deze tutorial wordt uitgelegd hoe je uniforme distributie in Python kunt gebruiken, met verschillende voorbeelden.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/statorials.org\/nl\/python-uniforme-distributie\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Uniforme distributie gebruiken in Python - Statorials\" \/>\n<meta property=\"og:description\" content=\"In deze tutorial wordt uitgelegd hoe je uniforme distributie in Python kunt gebruiken, met verschillende voorbeelden.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/nl\/python-uniforme-distributie\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-22T00:51:41+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/uniforme_pic.jpg\" \/>\n<meta name=\"author\" content=\"Dr.benjamin anderson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Verfasst von\" \/>\n\t<meta name=\"twitter:data1\" content=\"Dr.benjamin anderson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Gesch\u00e4tzte Lesezeit\" \/>\n\t<meta name=\"twitter:data2\" content=\"2\u00a0Minuten\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/statorials.org\/nl\/python-uniforme-distributie\/\",\"url\":\"https:\/\/statorials.org\/nl\/python-uniforme-distributie\/\",\"name\":\"Uniforme distributie gebruiken in Python - Statorials\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/nl\/#website\"},\"datePublished\":\"2023-07-22T00:51:41+00:00\",\"dateModified\":\"2023-07-22T00:51:41+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219\"},\"description\":\"In deze tutorial wordt uitgelegd hoe je uniforme distributie in Python kunt gebruiken, met verschillende voorbeelden.\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/nl\/python-uniforme-distributie\/#breadcrumb\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/nl\/python-uniforme-distributie\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/nl\/python-uniforme-distributie\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Thuis\",\"item\":\"https:\/\/statorials.org\/nl\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Hoe uniforme distributie in python te gebruiken\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/statorials.org\/nl\/#website\",\"url\":\"https:\/\/statorials.org\/nl\/\",\"name\":\"Statorials\",\"description\":\"Uw gids voor statistische competentie\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/statorials.org\/nl\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"de\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219\",\"name\":\"Dr.benjamin anderson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\/\/statorials.org\/nl\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/statorials.org\/nl\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"contentUrl\":\"http:\/\/statorials.org\/nl\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"caption\":\"Dr.benjamin anderson\"},\"description\":\"Ik ben Benjamin, een gepensioneerde hoogleraar statistiek die nu een toegewijde Statorials-lesgever is. Ik heb uitgebreide ervaring en expertise op het gebied van statistiek en ik ben vastbesloten om mijn kennis te delen met studenten via Statorials. Lees verder\",\"sameAs\":[\"http:\/\/statorials.org\/nl\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Uniforme distributie gebruiken in Python - Statorials","description":"In deze tutorial wordt uitgelegd hoe je uniforme distributie in Python kunt gebruiken, met verschillende voorbeelden.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/statorials.org\/nl\/python-uniforme-distributie\/","og_locale":"de_DE","og_type":"article","og_title":"Uniforme distributie gebruiken in Python - Statorials","og_description":"In deze tutorial wordt uitgelegd hoe je uniforme distributie in Python kunt gebruiken, met verschillende voorbeelden.","og_url":"https:\/\/statorials.org\/nl\/python-uniforme-distributie\/","og_site_name":"Statorials","article_published_time":"2023-07-22T00:51:41+00:00","og_image":[{"url":"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/uniforme_pic.jpg"}],"author":"Dr.benjamin anderson","twitter_card":"summary_large_image","twitter_misc":{"Verfasst von":"Dr.benjamin anderson","Gesch\u00e4tzte Lesezeit":"2\u00a0Minuten"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/statorials.org\/nl\/python-uniforme-distributie\/","url":"https:\/\/statorials.org\/nl\/python-uniforme-distributie\/","name":"Uniforme distributie gebruiken in Python - Statorials","isPartOf":{"@id":"https:\/\/statorials.org\/nl\/#website"},"datePublished":"2023-07-22T00:51:41+00:00","dateModified":"2023-07-22T00:51:41+00:00","author":{"@id":"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219"},"description":"In deze tutorial wordt uitgelegd hoe je uniforme distributie in Python kunt gebruiken, met verschillende voorbeelden.","breadcrumb":{"@id":"https:\/\/statorials.org\/nl\/python-uniforme-distributie\/#breadcrumb"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/nl\/python-uniforme-distributie\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/nl\/python-uniforme-distributie\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Thuis","item":"https:\/\/statorials.org\/nl\/"},{"@type":"ListItem","position":2,"name":"Hoe uniforme distributie in python te gebruiken"}]},{"@type":"WebSite","@id":"https:\/\/statorials.org\/nl\/#website","url":"https:\/\/statorials.org\/nl\/","name":"Statorials","description":"Uw gids voor statistische competentie","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/statorials.org\/nl\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"de"},{"@type":"Person","@id":"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219","name":"Dr.benjamin anderson","image":{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/statorials.org\/nl\/#\/schema\/person\/image\/","url":"http:\/\/statorials.org\/nl\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","contentUrl":"http:\/\/statorials.org\/nl\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","caption":"Dr.benjamin anderson"},"description":"Ik ben Benjamin, een gepensioneerde hoogleraar statistiek die nu een toegewijde Statorials-lesgever is. Ik heb uitgebreide ervaring en expertise op het gebied van statistiek en ik ben vastbesloten om mijn kennis te delen met studenten via Statorials. Lees verder","sameAs":["http:\/\/statorials.org\/nl"]}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"_links":{"self":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/posts\/2496","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/comments?post=2496"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/posts\/2496\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/media?parent=2496"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/categories?post=2496"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/tags?post=2496"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}