|
|
| Line 95: |
Line 95: |
|
| |
|
| </tabber> | | </tabber> |
| <restricted>
| | {{#restricted:{{4.2 Finding Patterns in Random Noise}}}}{{NavCard|prev=4.1 Signal and Noise|next=5.1 False Positives and Negatives}} |
| | |
| == Useful Resources ==
| |
| | |
| <tabber>
| |
| | |
| |-|Lecture Video=
| |
| | |
| <br /><center><youtube>VnTzHNRpJaM</youtube></center><br />
| |
| | |
| |-|Bonus Video=
| |
| | |
| <br /><center><youtube>3knMDoKbnBQ</youtube></center><br />
| |
| | |
| |-|Discussion Slides=
| |
| | |
| {{LinkCard
| |
| |url=https://docs.google.com/presentation/d/1wdH975Ry_TWRq8hH6NSXy7GyqCZzCz-YQ96JFebYCXw/
| |
| |title=Discussion Slides Template
| |
| |description=The discussion slides for this lesson.
| |
| }}
| |
| <br />
| |
| | |
| |-|Handouts and Activities=
| |
| | |
| {{LinkCard | |
| |url=https://docs.google.com/document/d/1jfjGqK_B0PmQwKhICUofbywVo_1F_DqI6iBWYBk8XWM/
| |
| |title=Manufactured Random Data Template
| |
| |description=Document to put manufactured random data for the Fool the Professor activity.}}
| |
| {{LinkCard
| |
| |url=https://docs.google.com/document/d/1W81llxFOsRweXRBEV3_uRbQwxL7-e4NMpSCxdq_BQ70/
| |
| |title=True Random Data Template
| |
| |description=Document to put true random data for the Fool the Professor activity.}}
| |
| {{LinkCard
| |
| |url=https://docs.google.com/spreadsheets/d/10hUomKQH0zcnVXTi_-hr1nxH5GGz_dmL/
| |
| |title=Fool the Professor Calculator Template
| |
| |description=Calculator to aid the professor in identifying true and false patterns in random noise for the Fool the Professor activity.}}
| |
| {{LinkCardInternal
| |
| |url=:File:Snowy Pictures Slides.pdf
| |
| |title=Snowy Pictures Slides
| |
| |description=A set of slides with ''only'' the snowy pictures on them.}}
| |
| {{LinkCard
| |
| |url=https://github.com/sensesensibilityscience/datascience/blob/master/p_hacking.ipynb
| |
| |title=<math>p</math>-hacking Jupyter Notebook
| |
| |description=Data science notebook for students to experience <math>p</math>-hacking for themselves.}}
| |
| {{LinkCard
| |
| |url=https://datahub.berkeley.edu/hub/user-redirect/git-pull?repo=https://github.com/sensesensibilityscience/datascience&urlpath=tree/datascience/p_hacking.ipynb&branch=master
| |
| |title=<math>p</math>-hacking Jupyter Notebook (Datahub Link)
| |
| |description='''Special link for use at UC Berkeley only.''' Data science notebook for students to experience <math>p</math>-hacking for themselves.}}
| |
| <br />
| |
| | |
| |-|Readings and Assignments=
| |
| | |
| {{LinkCardInternal
| |
| |url=:File:Patternicity- Finding Meaningful Patterns in Meaningless Noise - Shermer.pdf
| |
| |title=Patternicity: Finding Meaningful Patterns in Meaningless Noise
| |
| |description=Reading about finding patterns in random noise.}}
| |
| {{LinkCard
| |
| |url=https://www.npr.org/2010/11/23/131545319/go-wild-birds-bats-share-in-cocktail-party-effect
| |
| |title=Tuning in to the Brain's "Cocktail Party Effect"
| |
| |description=Excerpt from All Things Considered on this topic.}}
| |
| <br />
| |
| | |
| </tabber>
| |
| | |
| == Recommended Outline ==
| |
| | |
| === Before Class ===
| |
| | |
| * Familiarize yourself with the [[#Useful Resources|Google Docs]] for the [[#Fool the Professor|Fool the Professor game]].
| |
| * Get enough pennies for the whole class for the [[#Fool the Professor|Fool the Professor game]].
| |
| * Familiarize yourself with the [https://datahub.berkeley.edu/hub/user-redirect/git-pull?repo=https://github.com/sensesensibilityscience/datascience&urlpath=tree/datascience/p_hacking.ipynb&branch=master <math>p</math>-hacking notebook].
| |
| | |
| === During Class ===
| |
| | |
| {| class="wikitable" style="margin-left: 0px; margin-right: auto;"
| |
| |5 Minutes
| |
| |Introduce the lesson and go over the plan for the day. Make sure people have groups, spokespeople, etc.
| |
| |-
| |
| |24 Minutes
| |
| |Go through the [[#Discussion Questions|discussion questions]].
| |
| |-
| |
| |8 Minutes
| |
| |Run the [[#Stock Predictions|Stock Predictions activity]].
| |
| |-
| |
| |15 Minutes
| |
| |Run the [[#Fool the Professor|Fool the Professor activity]].
| |
| |-
| |
| |8 Minutes
| |
| |Run the [[#Snowy Pictures|Snowy Pictures activity]].
| |
| |-
| |
| |20 Minutes
| |
| |Use the remaining time to start work on the [[#p-hacking Notebook|<math>p</math>-hacking notebook]].
| |
| |}
| |
| | |
| === After Class ===
| |
| | |
| [[File:Fool the Professor Histograms.png|thumb]]
| |
| One instructor should compile histograms for the Fool the Professor game.
| |
| # Separately for each of the two strings of coin tosses, tally the number of times a consecutive run of N heads or tails occurs. (This may be done with a script or the search-and-replace function in a text editor.)
| |
| # Mask which string is the true random one by labelling them A and B.
| |
| # Make the following two histograms for the tallies of consecutive runs, stacking the tallies for heads and tails. There's a [https://docs.google.com/spreadsheets/d/10hUomKQH0zcnVXTi_-hr1nxH5GGz_dmL/ calculator spreadsheet template] to help you with this.
| |
| | |
| == Lesson Content ==
| |
| | |
| === Discussion Questions ===
| |
| | |
| Spend four minutes on each question.
| |
| | |
| ==== Question 1 ====
| |
| | |
| [[File:Significant.png|thumb|[https://xkcd.com/882/ Comic by Randall Munroe.]]]
| |
| What's the joke in this comic?
| |
| {{BoxAnswer|
| |
| If each test has a 5% chance of saying there's a signal when there's not, if you run enough tests (on enough colors of jelly beans), you're going to get one to say there's a signal ''even if there's only noise''.<br /><br />If your hypothesis is:
| |
| * "Do green jelly beans cause acne?" then you have a 5% chance of finding a false signal.
| |
| * "Do jelly beans cause acne?" then, with 20 experiments, you have a bout a 64% chance of finding a false signal. (1 - 0.95²⁰ ≈ 0.64).
| |
| You do not actually find that green jelly beans are linked to acne, you find that the people who were randomly part of the experiment eating green jelly beans happened to have more acne on average.}}
| |
| ==== Question 2 ====
| |
| | |
| Why might humans be likely to see patterns in random noise?
| |
| {{BoxAnswer|title=Example Answers|Natural psychological discomfort with ambiguity and uncertainty, link back to superstitions in previous sections (seeing causation when there is only correlation). Discuss Patternicity article: when the costs of missing a real signal are higher than the costs of misperceiving a non-existent signal in noise, we are likely to perceive a signal. The example of seeing the "pattern" of a predator from the "noise" of a rustling patch of grass is a great example.}}
| |
| ==== Question 3 ====
| |
| | |
| What are some ways in which the Look Elsewhere Effect may impact scientific studies?
| |
| {{BoxAnswer|If a seemingly impressive "signal" appeared in one part of a large data set, a scientist might get very excited and publish that result, but they would've been equally impressed had the "signal" appeared ''elsewhere'' in the data set. The likelihood that some spurious signal appears anywhere in a large data set is quite high. The scientist has in this case forgotten that they should've looked elsewhere in the data set and noted that the "signal" in the totality of the data set is actually very weak.}} | |
| ==== Question 4 ====
| |
| | |
| How do scientists try to stop themselves from seeing significant signals/patterns when only noise is present? (Hint: think <math>p</math>-values)
| |
| {{BoxAnswer|With tests of statistical significance! With a <math>p</math>-value cutoff of .05, you have a 5% chance of detecting a signal if there is truly only noise. You can adjust this threshold (typically .05) to suit your needs.}}
| |
| ==== Question 5 ====
| |
| | |
| What do you think of the results of the study in "Have smartphones destroyed a generation?" Do we trust it? Why or why not? How could we amend the analysis to trust it more?
| |
| {{BoxAnswer|It fell prey to the look elsewhere effect, since there were simply so many explanatory variables that is highly likely that one will be correlated purely by chance. We could correct this by having a lower <math>p</math>-value threshold, like .05/(number of variables considered)}}
| |
| === Stock Prediction ===
| |
| | |
| Students guess whether each of four fictional stocks will rise or fall. The instructor picks if each stock will rise or fall by flipping a coin, and then asks the students if anyone got all four right. Typically, at least one student will, just by chance, even though it is clearly a matter of chance.
| |
| | |
| {| class="wikitable" style="margin-left: auto; margin-right: auto;"
| |
| !|Stock
| |
| !Prediction
| |
| !Results
| |
| !Success
| |
| |-
| |
| !|XMPL
| |
| |''Rise''
| |
| |''Rise''
| |
| |''Yes''
| |
| |-
| |
| !|KGYN
| |
| |
| |
| |
| |
| |
| |
| |-
| |
| !|GFA
| |
| |
| |
| |
| |
| |
| |
| |-
| |
| !|XGY
| |
| |
| |
| |
| |
| |
| |
| |-
| |
| !|WIUT
| |
| |
| |
| |
| |
| |
| |
| |}
| |
| | |
| ==== Instructions ====
| |
| | |
| {| class="wikitable" style="margin-left: 0px; margin-right: auto;"
| |
| |1 Minute
| |
| |Either hand out sheets of the table above or show it on a screen. For each of the stocks above, have the students predict whether they will "Rise" or "Fall" and write their predictions down.
| |
| |-
| |
| |1 Minute
| |
| |For each stock, flip a coin to determine if a stock will rise or fall. Do this in front of the students so they can see that the results really are random.
| |
| |-
| |
| |1 Minute
| |
| |Ask the students if anyone's predictions were all correct. With enough students, there's typically at least one student that gets everything right.
| |
| |-
| |
| |3 Minutes
| |
| |Praise any students that got everything correct. Emphasize how brilliant of traders they are and ask them what their methodology was. See if they have any profound insights about the market to share.
| |
| |-
| |
| |2 Minutes
| |
| |Remind students that the results here actually were truly random. If you look at a set of data in enough ways after the fact you'll inevitably find something that looks like a pattern. But this should demonstrate that the same thing applies if you make enough predictions ahead of time as well.
| |
| |}
| |
| | |
| ==== Debrief ====
| |
| | |
| Did anyone do really well? That person must be an expert on stocks, right?
| |
| {{BoxAnswer|Nope. But, make sure you ''really'' ham it up and congratulate the students that do best.}}
| |
| {{Line}}
| |
| Why did that person do really well?
| |
| {{BoxAnswer|Pure random chance. In a class of 30 students, we would expect one to three students to accurately predict the four coin flips by guessing randomly. There's a 1 in 16 chance of doing so.}}
| |
| {{Line}}
| |
| What are some other cases in which luck looks like skill? What are consequences of this illusion?
| |
| {{BoxAnswer|Many possibilities. See the [[#Takeaways|examples]] for this lesson.}}
| |
| === Fool the Professor ===
| |
| {{BoxWarning|This is a logistically heavy activity requiring some planning and an instructor (or volunteer) other than the professor.}}
| |
| This activity illustrates the fact that pure randomness can and will generate apparent patterns. Each class is split into two halves, with one half generating a random string of coin flips and the other half coming up with a string of coin flips that should "fool the professor" into thinking that that is the random string. The upshot is that the true random string tends to contain more long consecutive heads (or tails) than the fake random string.
| |
| | |
| ==== Instructions ====
| |
| | |
| # The instructor should first familiarize themselves with the documents where the coin tosses will be recorded. Open the doc and be prepared to write down H or T. Prepare enough pennies to hand out to your students.
| |
| # Tell the students that the goal of this activity is to produce a string of coin tosses that can fool the instructor into believing that it is random, rather than produced by thought by students.
| |
| # Split the class into two halves (e.g. left and right halves of the room). Distribute the pennies to the second half of the class.
| |
| # The first half will produce a fake random string by shouting HEADS or TAILS one after another. After the GSI reads the last 10 coin tosses from the fake random string of the preceding section, let the students begin shouting their choices one by one. Record the results.
| |
| # The second half will produce a true random string by shouting the results of a ''real'' coin toss. After the GSI reads the last 10 coin tosses from the ''true random'' string of the preceding section, let the students shout the results of their coin tosses one by one. Record the results.
| |
| # The combined results of all sections will be revealed for the professor to guess. Typically, the true random sequence has longer strings of heads or tails than the fake-random sequence.
| |
| {{LinkCard
| |
| |url=https://docs.google.com/document/d/1jfjGqK_B0PmQwKhICUofbywVo_1F_DqI6iBWYBk8XWM/
| |
| |title=Manufactured Random Data Template
| |
| |description=Document to put manufactured random data for the Fool the Professor activity.}}
| |
| {{LinkCard
| |
| |url=https://docs.google.com/document/d/1W81llxFOsRweXRBEV3_uRbQwxL7-e4NMpSCxdq_BQ70/
| |
| |title=True Random Data Template
| |
| |description=Document to put true random data for the Fool the Professor activity.}}
| |
| {{LinkCard
| |
| |url=https://docs.google.com/spreadsheets/d/10hUomKQH0zcnVXTi_-hr1nxH5GGz_dmL/
| |
| |title=Fool the Professor Calculator Template
| |
| |description=Calculator to aid the professor in identifying true and false patterns in random noise for the Fool the Professor activity.}}
| |
| {{BoxCaution|You may allude to the ideas of false positives and false negatives, which will be introduced in the next lesson.}}
| |
| ==== Extra Instructions for Multiple Simultaneous Sections ====
| |
| | |
| [[File:Fool the Professor List Directions.png|thumb|How to fill out the Fool the Professor documents when you have multiple sections happening simultaneously.]]
| |
| If the activity is done in multiple small sections, aggregate the two strings (one true random and one fake random) across all classes. The final two long strings are to be presented to the professor at the plenary session. To make sure the strings continue from those of the previous class, read the 10 trailing coin flips to the students before they generate the new strings.
| |
| | |
| Consider the list of coin flips listed from top to bottom. If there are two concurrent sections, then one section should add their coin flips to the bottom of the list, while the other section adds theirs to the top of the list (in the reverse order). See the image.
| |
| | |
| === Snowy Pictures ===
| |
| | |
| In this activity, students will look at a series of "noisy" black and white images, each visible for only a second, with thirty second breaks between each for students to write down what they see. Some of the noisy pictures contain pictures of familiar creatures or objects, while others do not. The purpose of this activity is to give students practice looking for patterns where they may or may not exist, observing their responses as they "see" pictures that aren't there and fail to identify pictures that are really there because of too much noise.
| |
| {{LinkCardInternal
| |
| |url=:File:Snowy Pictures Slides.pdf
| |
| |title=Snowy Pictures Slides
| |
| |description=A set of slides with ''only'' the snowy pictures on them.}}
| |
| {{BoxCaution|You may allude to the ideas of false positives and false negatives, which will be introduced in the next lesson.}}
| |
| ==== Instructions ====
| |
| | |
| {| class="wikitable" style="margin-left: 0px; margin-right: auto;"
| |
| |8 Minutes
| |
| |Show the students the pictures in these slides. For each image, have students look for a pattern or decide if it is only noise. Give ~5 seconds. After showing the picture, give thirty seconds for the students to write down what they saw or if it was just noise.
| |
| |-
| |
| |4 Minutes
| |
| |Once all pictures are shown, go through the pictures one more time. Before showing each image, ask the students to share what they saw. After getting answers from the students, pull up the picture and reveal whether or not it had anything in it.
| |
| |}
| |
| | |
| ==== Answers ====
| |
| | |
| Which snowy pictures had images?
| |
| * {{Correct|[[:File:Snowy Picture 1.png|Picture 1: '''Anchor''']]}}
| |
| * [[:File:Snowy Picture 2.png|Picture 2: Noise]]
| |
| * [[:File:Snowy Picture 3.png|Picture 3: Noise]]
| |
| * {{Correct|[[:File:Snowy Picture 4.png|Picture 4: '''Camera''']]}}
| |
| * {{Correct|[[:File:Snowy Picture 5.png|Picture 5: '''Boat''']]}}
| |
| * {{Correct|[[:File:Snowy Picture 6.png|Picture 6: '''Deer''']]}}
| |
| | |
| === p-hacking Notebook ===
| |
| | |
| The last chunk of this lesson is reserved for students to work through the <math>p</math>-hacking Jupyter notebook in pairs. This is the first of several Jupyter notebooks we'll be using in this course. So, be ready to help the students in case they're confused. The students don't necessarily have to turn this in.
| |
| {{LinkCard
| |
| |url=https://github.com/sensesensibilityscience/datascience/blob/master/p_hacking.ipynb
| |
| |title=<math>p</math>-hacking Jupyter Notebook
| |
| |description=Data science notebook for students to experience <math>p</math>-hacking for themselves.}}
| |
| {{LinkCard
| |
| |url=https://datahub.berkeley.edu/hub/user-redirect/git-pull?repo=https://github.com/sensesensibilityscience/datascience&urlpath=tree/datascience/p_hacking.ipynb&branch=master
| |
| |title=<math>p</math>-hacking Jupyter Notebook (Datahub Link)
| |
| |description=Special link for use at UC Berkeley only. Data science notebook for students to experience <math>p</math>-hacking for themselves.}}
| |
| {{BoxCaution|Many students without programming experience are put off by the code in the notebook. They '''don't''' need to understand any of it or know how to program at all. They only need to press "shift-enter" in any cells with code in them. However, spending some time to walk through it with them can also serve to be an empowering experience.}}<!-- == Overflow ==
| |
| | |
| <div class="toccolours mw-collapsible mw-collapsed" style="overflow:auto;">
| |
| <div style="font-weight:bold;line-height:1.6;">Extra content that's not currently part of the official lesson plan.</div>
| |
| <div class="mw-collapsible-content">
| |
| | |
| === Clicker Question ===
| |
| | |
| A friend tells you that, when conducting coin flips, there were ten heads in a row. This is, of course, a surprising result. In what situation would it be most surprising?
| |
| <ol style="list-style-type:lower-alpha"> {{Answer|a|small=right}}
| |
| <li>She is the only person flipping a coin, and she flipped it only ten times.</li>
| |
| <li>There are many people flipping coins, and everyone flips ten times.</li>
| |
| <li>There are many people flipping coins, and each person conducts 100 flips.</li>
| |
| <li>She is the only person flipping a coin, and she conducts 100 flips.</li>
| |
| </ol>
| |
| | |
| </div></div> --></restricted>{{NavCard|prev=4.1 Signal and Noise|next=5.1 False Positives and Negatives}}
| |
| [[Category:Lesson plans]] | | [[Category:Lesson plans]] |