{"id":520,"date":"2012-03-29T13:52:22","date_gmt":"2012-03-29T18:52:22","guid":{"rendered":"http:\/\/linesoftangency.wordpress.com\/?p=520"},"modified":"2012-03-29T13:52:22","modified_gmt":"2012-03-29T18:52:22","slug":"building-a-probability-cannon","status":"publish","type":"post","link":"http:\/\/blog.chrislusto.com\/?p=520","title":{"rendered":"Building a Probability Cannon"},"content":{"rendered":"<p style=\"text-align:justify;\">For just a moment, let's consider a staple of the second year algebra curriculum: the one-dimensional projectile motion problem.\u00a0 (I <a href=\"http:\/\/linesoftangency.wordpress.com\/2012\/01\/11\/check-one-two\/\" target=\"_blank\">used to do<\/a> an awful lot of <a href=\"http:\/\/linesoftangency.wordpress.com\/2012\/02\/16\/war-games\/\" target=\"_blank\">this sort of thing<\/a>.)\u00a0 It's not a fantastic problem---it's overdone, and often under-well---but it's representative of many of our standard modeling problems in some important ways:<\/p>\n<ol style=\"text-align:justify;\">\n<li><strong>Every one of my students has participated in the activity we're modeling.<\/strong>\u00a0 They've thrown, dropped, and shot things.\u00a0 They've jumped and fallen and dove from various heights.\u00a0 In other words, they have a passing acquaintance with gravity.<\/li>\n<li><strong>Data points are relatively easy to come by.<\/strong>\u00a0 All we need is a stopwatch and a projectile-worthy object.\u00a0 If that's impractical, then there are also some great and simple---and free---simulations out there (<a href=\"http:\/\/phet.colorado.edu\/en\/simulation\/projectile-motion\" target=\"_blank\">PhET<\/a>, <a href=\"http:\/\/chrome.angrybirds.com\/\" target=\"_blank\">Angry Birds<\/a>), and some great and simple---and free---data collection software as well (<a href=\"http:\/\/www.cabrillo.edu\/~dbrown\/tracker\/\" target=\"_blank\">Tracker<\/a>).<\/li>\n<li><strong>We only need a few data points to fix the parameters.<\/strong>\u00a0 For a general quadratic model, we only need three data points to determine the particular solution.\u00a0 Really we only need two, if we assume constant acceleration.<\/li>\n<li><strong>Experiments are easy to repeat.<\/strong>\u00a0 Drop\/throw\/shoot the ball again.\u00a0 Run the applet again.<\/li>\n<li><strong>The model conforms to a fairly nice and well-behaved family of functions.<\/strong>\u00a0 Quadratics are continuous and differentiable and smooth, and they're generally willing to submit to whatever mathematical poking we're wont to visit upon them without getting gnarly.<\/li>\n<li><strong>Theoretical predictions are readily checked.<\/strong>\u00a0 Want to know, for instance, when our projectile will hit the ground?\u00a0 Find the sensible zero of the function (it's pretty easy to sanity check its reasonableness---see <strong>#1 above<\/strong>).\u00a0 Look at a table of values and step through the motion second-by-second (use a smaller delta t for an even better sense of what's going on).\u00a0 Click <strong>RUN<\/strong> on your simulation, and wait until it stops (self-explanatory).\u00a0 And, if you're completely dedicated, <a href=\"http:\/\/noschese180.posterous.com\/day-111-differentiated-projectile-practice#more\" target=\"_blank\">build yourself a cannon and put your money where your mouth is<\/a>.<\/li>\n<\/ol>\n<p style=\"text-align:justify;\">Of course I've chosen to introduce this discussion with the example of projectile motion, but there are plenty of other candidates: length\/area\/volume, exponential growth and decay, linear speed and distance.\u00a0 Almost without exception (in the algebra classroom), we model phenomena that satisfy the six conditions listed above.<\/p>\n<p style=\"text-align:justify;\">Almost.\u00a0 Because then we run into probability, and probability isn't so tame.\u00a0 I'll grant that #1 still holds (though I'm not entirely convinced it holds in the same sense), but the other five conditions go out the window.<\/p>\n<h1 style=\"text-align:justify;\">Data points are NOT easy to come by.<\/h1>\n<p style=\"text-align:justify;\">I can already hear you protesting.\u00a0 \"Flip a coin...that's a data point!\"\u00a0 Well, yes.\u00a0 Sort of.\u00a0 But in the realm of probability, individual data points are ambiguous.\u00a0 The ordered pair (3rd flip, heads) is very different from (3 seconds, 12 meters).\u00a0 They're both measurements, but the first one has much, much higher entropy.\u00a0 Interpretation becomes problematic.\u00a0 Here's another example: My meteorologist's incredibly sophisticated model (dart board?) made the following prediction yesterday: <strong>P(rain) = 0.6<\/strong>.\u00a0 In other words, the event \"rain\" was more likely than the event \"not rain.\"\u00a0 It did not rain yesterday.\u00a0 How am I to understand this un-rain?\u00a0 Was the model right?\u00a0 If so, then I'm not terribly surprised it didn't rain.\u00a0 Was the model wrong?\u00a0 If so, then I'm not terribly surprised it didn't rain.\u00a0 In what sense have I collected \"data?\"<\/p>\n<p style=\"text-align:justify;\">And what if I'm interested in a compound event?\u00a0 What if I want to know not just the result of a lone flip, but <strong>P(exactly 352 heads in 1000 flips)<\/strong>?\u00a0 Now a <strong>single<\/strong> data point suddenly consists of 1000 trials.\u00a0 So it turns out data points have the potential to be rather difficult to come by, which brings us to...<\/p>\n<h1 style=\"text-align:justify;\">We need an awful lot of data points.<\/h1>\n<p style=\"text-align:justify;\">I'm not talking about our 1000-flip trials here, which was just a result of my arbitrary choice of one particular problem.\u00a0 I mean that, no matter what our trials consist of, we need to do a whole bunch of them in order to build a reliable model.\u00a0 Two measurements in my projectile problem determine a unique curve and, in effect, answer any question I might want to ask.\u00a0 Two measurements in a probabilistic setting tell me just about nothing.<\/p>\n<p style=\"text-align:justify;\">Consider this historical problem born, like many probability problems, from gambling.\u00a0 On each turn, a player rolls three dice and wins or loses money based on the sum (fill in your own details if you want; they're not so important for our purposes here).\u00a0 As savvy and degenerate gamblers, we'd like to know which sums are more or less likely.\u00a0 We have some nascent theoretical ideas, but we'd like to test one in particular.\u00a0<strong> Is the probability of rolling a sum of 9 equal to the probability of rolling a sum of 10?<\/strong>\u00a0 It seems it should be: after all, there are six ways to roll a 9 ({6,2,1},{5,3,1},{5,2,2},{4,4,1},{4,3,2},{3,3,3}), and six ways to roll a 10 ({6,3,1},{6,2,2},{5,4,1},{5,3,2},{4,4,2},{4,3,3})*.\u00a0 Done, right?<\/p>\n<p style=\"text-align:justify;\">It turns out this isn't quite accurate.\u00a0 For instance, the combination {6,2,1} treats all of the 3! = 6 permutations of those numbers as one event, which is bad mojo.\u00a0 If you go through all 216 possibilities, you'll find that there are actually 27 ways to roll a 10, and only 25 ways to roll a 9, so the probabilities are in fact unequal.\u00a0 Okay, no biggie, our experiment will certainly show this bias, right?\u00a0 Well, it will, but if we want to be 95% experimentally certain that 10 is more likely, then we'll have to run through about <strong>7,600 trials<\/strong>!\u00a0 (For a derivation of this number---and a generally more expansive account---see <a href=\"http:\/\/gottwurfelt.wordpress.com\/2012\/03\/07\/how-long-does-it-take-to-observe-that-10-is-more-common-than-9-with-three-dice\/\" target=\"_blank\">Michael Lugo's blog post<\/a>.)\u00a0 In other words, the <a href=\"http:\/\/en.wikipedia.org\/wiki\/Law_of_large_numbers\" target=\"_blank\">Law of Large Numbers<\/a> is certainly our friend in determining probabilities experimentally, but it requires, you know, large numbers.<\/p>\n<p style=\"text-align:justify;\">*<em>If you've ever taught probability, you know that this type of dice-sense is rampant.\u00a0 Students consistently collapse distinct events based on superficial equivalence rather than true frequency.\u00a0 Ask a room of high school students this question: \"You flip a coin twice.\u00a0 What's the probability of getting exactly one head?\"\u00a0 A significant number will say 1\/3.\u00a0 After all, there are three possibilities: no heads, one head, two heads.\u00a0 Relatively few will immediately notice, without guidance, that \"one head\" is twice as likely as the other two outcomes.<\/em><\/p>\n<h1 style=\"text-align:justify;\">Experiments are NOT easy to repeat.<\/h1>\n<p style=\"text-align:justify;\">I've already covered some of the practical issues here in terms of needing a lot of data points.\u00a0 But beyond all that, there are also philosophical difficulties.\u00a0 Normally, in science, when we talk about repeating experiments, we tend to use the word \"reproduce.\"\u00a0 Because that's exactly what we expect\/are hoping for, right?\u00a0 I conduct an experiment.\u00a0 I get a result.\u00a0 I (or someone else) conduct the experiment again.\u00a0 I (they) get roughly the same result.\u00a0 Depending on how we define our probability experiment, that might not be the case.\u00a0 I flip a coin 10 times and count 3 heads.\u00a0 You flip a coin 10 times and count 6 heads.\u00a0 Experimental results that differ by 100% are not generally awesome in science.\u00a0 In probability, they are the norm.<\/p>\n<p style=\"text-align:justify;\">As an interesting, though somewhat tangential observation, note that there is another strange philosophical issue at play here.\u00a0 Not only can events be difficult to repeat, but sometimes they are <strong>fundamentally unrepeatable<\/strong>.\u00a0 Go back to my meteorologist's prediction for a moment.\u00a0 How do I repeat the experiment of \"live through yesterday and see whether it rains?\"\u00a0 And what does a 60% chance of rain even <strong>mean<\/strong>?\u00a0 To a high school student (teacher) who deals almost exclusively in frequentist interpretations of probability, it means something like, \"If we could experience yesterday one million times, about 600,000 of those experiences would include rain.\"\u00a0 Which sounds borderline crazy.\u00a0 And the Bayesian degree-of-belief interpretation isn't much more comforting: \"I believe, with 60% intensity, that it will rain today.\"\u00a0 How can we justify that level of belief without being able to test its reliability by being repeatedly correct?\u00a0 Discuss.<\/p>\n<h1 style=\"text-align:justify;\">Probability distributions can be unwieldy.<\/h1>\n<p style=\"text-align:justify;\">Discrete distributions are conceptually easy, but cumbersome.\u00a0 Continuous distributions are beautiful for modeling, but practically impossible for prior-to-calculus students (not just <em>pre<\/em>-calculus ones).<em><\/em>\u00a0 Even with the ubiquitous normal distribution, there is an awful lot of hand-waving going on in my classroom.\u00a0 Distributions can make polynomials look like first-grade stuff.<\/p>\n<h1 style=\"text-align:justify;\">Theoretical predictions aren't so easily checked.<\/h1>\n<p style=\"text-align:justify;\">My theoretical calculations for <a href=\"http:\/\/linesoftangency.wordpress.com\/2012\/03\/10\/cereal-boxes-redux\/\" target=\"_blank\">the cereal box problem<\/a> tell me that, on average, I expect to buy between 5 and 6 boxes to collect all the prizes.\u00a0 But sometimes when I actually run through the experiment, it takes me northward of 20 boxes!\u00a0 This is a teacher's nightmare.\u00a0 We've done everything right, and then suddenly our results are off by a factor of 4.\u00a0 Have we confirmed our theory?\u00a0 Have we busted it?\u00a0 Neither?\u00a0 Blurg.\u00a0 So what are we to do?<\/p>\n<h1 style=\"text-align:justify;\">We are to build a probability cannon!<\/h1>\n<p style=\"text-align:justify;\">With projectile motion problems, building a cannon is nice.\u00a0 It's cool.\u00a0 We get to launch things, which is awesome.\u00a0 With probability, I submit that it's a necessity.\u00a0 We need to generate data: it's the raw material from which conjecture is built, and the touchstone by which theory is tested.\u00a0 We need to (metaphorically) shoot some stuff and see where it lands.\u00a0 We need...simulations!<\/p>\n<p style=\"text-align:justify;\">If your model converges quickly, then hand out some dice\/coins\/spinners.\u00a0 If it doesn't, teach your students how to use their calculators for something besides screwing up order of operations.\u00a0 Better yet, teach them how to <strong>tell a computer to do something<\/strong> instead of just watching\/listening to it.\u00a0 (<a href=\"http:\/\/www.python.org\/\" target=\"_blank\">Python<\/a> is free.\u00a0 If you own a Mac, you already have it.)\u00a0 Impress them with your wizardry by programming, right in front of their eyes, and with only a few lines of code, dice\/coins\/spinners that can be rolled\/flipped\/spun millions of times with the push of a button.\u00a0 Create <em>your own<\/em> freaking distributions with lovely, computer-generated histograms from your millions of trials.\u00a0 Make theories.\u00a0 Test theories.\u00a0 Experience anomalous results.\u00a0 See that they are anomalous.\u00a0 Bend the LLN to your will.<\/p>\n<p style=\"text-align:justify;\"><strong>Exempli Gratia<\/strong><\/p>\n<p style=\"text-align:justify;\"><a href=\"http:\/\/www.nctm.org\/\" target=\"_blank\">NCTM<\/a> was kind enough to tweet the following problem today, as I was in the middle of writing this post:<\/p>\n<p style=\"text-align:justify;\"><a href=\"http:\/\/blog.chrislusto.com\/wp-content\/uploads\/2012\/03\/kylekim.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-526\" title=\"Kyle and Kim\" src=\"http:\/\/blog.chrislusto.com\/wp-content\/uploads\/2012\/03\/kylekim.png\" alt=\"\" width=\"584\" height=\"171\" srcset=\"http:\/\/blog.chrislusto.com\/wp-content\/uploads\/2012\/03\/kylekim.png 658w, http:\/\/blog.chrislusto.com\/wp-content\/uploads\/2012\/03\/kylekim-300x87.png 300w\" sizes=\"auto, (max-width: 584px) 100vw, 584px\" \/><\/a>Okay, maybe the probability is just 1\/2.\u00a0 I mean, any argument I make for Kim must be symmetrically true for Kyle, right?\u00a0 But wait, it says \"greater than\" and not \"greater than or equal to,\" so maybe that changes things.\u00a0 Kim's number will be different from Kyle's most of the time, and it will be greater half <em><\/em>of the times it's different, so...slightly less than 1\/2?\u00a0 Or maybe I should break it down into mutually exclusive cases of {Kim rolls 1, Kim rolls 2, ... , Kim rolls 6}.\u00a0 You know what, let's build a cannon.\u00a0 Here it is, in <a href=\"http:\/\/www.wolfram.com\/mathematica\/\" target=\"_blank\">Mathematica<\/a>:<\/p>\n<p style=\"text-align:justify;\"><a href=\"http:\/\/blog.chrislusto.com\/wp-content\/uploads\/2012\/03\/kktrial.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-528\" title=\"Dice Cannon\" src=\"http:\/\/blog.chrislusto.com\/wp-content\/uploads\/2012\/03\/kktrial.png\" alt=\"\" width=\"537\" height=\"161\" srcset=\"http:\/\/blog.chrislusto.com\/wp-content\/uploads\/2012\/03\/kktrial.png 537w, http:\/\/blog.chrislusto.com\/wp-content\/uploads\/2012\/03\/kktrial-300x89.png 300w\" sizes=\"auto, (max-width: 537px) 100vw, 537px\" \/><\/a>Okay, so it looks like my second conjecture is right; the probability is a little less than 1\/2.\u00a0 Blammo!\u00a0 And it only took (after a few seconds of typing the code) 1.87 seconds to do a million trials.\u00a0 Double blammo!\u00a0 But how much less than 1\/2?\u00a0 Emboldened by my cannon results, I can turn back to the theory.\u00a0 Now, if Kyle rolls a one, Kim will roll a not-one with probability 5\/6.\u00a0 Ditto two, three, four, five, and six.\u00a0 So Kim's number is different from Kyle's 5\/6 of the time.\u00a0 And---back to my symmetry argument---there should be no reason for us to believe one or the other person will roll a bigger number, so Kim's number is larger 1\/2 of 5\/6 of the time, which is 5\/12 of the time.\u00a0 Does that work?\u00a0 Well, since 5\/12 \u2248 0.4167, which is convincingly close to 0.416159, I should say that it does.\u00a0 Triple blammo and checkmate!<\/p>\n<p style=\"text-align:justify;\">But we don't have to stop there.\u00a0 What if I remove the condition that Kim's number is strictly greater?\u00a0 What's the probability her number is greater than <strong>or equal to<\/strong> Kyle's?\u00a0 Now my original appeal to symmetry doesn't require any qualification.\u00a0 The probability ought simply be 1\/2.\u00a0 So...<\/p>\n<p style=\"text-align:justify;\"><a href=\"http:\/\/blog.chrislusto.com\/wp-content\/uploads\/2012\/03\/kktrial2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-529\" title=\"Dice Cannon Again\" src=\"http:\/\/blog.chrislusto.com\/wp-content\/uploads\/2012\/03\/kktrial2.png\" alt=\"\" width=\"545\" height=\"169\" srcset=\"http:\/\/blog.chrislusto.com\/wp-content\/uploads\/2012\/03\/kktrial2.png 545w, http:\/\/blog.chrislusto.com\/wp-content\/uploads\/2012\/03\/kktrial2-300x93.png 300w\" sizes=\"auto, (max-width: 545px) 100vw, 545px\" \/><\/a>What what?\u00a0 Why is the probability <strong>greater<\/strong> than 1\/2 now?\u00a0 Oh, right.\u00a0 Kim's roll will be equal to Kyle's 1\/6 of the time, and we already know it's strictly greater than Kyle's 5\/12 of the time.\u00a0 Since those two outcomes are mutually exclusive, we can just add the probabilities, and 1\/6 + 5\/12 = 7\/12, which is about (yup yup) 0.583.\u00a0 Not too shabby.<\/p>\n<p style=\"text-align:justify;\">What if we add another person into the mix?\u00a0 We'll let Kevin join in the fun, too.\u00a0 What's the probability that Kim's number will be greater than both Kyle's and Kevin's?<\/p>\n<p style=\"text-align:justify;\"><a href=\"http:\/\/blog.chrislusto.com\/wp-content\/uploads\/2012\/03\/kktrial3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-530\" title=\"Dice Cannon Cubed\" src=\"http:\/\/blog.chrislusto.com\/wp-content\/uploads\/2012\/03\/kktrial3.png\" alt=\"\" width=\"584\" height=\"133\" srcset=\"http:\/\/blog.chrislusto.com\/wp-content\/uploads\/2012\/03\/kktrial3.png 657w, http:\/\/blog.chrislusto.com\/wp-content\/uploads\/2012\/03\/kktrial3-300x68.png 300w\" sizes=\"auto, (max-width: 584px) 100vw, 584px\" \/><\/a>It looks like the probability of Kim's number being greater than both of her friends' might just be about 1\/4.\u00a0 Why?\u00a0 I leave it as an exercise to the reader.<\/p>\n<p style=\"text-align:justify;\">That tweet-sized problem easily becomes an entire lesson with the help of a relatively simple probability cannon.\u00a0 If that's not an argument for introducing them into your classroom, I don't know what is.<\/p>\n<p style=\"text-align:justify;\">Ready.\u00a0 Aim.\u00a0 Fire!<\/p>\n<p style=\"text-align:justify;\"><em>Thanks to <a href=\"http:\/\/christopherdanielson.wordpress.com\/\" target=\"_blank\">Christopher Danielson<\/a> for sparking this whole discussion.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>For just a moment, let's consider a staple of the second year algebra curriculum: the one-dimensional projectile motion problem.\u00a0 (I used to do an awful lot of this sort of thing.)\u00a0 It's not a fantastic problem---it's overdone, and often under-well---but it's representative of many of our standard modeling problems in some important ways: Every one [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[32,37,46,50,55],"class_list":["post-520","post","type-post","status-publish","format-standard","hentry","category-math-teaching","tag-math","tag-modeling","tag-probability","tag-simulations","tag-teaching"],"_links":{"self":[{"href":"http:\/\/blog.chrislusto.com\/index.php?rest_route=\/wp\/v2\/posts\/520","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.chrislusto.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.chrislusto.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.chrislusto.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.chrislusto.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=520"}],"version-history":[{"count":0,"href":"http:\/\/blog.chrislusto.com\/index.php?rest_route=\/wp\/v2\/posts\/520\/revisions"}],"wp:attachment":[{"href":"http:\/\/blog.chrislusto.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=520"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.chrislusto.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=520"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.chrislusto.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=520"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}