[301] randomness - tyler r. caraza-harter...tue, dec 17 (1-3pm) wed, dec 18 (9-11am) thu, dec 19...
TRANSCRIPT
![Page 1: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/1.jpg)
[301] RandomnessTyler Caraza-Harter
![Page 2: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/2.jpg)
Which series was randomly generated?Which did I pick by hand?
1
2
![Page 3: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/3.jpg)
Announcement 1: Recommended popularstats books (for winter reading)
The Visual Display of Quantitative Information by Edward R. Tufte
Thinking, Fast and Slow by Daniel Kahneman
Statistics Done Wrong by Alex Reinhart
The Signal and the Noise by Nate Silver
![Page 4: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/4.jpg)
Announcement 1: Recommended popularstats books (for winter reading)
The Visual Display of Quantitative Information by Edward R. Tufte
Thinking, Fast and Slow by Daniel Kahneman
Statistics Done Wrong by Alex Reinhart
The Signal and the Noise by Nate Silver
![Page 5: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/5.jpg)
Announcement 2: Projects
Finish up P10• due this Wed• no late days (see syllabus), so we have time for fixes before final grading
Report grading issues w/ form• https://forms.gle/989i5vqmxesENfTNA• I'll personally check every timely submission before final grades go out
![Page 6: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/6.jpg)
Announcement 3: Office Hours
Wed is last day for TA+Shelf office hours
There will be increased instructor office hours through Thu, Dec 19th• https://piazza.com/class/jzkcu4am8lmc3?cid=880
Thu, Dec 12 (1-2pm)Fri, Dec 13 (1-3pm)Mon, Dec 16 (1-3pm)Tue, Dec 17 (1-3pm)Wed, Dec 18 (9-11am)Thu, Dec 19 (1-3pm)
![Page 7: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/7.jpg)
Announcement 4: Final Exam
Details: similar to midterms• worth 20%• 110 minutes on Thu Dec 19 @ 7:25PM - 9:25PM• you can have a single page of notes (both sides), as usual• cumulative, across whole semester• prep for Wed review session• watch your email for room details!
Recommended prep• make sure you understand all the worksheet problems• review the readings, especially anything I took the time to write myself• review everything you got wrong on the midterms• review the slides• review the code you wrote for the projects
![Page 8: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/8.jpg)
Announcement 4: Final Exam
Seven one-page sections (35 total questions):1. True/False (designed to be fast, to compensate for 10-minute setup)2. Exam 1 Review3. Exam 2 Review4. Pandas5. Web6. Databases7. Plotting
Notes:• many questions will have project themes, but we may mix/match
(e.g., "Exam 1 review" could have world geography questions)• we may sneak smaller topics into other sections
(e.g., randomness within database section)
Logistics:• don't trust student center for location!• aiming to have more proctors• Student ID scan-out only
![Page 9: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/9.jpg)
Announcement 5: Course Evaluations
Section 1:https://aefis.wisc.edu/index.cfm/page/AefisCourseSection.surveyResults?courseSectionid=609839
Section 2:https://aefis.wisc.edu/index.cfm/page/AefisCourseSection.surveyResults?courseSectionid=609838
I always read all the feedback, so please take the time to complete these!
![Page 10: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/10.jpg)
Why Randomize?
Games
Security
Simulation our focus
![Page 11: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/11.jpg)
Outline
choice()
bugs and seeding
significance
histograms
normal()
![Page 12: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/12.jpg)
New Functions Today
numpy.random:• powerful collection of functions• choice, normal
Series.plot.hist:• similar to bar plot• visualize spread of
random results powerful collection of functions
![Page 13: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/13.jpg)
choice
from numpy.random import choice, normal
result = choice( )
list of things torandomly choose from
![Page 14: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/14.jpg)
choice
from numpy.random import choice, normal
result = choice(["rock", "paper", "scissors"])
list of things torandomly choose from
https://www.securifera.com/blog/2015/09/09/mmactf-2015-rock-paper-scissors-rps/
![Page 15: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/15.jpg)
choice
from numpy.random import choice, normal
result = choice(["rock", "paper", "scissors"])print(result)
scissors
Output:
https://www.securifera.com/blog/2015/09/09/mmactf-2015-rock-paper-scissors-rps/
![Page 16: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/16.jpg)
choice
from numpy.random import choice, normal
result = choice(["rock", "paper", "scissors"])print(result)
result = choice(["rock", "paper", "scissors"])print(result)
scissors rock
Output:
each time choice iscalled, a value is randomly
selected (will vary run to run)
![Page 17: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/17.jpg)
choice
from numpy.random import choice, normal
choice(["rock", "paper", "scissors"], size=5)
for simulation, we'll often wantto compute many random results
![Page 18: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/18.jpg)
choice
from numpy.random import choice, normal
choice(["rock", "paper", "scissors"], size=5)
array(['rock', 'scissors', 'paper', 'rock', 'paper'], dtype='<U8')
it's list-like
![Page 19: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/19.jpg)
Random values and Pandas
from numpy.random import choice, normal
# random SeriesSeries(choice(["rock", "paper", "scissors"], size=5))
![Page 20: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/20.jpg)
Random values and Pandas
from numpy.random import choice, normal
# random SeriesDataFrame(choice(["rock", "paper", "scissors"], size=(5,2)))
![Page 21: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/21.jpg)
Demo: exploring bias
choice(["rock", "paper", "scissors"])
Question 1: how can we make sure the randomization isn't biased?
![Page 22: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/22.jpg)
Demo: exploring bias
choice(["rock", "paper", "scissors"])
Question 1: how can we make sure the randomization isn't biased?
![Page 23: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/23.jpg)
Demo: exploring bias
choice(["rock", "paper", "scissors"])
Question 1: how can we make sure the randomization isn't biased?
Question 2: how can we make it biased (if we want it to be)?
p=[...]
![Page 24: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/24.jpg)
Random Strings vs. Random Ints
from numpy.random import choice, normal
# random string: rock, paper, or scissorschoice(["rock", "paper", "scissors"])
# random int: 0, 1, or 2choice([0, 1, 2])
![Page 25: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/25.jpg)
Random Strings vs. Random Ints
from numpy.random import choice, normal
# random string: rock, paper, or scissorschoice(["rock", "paper", "scissors"])
# random int: 0, 1, or 2choice([0, 1, 2])
# random int (approach 2): 0, 1, or 2choice(3)
random non-negative intthat is less than 3
same
![Page 26: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/26.jpg)
Outline
choice()
bugs and seeding
significance
histograms
normal()
![Page 27: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/27.jpg)
Example: change over time
s = Series(choice(10, size=5))
s.plot.line()
![Page 28: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/28.jpg)
Example: change over time
s = Series(choice(10, size=5))
s.plot.line()
percents = []for i in range(1, len(s)): diff = 100 * (s[i] / s[i-1] - 1) percents.append(diff)Series(percents).plot.line()
what are we computing for diff?
![Page 29: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/29.jpg)
Example: change over time
s = Series(choice(10, size=5))
s.plot.line()
percents = []for i in range(1, len(s)): diff = 100 * (s[i] / s[i-1] - 1) percents.append(diff)Series(percents).plot.line()
can you identify the bug in the code?
![Page 30: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/30.jpg)
Example: change over time
s = Series(choice(10, size=5))
s.plot.line()
percents = []for i in range(1, len(s)): diff = 100 * (s[i] / s[i-1] - 1) percents.append(diff)Series(percents).plot.line()
can you identify the bug in the code?
![Page 31: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/31.jpg)
Not all bugs are equal!
scary bugs "nice" bugs
non-deterministic
https://owlcation.com/stem/5-Badass-Bugs-That-You-Should-Have-Nightmares-About
deterministic (reproducible)
![Page 32: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/32.jpg)
Not all bugs are equal!
scary bugs "nice" bugs
non-deterministic deterministic (reproducible)system relatedrandomness
https://owlcation.com/stem/5-Badass-Bugs-That-You-Should-Have-Nightmares-About
![Page 33: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/33.jpg)
Not all bugs are equal!
scary bugs "nice" bugs
non-deterministic
large data small data
semantic syntax
runtime
system relatedrandomness
https://owlcation.com/stem/5-Badass-Bugs-That-You-Should-Have-Nightmares-About
deterministic (reproducible)
![Page 34: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/34.jpg)
Not all bugs are equal!
scary bugs "nice" bugs
non-deterministic
semantic syntax
runtime
system relatedrandomness
https://owlcation.com/stem/5-Badass-Bugs-That-You-Should-Have-Nightmares-About
????
deterministic (reproducible)
large data small data
![Page 35: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/35.jpg)
Not all bugs are equal!
scary bugs "nice" bugs
non-deterministic
semantic syntax
runtime
system relatedrandomness
https://owlcation.com/stem/5-Badass-Bugs-That-You-Should-Have-Nightmares-About
assert
seedingdeterministic (reproducible)
large data small data
![Page 36: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/36.jpg)
Pseudorandom Generators
"Random" generators are really just pseudorandom
684 559 629 192 835 ...
37 235 908 72 767 ...
168 527 493 584 534 ...
874 664 249 643 952 ...
![Page 37: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/37.jpg)
Pseudorandom Generators
Producing random numbers is like cruising down the tracks...
684 559 629 192 835 ...
37 235 908 72 767 ...
168 527 493 584 534 ...
874 664 249 643 952 ...
![Page 38: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/38.jpg)
Pseudorandom Generators
Every run, you get on another tracks, so it feels random
684 559 629 192 835 ...
37 235 908 72 767 ...
168 527 493 584 534 ...
874 664 249 643 952 ...
![Page 39: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/39.jpg)
Seeding
What if I told you that you can choose your track?
684 559 629 192 835 ...
37 235 908 72 767 ...
168 527 493 584 534 ...
874 664 249 643 952 ...
100:
101:
102:
...:
seeds
![Page 40: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/40.jpg)
Seeding
What if I told you that you can choose your track?
![Page 41: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/41.jpg)
Seeding
Common approach for simulations:1. seed using current time2. print seed3. use the seed for reproducing bugs, as necessary
![Page 42: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/42.jpg)
Outline
choice()
bugs and seeding
significance
histograms
normal()
![Page 43: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/43.jpg)
https://dilbert.com/strip/2001-10-25
In a noisy world, what is noteworthy?
![Page 44: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/44.jpg)
Is this coin biased?
51 49 a statistician might say we're trying to decide if the evidence
that the coin isn't fair is statistically significant
Call shenanigans?
whoever has the coin cheated(it's not 50/50 heads/tails)
![Page 45: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/45.jpg)
Is this coin biased?
51 49
Call shenanigans? No.
![Page 46: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/46.jpg)
Is this coin biased?
51 49
Call shenanigans? No.
5 95
Call shenanigans?
![Page 47: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/47.jpg)
Is this coin biased?
51 49
Call shenanigans? No.
5 95
Call shenanigans? Yes.
Note: there is a non-zero probability that a fair coin will do this, but the odds are slim
![Page 48: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/48.jpg)
Is this coin biased?
51 49
Call shenanigans? No.
5 95
Call shenanigans? Yes.
55 45
Call shenanigans?
55 million 45 million
Call shenanigans?
![Page 49: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/49.jpg)
Is this coin biased?
51 49
Call shenanigans? No.
5 95
Call shenanigans? Yes.
55 45
Call shenanigans? No.
55 million 45 million
Call shenanigans? Yes.
![Page 50: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/50.jpg)
Is this coin biased?
51 49
Call shenanigans? No.
5 95
Call shenanigans? Yes.
55 45
Call shenanigans? No.
55 million 45 million
Call shenanigans? Yes.
large skew is good evidence of shenanigans
small skew over large samples is good evidence
![Page 51: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/51.jpg)
Demo: CoinSim
60 40
Call shenanigans?
Strategy: simulate a fair coin
1. "flip" it 100 times using numpy.random.choice2. count heads3. repeat above 10K times
[50, 61, 51, 44, 39, 43, 51, 49, 49, 38, ...]
![Page 52: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/52.jpg)
Demo: CoinSim
60 40
Call shenanigans?
Strategy: simulate a fair coin
1. "flip" it 100 times using numpy.random.choice2. count heads3. repeat above 10K times
[50, 61, 51, 44, 39, 43, 51, 49, 49, 38, ...]
we got 10 more heads than we expect on averagehow common is this?
![Page 53: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/53.jpg)
Demo: CoinSim
60 40
Call shenanigans?
Strategy: simulate a fair coin
1. "flip" it 100 times using numpy.random.choice2. count heads3. repeat above 10K times
[50, 61, 51, 44, 39, 43, 51, 49, 49, 38, ...]
we got 10 more heads than we expect on averagehow common is this?
11 more 12 less
![Page 54: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/54.jpg)
Outline
choice()
bugs and seeding
significance
histograms
normal()
![Page 55: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/55.jpg)
Frequencies across categories
s = Series(["rock", "rock", "paper", "scissors", "scissors", "scissors"])
s.value_counts().plot.bar(color="orange")
bars are a good way to view frequencies across categories
![Page 56: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/56.jpg)
Frequencies across numbers
s = Series([0, 0, 1, 8, 9, 9])
s.value_counts().plot.bar(color="orange")
bars are a bad way to view frequencies across numbers
numbers not ordered
![Page 57: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/57.jpg)
Frequencies across numbers
s = Series([0, 0, 1, 8, 9, 9])
s.value_counts().sort_index().plot.bar(color="orange")
bars are a bad way to view frequencies across numbers
gap between 1 and 8 not obvious
![Page 58: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/58.jpg)
Frequencies across numbers
s = Series([0, 0, 1, 8, 9, 9])
s.value_counts().sort_index().plot.bar() s.plot.hist()
bars are a bad way to view frequencies across numbers
![Page 59: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/59.jpg)
Frequencies across numbers
s = Series([0, 0, 1, 8, 9, 9])
s.value_counts().sort_index().plot.bar() s.plot.hist()
histograms are a good way to view frequencies across numbers
this kind of plot is called a histogram
![Page 60: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/60.jpg)
Frequencies across numbers
s = Series([0.1, 0, 1, 8, 9, 9.2])
s.value_counts().sort_index().plot.bar() s.plot.hist()
a histogram "bins" nearby numbers to create discrete bars
histograms are a good way to view frequencies across numbers
both 0 and 0.1
![Page 61: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/61.jpg)
Frequencies across numbers
s = Series([0.1, 0, 1, 8, 9, 9.2])
s.value_counts().sort_index().plot.bar() s.plot.hist(bins=10)
we can control the number of bins
histograms are a good way to view frequencies across numbers
![Page 62: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/62.jpg)
Frequencies across numbers
s = Series([0.1, 0, 1, 8, 9, 9.2])
s.value_counts().sort_index().plot.bar() s.plot.hist(bins=3)
too few bins provides too little detail
histograms are a good way to view frequencies across numbers
![Page 63: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/63.jpg)
Frequencies across numbers
s = Series([0.1, 0, 1, 8, 9, 9.2])
s.value_counts().sort_index().plot.bar() s.plot.hist(bins=100)
too many bins provides too much detail (equally bad)
histograms are a good way to view frequencies across numbers
![Page 64: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/64.jpg)
Frequencies across numbers
s = Series([0.1, 0, 1, 8, 9, 9.2])
s.value_counts().sort_index().plot.bar() s.plot.hist(bins=10)
pandas chooses the default bin boundaries
histograms are a good way to view frequencies across numbers
![Page 65: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/65.jpg)
Frequencies across numbers
s = Series([0.1, 0, 1, 8, 9, 9.2])
s.value_counts().sort_index().plot.bar() s.plot.hist(bins=[0,1,2,3,4,5,6,7,8,9,10])
we can override the defaults
histograms are a good way to view frequencies across numbers
![Page 66: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/66.jpg)
Frequencies across numbers
s = Series([0.1, 0, 1, 8, 9, 9.2])
s.value_counts().sort_index().plot.bar() s.plot.hist(bins=range(11))
this is easily done with range
histograms are a good way to view frequencies across numbers
![Page 67: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/67.jpg)
Demo: Visualize CoinSim Results
number of heads (out of 100)
![Page 68: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/68.jpg)
Demo: Visualize CoinSim Results
number of heads (out of 100)
this shape resembles what we often call a normal distribution or a "bell curve"
![Page 69: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/69.jpg)
Demo: Visualize CoinSim Results
number of heads (out of 100)
this shape resembles what we often call a normal distribution or a "bell curve"
in general, if we take large samples enough times, the sample averages will look like this (we won't discuss exceptions here)
![Page 70: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/70.jpg)
Demo: Visualize CoinSim Results
number of heads (out of 100)
this shape resembles what we often call a normal distribution or a "bell curve"
in general, if we take large samples enough times, the sample averages will look like this (we won't discuss exceptions here)
numpy can directlygenerate randomnumbers fitting a
normal distribution
![Page 71: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/71.jpg)
Outline
choice()
bugs and seeding
significance
histograms
normal()
![Page 72: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/72.jpg)
normal
from numpy.random import choice, normalimport numpy as np
for i in range(10): print(normal())
![Page 73: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/73.jpg)
normal
from numpy.random import choice, normalimport numpy as np
for i in range(10): print(normal())
-0.186385539933711570.028884529167692471.2474561113726423-0.5388224399358179-0.45143322136388525-1.40018611120182410.281193715118680470.2608861898556597-0.192462887289551440.2979572961710292
Output:
average is 0 (over many calls)
numbers closer to 0 more likely
-x just as likely as x
![Page 74: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/74.jpg)
normal
from numpy.random import choice, normalimport numpy as np
s = Series(normal(size=10000))
![Page 75: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/75.jpg)
normal
from numpy.random import choice, normalimport numpy as np
s = Series(normal(size=10000))
s.plot.hist()
![Page 76: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/76.jpg)
normal
from numpy.random import choice, normalimport numpy as np
s = Series(normal(size=10000))
s.plot.hist()
![Page 77: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/77.jpg)
normal
from numpy.random import choice, normalimport numpy as np
s = Series(normal(size=10000))
s.plot.hist(bins=100)
![Page 78: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/78.jpg)
normal
from numpy.random import choice, normalimport numpy as np
s = Series(normal(size=10000))
s.plot.hist(bins=100, loc= , scale= )
![Page 79: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/79.jpg)
normal
from numpy.random import choice, normalimport numpy as np
s = Series(normal(size=10000))
s.plot.hist(bins=100, loc= , scale= )
try plugging in different values(defaults are 0 and 1, respectively)
![Page 80: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/80.jpg)
Demo: plot overlay
10K samples of 100 coin flips10K samples from normal(size=10000)
![Page 81: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/81.jpg)
Demo: plot overlay
10K samples of 100 coin flips10K samples from normal(size=10000)
goal: play with loc and scale arguments to normal until gray overlaps red
version 1
![Page 82: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/82.jpg)
Demo: plot overlay
10K samples of 100 coin flips10K samples from normal(size=10000)
goal: play with loc and scale arguments to normal until gray overlaps red
version 2
![Page 83: [301] Randomness - Tyler R. Caraza-Harter...Tue, Dec 17 (1-3pm) Wed, Dec 18 (9-11am) Thu, Dec 19 (1-3pm) Announcement 4: Final Exam Details: similar to midterms • worth 20% • 110](https://reader035.vdocuments.us/reader035/viewer/2022071116/5ffc35bda8e7fb48ae1a977b/html5/thumbnails/83.jpg)
Demo: plot overlay
10K samples of 100 coin flips10K samples from normal(size=10000)
goal: play with loc and scale arguments to normal until gray overlaps red
version 3