{"id":74,"date":"2018-10-18T14:11:58","date_gmt":"2018-10-18T14:11:58","guid":{"rendered":"https:\/\/www.allendowney.com\/blog\/?p=74"},"modified":"2018-10-18T14:11:58","modified_gmt":"2018-10-18T14:11:58","slug":"how-tall-is-a","status":"publish","type":"post","link":"https:\/\/www.allendowney.com\/blog\/2018\/10\/18\/how-tall-is-a\/","title":{"rendered":"How tall is A?"},"content":{"rendered":"<p>Here are a series of problems I posed in my Bayesian statistics class:<\/p>\n<p>1) Suppose you meet an adult resident of the U.S. who is 170 cm tall. What is the probability that they are male?<\/p>\n<p>2) Suppose I choose two U.S. residents at random and A is taller than B.\u00a0 How tall is A?<\/p>\n<p>3)\u00a0In a room of 10 randomly chosen U.S. residents, A is the second tallest.\u00a0 How tall is A?\u00a0 And what is the probability that A is male?<\/p>\n<p>As background: For adult male residents of the US, the mean and standard deviation of height are 178 cm and 7.7 cm. For adult female residents the corresponding stats are 163 cm and 7.3 cm.\u00a0 And 51% of the adult population is female.<\/p>\n<p>If you solve the problems in order, you can reuse code from the first two to solve the third.<\/p>\n<p>Here&#8217;s my solution, using a grid algorithm and the libraries from <em>Think Bayes<\/em>:<\/p>\n<div class=\"oembed-gist\"><script src=\"https:\/\/gist.github.com\/e9b71992465e9fd5b7f96e7ed619b6f5.js\"><\/script><noscript>View the code on <a href=\"https:\/\/gist.github.com\/e9b71992465e9fd5b7f96e7ed619b6f5\">Gist<\/a>.<\/noscript><\/div>\n<p>When I tweeted about this problem, I heard from <a href=\"https:\/\/twitter.com\/colindcarroll\">Colin Carroll<\/a>, who wrote a solution using PyMC:<\/p>\n<div class=\"oembed-gist\"><script src=\"https:\/\/gist.github.com\/ColCarroll\/df1021a9215b8ed83de3dfe7fcd3eae7.js\"><\/script><noscript>View the code on <a href=\"https:\/\/gist.github.com\/ColCarroll\/df1021a9215b8ed83de3dfe7fcd3eae7\">Gist<\/a>.<\/noscript><\/div>\n<p>And <a href=\"https:\/\/twitter.com\/dovgalec\">vlad<\/a> posted a this solution using WebPPL, a browser-based environment for probablistic programming:<\/p>\n<div class=\"oembed-gist\"><script src=\"https:\/\/gist.github.com\/usptact\/5cb049452a0acc8d8c6801ce53c30e2d.js\"><\/script><noscript>View the code on <a href=\"https:\/\/gist.github.com\/usptact\/5cb049452a0acc8d8c6801ce53c30e2d\">Gist<\/a>.<\/noscript><\/div>\n<p>You can run that solution at <a href=\"http:\/\/webppl.org\/\">WebPPL<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here are a series of problems I posed in my Bayesian statistics class: 1) Suppose you meet an adult resident of the U.S. who is 170 cm tall. What is the probability that they are male? 2) Suppose I choose two U.S. residents at random and A is taller than B.\u00a0 How tall is A? 3)\u00a0In a room of 10 randomly chosen U.S. residents, A is the second tallest.\u00a0 How tall is A?\u00a0 And what is the probability that A&#8230;<\/p>\n<p class=\"read-more\"><a class=\"btn btn-default\" href=\"https:\/\/www.allendowney.com\/blog\/2018\/10\/18\/how-tall-is-a\/\"> Read More<span class=\"screen-reader-text\">  Read More<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","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":[],"class_list":["post-74","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How tall is A? - 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\/2018\/10\/18\/how-tall-is-a\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How tall is A? - Probably Overthinking It\" \/>\n<meta property=\"og:description\" content=\"Here are a series of problems I posed in my Bayesian statistics class: 1) Suppose you meet an adult resident of the U.S. who is 170 cm tall. What is the probability that they are male? 2) Suppose I choose two U.S. residents at random and A is taller than B.\u00a0 How tall is A? 3)\u00a0In a room of 10 randomly chosen U.S. residents, A is the second tallest.\u00a0 How tall is A?\u00a0 And what is the probability that A... Read More Read More\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.allendowney.com\/blog\/2018\/10\/18\/how-tall-is-a\/\" \/>\n<meta property=\"og:site_name\" content=\"Probably Overthinking It\" \/>\n<meta property=\"article:published_time\" content=\"2018-10-18T14:11:58+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=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/2018\\\/10\\\/18\\\/how-tall-is-a\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/2018\\\/10\\\/18\\\/how-tall-is-a\\\/\"},\"author\":{\"name\":\"Allen B. Downey\",\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/#\\\/schema\\\/person\\\/4e5bfb2e9af6c3446cb0031a7bf83207\"},\"headline\":\"How tall is A?\",\"datePublished\":\"2018-10-18T14:11:58+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/2018\\\/10\\\/18\\\/how-tall-is-a\\\/\"},\"wordCount\":235,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/#\\\/schema\\\/person\\\/4e5bfb2e9af6c3446cb0031a7bf83207\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/2018\\\/10\\\/18\\\/how-tall-is-a\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/2018\\\/10\\\/18\\\/how-tall-is-a\\\/\",\"url\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/2018\\\/10\\\/18\\\/how-tall-is-a\\\/\",\"name\":\"How tall is A? - Probably Overthinking It\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/#website\"},\"datePublished\":\"2018-10-18T14:11:58+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/2018\\\/10\\\/18\\\/how-tall-is-a\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/2018\\\/10\\\/18\\\/how-tall-is-a\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/2018\\\/10\\\/18\\\/how-tall-is-a\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How tall is A?\"}]},{\"@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":"How tall is A? - 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\/2018\/10\/18\/how-tall-is-a\/","og_locale":"en_US","og_type":"article","og_title":"How tall is A? - Probably Overthinking It","og_description":"Here are a series of problems I posed in my Bayesian statistics class: 1) Suppose you meet an adult resident of the U.S. who is 170 cm tall. What is the probability that they are male? 2) Suppose I choose two U.S. residents at random and A is taller than B.\u00a0 How tall is A? 3)\u00a0In a room of 10 randomly chosen U.S. residents, A is the second tallest.\u00a0 How tall is A?\u00a0 And what is the probability that A... Read More Read More","og_url":"https:\/\/www.allendowney.com\/blog\/2018\/10\/18\/how-tall-is-a\/","og_site_name":"Probably Overthinking It","article_published_time":"2018-10-18T14:11:58+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":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.allendowney.com\/blog\/2018\/10\/18\/how-tall-is-a\/#article","isPartOf":{"@id":"https:\/\/www.allendowney.com\/blog\/2018\/10\/18\/how-tall-is-a\/"},"author":{"name":"Allen B. Downey","@id":"https:\/\/www.allendowney.com\/blog\/#\/schema\/person\/4e5bfb2e9af6c3446cb0031a7bf83207"},"headline":"How tall is A?","datePublished":"2018-10-18T14:11:58+00:00","mainEntityOfPage":{"@id":"https:\/\/www.allendowney.com\/blog\/2018\/10\/18\/how-tall-is-a\/"},"wordCount":235,"commentCount":0,"publisher":{"@id":"https:\/\/www.allendowney.com\/blog\/#\/schema\/person\/4e5bfb2e9af6c3446cb0031a7bf83207"},"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.allendowney.com\/blog\/2018\/10\/18\/how-tall-is-a\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.allendowney.com\/blog\/2018\/10\/18\/how-tall-is-a\/","url":"https:\/\/www.allendowney.com\/blog\/2018\/10\/18\/how-tall-is-a\/","name":"How tall is A? - Probably Overthinking It","isPartOf":{"@id":"https:\/\/www.allendowney.com\/blog\/#website"},"datePublished":"2018-10-18T14:11:58+00:00","breadcrumb":{"@id":"https:\/\/www.allendowney.com\/blog\/2018\/10\/18\/how-tall-is-a\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.allendowney.com\/blog\/2018\/10\/18\/how-tall-is-a\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.allendowney.com\/blog\/2018\/10\/18\/how-tall-is-a\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.allendowney.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How tall is A?"}]},{"@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\/74","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=74"}],"version-history":[{"count":5,"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/posts\/74\/revisions"}],"predecessor-version":[{"id":79,"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/posts\/74\/revisions\/79"}],"wp:attachment":[{"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/media?parent=74"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/categories?post=74"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/tags?post=74"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}