{"id":462,"date":"2020-07-06T14:30:48","date_gmt":"2020-07-06T14:30:48","guid":{"rendered":"https:\/\/www.allendowney.com\/blog\/?p=462"},"modified":"2020-07-06T14:30:48","modified_gmt":"2020-07-06T14:30:48","slug":"maxima-minima-and-mixtures","status":"publish","type":"post","link":"https:\/\/www.allendowney.com\/blog\/2020\/07\/06\/maxima-minima-and-mixtures\/","title":{"rendered":"Maxima, Minima, and Mixtures"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">I am hard at work on the second edition of <em>Think Bayes<\/em>, currently working on Chapter 6, which is about computing distributions of minima, maxima and mixtures of other distributions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Of all the changes in the second edition, I am particularly proud of the exercises.  I present three new exercises from Chapter 6 below.  If you want to work on them, you can use <a rel=\"noreferrer noopener\" href=\"https:\/\/colab.research.google.com\/github\/AllenDowney\/ThinkBayes2\/blob\/master\/code\/chap06.ipynb\" target=\"_blank\">this notebook<\/a>, which contains the material you will need from the chapter and some code to get you started.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Exercise 1<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Henri Poincar\u00e9 was a French mathematician who taught at the Sorbonne around 1900. The following anecdote about him is probably fabricated, but it makes an interesting probability problem.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Supposedly Poincar\u00e9 suspected that his local bakery was selling loaves of bread that were lighter than the advertised weight of 1 kg, so every day for a year he bought a loaf of bread, brought it home and weighed it. At the end of the year, he plotted the distribution of his measurements and showed that it fit a normal distribution with mean 950 g and standard deviation 50 g. He brought this evidence to the bread police, who gave the baker a warning.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For the next year, Poincar\u00e9 continued the practice of weighing his bread every day. At the end of the year, he found that the average weight was 1000 g, just as it should be, but again he complained to the bread police, and this time they fined the baker.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Why? Because the shape of the distribution was asymmetric. Unlike the normal distribution, it was skewed to the right, which is consistent with the hypothesis that the baker was still making 950 g loaves, but deliberately giving Poincar\u00e9 the heavier ones.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To see whether this anecdote is plausible, let&#8217;s suppose that when the baker sees Poincar\u00e9 coming, he hefts\u00a0<code>n<\/code>\u00a0loaves of bread and gives Poincar\u00e9 the heaviest one. How many loaves would the baker have to heft to make the average of the maximum 1000 g?<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Exercise 2<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Two doctors fresh out of medical school are arguing about whose hospital delivers more babies. The first doctor says, &#8220;I&#8217;ve been at Hospital A for two weeks, and already we&#8217;ve had a day when we delivered 20 babies.&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The second doctor says, &#8220;I&#8217;ve only been at Hospital B for one week, but already there&#8217;s been a 19-baby day.&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Which hospital do you think delivers more babies on average? You can assume that the number of babies born in a day is well modeled by a\u00a0<a rel=\"noreferrer noopener\" href=\"https:\/\/en.wikipedia.org\/wiki\/Poisson_distribution\" target=\"_blank\">Poisson distribution<\/a>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Exercise 3<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Suppose I drive the same route three times and the fastest of the three attempts takes 8 minutes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">There are two traffic lights on the route. As I approach each light, there is a 40% chance that it is green; in that case, it causes no delay. And there is a 60% chance it is red; in that case it causes a delay that is uniformly distributed from 0 to 60 seconds.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">What is the posterior distribution of the time it would take to drive the route with no delays?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The solution to this exercise is very similar to <a rel=\"noreferrer noopener\" href=\"https:\/\/patents.google.com\/patent\/US8385227B1\/en\" target=\"_blank\">a method I developed<\/a>\u00a0for estimating the minimum time for a packet of data to travel through a path in the internet.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Again, <a href=\"https:\/\/colab.research.google.com\/github\/AllenDowney\/ThinkBayes2\/blob\/master\/code\/chap06.ipynb\" target=\"_blank\" rel=\"noreferrer noopener\">here&#8217;s the notebook where you can work on these exercises<\/a>.  I will publish solutions later this week.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I am hard at work on the second edition of Think Bayes, currently working on Chapter 6, which is about computing distributions of minima, maxima and mixtures of other distributions. Of all the changes in the second edition, I am particularly proud of the exercises. I present three new exercises from Chapter 6 below. If you want to work on them, you can use this notebook, which contains the material you will need from the chapter and some code to&#8230;<\/p>\n<p class=\"read-more\"><a class=\"btn btn-default\" href=\"https:\/\/www.allendowney.com\/blog\/2020\/07\/06\/maxima-minima-and-mixtures\/\"> Read More<span class=\"screen-reader-text\">  Read More<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1],"tags":[71,16],"class_list":["post-462","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-bayesian-statistics","tag-python"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Maxima, Minima, and Mixtures - Probably Overthinking It<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.allendowney.com\/blog\/2020\/07\/06\/maxima-minima-and-mixtures\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Maxima, Minima, and Mixtures - Probably Overthinking It\" \/>\n<meta property=\"og:description\" content=\"I am hard at work on the second edition of Think Bayes, currently working on Chapter 6, which is about computing distributions of minima, maxima and mixtures of other distributions. Of all the changes in the second edition, I am particularly proud of the exercises. I present three new exercises from Chapter 6 below. If you want to work on them, you can use this notebook, which contains the material you will need from the chapter and some code to... Read More Read More\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.allendowney.com\/blog\/2020\/07\/06\/maxima-minima-and-mixtures\/\" \/>\n<meta property=\"og:site_name\" content=\"Probably Overthinking It\" \/>\n<meta property=\"article:published_time\" content=\"2020-07-06T14:30:48+00:00\" \/>\n<meta name=\"author\" content=\"Allen B. Downey\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@AllenDowney\" \/>\n<meta name=\"twitter:site\" content=\"@AllenDowney\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Allen B. Downey\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/2020\\\/07\\\/06\\\/maxima-minima-and-mixtures\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/2020\\\/07\\\/06\\\/maxima-minima-and-mixtures\\\/\"},\"author\":{\"name\":\"Allen B. Downey\",\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/#\\\/schema\\\/person\\\/4e5bfb2e9af6c3446cb0031a7bf83207\"},\"headline\":\"Maxima, Minima, and Mixtures\",\"datePublished\":\"2020-07-06T14:30:48+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/2020\\\/07\\\/06\\\/maxima-minima-and-mixtures\\\/\"},\"wordCount\":554,\"publisher\":{\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/#\\\/schema\\\/person\\\/4e5bfb2e9af6c3446cb0031a7bf83207\"},\"keywords\":[\"bayesian statistics\",\"python\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/2020\\\/07\\\/06\\\/maxima-minima-and-mixtures\\\/\",\"url\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/2020\\\/07\\\/06\\\/maxima-minima-and-mixtures\\\/\",\"name\":\"Maxima, Minima, and Mixtures - Probably Overthinking It\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/#website\"},\"datePublished\":\"2020-07-06T14:30:48+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/2020\\\/07\\\/06\\\/maxima-minima-and-mixtures\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/2020\\\/07\\\/06\\\/maxima-minima-and-mixtures\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/2020\\\/07\\\/06\\\/maxima-minima-and-mixtures\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Maxima, Minima, and Mixtures\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/\",\"name\":\"Probably Overthinking It\",\"description\":\"Data science, Bayesian Statistics, and other ideas\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/#\\\/schema\\\/person\\\/4e5bfb2e9af6c3446cb0031a7bf83207\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/#\\\/schema\\\/person\\\/4e5bfb2e9af6c3446cb0031a7bf83207\",\"name\":\"Allen B. Downey\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/03\\\/probably_logo.png\",\"url\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/03\\\/probably_logo.png\",\"contentUrl\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/03\\\/probably_logo.png\",\"width\":714,\"height\":784,\"caption\":\"Allen B. Downey\"},\"logo\":{\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/03\\\/probably_logo.png\"},\"sameAs\":[\"https:\\\/\\\/www.allendowney.com\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/allendowney\\\/\",\"https:\\\/\\\/x.com\\\/AllenDowney\",\"https:\\\/\\\/github.com\\\/AllenDowney\",\"https:\\\/\\\/bsky.app\\\/profile\\\/allendowney.bsky.social\",\"https:\\\/\\\/allendowney.github.io\\\/Portfolio\\\/\",\"https:\\\/\\\/greenteapress.com\\\/wp\\\/\"],\"url\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/author\\\/allen-downey\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Maxima, Minima, and Mixtures - Probably Overthinking It","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:\/\/www.allendowney.com\/blog\/2020\/07\/06\/maxima-minima-and-mixtures\/","og_locale":"en_US","og_type":"article","og_title":"Maxima, Minima, and Mixtures - Probably Overthinking It","og_description":"I am hard at work on the second edition of Think Bayes, currently working on Chapter 6, which is about computing distributions of minima, maxima and mixtures of other distributions. Of all the changes in the second edition, I am particularly proud of the exercises. I present three new exercises from Chapter 6 below. If you want to work on them, you can use this notebook, which contains the material you will need from the chapter and some code to... Read More Read More","og_url":"https:\/\/www.allendowney.com\/blog\/2020\/07\/06\/maxima-minima-and-mixtures\/","og_site_name":"Probably Overthinking It","article_published_time":"2020-07-06T14:30:48+00:00","author":"Allen B. Downey","twitter_card":"summary_large_image","twitter_creator":"@AllenDowney","twitter_site":"@AllenDowney","twitter_misc":{"Written by":"Allen B. Downey","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.allendowney.com\/blog\/2020\/07\/06\/maxima-minima-and-mixtures\/#article","isPartOf":{"@id":"https:\/\/www.allendowney.com\/blog\/2020\/07\/06\/maxima-minima-and-mixtures\/"},"author":{"name":"Allen B. Downey","@id":"https:\/\/www.allendowney.com\/blog\/#\/schema\/person\/4e5bfb2e9af6c3446cb0031a7bf83207"},"headline":"Maxima, Minima, and Mixtures","datePublished":"2020-07-06T14:30:48+00:00","mainEntityOfPage":{"@id":"https:\/\/www.allendowney.com\/blog\/2020\/07\/06\/maxima-minima-and-mixtures\/"},"wordCount":554,"publisher":{"@id":"https:\/\/www.allendowney.com\/blog\/#\/schema\/person\/4e5bfb2e9af6c3446cb0031a7bf83207"},"keywords":["bayesian statistics","python"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.allendowney.com\/blog\/2020\/07\/06\/maxima-minima-and-mixtures\/","url":"https:\/\/www.allendowney.com\/blog\/2020\/07\/06\/maxima-minima-and-mixtures\/","name":"Maxima, Minima, and Mixtures - Probably Overthinking It","isPartOf":{"@id":"https:\/\/www.allendowney.com\/blog\/#website"},"datePublished":"2020-07-06T14:30:48+00:00","breadcrumb":{"@id":"https:\/\/www.allendowney.com\/blog\/2020\/07\/06\/maxima-minima-and-mixtures\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.allendowney.com\/blog\/2020\/07\/06\/maxima-minima-and-mixtures\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.allendowney.com\/blog\/2020\/07\/06\/maxima-minima-and-mixtures\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.allendowney.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Maxima, Minima, and Mixtures"}]},{"@type":"WebSite","@id":"https:\/\/www.allendowney.com\/blog\/#website","url":"https:\/\/www.allendowney.com\/blog\/","name":"Probably Overthinking It","description":"Data science, Bayesian Statistics, and other ideas","publisher":{"@id":"https:\/\/www.allendowney.com\/blog\/#\/schema\/person\/4e5bfb2e9af6c3446cb0031a7bf83207"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.allendowney.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.allendowney.com\/blog\/#\/schema\/person\/4e5bfb2e9af6c3446cb0031a7bf83207","name":"Allen B. Downey","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2025\/03\/probably_logo.png","url":"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2025\/03\/probably_logo.png","contentUrl":"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2025\/03\/probably_logo.png","width":714,"height":784,"caption":"Allen B. Downey"},"logo":{"@id":"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2025\/03\/probably_logo.png"},"sameAs":["https:\/\/www.allendowney.com\/","https:\/\/www.linkedin.com\/in\/allendowney\/","https:\/\/x.com\/AllenDowney","https:\/\/github.com\/AllenDowney","https:\/\/bsky.app\/profile\/allendowney.bsky.social","https:\/\/allendowney.github.io\/Portfolio\/","https:\/\/greenteapress.com\/wp\/"],"url":"https:\/\/www.allendowney.com\/blog\/author\/allen-downey\/"}]}},"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/posts\/462","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/comments?post=462"}],"version-history":[{"count":4,"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/posts\/462\/revisions"}],"predecessor-version":[{"id":466,"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/posts\/462\/revisions\/466"}],"wp:attachment":[{"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/media?parent=462"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/categories?post=462"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/tags?post=462"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}