lkarch.org/tools/mathisfun/www.mathsisfun.com/data/probability-shared-birthday.html
Lucas Kent e39465ad2f Changes to be committed:
new file:   Files/flashplayer_32_sa.exe
	new file:   favicon.ico
	new file:   globe.gif
	new file:   imgs/download.png
	new file:   imgs/zuck.jpg
	new file:   index.html
	new file:   other.ico
	new file:   script.js
	new file:   site.webmanifest
	new file:   sitemap.html
	new file:   styles/backround.css
	new file:   styles/border.css
	new file:   styles/fonts/Titillium_Web/OFL.txt
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-Black.ttf
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-Bold.ttf
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-BoldItalic.ttf
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-ExtraLight.ttf
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-ExtraLightItalic.ttf
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-Italic.ttf
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-Light.ttf
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-LightItalic.ttf
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-Regular.ttf
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-SemiBold.ttf
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-SemiBoldItalic.ttf
	new file:   styles/fonts/webfontkit-20221027-163353/generator_config.txt
	new file:   styles/fonts/webfontkit-20221027-163353/specimen_files/grid_12-825-55-15.css
	new file:   styles/fonts/webfontkit-20221027-163353/specimen_files/specimen_stylesheet.css
	new file:   styles/fonts/webfontkit-20221027-163353/stylesheet.css
	new file:   styles/fonts/webfontkit-20221027-163353/titilliumweb-extralight-demo.html
	new file:   styles/fonts/webfontkit-20221027-163353/titilliumweb-extralight-webfont.woff
	new file:   styles/fonts/webfontkit-20221027-163353/titilliumweb-extralight-webfont.woff2
	new file:   styles/fonts/webfontkit-20221027-165950/generator_config.txt
	new file:   styles/fonts/webfontkit-20221027-165950/specimen_files/grid_12-825-55-15.css
	new file:   styles/fonts/webfontkit-20221027-165950/specimen_files/specimen_stylesheet.css
	new file:   styles/fonts/webfontkit-20221027-165950/stylesheet.css
	new file:   styles/fonts/webfontkit-20221027-165950/titilliumweb-bold-demo.html
	new file:   styles/fonts/webfontkit-20221027-165950/titilliumweb-bold-webfont.woff
	new file:   styles/fonts/webfontkit-20221027-165950/titilliumweb-bold-webfont.woff2
	new file:   styles/style.css
	new file:   tools/2048/.gitignore
	new file:   tools/2048/.jshintrc
	new file:   tools/2048/CONTRIBUTING.md
	new file:   tools/2048/LICENSE.txt
	new file:   tools/2048/README.md
	new file:   tools/2048/Rakefile
	new file:   tools/2048/favicon.ico
	new file:   tools/2048/index.html
	new file:   tools/2048/js/animframe_polyfill.js
	new file:   tools/2048/js/application.js
	new file:   tools/2048/js/bind_polyfill.js
	new file:   tools/2048/js/classlist_polyfill.js
	new file:   tools/2048/js/game_manager.js
	new file:   tools/2048/js/grid.js
	new file:   tools/2048/js/html_actuator.js
	new file:   tools/2048/js/keyboard_input_manager.js
	new file:   tools/2048/js/local_storage_manager.js
	new file:   tools/2048/js/tile.js
    new file:   tools/2048/meta/apple-touch-icon.png
	new file:   tools/webretro/cores/neocd_libretro.js
	new file:   tools/webretro/cores/neocd_libretro.wasm
	new file:   tools/webretro/cores/nestopia_libretro.js
	new file:   tools/webretro/cores/nestopia_libretro.wasm
	new file:   tools/webretro/cores/o2em_libretro.js
	new file:   tools/webretro/cores/o2em_libretro.wasm
	new file:   tools/webretro/cores/opera_libretro.js
	new file:   tools/webretro/cores/opera_libretro.wasm
2022-11-02 08:40:01 -04:00

222 lines
12 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!doctype html>
<html lang="en">
<!-- #BeginTemplate "/Templates/Advanced.dwt" --><!-- DW6 -->
<!-- Mirrored from www.mathsisfun.com/data/probability-shared-birthday.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 29 Oct 2022 00:42:20 GMT -->
<head>
<meta charset="UTF-8">
<!-- #BeginEditable "doctitle" -->
<title>Shared Birthdays</title>
<meta name="description" content="Math explained in easy language, plus puzzles, games, quizzes, worksheets and a forum. For K-12 kids, teachers and parents.">
<!-- #EndEditable -->
<meta name="keywords" content="math, maths, mathematics, school, homework, education">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<meta name="HandheldFriendly" content="true">
<meta name="referrer" content="always">
<link rel="stylesheet" type="text/css" href="../style3.css">
<script src="../main3.js"></script>
</head>
<body id="bodybg" class="adv">
<div class="bg">
<div id="stt"></div>
<header>
<div id="hdr"></div>
<div id="logo"><a href="../index.html"><img src="../images/style/logo.svg" alt="Math is Fun"></a></div>
<div id="advText">Advanced</div>
<div id="gtran">
<script>document.write(getTrans());</script>
</div>
<div id="adTopOuter" class="centerfull noprint">
<div id="adTop">
<script>document.write(getAdTop());</script>
</div>
</div>
<div id="adHide">
<div id="showAds1"><a href="javascript:showAds()">Show Ads</a></div>
<div id="hideAds1"><a href="javascript:hideAds()">Hide Ads</a><br>
<a href="../about-ads.html">About Ads</a></div>
</div>
</header>
<nav>
<div id="menuWide" class="menu">
<script>document.write(getMenu(0));</script>
</div>
<div id="linkto">
<div id="linktort">
<script>document.write(getLinks());</script>
</div>
</div>
<div id="search" role="search">
<script>document.write(getSearch());</script>
</div>
<div id="menuSlim" class="menu">
<script>document.write(getMenu(1));</script>
</div>
<div id="menuTiny" class="menu">
<script>document.write(getMenu(2));</script>
</div>
</nav>
<div id="extra"></div>
</div>
<article id="content" role="main">
<!-- #BeginEditable "Body" -->
<h1 class="center">Shared Birthdays</h1>
<p>This is a great puzzle, and you get to learn a lot about probability along the way ...</p>
<div class="example">
<p class="larger">There are 30 people in a room ... what is the chance that any two of them celebrate their birthday on the same day? Assume 365 days in a year.</p>
</div>
<p style="float:right; margin: 0 0 5px 10px;"><img src="../images/style/thinks.svg" alt="thinks"></p>
<p>Some people may think:</p>
<p class="center">"there are 30 people, and 365 days, so 30/365 sounds about right.<br>
Which is 30/365 = 0.08..., so about <b>8% maybe?</b>"</p>
<p><b>But no!</b></p>
<p>The probability is much higher.</p>
<p>It is actually <b> likely</b> there are people who share a birthday in that room.</p>
<table style="border: 0; margin:auto;">
<tbody>
<tr>
<td><img src="images/probability-many-many.svg" alt="probability many many"></td>
<td>&nbsp;</td>
<td>
<p class="larger">Because you should compare everyone to everyone else.</p>
<p>And with 30 people that is <b>435 comparisons</b>.</p>
<p>But you also have to be careful not to over-count the chances.</p></td>
</tr>
</tbody></table>
<p>I will show you how to do it ... starting with a smaller example:</p>
<h2>Friends and Random Numbers</h2>
<div class="example">
<p class="larger"><b>4 friends</b> (Alex, Billy, Chris and Dusty) each choose a random number between 1 and 5. What is the chance that any of them chose the same number?</p>
</div>
<p>We will add our friends one at a time ...</p>
<p>&nbsp;</p>
<h3>First, what is the chance that Alex and Billy have the same number?</h3>
<p>Billy compares his number to Alex's number. There is a 1 in 5 chance of a match.</p>
<p>As a <a href="probability-tree-diagrams.html">tree diagram</a>:</p>
<p class="center"><img src="images/events-dependent-ex-1.svg" alt="events dependent 1"></p>
<p class="center">Note: "Yes" and "No" together&nbsp; make 1<br>
(1/5 + 4/5 = 5/5 = 1)</p>
<h3>&nbsp;</h3>
<h3>Now, let's include Chris ...</h3>
<p>But there are now two cases to consider (called "<a href="probability-events-conditional.html">Conditional Probability</a>"):</p>
<ul>
<li>If Alex and Billy <b>did</b> match, then Chris has only <b>one number</b> to compare to.</li>
<li>But if Alex and Billy <b>did not</b> match then Chris has <b>two numbers</b> to compare to.</li>
</ul>
<p>And we get this:</p>
<p class="center"><img src="images/events-dependent-ex-2.svg" alt="events dependent 2" style="max-width:100%"></p>
<p>For the top line (Alex and Billy <b>did</b> match) we already have a match (a chance of 1/5).</p>
<p>But for the "Alex and Billy <b>did not</b> match" case there are <b>2 numbers</b> that Chris could match with, so there is a <b>2/5</b> chance of Chris matching (against both Alex and Billy). And a 3/5 chance of not matching.</p>
<p>And we can work out the combined chance by <b>multiplying the chances</b> it took to get there:</p>
<div class="dotpoint">
<p>Following the <i>"No, Yes"</i> path ... there is a 4/5 chance of No, followed by a 2/5 chance of Yes:</p>
<div class="so">(4/5) × (2/5) = 8/25</div>
</div>
<div class="dotpoint">
<p>Following the <i>"No, No"</i> path ... there is a 4/5 chance of No, followed by a 3/5 chance of No:</p>
<div class="so">(4/5) × (3/5) = 12/25</div>
</div>
<p>Also notice that adding all chances together is <b>1</b> (a good check that we haven't made a mistake):</p>
<p class="center">(5/25) + (8/25) + (12/25) = 25/25 = 1</p>
<p>&nbsp;</p>
<h3>Now what happens when we include Dusty?</h3>
<p>It is the same idea, just more of it:</p>
<p class="center"><img src="images/events-dependent-ex-3.svg" alt="events dependent 3" style="max-width:100%"></p>
<p>OK, that is all 4 friends, and the "Yes" chances together make 101/125:</p>
<p class="center large">Answer: <b>101/125</b></p>
<p>&nbsp;</p>
<div class="center80">
<p>But here is something interesting ... if we follow the "No" path we can <b>skip all the other calculations</b> and make our life easier:</p>
<p class="center"><img src="images/events-dependent-ex-4.svg" alt="events dependent 4" style="max-width:100%"></p>
<p>The chances of <b>not matching</b> are:</p>
<p class="center larger">(4/5) × (3/5) × (2/5) = <b>24/125</b></p>
<p>So the chances of <b>matching</b> are:</p>
<p class="center larger">1 (24/125) = <b>101/125</b></p>
<p>(And we didn't really need a tree diagram for that!)</p>
</div>
<p>&nbsp;</p>
<p>And that is a popular trick in probability:</p>
<p class="center larger">It is often easier to work out the "No" case<br>
(and subtract from 1 for the "Yes" case)</p>
<p>&nbsp;</p>
<div class="example">
<h3>Example: what are the chances that with 6 people any of them celebrate their Birthday in the same month? (Assume equal months)</h3>
<p>The "no match" case for:</p>
<ul>
<li>2 people is 11/12</li>
<li>3 people is (11/12) <span class="center">×</span> (10/12)</li>
<li>4 people is (11/12) <span class="center">×</span> (10/12) <span class="center">×</span> (9/12)</li>
<li>5 people is (11/12) <span class="center">×</span> (10/12) <span class="center">×</span> (9/12) <span class="center">×</span> (8/12)</li>
<li>6 people is (11/12) <span class="center">×</span> (10/12) <span class="center">×</span> (9/12) <span class="center">×</span> (8/12) <span class="center">×</span> (7/12)</li>
</ul>
<p>So the chance of <b>not matching</b> is:</p>
<p class="center larger">(11/12) <span class="center">×</span> (10/12) <span class="center">×</span> (9/12) <span class="center">×</span> (8/12) <span class="center">×</span> (7/12) = 0.22...</p>
<p>Flip that around and we get the chance of <b>matching</b>:</p>
<p class="center larger">1 0.22... = <b>0.78...</b></p>
<p>So, there is a <b>78% chance</b> of any of them celebrating their Birthday in the same month</p>
</div>
<p>&nbsp;</p>
<p>And now we can try calculating the "Shared Birthday" question we started with:</p>
<div class="example">
<h3><span class="larger">There are 30 people in a room ... what is the chance that any two of them celebrate their birthday on the same day? Assume 365 days in a year.</span></h3>
<p>It is just like the previous example! But bigger and more numbers:</p>
<p>The chance of <b>not matching</b>:</p>
<p class="center larger">364/365 × 363/365 × 362/365 × ... × 336/365 = <b>0.294...</b></p>
<p class="center">(I did that calculation in a spreadsheet,<br>
but there are also mathematical shortcuts)</p>
<p>And the probability of <b>matching</b> is <b>1 0.294...</b> :</p>
<p class="center larger">The probability of sharing a birthday = 1 0.294... = <b>0.706...</b></p>
<p>Or a 70.6% chance, which is <b>likely</b>!</p>
</div>
<p>So the probability for <b>30</b> people is about <b>70%</b>.</p>
<p>And the probability for <b>23</b> people is about <b>50%</b>.</p>
<p>And the probability for <b>57</b> people is <b>99%</b> (almost certain!)</p>
<h3>Simulation</h3>
<p>We can also <b>simulate</b> this using random numbers. Try it yourself here, use 30 and 365 and press Go. A thousand random trials will be run and the results given.</p>
<script src="images/prob-match.js"></script>
<script>probmatchMain()</script>
<p>You can also try the other examples from above, such as 4 and 5 to simulate "Friends and Random Numbers".</p>
<h3>For Real</h3>
<p>Next time you are in a room with a group of people why not find out if there are any shared birthdays?</p>
<p>&nbsp;</p>
<p>Footnote: In real life birthdays are not evenly spread out ... more babies are born in July, August, and September. Also Hospitals prefer to work on weekdays, not weekends, so there are more births early in the week. And then there are leap years. But you get the idea.</p>
<p>&nbsp;</p>
<div class="questions">
<script>getQ(3115,3116,3117,3118,3841,3842,3843,8616,8617,8618);</script>&nbsp;
</div>
<div class="related">
<a href="probability-events-conditional.html">Conditional Probability</a>
<a href="probability-tree-diagrams.html">Tree Diagrams</a>
<a href="index.html">Data Index</a>
</div>
<!-- #EndEditable -->
</article>
<div id="adend" class="centerfull noprint">
<script>document.write(getAdEnd());</script>
</div>
<footer id="footer" class="centerfull noprint">
<script>document.write(getFooter());</script>
</footer>
<div id="copyrt">
Copyright &copy; 2020 MathsIsFun.com
</div>
<script>document.write(getBodyEnd());</script>
</body>
<!-- #EndTemplate -->
<!-- Mirrored from www.mathsisfun.com/data/probability-shared-birthday.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 29 Oct 2022 00:42:21 GMT -->
</html>