{"id":94,"date":"2018-12-03T14:04:34","date_gmt":"2018-12-03T14:04:34","guid":{"rendered":"https:\/\/www.allendowney.com\/blog\/?p=94"},"modified":"2018-12-03T14:04:34","modified_gmt":"2018-12-03T14:04:34","slug":"lions-and-tigers-and-bears","status":"publish","type":"post","link":"https:\/\/www.allendowney.com\/blog\/2018\/12\/03\/lions-and-tigers-and-bears\/","title":{"rendered":"Lions and tigers and bears"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignright\" src=\"http:\/\/mfsaweb.org\/wp-content\/uploads\/WizardOfOz.jpg\" width=\"323\" height=\"242\" \/>Here&#8217;s another Bayes puzzle:<\/p>\n<p><em>Suppose we visit a wild animal preserve where we know that the only animals are lions and tigers and bears, but we don&#8217;t know how many of each there are.<\/em><\/p>\n<p><em>During the tour, we see 3 lions, 2 tigers,\u00a0and one bear. Assuming that every animal had an equal chance to appear in our sample, estimate the prevalence of each species.<\/em><\/p>\n<p><em>What is the probability that the next animal we see is a bear?<\/em><\/p>\n<h3>Solutions<\/h3>\n<div class=\"oembed-gist\"><script src=\"https:\/\/gist.github.com\/AllenDowney\/8b198f4ee59b5f8ffa9be90963f618a5.js\"><\/script><noscript>View the code on <a href=\"https:\/\/gist.github.com\/AllenDowney\/8b198f4ee59b5f8ffa9be90963f618a5\">Gist<\/a>.<\/noscript><\/div>\n<p><a href=\"http:\/\/nbviewer.jupyter.org\/github\/WillKoehrsen\/probabilistic-programming\/blob\/master\/Allen%20Downey%20Problem.ipynb\">Will Koehrsen posted an excellent solution here<\/a>.\u00a0 His solution is more general than mine, allowing for uncertainty about the parameters of the Dirichlet prior.<\/p>\n<p>And vlad<a href=\"https:\/\/gist.github.com\/usptact\/263f63f0af1bc41fb7d7ddc7e5e6123c\">\u00a0posted another good solution using WebPPL<\/a>.<\/p>\n<p>&nbsp;<\/p>\n<h3>Cats and rats and elephants<\/h3>\n<p>Now that we solved the appetizer, we are ready for the main course&#8230;<\/p>\n<p><em>Suppose there are six species that might be in a zoo: lions and tigers and bears, and cats and rats and elephants.\u00a0 Every zoo has a subset of these species, and every subset is equally likely.<\/em><\/p>\n<p><em>One day we visit a zoo and see\u00a03 lions, 2 tigers,\u00a0and one bear.\u00a0 Assuming that every animal in the zoo has an equal chance to be seen, what is the probability that the next animal we see is an elephant?<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s another Bayes puzzle: Suppose we visit a wild animal preserve where we know that the only animals are lions and tigers and bears, but we don&#8217;t know how many of each there are. During the tour, we see 3 lions, 2 tigers,\u00a0and one bear. Assuming that every animal had an equal chance to appear in our sample, estimate the prevalence of each species. What is the probability that the next animal we see is a bear? Solutions View the&#8230;<\/p>\n<p class=\"read-more\"><a class=\"btn btn-default\" href=\"https:\/\/www.allendowney.com\/blog\/2018\/12\/03\/lions-and-tigers-and-bears\/\"> 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-94","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>Lions and tigers and bears - 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\/12\/03\/lions-and-tigers-and-bears\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Lions and tigers and bears - Probably Overthinking It\" \/>\n<meta property=\"og:description\" content=\"Here&#8217;s another Bayes puzzle: Suppose we visit a wild animal preserve where we know that the only animals are lions and tigers and bears, but we don&#8217;t know how many of each there are. During the tour, we see 3 lions, 2 tigers,\u00a0and one bear. Assuming that every animal had an equal chance to appear in our sample, estimate the prevalence of each species. What is the probability that the next animal we see is a bear? Solutions View the... Read More Read More\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.allendowney.com\/blog\/2018\/12\/03\/lions-and-tigers-and-bears\/\" \/>\n<meta property=\"og:site_name\" content=\"Probably Overthinking It\" \/>\n<meta property=\"article:published_time\" content=\"2018-12-03T14:04:34+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/mfsaweb.org\/wp-content\/uploads\/WizardOfOz.jpg\" \/>\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\\\/12\\\/03\\\/lions-and-tigers-and-bears\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/2018\\\/12\\\/03\\\/lions-and-tigers-and-bears\\\/\"},\"author\":{\"name\":\"Allen B. Downey\",\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/#\\\/schema\\\/person\\\/4e5bfb2e9af6c3446cb0031a7bf83207\"},\"headline\":\"Lions and tigers and bears\",\"datePublished\":\"2018-12-03T14:04:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/2018\\\/12\\\/03\\\/lions-and-tigers-and-bears\\\/\"},\"wordCount\":225,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/#\\\/schema\\\/person\\\/4e5bfb2e9af6c3446cb0031a7bf83207\"},\"image\":{\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/2018\\\/12\\\/03\\\/lions-and-tigers-and-bears\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/mfsaweb.org\\\/wp-content\\\/uploads\\\/WizardOfOz.jpg\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/2018\\\/12\\\/03\\\/lions-and-tigers-and-bears\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/2018\\\/12\\\/03\\\/lions-and-tigers-and-bears\\\/\",\"url\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/2018\\\/12\\\/03\\\/lions-and-tigers-and-bears\\\/\",\"name\":\"Lions and tigers and bears - Probably Overthinking It\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/2018\\\/12\\\/03\\\/lions-and-tigers-and-bears\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/2018\\\/12\\\/03\\\/lions-and-tigers-and-bears\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/mfsaweb.org\\\/wp-content\\\/uploads\\\/WizardOfOz.jpg\",\"datePublished\":\"2018-12-03T14:04:34+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/2018\\\/12\\\/03\\\/lions-and-tigers-and-bears\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/2018\\\/12\\\/03\\\/lions-and-tigers-and-bears\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/2018\\\/12\\\/03\\\/lions-and-tigers-and-bears\\\/#primaryimage\",\"url\":\"http:\\\/\\\/mfsaweb.org\\\/wp-content\\\/uploads\\\/WizardOfOz.jpg\",\"contentUrl\":\"http:\\\/\\\/mfsaweb.org\\\/wp-content\\\/uploads\\\/WizardOfOz.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/2018\\\/12\\\/03\\\/lions-and-tigers-and-bears\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Lions and tigers and bears\"}]},{\"@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":"Lions and tigers and bears - 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\/12\/03\/lions-and-tigers-and-bears\/","og_locale":"en_US","og_type":"article","og_title":"Lions and tigers and bears - Probably Overthinking It","og_description":"Here&#8217;s another Bayes puzzle: Suppose we visit a wild animal preserve where we know that the only animals are lions and tigers and bears, but we don&#8217;t know how many of each there are. During the tour, we see 3 lions, 2 tigers,\u00a0and one bear. Assuming that every animal had an equal chance to appear in our sample, estimate the prevalence of each species. What is the probability that the next animal we see is a bear? Solutions View the... Read More Read More","og_url":"https:\/\/www.allendowney.com\/blog\/2018\/12\/03\/lions-and-tigers-and-bears\/","og_site_name":"Probably Overthinking It","article_published_time":"2018-12-03T14:04:34+00:00","og_image":[{"url":"http:\/\/mfsaweb.org\/wp-content\/uploads\/WizardOfOz.jpg","type":"","width":"","height":""}],"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\/12\/03\/lions-and-tigers-and-bears\/#article","isPartOf":{"@id":"https:\/\/www.allendowney.com\/blog\/2018\/12\/03\/lions-and-tigers-and-bears\/"},"author":{"name":"Allen B. Downey","@id":"https:\/\/www.allendowney.com\/blog\/#\/schema\/person\/4e5bfb2e9af6c3446cb0031a7bf83207"},"headline":"Lions and tigers and bears","datePublished":"2018-12-03T14:04:34+00:00","mainEntityOfPage":{"@id":"https:\/\/www.allendowney.com\/blog\/2018\/12\/03\/lions-and-tigers-and-bears\/"},"wordCount":225,"commentCount":0,"publisher":{"@id":"https:\/\/www.allendowney.com\/blog\/#\/schema\/person\/4e5bfb2e9af6c3446cb0031a7bf83207"},"image":{"@id":"https:\/\/www.allendowney.com\/blog\/2018\/12\/03\/lions-and-tigers-and-bears\/#primaryimage"},"thumbnailUrl":"http:\/\/mfsaweb.org\/wp-content\/uploads\/WizardOfOz.jpg","inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.allendowney.com\/blog\/2018\/12\/03\/lions-and-tigers-and-bears\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.allendowney.com\/blog\/2018\/12\/03\/lions-and-tigers-and-bears\/","url":"https:\/\/www.allendowney.com\/blog\/2018\/12\/03\/lions-and-tigers-and-bears\/","name":"Lions and tigers and bears - Probably Overthinking It","isPartOf":{"@id":"https:\/\/www.allendowney.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.allendowney.com\/blog\/2018\/12\/03\/lions-and-tigers-and-bears\/#primaryimage"},"image":{"@id":"https:\/\/www.allendowney.com\/blog\/2018\/12\/03\/lions-and-tigers-and-bears\/#primaryimage"},"thumbnailUrl":"http:\/\/mfsaweb.org\/wp-content\/uploads\/WizardOfOz.jpg","datePublished":"2018-12-03T14:04:34+00:00","breadcrumb":{"@id":"https:\/\/www.allendowney.com\/blog\/2018\/12\/03\/lions-and-tigers-and-bears\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.allendowney.com\/blog\/2018\/12\/03\/lions-and-tigers-and-bears\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.allendowney.com\/blog\/2018\/12\/03\/lions-and-tigers-and-bears\/#primaryimage","url":"http:\/\/mfsaweb.org\/wp-content\/uploads\/WizardOfOz.jpg","contentUrl":"http:\/\/mfsaweb.org\/wp-content\/uploads\/WizardOfOz.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.allendowney.com\/blog\/2018\/12\/03\/lions-and-tigers-and-bears\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.allendowney.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Lions and tigers and bears"}]},{"@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\/94","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=94"}],"version-history":[{"count":1,"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/posts\/94\/revisions"}],"predecessor-version":[{"id":95,"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/posts\/94\/revisions\/95"}],"wp:attachment":[{"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/media?parent=94"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/categories?post=94"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/tags?post=94"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}