├── .gitignore ├── lessons ├── readme.md ├── Pipfile ├── week1 │ ├── landlord_tenant.ipynb │ └── basic_intro.ipynb ├── Pipfile.lock └── tbd │ ├── intro-stats.md │ └── gotcha.ipynb ├── syllabus ├── week1 │ ├── basic_stats.md │ └── about_python.md ├── summary.md ├── evaluation.md ├── coverage_by_week │ └── w1.md ├── coverage.md ├── texts.md └── manifesto.md ├── base-pipfile ├── tooling.md ├── tasks.md ├── datacamp.org ├── readme.md ├── links-and-resources.md ├── broad_goals.org └── LICENSE.md /.gitignore: -------------------------------------------------------------------------------- 1 | .ipynb_checkpoints/ 2 | __pycache__/ 3 | -------------------------------------------------------------------------------- /lessons/readme.md: -------------------------------------------------------------------------------- 1 | Note: ignore the virtual env stuff in here. This shouldn't be necessary for students with azure notebooks; sadly, it is necessary for me with my totally borked python environment. 2 | -------------------------------------------------------------------------------- /lessons/Pipfile: -------------------------------------------------------------------------------- 1 | [[source]] 2 | url = "https://pypi.python.org/simple" 3 | verify_ssl = true 4 | name = "pypi" 5 | 6 | [packages] 7 | python-dateutil = "*" 8 | pandas = "*" 9 | numpy = "*" 10 | pytz = "*" 11 | delorean = "*" 12 | matplotlib = "*" 13 | 14 | [dev-packages] 15 | 16 | [requires] 17 | python_version = "3.6" 18 | -------------------------------------------------------------------------------- /syllabus/week1/basic_stats.md: -------------------------------------------------------------------------------- 1 | (Intro to statistical concepts and numerical comfort goes here, exercises they can do to build comfort before the material starts) 2 | 3 | Also assign this: https://towardsdatascience.com/statistics-for-people-in-a-hurry-a9613c0ed0b 4 | 5 | Perhaps just move to week four and intro no math in beginning? -------------------------------------------------------------------------------- /base-pipfile: -------------------------------------------------------------------------------- 1 | [[source]] 2 | url = "https://pypi.python.org/simple" 3 | verify_ssl = true 4 | name = "pypi" 5 | 6 | [packages] 7 | numpy = {version = "==1.14.5"} 8 | jupyter = "*" 9 | pandas = {version = "==0.22.0"} 10 | matplotlib = {version = "==3.0.0"} 11 | statsmodels = {version = "==0.9.0"} 12 | ipykernel = "*" 13 | scipy = {version = "==1.1.0"} 14 | sympy = {version = "==1.3"} 15 | scikit-learn = {version = "==0.19.1"} 16 | requests = {version = "==2.19.1"} 17 | bokeh = {version = "==0.13.0"} 18 | plotly = {version = "==3.4.1"} 19 | seaborn = {version = "==0.9.0"} 20 | beautifulsoup4 = {version = "==4.6.3"} 21 | arviz = {version = "==0.2.1"} 22 | 23 | [dev-packages] 24 | 25 | [requires] 26 | python_version = "3.6" 27 | -------------------------------------------------------------------------------- /syllabus/summary.md: -------------------------------------------------------------------------------- 1 | # Course Summary 2 | 3 | This course will review basic principles of probability, statistics, and computational reasoning (including elementary programming) for law students. Throughout, the emphasis will be on mathematically modest intuition, practical skills, and legal applications. No mathematical background beyond high school algebra will be assumed. 4 | 5 | This course is not advised for students with substantial statistical or computational backgrounds---it is designed as a beginner course. Nor will it prepare students to be competent empirical researchers or computer programmers---the goal is to give students the capacity to critically evaluate and understand statistical reasoning, and to use computational methods to do so (as well as in their legal practices more generally). Focus will be on breadth rather than depth. 6 | -------------------------------------------------------------------------------- /syllabus/evaluation.md: -------------------------------------------------------------------------------- 1 | # Evaluation 2 | 3 | Evaluation will be based on four problem sets. The first two will be computer programming-based, and will be worth 20% of the grade each; the last two will be probability and statistics based and will be worth 30% of the grade each. 4 | 5 | Pursuant to Student Handbook section B.3 ("The curve is not applicable in upper-level seminars and other upper- level classes in which a student's grade is based primarily on the student’s performance on graded skills-oriented tasks (including writing) other than a final exam."), this course will not be curved. 6 | 7 | In order to ensure that students in this course aren’t disadvantaged by unfamiliarity with the format or a collection of too-hard problem sets on which everyone struggles, there will be a floor curve for this course: at the lowest, the median grade for this course will be the official law school median of 3.3. In other words, you can’t do worse than the standard curve would otherwise dictate. 8 | 9 | *TODO: detailed rules specifying the extent to which collaboration is permissible on the problem sets.* 10 | -------------------------------------------------------------------------------- /syllabus/coverage_by_week/w1.md: -------------------------------------------------------------------------------- 1 | # Week 1: basics/up and running 2 | 3 | ## Day 1: minimal programming 4 | 5 | ### Pre-class 1: setup 6 | 7 | Go through a video tutorial to set up with Azure and Github. 8 | 9 | - get Chrome 10 | 11 | - get Azure account 12 | 13 | - get Github account and desktop application for your platform 14 | 15 | - clone day 1 repo, verify they can successfully run a hello world exercise 16 | 17 | - small show-off exercise/"what you'll be able to do" that walks them through a pre-coded flashy thing involving datavis and tearing up some bad analysis? 18 | 19 | ### In-class hour: computation basics/building a mental model 20 | 21 | (Need a pre-class video for this too) 22 | 23 | - loops 24 | 25 | - conditionals 26 | 27 | - functions 28 | 29 | - computational logic, human logic 30 | 31 | ## Day 2: conceptual connections between law and code 32 | 33 | - expressing some basic legal claims in code 34 | 35 | - Tax code exercise (or some other statutory thing that can be represented in code. Was originally planning Iowa Landlord-Tenant law, but too much manipulation of dates, which I don't want to hit students with.) 36 | -------------------------------------------------------------------------------- /tooling.md: -------------------------------------------------------------------------------- 1 | # Tooling 2 | 3 | Students will work in Python 3.6 (or whatever the latest release minor version is when the class starts), on [Microsoft Azure Notebooks](https://notebooks.azure.com). Students will clone problem sets, in-class exercises, and tutorials as notebooks from Github directly into Azure. Students will be required to have a Github account. I'll probably also require students to use Chrome just to standardize as much as possible and push the tech support burden to zero. (Most sensible approach is probably to create a course GH organization and make students members of it.) 4 | 5 | Because of the problem of Windows users, there will be no command line component to this course. However, I will make bonus tutorials explaining how to use Azure and the commandline embedded in there to push their own code back to github, use Anaconda to get their own decent Python installation, etc. 6 | 7 | Problem sets will be submitted by saving notebooks and submitting over Canvas; I plan to auto-grade them to the extent possible. 8 | 9 | I should also spin up an online platform for quick in-class/in-video quizzes, which won't be graded but will be recorded for data analysis purposes, i.e., for the purposes of formative assessment. This could possibly also be done over Canvas, if I can't find the time to write something better. 10 | 11 | For iOS, [Juno](https://juno.sh) will connect to notebooks on azure (requires $15 pro purchase I think), so students on iOS should be mostly able to function (though they might still have to use the web interface to clone things, etc.). Is there an equivalent for android? 12 | 13 | In principle, I could use my teaching library to also wrap up some shell commands that can be executed straight from the server on azure notebooks. I could also just have students buy a cheap $5/month digital ocean or linode and install everything from there with a script. -------------------------------------------------------------------------------- /syllabus/week1/about_python.md: -------------------------------------------------------------------------------- 1 | In this class, we will be using the [Python](https://www.python.org/) programming language. In this first week, we will have a basic introduction to Python and to the fundamentals of computer programming. 2 | 3 | Before we get started programming, we have to set up a system to write our code and get the computer to read it. Most introductory Python texts, including the texts we'll be working with, ask you to install an "interpreter"---a program on your own computer that can read and execute Python code. **We won't be doing that here.** (Feel free to install one and experiment, but it won't be officially supported by the course.) 4 | 5 | Instead, all your code will run in the cloud. We'll be using a free service by Microsoft called [Azure Notebooks](https://notebooks.azure.com/). This service will let you type in and execute your code online, through your web browser. This has some very large advantages: 6 | 7 | - You don't have to install anything locally, which can be problematic (especially for Windows users), and I don't have to try to debug your local installations. 8 | 9 | - Azure Notebooks runs on notebook software called [Jupyter](http://jupyter.org/) which is built for data analysis (all the cool data scientist kiddos use it), so it has lots of nice facilities for exploring data and code incrementally, visualizing data, displaying tables, etc. 10 | 11 | In addition, I will ask you to make use of the free [Github](https://github.com/) service to "clone" (copy) assignments, which will be in notebook files that you can just run on Azure, as well as to turn those assignments in. 12 | 13 | There's an introductory video (LINK IT) which shows you how to sign up for these services and some basic usage. Please watch that video, follow the steps, and also run the first notebook (assignment 0) before the first class. In addition, please read pages 1-55 of Python for Everybody. (Don't worry if everything isn't super clear yet, we'll go over the same material in class.) -------------------------------------------------------------------------------- /tasks.md: -------------------------------------------------------------------------------- 1 | # Lessons yet to prepare 2 | 3 | ## In class 4 | 5 | - [ ] Day 1: Installation of all the things 6 | 7 | - [ ] Day 2: Python introduction, programming introduction 8 | 9 | - [ ] all the rest 10 | 11 | ## Out of class 12 | 13 | - [X] Day 3: Libraries, error handling 14 | 15 | - [ ] All the rest 16 | 17 | # Pre-class 18 | 19 | ## Windows machine 20 | 21 | - [ ] check out new azure notebook features https://github.com/Microsoft/AzureNotebooks/wiki/Azure-Notebooks-at-Microsoft-Connect()-2018 22 | 23 | - [ ] see if jupyterlab will work per this https://notebooks.azure.com/anon-jhu4eq/projects/workshop-jupyterlab?page=0 24 | 25 | - [ ] Record installation videos on windows (and figure out how to do it) 26 | 27 | 28 | ## Wherever 29 | 30 | - [ ] clean up repo 31 | 32 | - [ ] Put lessons in repo 33 | 34 | - [ ] Open up repo for webpage 35 | 36 | - [ ] Link datacamp from course page as promised 37 | 38 | - [ ] Prepare software recs (anaconda, atom. Maybe distribute a pre-set-up atom?) 39 | 40 | - [ ] Link appropriate downloaders from ICON? 41 | 42 | - [ ] Look into JupyterLab 43 | 44 | - [ ] Find Richard Sander data and King et al critique 45 | 46 | - [ ] Reorganize lessons on website and here by day 47 | 48 | - [ ] Figure out how students should turn in assignments. (Notebooks on icon?) 49 | 50 | # First day of class 51 | 52 | - [ ] Bring Mac in to show them what things look like there. 53 | 54 | - [ ] Bring windows machine in, ditto 55 | 56 | - [ ] sign students up for datacamp 57 | 58 | - [ ] sign students up for github 59 | 60 | - [ ] get students going with azure notebooks 61 | 62 | - [ ] Show them where anaconda is, encourage them to install 63 | 64 | - [ ] Go over syllabus 65 | 66 | - [ ] Show basic Jupiter usage 67 | 68 | # Notes 69 | 70 | - Perhaps WSL for anaconda? https://medium.com/hugo-ferreiras-blog/using-windows-subsystem-for-linux-for-data-science-9a8e68d7610c 71 | 72 | - azure notebooks docs are improving https://docs.microsoft.com/en-us/azure/notebooks/ 73 | 74 | - package updates are around, including seaborn 9 thankfully https://github.com/Microsoft/AzureNotebooks/wiki/Azure-Notebooks-Fall-2018-Package-Update 75 | 76 | -------------------------------------------------------------------------------- /datacamp.org: -------------------------------------------------------------------------------- 1 | * Introduction to Python (4 hours) 2 | 3 | https://www.datacamp.com/courses/intro-to-python-for-data-science 4 | 5 | ** Variables 6 | 7 | ** Lists (but not dicts?!) 8 | 9 | ** Functions 10 | 11 | ** Libraries 12 | 13 | ** Numpy arrays and subsets 14 | 15 | * Intermediate Python for Data Science (4 hours) 16 | 17 | https://www.datacamp.com/courses/intermediate-python-for-data-science 18 | 19 | ** Matplotlib 20 | 21 | ** Dicts 22 | 23 | ** Pandas 24 | 25 | ** Control flow 26 | 27 | ** Loops 28 | 29 | * Python Data Science Toolbox (part 1) (3 hours) 30 | 31 | https://www.datacamp.com/courses/python-data-science-toolbox-part-1 32 | 33 | ** Writing functions 34 | 35 | * Importing data in python, part 2 (2 hours) 36 | 37 | https://www.datacamp.com/courses/importing-data-in-python-part-2 I 38 | really only want them to have chapter 2, which is about apis. But may 39 | not work because assumes a prior datacamp course with flat files and 40 | such. 41 | 42 | ** APIs 43 | 44 | ** JSON 45 | 46 | * Statistical thinking in Python part 1 (3 hours) 47 | 48 | https://www.datacamp.com/courses/statistical-thinking-in-python-part-1 49 | 50 | ** Exploratory data analysis 51 | 52 | ** Bernoilli 53 | 54 | ** Binomial 55 | 56 | ** Poisson 57 | 58 | ** Normal 59 | 60 | ** Exponential 61 | 62 | * Statistical thinking in python part 2 (4 hours) 63 | 64 | https://www.datacamp.com/courses/statistical-thinking-in-python-part-2 65 | 66 | ** Regression 67 | 68 | ** Bootstrap confidence intervals 69 | 70 | ** Hypothesis tests (including on correlation) 71 | 72 | * Case studies in statistical thinking (4 hours) 73 | 74 | https://www.datacamp.com/courses/case-studies-in-statistical-thinking 75 | 76 | ** Practice. 77 | 78 | * Introduction to linear modeling in python (4 hrs) 79 | 80 | https://www.datacamp.com/courses/introduction-to-linear-modeling-in-python 81 | Probably good as an optional advanced.\\ 82 | Or maybe for regression weeks. 83 | 84 | ** Lots of regression mechanics. 85 | 86 | * Statistical simulation in python (4 hrs) 87 | 88 | https://www.datacamp.com/courses/statistical-simulation-in-python Seems 89 | quite advanced, but I want some of it early for simulation intro?? Maybe 90 | I can do a brief simulation intro before this? 91 | 92 | ** Simulating randomness 93 | 94 | ** Probability concepts 95 | 96 | ** Bootstrap, jackknife 97 | 98 | ** Power analysis (!!!)) 99 | -------------------------------------------------------------------------------- /syllabus/coverage.md: -------------------------------------------------------------------------------- 1 | # Course coverage and Organization 2 | 3 | Approximately five weeks will be spent on basic computation, and nine weeks on probability and statistics via computational methods. 4 | 5 | Week 1: Basic ideas of programming, units of computation, functions and loops. Computational logic and legal logic, law as computation. 6 | 7 | Week 2: Files and Strings, Regular expressions. Focused legal application: data-wrangling in legal documents. 8 | 9 | Week 3: Documentation and debugging. Problem set 1 due. 10 | 11 | Week 4: Basic principles of probability. Focused legal application: loss of a chance in torts. 12 | 13 | Week 5: Examining data, measures of central tendency, computational exploratory analysis and data visualization. 14 | 15 | Week 6: Conditional probability, Independence, Bayes Rule. Focused legal application: tests and error rates. Problem set 2 due. 16 | 17 | Week 7: Probability distributions, Central limit theorem. 18 | 19 | Week 8: Hypothesis testing, statistical epistemology. Focused legal application: statistical evidence of discrimination. 20 | 21 | *Do I want an experiments section in here, focusing on audit tests like those used by housing discriminating organizations?* 22 | 23 | Week 9. Statistical dangers (part 1): Statistical significance and its misuse, statistical power, common statistical blunders, paradoxes, and fallacies. Statistical evidence of discrimination continued, the famous Berkeley sex discrimination/Simpson’s paradox case. 24 | 25 | Week 10. Statistical dangers (part 2), continuation of previous week. Problem set 3 due. 26 | 27 | Week 11. Linear regression (and ways it can go wrong). Logistic regression as minor extension on linear regression. 28 | 29 | Week 12: Correlation vs. causation. Experiments, quasi-experiments, natural experiments. 30 | 31 | Week 13: Prediction and machine learning. Focused legal application: predicting judicial outcomes. 32 | 33 | *Possibly include an algorithmic accountability section here, returning to running example of discrimination and considering possibility of actionable discrimination by machine learning?* 34 | 35 | Week 14: Text as data, natural language processing. Focused legal application: machine-reading contracts. Problem set 4 due. 36 | 37 | Material designated for weeks 13 and 14 may be omitted if earlier weeks require more time, depending on student progress. 38 | 39 | 40 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # Introduction to Quantitative and Computational Legal Reasoning 2 | 3 | ## Introduction 4 | 5 | This is a course, to be taught by [Paul Gowder](https://gowder.io) (me) in the Spring of 2019 at the University of Iowa College of Law. It now has the unofficial name (and website) [Sociological Gobbledygook](http://sociologicalgobbledygook.com), in (dis)honor of Chief Justice Roberts and his proud innumeracy, the disinspiration for the course. 6 | 7 | The course is currently in the early stages of development, and I have decided to open source it in order to borrow from the wisdom of the wonderful legal technology and legal data community. 8 | 9 | ## Course Goals 10 | 11 | The primary goals are threefold: 12 | 13 | 1. To equip law students with a basic comfort in data-driven and computational reasoning---to have some idea of the capacities and the limitations of those tools, and can communicate intelligently with technical and scientific professionals. 14 | 15 | 2. To equip law students with more powerful bullshit detectors, especially in the domain of statistical reasoning, by giving them the capacity to poke at data-driven claims made in legal practice---generate visualizations, tweak models, and discover errors. 16 | 17 | 3. To show law students the initial steps along more involved technical paths, so that they can discover latent interests they might have in, e.g., programming, data analysis, or more directly commercial opportunities like law practice automation. 18 | 19 | The course will be aimed at an introductory level, for students who have no substantial programming experience and no math beyond high school algebra. It will introduce very basic programming (a few steps beyond Hello World) primarily as a route into computational data analysis (data visualization, basic statistical modeling). It will not go into too much mathematical depth, but will focus on manipulating data with code in order to understand it. 20 | 21 | ## Contributions solicited! 22 | 23 | As I said at the beginning of this document, this is an open source course. I have about 6 months to put it together, and I would love to have access to the wisdom of the vast legal tech/data community about how to best provide an introduction to this kind of material to law students. So, please, explore the repository, make suggestions! Feel free to file an issue, or just go all the way and file a pull request. (All text contents are in [Pandoc](http://pandoc.org/)-style Markdown.) 24 | 25 | It's licensed under a very forgiving Creative Commons license, and as it develops, I'll be creating some of my own issues with calls for suggestions and discussion (Update: just created the first one. [What are your suggestions on the tech stack for this course?](https://github.com/paultopia/quantitative-methods-for-lawyers/issues/1)). After the course is taught for the first time, I'll also invite the students to make their own contributions. 26 | 27 | Because it's licensed under Creative Commons, I hope that when the course is complete it will inspire other law professors to remix it and create their own technical offerings. Let's tech up the law! 28 | -------------------------------------------------------------------------------- /links-and-resources.md: -------------------------------------------------------------------------------- 1 | # Some Resources from Around the Web 2 | 3 | 4 | ## Other courses 5 | 6 | - [Syllabi commons](http://techforlawstudents.classcaster.net/syllabi-commons/) -- a ton of legal-tech oriented courses 7 | 8 | - Dan Katz's [Quantitative Methods](http://www.quantitativemethodsclass.com/) and [Legal Analytics](http://www.legalanalyticscourse.com/) 9 | 10 | - Carl Bergstrom & Jevin West's [Calling Bullshit](http://callingbullshit.org/) 11 | 12 | - Paul Ohm's [Computer Programming for Lawyers](https://cp4l.org/) 13 | 14 | - [Data Camp for the Classroom](https://www.datacamp.com/groups/education) 15 | 16 | - [MIT-IAP Computational Law](https://mitmedialab.github.io/2018-MIT-IAP-ComputationalLaw/) 17 | 18 | - [Hotshot Intro to Stats](https://www.hotshotlegal.com/courses/introduction-to-statistics) 19 | 20 | - David Colarusso's [Coding the Law](http://www.codingthelaw.org/) and [Data Science Demystified](http://suffolklitlab.org/howto/#demystified) 21 | 22 | - Cat Moon's [Legal Problem Solving](http://www.legalproblemsolving.org/) 23 | 24 | - Will Moore and Savid Siegel's version of a [political science math camp](http://people.duke.edu/%7Edas76/MooSieBook.html) 25 | 26 | - Wolfgang Alschner's [Data Science for Lawyers](http://www.legaldatascience.org) 27 | 28 | ## Other people and places making legal tech 29 | 30 | - [Legal Hackers](https://legalhackers.org/) 31 | 32 | - [Stanford Center for Legal Informmatics](https://law.stanford.edu/codex-the-stanford-center-for-legal-informatics/) 33 | 34 | - [Harvard Library Innovation Lab](https://lil.law.harvard.edu/) at HLS and of course [Berkman Center](https://cyber.harvard.edu/). 35 | 36 | - [Vermont Center for Legal Innovation/Jeannette Eicks](https://www.vermontlaw.edu/academics/centers-and-programs/center-for-legal-innovation) 37 | 38 | - [Suffolk Legal Innovation & Technology Lab/David Colarusso](http://suffolklitlab.org/) 39 | 40 | - [Harry Surden, Colorado](http://www.harrysurden.com/wordpress/)i 41 | 42 | - [James Grimmelmann](http://james.grimmelmann.net/) 43 | 44 | - [ABA Techshow](http://www.techshow.com/) 45 | 46 | - [Chicago-Kent Center for Access to Justice and Technology](https://www.kentlaw.iit.edu/institutes-centers/center-for-access-to-justice-and-technology) 47 | 48 | - [Open Law Lab/Margaret Hagan](http://www.openlawlab.com/) 49 | 50 | - [ABA Center for Innovation](http://abacenterforinnovation.org/) 51 | 52 | - [ABA Legal Analytics Committee (in the Business Law Section)](https://apps.americanbar.org/dch/committee.cfm?com=CL570000) 53 | 54 | ## Great Piles of Legal Data 55 | 56 | - [Courtlistener](https://www.courtlistener.com/) 57 | 58 | ## Texts, tutorials, etc. 59 | 60 | - V. David Zvenyach's [Coding for Lawyers](http://codingforlawyers.com/) 61 | 62 | - [Online Statistics Education: An Interactive Multimedia Course of Study](http://onlinestatbook.com/2/index.html) 63 | 64 | - [A really cool set of animated graphs of causal inference techniques](http://nickchk.com/causalgraphs.html) 65 | 66 | ## Inspiring code and daya projects for students 67 | 68 | - Many utilities by [V. David Zvenyach](https://esq.io/pages/projects.html) 69 | 70 | ## Little datasets for students to play with 71 | 72 | - A [collection by Vicki Boykis](http://veekaybee.github.io/2018/07/23/small-datasets/). 73 | 74 | ## Resources for teaching (tech pedagogy, misc materials and exercises, etc.) 75 | 76 | - [Teaching Tech Together](http://teachtogether.tech) 77 | 78 | - [Software Carpentry](https://software-carpentry.org) and [Data Carpentry](https://datacarpentry.org) 79 | 80 | - materials from [data8](http://data8.org) 81 | 82 | ## Free stuff for educational purposes 83 | 84 | - [DataCamp for the Classroom](https://www.datacamp.com/groups/education) (free!) 85 | 86 | - [Tableau Academic](https://www.tableau.com/academic) 87 | 88 | - [Github Education](https://education.github.com) 89 | 90 | -------------------------------------------------------------------------------- /syllabus/texts.md: -------------------------------------------------------------------------------- 1 | # Texts 2 | 3 | The main readings for this course will be drawn from [Charles Severance, Python for Everybody](https://www.py4e.com/book), which is available for free online, and [Michael Finkelstein & Bruce Levin, Statistics for Lawyers](https://link.springer.com/book/10.1007%2F978-1-4419-5985-0) which should be free to download as PDF through our library's subscription. (You may have to be on the campus network to download it; you might also have to search for it through the library's directory.) We will also (probably) be using some excerpts from the [Federal Judicial Center's Reference Manual on Scientific Evidence](https://www.fjc.gov/content/reference-manual-scientific-evidence-third-edition-1) In addition, we'll make use of some videos and exercises from [DataCamp](https://www.datacamp.com/), which has free accounts available for educational purposes; I'm in the process of signing our class up for that access. There will also be copious readings written by me available online on the public-facing website, and some copyrighted stuff that I can't distribute publicly on ICON. 4 | 5 | I am committed to only assigning resources which are free to students. However, the nature of this material is that sometimes one explanation will just "click" where another might not. So in addition to the assigned readings, I offer you this list of additional, non-free, readings which you might consult for a different perspective on the material---or for deeper engagement and exploration. 6 | 7 | 8 | 9 | ## Statistics 10 | 11 | I really like the Aspen textbook by Lawless, Robbennolt and Ulen, [Empirical Methods in Law](http://www.aspenlawschool.com/books/empirical_methods/). It has very good clear explanations of a number of research methods topics, and is not overly math-y. If you want to dig deeper into stats and empirical research in law, I highl recommend it. I also recommend Lee Epstein & Andrew Martin, [An Introduction to Empirical Legal Research](https://global.oup.com/academic/product/an-introduction-to-empirical-legal-research-9780199669066?cc=us&lang=en&). 12 | 13 | If you want to do serious research on your own, you will need to move to more advanced texts, but the direction you go will depend on the particular kind of research you want to conduct. For expermental research, especially experimental research out in the world (like the kinds of things done by discrimination testers, about which we will talk), a classic text is Gerber & Green [Field Experiments: Design, Analysis and Interpretation](https://global.oup.com/academic/product/an-introduction-to-empirical-legal-research-9780199669066?cc=us&lang=en&); if you are more interested in observational research, I really like Angrist & Pischke, [Mastering Metrics](http://masteringmetrics.com/). Both of those books are rather-more math-y than the others (or our class). 14 | 15 | Some other books that might be of interest to you, though I haven't reviewed them as closely and can't as enthusiastially endorse, include: 16 | 17 | - Peter Bruce & Andrew Bruce, Practical Statistics for Data Scientists 18 | 19 | - Michael A. Bailey, Real Stats: Using Econometrics for Political Science and Public Policy 20 | 21 | - Charles Wheelan, Naked Statistics: Stripping the Dread from the Data 22 | 23 | - Uri Bram, Thinking Statistically 24 | 25 | 26 | ## Programming 27 | 28 | My favorite introductory Python book (not free) is John Guttag, [Introduction to Computation and Programming Using Python](https://mitpress.mit.edu/books/introduction-computation-and-programming-using-python-revised-and-expanded-edition). This book is also the basis for a wonderful electronic [course by almost the same name MIT on EdX](https://www.edx.org/course/introduction-to-computer-science-and-programming-using-python) --- and you can go through the course for free, and without buying the book. I really do think that course (and the second course in the same series) is an amazing way to learn Python, and programming in general. 29 | 30 | Blessedly, there are a lot of good introductory Python programming books out there which are also available online for free. One of my favorites is Al Sweigart, [Automate the Boring Stuff with Python](https://automatetheboringstuff.com). For more advanced (and non-free) learning, I really love Luciano Ramalho's [Fluent Python](http://shop.oreilly.com/product/0636920032519.do), although by the time you need that you should be looking at building fairly substantial programs. 31 | 32 | On the whole, it is better to use a Python book that is based on Python 3, not Python 2. 33 | 34 | 35 | 36 | ## Misc/general 37 | 38 | I highly recommend Barbara Oakley's book [A Mind for Numbers](https://barbaraoakley.com/books/a-mind-for-numbers/), which is basically a self-help book on the psychology of learning difficult things---which can help you not just in math-y classes but in law school and other classes in general. There's an online course based on her book on Coursera, called [Learning How to Learn](https://www.coursera.org/learn/learning-how-to-learn); I've never looked at that course but everyone who has done so has raved about it. 39 | -------------------------------------------------------------------------------- /broad_goals.org: -------------------------------------------------------------------------------- 1 | * Programming 2 | 3 | ** Be able to write basic programs to automate repetitive tasks 4 | 5 | *** Fundamentals of programming: variables, loops, data types, 6 | functions, state 7 | 8 | Problem set 1: classic beginners programming problem, like hangman or 9 | something, 10 | 11 | **** Objects and basic OOP?? 12 | 13 | *** Libraries, installing and using 14 | 15 | Conceptually, this follows nicely from functions: it's just another form 16 | of code modularity/reuse. Will have to explain some of the stuff under 17 | the surface about dependencies, how the same model tracks out to 18 | unixland etc. 19 | 20 | *** Access data 21 | 22 | **** Open files 23 | 24 | **** Make network requests 25 | 26 | ***** And api calls? 27 | 28 | This is another excuse for courtlistener data, since they have a nice 29 | API. Also case.law? They also have a great "beginner's introduction to 30 | APIs" https://case.law/api/#beginners 31 | 32 | *** Problem-solve with code 33 | 34 | **** Work through problem sets with realistic tasks 35 | 36 | Problem set 2: do something interesting with legal text data, like Enron 37 | or courtlistener. Probably make some graphs too. 38 | 39 | **** Distinctive legal tasks 40 | 41 | ***** String manipulation, regex 42 | 43 | This also suggests Enron data or courtlistener/case.law. Could ask them 44 | to, for example, extract all citations from a particular case... or even 45 | from a brief! 46 | 47 | ** Be able to engage in basic data visualization and exploration 48 | 49 | *** Common libraries 50 | 51 | **** Pandas, Seaborn 52 | 53 | *** Plotting toolkit 54 | 55 | **** Histograms 56 | 57 | **** Scatterplots 58 | 59 | **** Boxplots 60 | 61 | *** Exploratory data analysis toolkit 62 | 63 | **** Crosstabs 64 | 65 | **** Maybe some fancy pandas stuff? 66 | 67 | **** Measures of central tendency 68 | 69 | **** Basic properties of data (discrete vs continuous etc.) 70 | 71 | **** Standard deviation, percentiles, etc. 72 | 73 | ** Be able to learn more, have an intellectual foundation 74 | 75 | *** Perhaps exposure to other programming languages for purposes of 76 | comparison/abstraction? (Javascript? R? Racket??!!) 77 | 78 | * Stats 79 | 80 | ** Understand basic ideas of probability 81 | 82 | *** Randomness, variables 83 | 84 | Maybe they need this, maybe they don't? Will help with understanding 85 | presentation of stats stuff in other texts? 86 | 87 | *** Expectation 88 | 89 | Connect to expected value from Econ? Also, this conceptual level stuff 90 | they definitely need because every proof in stats relies on properties 91 | of expectations---should work students through an example from a real 92 | text somewhere, possibly from mastering metrics or gerber/green or 93 | something. 94 | 95 | Loss of a chance in torts possibly comes in here too. 96 | 97 | *** Bayes rule, conditional probability, independence 98 | 99 | Legal application: sobriety testing. Is there actual evidence on this 100 | somewhere? Also, laser speed detectors! And maybe hair follicle testing? 101 | DNA tests? 102 | 103 | ** Distributions 104 | 105 | *** Conceptual understanding, PDF and CDF, how they help us 106 | 107 | *** Normal distribution and central limit theorem 108 | 109 | *** Other common distributions and where they appear 110 | 111 | **** Binomial, poisson, etc. 112 | 113 | **** With practical examples of how this is usable 114 | 115 | IRS tax fraud detection with distribution of numbers? General empirical 116 | verification of distributions? We're not going to get into 117 | non-parametric modeling and such. 118 | 119 | ** Causal analysis 120 | 121 | *** Classic build-up from RCTs to controls and such, rooted in matching 122 | 123 | *** Conceptual introduction to econometrics 124 | 125 | *** Prediction vs inference 126 | 127 | *** Some of the causal diagram stuff from Book of Why maybe?! 128 | 129 | ** Hypothesis testing 130 | 131 | *** Relationship to distributions and to causal analysis (get the 132 | conceptual stuff sound) 133 | 134 | Do this graphically. Show the statistically significant areas of 135 | distros, etc. This may be a way to sneak in learning about libraries in 136 | a lower-level: have students install a teaching library that just has my 137 | code for generating all of these graphics. And give them documentation 138 | in standard programmer style, make them look at the vis via calls. 139 | 140 | *** Classic boring stuff: chi\^2, anova, t-test, etc. 141 | 142 | Go through this quickly, as I believe it's what shows up in AP classes, 143 | undergrad psych majors, etc. 144 | 145 | ** Regression 146 | 147 | Problem set 3 to cover the core stats material and regression, longer 148 | and bigger in grade than prior 2. 149 | 150 | Possibly better to have some mini problem sets as well, or break up set 151 | 3 into 2 parts and have five psets total? One problem set is really not 152 | enough practice. 153 | 154 | *** Basic idea as line-fitting 155 | 156 | *** Assumptions and their fragility 157 | 158 | *** Logit 159 | 160 | ** Ways to screw up 161 | 162 | Problem set 4 should come from this material, but also be comprehensive: 163 | e.g., critique analysis, analyze a dataset without screwing up. Also can 164 | incorporate bias material, essentially can be like a law school final 165 | (but longer and take home) where the fact pattern is some preexisting 166 | analysis and facts and data surrounding it, and students are to analyze. 167 | 168 | *** P-values and their dangers 169 | 170 | *** Simpson's paradox 171 | 172 | Berkeley sex discrimination example 173 | 174 | *** Greiner critique of regression 175 | 176 | (griener? Harvard guy with the synthetic discrimination dataset) 177 | 178 | *** Power and underpoweredness 179 | 180 | Should discuss the replication crisis in psychology here. 181 | 182 | * Frontiers (time permitting) 183 | 184 | ** Machine learning and prediction 185 | 186 | Predicting judicial results, let them just read papers 187 | 188 | ** Algorithmic bias, role of lawyers in 189 | 190 | And existence in legal system. Predictive policing, new CA bail 191 | alternative in risk assessment. Maybe have them read Virginia Eubanks 192 | work, such as child abuse one : 193 | https://www.wired.com/story/excerpt-from-automating-inequality/ 194 | 195 | This is probably much more important, given time limitations, than 196 | predicting judicial results. 197 | -------------------------------------------------------------------------------- /syllabus/manifesto.md: -------------------------------------------------------------------------------- 1 | # Course Manifesto 2 | 3 | In 2018, lawyers need quantitative and computational comfort. 4 | 5 | ## Quantitative Comfort 6 | 7 | The practice of law has always had an uncomfortable relationship with mathematical thinking. Many students find themselves in law school in part out of a discomfort with math, and this discomfort continues even to the highest levels of the legal profession. For example, in oral argument in Gil v. Whitford Chief Justice Roberts famously described the use of quantitative measures of gerrymandering as “sociological gobbledygook” and objected to its use on the basis of not only his personal discomfort but also a sense that the public would question the fairness and legitimacy of a court that used such a mathematical measure: 8 | 9 | > And if you're the intelligent man on the street and the Court issues a decision, and let's say, okay, the Democrats win, and that person will say: "Well, why did the Democrats win?" And the answer is going to be because EG was greater than 7 percent, where EG is the sigma of party X wasted votes minus the sigma of party Y wasted votes over the sigma of party X votes plus party Y votes. And the intelligent man on the street is going to say that's a bunch of baloney. It must be because the Supreme Court preferred the Democrats over the Republicans. 10 | 11 | Yet the modern practice of law requires comfort with mathematical claims and methods in many areas. Most important for legal practice is a familiarity with probability and statistics, which will allow lawyers to understand and begin to answer (or communicate with experts about answering questions like): 12 | 13 | - Is the racial disparity (in employment, housing, jury challenges) substantially more stark than would have been expected by mere chance? 14 | 15 | - If I know the measured accuracy of the test (BreathAlyzer, radar gun, urinalysis, genetic test) taken by the defendant, what is the chance that the defendant has been falsely accused? (The correct answer to this question is less obvious than you think!) 16 | 17 | *TODO: add more examples* 18 | 19 | Moreover, the expert witnesses that lawyers so often rely upon are often called upon to make claims based on statistical evidence—and a lawyer who is equipped to understand the basic ways this evidence can go wrong will be better able to defend or attack the credibility of that testimony. These kinds of errors can lead to dire consequences: in 2015, the FBI admitted that “at least 90 percent” of the cases over a period of decades in which its hair follicle examiners testified, those examiners overstated the significance of their data. Most troublingly, known errors appeared in 33 of 35 cases in which defendants were sentenced to death.^[FBI Press Release, April 20, 2015, [https://www.fbi.gov/news/pressrel/press-releases/fbi-testimony-on-microscopic-hair-analysis-contained-errors-in-at-least-90-percent-of-cases-in-ongoing-review](https://www.fbi.gov/news/pressrel/press-releases/fbi-testimony-on-microscopic-hair-analysis-contained-errors-in-at-least-90-percent-of-cases-in-ongoing-review)] Perhaps prosecutors or defense lawyers with some familiarity with probability and statistics could have prevented some of these terrible mistakes. 20 | 21 | The first goal of this course will be to endow students with sufficient quantitative comfort to be competent consumers of statistical and probabilistic claims. The course will not enable students to carry out original rigorous scientific analysis, but it will enable them to understand and critically examine statistical probabilistic claims often made in legal contexts. It will also enable them to do the most fundamental math for empirical claims, such as calculation of posterior probabilities and understanding of the properties of various statistical distributions, confidence intervals, and other mathematical artifacts. 22 | 23 | ## Computational Comfort 24 | 25 | The legal profession is also rapidly being disrupted by technological advancements. “Predictive coding” systems using machine learning techniques are replacing lawyers in the discovery process, computational legal research is becoming integrated with artificial intelligence, and startups are offering basic legal services such as contracts and wills in computationally facilitated forms that allow customers to avoid consulting with a lawyer. Moreover, the continuing growth of the technological sector of the economy creates a demand for lawyers who understand technical concepts—at least well enough to communicate about them with expert witnesses and jurors.^[See Michaela Ross, “Tech-Savvy Attorneys in Heavy Demand Amid Emerging Tech,” Bloomberg BNA, February 22, 2018, [https://www.bna.com/techsavvy-attorneys-heavy-n57982089186/](https://www.bna.com/techsavvy-attorneys-heavy-n57982089186/)] Finally, increasing evidence appears in the form of “eDiscovery,” which requires special technological skills to handle. 26 | 27 | At the same time, there are strong indications that lawyers lack even a minimal level of technical competence. Even that unavoidable tool of legal practice, Microsoft Word, seems to cause lawyers no end of (expensive and time-wasting) problems.^[See D. Casey Flaherty, “Could you pass this in-house counsel’s tech test? If the answer is no, you may be losing business,” ABA Journal, July 27, 2013, [http://www.abajournal.com/legalrebels/article/could_you_pass_this_in-house_counsels_tech_test](http://www.abajournal.com/legalrebels/article/could_you_pass_this_in-house_counsels_tech_test)] I shiver to consider the problems that lawyers have with more complicated and important technical skills, like choosing secure data storage and communication options to protect client information. 28 | 29 | This course cannot (and will not attempt to) teach Microsoft Word or encryption and information security. But it can teach basic technological comfort, and even a few superpowers, through offering a deeper understanding of the logic and basic tools of computer programming. Through basic computer programming, lawyers can automate many of the most tedious tasks of their professional lives and save their clients money and themselves time—particularly tasks involving the processing of large volumes of text. 30 | 31 | More interestingly, programming skills offer deep synergies with statistical skills. A lawyer who can use a computer to look at data can use statistical computing tools to double-check the claims made by others about the data that shows up in the practice of law, tweak statistical tests to “stress-test” those claims, and visualize data in order to catch mistakes and false assumptions on which those claims depend. And by learning basic programming prior to statistics, a lawyer can make use of statistical data without relying either on expensive and rigid dedicated statistical software like STATA and SPSS, or, worse, struggling through the math by hand. 32 | 33 | The second goal of the course will be to endow students with basic programming and statistical computation capacity, using the Python programming language. The course does not aim to produce programmers, but rather to produce lawyers with the skills to work with text and with data in a computational form. 34 | -------------------------------------------------------------------------------- /lessons/week1/landlord_tenant.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# Representing Basic Landlord-Tenant Law\n", 8 | "\n", 9 | "The logic of the law and the logic of computers aren't that different. If you remember back to the logic games section of the LSAT, effectively what you were demonstrating was your ability to engage in structured, conditional reasoning---exactly the same kind of reasoning you have to do when you read a statute, and the kind of reasoning that computers do (and that you have to model) when you program. \n", 10 | "\n", 11 | "To illustrate this, let's represent a few pieces of [Iowa's Landlord-Tenant Act](https://www.legis.iowa.gov/docs/code/562a.pdf) in code. \n", 12 | "\n", 13 | "In order to do this, we'll introduce a new programming idea, the **class**. Basically, a class is a way to collect data of a specific shape, and stuff that you can do with the data, together in a convenient way. You can define a class with the class keyword, and then you can instantiate individual cases of a class (\"instances\" or \"objects\") by calling it like a function. Let's look at an example." 14 | ] 15 | }, 16 | { 17 | "cell_type": "code", 18 | "execution_count": 1, 19 | "metadata": {}, 20 | "outputs": [], 21 | "source": [ 22 | "class Termination_Notice(object):\n", 23 | " def __init__(self, termination_days):\n", 24 | " self.termination_days = termination_days\n", 25 | " \n", 26 | " def has_adequate_notice(self, days_given):\n", 27 | " if days_given >= self.termination_days:\n", 28 | " return True\n", 29 | " return False" 30 | ] 31 | }, 32 | { 33 | "cell_type": "markdown", 34 | "metadata": {}, 35 | "source": [ 36 | "Let's go through that code.\n", 37 | "\n", 38 | " class Termination_Notice(object):\n", 39 | "\n", 40 | "The `class` keyword is how you declare a class. By convention, classes start with a capital letter (though they don't have to). The thing in parens is what the class *inherits* from, but you don't need to worry about that now---just know that most classes we'll create in this course will inherit from object. (Consider it a kind of boilerplate). \n", 41 | "\n", 42 | "As is usual for Python syntax, we designate that a bunch of stuff that follows will be part of this class by a colon, and then by indenting the stuff that goes inside to follow. \n", 43 | "\n", 44 | " def __init__(self, termination_days):\n", 45 | " self.termination_days = termination_days\n", 46 | "\n", 47 | "This should look familiar. It's a function definition. However, a function definition inside a class is called a *method*---it's a function that belongs to an instance of that class, and we call it by appending it to its owner with a period (we'll see an example of this in a moment). \n", 48 | "\n", 49 | "Every method takes a special first parameter, by convention called `self`. This is the actual instance of the class that it belongs to, and allows you to access and change properties of that instance (the data it stores). You don't have to pass that in when you call it, it's implicitly passed in. So this method, when called on an instance of `Termination_Notice`, takes one parameter, `termination_days`, and sets that to the value locked up in the object. \n", 50 | "\n", 51 | "Every class has a special `__init__` method (that's two underscores on either side) that specifies what happens when you intialize the class.\n", 52 | "\n", 53 | "Let's take a look at how this works." 54 | ] 55 | }, 56 | { 57 | "cell_type": "code", 58 | "execution_count": 2, 59 | "metadata": {}, 60 | "outputs": [], 61 | "source": [ 62 | "iowa_termination_for_nonpayment = Termination_Notice(3)" 63 | ] 64 | }, 65 | { 66 | "cell_type": "code", 67 | "execution_count": 3, 68 | "metadata": {}, 69 | "outputs": [ 70 | { 71 | "name": "stdout", 72 | "output_type": "stream", 73 | "text": [ 74 | "3\n" 75 | ] 76 | } 77 | ], 78 | "source": [ 79 | "print(iowa_termination_for_nonpayment.termination_days)" 80 | ] 81 | }, 82 | { 83 | "cell_type": "markdown", 84 | "metadata": {}, 85 | "source": [ 86 | "As you can see, we initialized an instance of `Termination_Notice` called `iowa_termination_for_nonpayment` with a `termination_days` value of 3, and then looked at the object and saw that the value stuck around. \n", 87 | "\n", 88 | "**This represents a legal fact**: Iowa Code 562A.27(2) provides that a landlord may give a three-day notice to a tenant if the rent isn't paid on time, and then may file a lawsuit to evict them if they don't pay within the three days. Because we created an abstract `Termination_Notice` class, we can specify Iowa's particular rule as an instance of a class. If some other state, say, Hawkeye, has a five-day notice, we could also do something like `hawkeye_termination_for_nonpayment = Termination_Notice(5)` and represent Hawkeye's rule.\n", 89 | "\n", 90 | "In other words, the class `Termination_Notice` represents the abstract concept of a rule for how long notice the landlord has to give you, and then individual instances of that class represent the specific rules of particular states in specific situations." 91 | ] 92 | }, 93 | { 94 | "cell_type": "code", 95 | "execution_count": 4, 96 | "metadata": {}, 97 | "outputs": [ 98 | { 99 | "name": "stdout", 100 | "output_type": "stream", 101 | "text": [ 102 | "The landlord gave enough notice, the eviction may proceed.\n" 103 | ] 104 | } 105 | ], 106 | "source": [ 107 | "def judge_the_landlord(termination_notice_rule, days_given):\n", 108 | " if termination_notice_rule.has_adequate_notice(days_given):\n", 109 | " print(\"The landlord gave enough notice, the eviction may proceed.\")\n", 110 | " else:\n", 111 | " print(\"The landlord did not give enough notice, dismiss the eviction.\")\n", 112 | "\n", 113 | "judge_the_landlord(iowa_termination_for_nonpayment, 3)" 114 | ] 115 | }, 116 | { 117 | "cell_type": "code", 118 | "execution_count": 5, 119 | "metadata": {}, 120 | "outputs": [ 121 | { 122 | "name": "stdout", 123 | "output_type": "stream", 124 | "text": [ 125 | "The landlord did not give enough notice, dismiss the eviction.\n" 126 | ] 127 | } 128 | ], 129 | "source": [ 130 | "judge_the_landlord(iowa_termination_for_nonpayment, 2)" 131 | ] 132 | }, 133 | { 134 | "cell_type": "markdown", 135 | "metadata": {}, 136 | "source": [ 137 | "Do you see what just happened here? We created a function, `judge_the_landlord` that takes an instance of some kind of termination rule, as well as a number of days of notice that the landlord gave, and then checks to see whether they've followed the law. You could imagine a more complex version of this function as something we might provide to a judge in a landlord-tenant court to keep them from making mistakes about how many days notice the landlord has to give. \n", 138 | "\n", 139 | "Notice how within the body of the function we have the call `termination_notice_rule.has_adequate_notice(days_given)`. This is what a method call looks like: our function takes whatever termination notice rule got passed into our function, and calls its `has_adequate_notice` method with the number of days provided. \n", 140 | "\n", 141 | "So long as we use this same general form, we can represent other notice rules as well. For example, Iowa Code 562a.34(1) provides that a landlord may terminate a week-to-week tenancy for no cause with 10 days notice, and a month-to-month or longer tenancy for no cause with 30 days notice. Let's make an instance for that, and then we can use the same function to test our new rule." 142 | ] 143 | }, 144 | { 145 | "cell_type": "code", 146 | "execution_count": 6, 147 | "metadata": {}, 148 | "outputs": [], 149 | "source": [ 150 | "iowa_weekly_nocause = Termination_Notice(7)" 151 | ] 152 | }, 153 | { 154 | "cell_type": "markdown", 155 | "metadata": {}, 156 | "source": [ 157 | "Now we've identified the fact that there are different rules for different situations by having different rule instances, and we can use code to represent the fact that, say, a five-day notice is sufficient for nonpayment, but insufficient for no cause eviction on a weekly lease." 158 | ] 159 | }, 160 | { 161 | "cell_type": "code", 162 | "execution_count": 7, 163 | "metadata": {}, 164 | "outputs": [ 165 | { 166 | "name": "stdout", 167 | "output_type": "stream", 168 | "text": [ 169 | "The landlord gave enough notice, the eviction may proceed.\n" 170 | ] 171 | } 172 | ], 173 | "source": [ 174 | "notice_ll_gave = 5\n", 175 | "judge_the_landlord(iowa_termination_for_nonpayment, notice_ll_gave)" 176 | ] 177 | }, 178 | { 179 | "cell_type": "code", 180 | "execution_count": 8, 181 | "metadata": {}, 182 | "outputs": [ 183 | { 184 | "name": "stdout", 185 | "output_type": "stream", 186 | "text": [ 187 | "The landlord did not give enough notice, dismiss the eviction.\n" 188 | ] 189 | } 190 | ], 191 | "source": [ 192 | "judge_the_landlord(iowa_weekly_nocause, notice_ll_gave)" 193 | ] 194 | }, 195 | { 196 | "cell_type": "markdown", 197 | "metadata": {}, 198 | "source": [ 199 | "## More date calculations, FRCP edition\n", 200 | "\n", 201 | "Now let's try to do something a little more complicated (and without any classes). The Federal Rules of Civil Procedure has a rule [just about calculating dates](https://www.law.cornell.edu/rules/frcp/rule_6). Let's represent it in code!" 202 | ] 203 | }, 204 | { 205 | "cell_type": "code", 206 | "execution_count": 9, 207 | "metadata": {}, 208 | "outputs": [], 209 | "source": [ 210 | "# if you don't already have dateutil installed (the next cell will throw an error), \n", 211 | "# then uncomment and run the next line \n", 212 | "# !pip install python-dateutil\n", 213 | "# !pip install pytz" 214 | ] 215 | }, 216 | { 217 | "cell_type": "code", 218 | "execution_count": 10, 219 | "metadata": {}, 220 | "outputs": [ 221 | { 222 | "name": "stdout", 223 | "output_type": "stream", 224 | "text": [ 225 | "\n" 226 | ] 227 | } 228 | ], 229 | "source": [ 230 | "from dateutil.tz import gettz\n", 231 | "from dateutil.relativedelta import relativedelta\n", 232 | "from datetime import datetime\n", 233 | "\n", 234 | "def local_time_now():\n", 235 | " return datetime.now(gettz())\n", 236 | "\n", 237 | "print()" 238 | ] 239 | }, 240 | { 241 | "cell_type": "code", 242 | "execution_count": 11, 243 | "metadata": {}, 244 | "outputs": [ 245 | { 246 | "data": { 247 | "text/plain": [ 248 | "'CDT'" 249 | ] 250 | }, 251 | "execution_count": 11, 252 | "metadata": {}, 253 | "output_type": "execute_result" 254 | } 255 | ], 256 | "source": [ 257 | "datetime.now(gettz()).tzname()" 258 | ] 259 | }, 260 | { 261 | "cell_type": "code", 262 | "execution_count": 12, 263 | "metadata": {}, 264 | "outputs": [], 265 | "source": [ 266 | "def local_time_now():\n", 267 | " return datetime.now(gettz())" 268 | ] 269 | }, 270 | { 271 | "cell_type": "code", 272 | "execution_count": 13, 273 | "metadata": {}, 274 | "outputs": [ 275 | { 276 | "data": { 277 | "text/plain": [ 278 | "datetime.datetime(2018, 7, 30, 17, 34, 35, 495811, tzinfo=tzfile('/etc/localtime'))" 279 | ] 280 | }, 281 | "execution_count": 13, 282 | "metadata": {}, 283 | "output_type": "execute_result" 284 | } 285 | ], 286 | "source": [ 287 | "local_time_now()" 288 | ] 289 | }, 290 | { 291 | "cell_type": "code", 292 | "execution_count": 14, 293 | "metadata": {}, 294 | "outputs": [], 295 | "source": [ 296 | "# WIP, to be contined. sorting through datetime libraries (probably should use pytz) to avoid stupidity" 297 | ] 298 | }, 299 | { 300 | "cell_type": "code", 301 | "execution_count": null, 302 | "metadata": {}, 303 | "outputs": [], 304 | "source": [] 305 | } 306 | ], 307 | "metadata": { 308 | "kernelspec": { 309 | "display_name": "gobbledygook_lessons", 310 | "language": "python", 311 | "name": "gobbledygook_lessons" 312 | }, 313 | "language_info": { 314 | "codemirror_mode": { 315 | "name": "ipython", 316 | "version": 3 317 | }, 318 | "file_extension": ".py", 319 | "mimetype": "text/x-python", 320 | "name": "python", 321 | "nbconvert_exporter": "python", 322 | "pygments_lexer": "ipython3", 323 | "version": "3.6.4" 324 | } 325 | }, 326 | "nbformat": 4, 327 | "nbformat_minor": 1 328 | } 329 | -------------------------------------------------------------------------------- /lessons/Pipfile.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_meta": { 3 | "hash": { 4 | "sha256": "f9166881e2ce66ea018334a6aa0fae64f2adc1cbee0b73069b7ed2e2340d1acc" 5 | }, 6 | "pipfile-spec": 6, 7 | "requires": { 8 | "python_version": "3.6" 9 | }, 10 | "sources": [ 11 | { 12 | "name": "pypi", 13 | "url": "https://pypi.python.org/simple", 14 | "verify_ssl": true 15 | } 16 | ] 17 | }, 18 | "default": { 19 | "babel": { 20 | "hashes": [ 21 | "sha256:6778d85147d5d85345c14a26aada5e478ab04e39b078b0745ee6870c2b5cf669", 22 | "sha256:8cba50f48c529ca3fa18cf81fa9403be176d374ac4d60738b839122dfaaa3d23" 23 | ], 24 | "version": "==2.6.0" 25 | }, 26 | "cycler": { 27 | "hashes": [ 28 | "sha256:1d8a5ae1ff6c5cf9b93e8811e581232ad8920aeec647c37316ceac982b08cb2d", 29 | "sha256:cd7b2d1018258d7247a71425e9f26463dfb444d411c39569972f4ce586b0c9d8" 30 | ], 31 | "version": "==0.10.0" 32 | }, 33 | "delorean": { 34 | "hashes": [ 35 | "sha256:fe67786e12338523848bec5588a658c4d425e12d53eb51cfef870bec8f576134" 36 | ], 37 | "index": "pypi", 38 | "version": "==1.0.0" 39 | }, 40 | "humanize": { 41 | "hashes": [ 42 | "sha256:a43f57115831ac7c70de098e6ac46ac13be00d69abbf60bdcac251344785bb19" 43 | ], 44 | "version": "==0.5.1" 45 | }, 46 | "kiwisolver": { 47 | "hashes": [ 48 | "sha256:0ee4ed8b3ae8f5f712b0aa9ebd2858b5b232f1b9a96b0943dceb34df2a223bc3", 49 | "sha256:0f7f532f3c94e99545a29f4c3f05637f4d2713e7fd91b4dd8abfc18340b86cd5", 50 | "sha256:1a078f5dd7e99317098f0e0d490257fd0349d79363e8c923d5bb76428f318421", 51 | "sha256:1aa0b55a0eb1bd3fa82e704f44fb8f16e26702af1a073cc5030eea399e617b56", 52 | "sha256:2874060b91e131ceeff00574b7c2140749c9355817a4ed498e82a4ffa308ecbc", 53 | "sha256:379d97783ba8d2934d52221c833407f20ca287b36d949b4bba6c75274bcf6363", 54 | "sha256:3b791ddf2aefc56382aadc26ea5b352e86a2921e4e85c31c1f770f527eb06ce4", 55 | "sha256:4329008a167fac233e398e8a600d1b91539dc33c5a3eadee84c0d4b04d4494fa", 56 | "sha256:45813e0873bbb679334a161b28cb9606d9665e70561fd6caa8863e279b5e464b", 57 | "sha256:53a5b27e6b5717bdc0125338a822605084054c80f382051fb945d2c0e6899a20", 58 | "sha256:574f24b9805cb1c72d02b9f7749aa0cc0b81aa82571be5201aa1453190390ae5", 59 | "sha256:66f82819ff47fa67a11540da96966fb9245504b7f496034f534b81cacf333861", 60 | "sha256:79e5fe3ccd5144ae80777e12973027bd2f4f5e3ae8eb286cabe787bed9780138", 61 | "sha256:83410258eb886f3456714eea4d4304db3a1fc8624623fc3f38a487ab36c0f653", 62 | "sha256:8b6a7b596ce1d2a6d93c3562f1178ebd3b7bb445b3b0dd33b09f9255e312a965", 63 | "sha256:9576cb63897fbfa69df60f994082c3f4b8e6adb49cccb60efb2a80a208e6f996", 64 | "sha256:95a25d9f3449046ecbe9065be8f8380c03c56081bc5d41fe0fb964aaa30b2195", 65 | "sha256:a424f048bebc4476620e77f3e4d1f282920cef9bc376ba16d0b8fe97eec87cde", 66 | "sha256:aaec1cfd94f4f3e9a25e144d5b0ed1eb8a9596ec36d7318a504d813412563a85", 67 | "sha256:acb673eecbae089ea3be3dcf75bfe45fc8d4dcdc951e27d8691887963cf421c7", 68 | "sha256:b15bc8d2c2848a4a7c04f76c9b3dc3561e95d4dabc6b4f24bfabe5fd81a0b14f", 69 | "sha256:b1c240d565e977d80c0083404c01e4d59c5772c977fae2c483f100567f50847b", 70 | "sha256:c595693de998461bcd49b8d20568c8870b3209b8ea323b2a7b0ea86d85864694", 71 | "sha256:ce3be5d520b4d2c3e5eeb4cd2ef62b9b9ab8ac6b6fedbaa0e39cdb6f50644278", 72 | "sha256:e0f910f84b35c36a3513b96d816e6442ae138862257ae18a0019d2fc67b041dc", 73 | "sha256:ea36e19ac0a483eea239320aef0bd40702404ff8c7e42179a2d9d36c5afcb55c", 74 | "sha256:efabbcd4f406b532206b8801058c8bab9e79645b9880329253ae3322b7b02cd5", 75 | "sha256:f923406e6b32c86309261b8195e24e18b6a8801df0cfc7814ac44017bfcb3939" 76 | ], 77 | "version": "==1.0.1" 78 | }, 79 | "matplotlib": { 80 | "hashes": [ 81 | "sha256:07055eb872fa109bd88f599bdb52065704b2e22d475b67675f345d75d32038a0", 82 | "sha256:0f2f253d6d51f5ed52a819921f8a0a8e054ce0daefcfbc2557e1c433f14dc77d", 83 | "sha256:1770b70622b78f3fd76638526b8c176af8b23a0b129e0190d9407fa403855e0c", 84 | "sha256:1ef9fd285334bd6b0495b6de9d56a39dc95081577f27bafabcf28e0d318bed31", 85 | "sha256:3eb17a4dc45e1ceefb899423e8152e10169fa281f960421c762fd8532186c323", 86 | "sha256:3fb2db66ef98246bafc04b4ef4e9b0e73c6369f38a29716844e939d197df816a", 87 | "sha256:3fd90b407d1ab0dae686a4200030ce305526ff20b85a443dc490d194114b2dfa", 88 | "sha256:45dac8589ef1721d7f2ab0f48f986694494dfcc5d13a3e43a5cb6c816276094e", 89 | "sha256:4bb10087e09629ba3f9b25b6c734fd3f99542f93d71c5b9c023f28cb377b43a9", 90 | "sha256:4dc7ef528aad21f22be85e95725234c5178c0f938e2228ca76640e5e84d8cde8", 91 | "sha256:4f6a516d5ef39128bb16af7457e73dde25c30625c4916d8fbd1cc7c14c55e691", 92 | "sha256:70f0e407fbe9e97f16597223269c849597047421af5eb8b60dbaca0382037e78", 93 | "sha256:7b3d03c876684618e2a2be6abeb8d3a033c3a1bb38a786f751199753ef6227e6", 94 | "sha256:8944d311ce37bee1ba0e41a9b58dcf330ffe0cf29d7654c3d07c572215da68ac", 95 | "sha256:8ff08eaa25c66383fe3b6c7eb288da3c22dcedc4b110a0b592b35f68d0e093b2", 96 | "sha256:9d12378d6a236aa38326e27f3a29427b63edce4ce325745785aec1a7535b1f85", 97 | "sha256:abfd3d9390eb4f2d82cbcaa3a5c2834c581329b64eccb7a071ed9d5df27424f7", 98 | "sha256:bc4d7481f0e8ec94cb1afc4a59905d6274b3b4c389aba7a2539e071766671735", 99 | "sha256:c78883145da9b5620aec523fa14ea814e07f2ba26a16b7f68ff7300604a911b3", 100 | "sha256:dc0ba2080fd0cfdd07b3458ee4324d35806733feb2b080838d7094731d3f73d9", 101 | "sha256:f26fba7fc68994ab2805d77e0695417f9377a00d36ba4248b5d0f1e5adb08d24", 102 | "sha256:f397479742c1ca31805a4bffdfcc5f6189a31116b79aa0b83a50c689f42a23bb" 103 | ], 104 | "index": "pypi", 105 | "version": "==2.2.2" 106 | }, 107 | "numpy": { 108 | "hashes": [ 109 | "sha256:14fb76bde161c87dcec52d91c78f65aa8a23aa2e1530a71f412dabe03927d917", 110 | "sha256:21041014b7529237994a6b578701c585703fbb3b1bea356cdb12a5ea7804241c", 111 | "sha256:24f3bb9a5f6c3936a8ccd4ddfc1210d9511f4aeb879a12efd2e80bec647b8695", 112 | "sha256:34033b581bc01b1135ca2e3e93a94daea7c739f21a97a75cca93e29d9f0c8e71", 113 | "sha256:3fbccb399fe9095b1c1d7b41e7c7867db8aa0d2347fc44c87a7a180cedda112b", 114 | "sha256:50718eea8e77a1bedcc85befd22c8dbf5a24c9d2c0c1e36bbb8d7a38da847eb3", 115 | "sha256:55daf757e5f69aa75b4477cf4511bf1f96325c730e4ad32d954ccb593acd2585", 116 | "sha256:61efc65f325770bbe787f34e00607bc124f08e6c25fdf04723848585e81560dc", 117 | "sha256:62cb836506f40ce2529bfba9d09edc4b2687dd18c56cf4457e51c3e7145402fd", 118 | "sha256:64c6acf5175745fd1b7b7e17c74fdbfb7191af3b378bc54f44560279f41238d3", 119 | "sha256:674ea7917f0657ddb6976bd102ac341bc493d072c32a59b98e5b8c6eaa2d5ec0", 120 | "sha256:73a816e441dace289302e04a7a34ec4772ed234ab6885c968e3ca2fc2d06fe2d", 121 | "sha256:78c35dc7ad184aebf3714dbf43f054714c6e430e14b9c06c49a864fb9e262030", 122 | "sha256:7f17efe9605444fcbfd990ba9b03371552d65a3c259fc2d258c24fb95afdd728", 123 | "sha256:816645178f2180be257a576b735d3ae245b1982280b97ae819550ce8bcdf2b6b", 124 | "sha256:924f37e66db78464b4b85ed4b6d2e5cda0c0416e657cac7ccbef14b9fa2c40b5", 125 | "sha256:a17a8fd5df4fec5b56b4d11c9ba8b9ebfb883c90ec361628d07be00aaa4f009a", 126 | "sha256:aaa519335a71f87217ca8a680c3b66b61960e148407bdf5c209c42f50fe30f49", 127 | "sha256:ae3864816287d0e86ead580b69921daec568fe680857f07ee2a87bf7fd77ce24", 128 | "sha256:b5f8c15cb9173f6cdf0f994955e58d1265331029ae26296232379461a297e5f2", 129 | "sha256:c3ac359ace241707e5a48fe2922e566ac666aacacf4f8031f2994ac429c31344", 130 | "sha256:c7c660cc0209fdf29a4e50146ca9ac9d8664acaded6b6ae2f5d0ae2e91a0f0cd", 131 | "sha256:d690a2ff49f6c3bc35336693c9924fe5916be3cc0503fe1ea6c7e2bf951409ee", 132 | "sha256:e2317cf091c2e7f0dacdc2e72c693cc34403ca1f8e3807622d0bb653dc978616", 133 | "sha256:f28e73cf18d37a413f7d5de35d024e6b98f14566a10d82100f9dc491a7d449f9", 134 | "sha256:f2a778dd9bb3e4590dbe3bbac28e7c7134280c4ec97e3bf8678170ee58c67b21", 135 | "sha256:f5a758252502b466b9c2b201ea397dae5a914336c987f3a76c3741a82d43c96e", 136 | "sha256:fb4c33a404d9eff49a0cdc8ead0af6453f62f19e071b60d283f9dc05581e4134" 137 | ], 138 | "index": "pypi", 139 | "version": "==1.15.0" 140 | }, 141 | "pandas": { 142 | "hashes": [ 143 | "sha256:05ac350f8a35abe6a02054f8cf54e0c048f13423b2acb87d018845afd736f0b4", 144 | "sha256:174543cd68eaee60620146b38faaed950071f5665e0a4fa4adfdcfc23d7f7936", 145 | "sha256:1a62a237fb7223c11d09daaeaf7d15f234bb836bfaf3d4f85746cdf9b2582f99", 146 | "sha256:2c1ed1de5308918a7c6833df6db75a19c416c122921824e306c64a0626b3606c", 147 | "sha256:33825ad26ce411d6526f903b3d02c0edf627223af59cf4b5876aa925578eec74", 148 | "sha256:4c5f76fce8a4851f65374ea1d95ca24e9439540550e41e556c0879379517a6f5", 149 | "sha256:67504a96f72fb4d7f051cfe77b9a7bb0d094c4e2e5a6efb2769eb80f36e6b309", 150 | "sha256:683e0cc8c7faececbbc06aa4735709a07abad106099f165730c1015da916adec", 151 | "sha256:77cd1b485c6a860b950ab3a85be7b5683eaacbc51cadf096db967886607d2231", 152 | "sha256:814f8785f1ab412a7e9b9a8abb81dfe8727ebdeef850ecfaa262c04b1664000f", 153 | "sha256:894216edaf7dd0a92623cdad423bbec2a23fc06eb9c85483e21876d1ef8f47e9", 154 | "sha256:9331e20a07360b81d8c7b4b50223da387d264151d533a5a5853325800e6631a4", 155 | "sha256:9cd3614b4e31a0889388ff1bd19ae857ad52658b33f776065793c293a29cf612", 156 | "sha256:9d79e958adcd037eba3debbb66222804171197c0f5cd462315d1356aa72a5a30", 157 | "sha256:b90e5d5460f23607310cbd1688a7517c96ce7b284095a48340d249dfc429172e", 158 | "sha256:bc80c13ffddc7e269b706ed58002cc4c98cc135c36d827c99fb5ca54ced0eb7a", 159 | "sha256:cbb074efb2a5e4956b261a670bfc2126b0ccfbf5b96b6ed021bc8c8cb56cf4a8", 160 | "sha256:e8c62ab16feeda84d4732c42b7b67d7a89ad89df7e99efed80ea017bdc472f26", 161 | "sha256:ff5ef271805fe877fe0d1337b6b1861113c44c75b9badb595c713a72cd337371" 162 | ], 163 | "index": "pypi", 164 | "version": "==0.23.3" 165 | }, 166 | "pyparsing": { 167 | "hashes": [ 168 | "sha256:0832bcf47acd283788593e7a0f542407bd9550a55a8a8435214a1960e04bcb04", 169 | "sha256:281683241b25fe9b80ec9d66017485f6deff1af5cde372469134b56ca8447a07", 170 | "sha256:8f1e18d3fd36c6795bb7e02a39fd05c611ffc2596c1e0d995d34d67630426c18", 171 | "sha256:9e8143a3e15c13713506886badd96ca4b579a87fbdf49e550dbfc057d6cb218e", 172 | "sha256:b8b3117ed9bdf45e14dcc89345ce638ec7e0e29b2b579fa1ecf32ce45ebac8a5", 173 | "sha256:e4d45427c6e20a59bf4f88c639dcc03ce30d193112047f94012102f235853a58", 174 | "sha256:fee43f17a9c4087e7ed1605bd6df994c6173c1e977d7ade7b651292fab2bd010" 175 | ], 176 | "version": "==2.2.0" 177 | }, 178 | "python-dateutil": { 179 | "hashes": [ 180 | "sha256:1adb80e7a782c12e52ef9a8182bebeb73f1d7e24e374397af06fb4956c8dc5c0", 181 | "sha256:e27001de32f627c22380a688bcc43ce83504a7bc5da472209b4c70f02829f0b8" 182 | ], 183 | "index": "pypi", 184 | "version": "==2.7.3" 185 | }, 186 | "pytz": { 187 | "hashes": [ 188 | "sha256:a061aa0a9e06881eb8b3b2b43f05b9439d6583c206d0a6c340ff72a7b6669053", 189 | "sha256:ffb9ef1de172603304d9d2819af6f5ece76f2e85ec10692a524dd876e72bf277" 190 | ], 191 | "index": "pypi", 192 | "version": "==2018.5" 193 | }, 194 | "six": { 195 | "hashes": [ 196 | "sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9", 197 | "sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb" 198 | ], 199 | "version": "==1.11.0" 200 | }, 201 | "tzlocal": { 202 | "hashes": [ 203 | "sha256:4ebeb848845ac898da6519b9b31879cf13b6626f7184c496037b818e238f2c4e" 204 | ], 205 | "version": "==1.5.1" 206 | } 207 | }, 208 | "develop": {} 209 | } 210 | -------------------------------------------------------------------------------- /lessons/tbd/intro-stats.md: -------------------------------------------------------------------------------- 1 | title: Lesson 2.1 Why Statistics for Lawyers? 2 | tags: statistics, week2, conceptual 3 | date: 2018-11-03 4 | 5 | The brunt of this course will be devoted to statistics and exploratory data analysis. 6 | 7 | *Exploratory data analysis* is just looking at data to see what you see. We will spend some time, for example, looking at how to see the shape of data and what that can tell you about the world, how to shape investigations with it. 8 | 9 | But the heavy stuff all falls under the rubric of *statistics*---and my hope is to convince you by the end of the course that it needn't be quite so heavy as lawyers have traditionally feared. 10 | 11 | So what's the point of statistics? There are really two points to statistics: first, to allow us to quantify our confidence in our understanding of reality, and second, to help us tease out cause and effect. Let's motivate our exploration of statistics with a few examples. 12 | 13 | ### You Be the Scientist 14 | 15 | First, suppose you're a scientist and you think you've invented a cure for the common cold. How do you test it and make sure it works? 16 | 17 | You might start by experimenting on yourself. That has a pretty long tradition in science, actually---[Marie and Pierre Curie](https://www.nobelprize.org/prizes/themes/marie-and-pierre-curie-and-the-discovery-of-polonium-and-radium/), for example, experimented on themselves to learn about how radiation worked (and suffered very severe radiation poisoning as a result). 18 | 19 | But, if you're going to take on the risk of hurting yourself, you should be sure that you're learning something as a result! Suppose you take the drug, and then you get well the next day. You might conclude that the drug cured you, but it could also just be that the cold was about to run its natural course. The drug could have done nothing... or it could have even made it worse---maybe if you hadn't taken it, you would have gotten better that evening. 20 | 21 | The problem is that you'd really like to know how quickly you would have gotten better if you hadn't taken the medicine. But you can never know that, because you did take the medicine. We can never see the *counterfactual* case of what would have happened if we had done something different. That inability has spawned countless speculative takes on history: what would have happened if Japan had never attacked Pearl Harbor and brought America into the war? Would we all be speaking German? Nobody can know. 22 | 23 | So you decide to try the next best thing: your old college roommate also has a cold, and, as you learned from your undergraduate days, you're pretty good at talking your poor roommate into doing dumb things. So you decide, he'll take the medicine, and you'll go untreated, and you'll see who gets well faster. This is a scientific experiment, and you're the control group. 24 | 25 | Alas, it's a pretty lousy scientific experiment. How do you know that you and your friend don't heal at different paces? Or maybe s/he took some other medicine beforehand and, not wanting to disappoint you, didn't report that fact? Maybe being the kind of person who is willing to participate in someone's wild-west-style science experiment also makes you more likely to heal faster (something about stress and cortisol levels, perhaps). What you should have done was recruit a bunch of other participants, and then randomly assign some of them to a treatment group and some to a control group. 26 | 27 | The discipline of statistics will guide our hypothetical scientist in designing that experiment and evaluating its results. For example: 28 | 29 | - Recruiting a large number of experimental participants and delivering treatment to them is difficult, expensive and potentially risky (what if our drug turns out to have nasty side effects). We'd like to recruit as few people as possible in order to get reliable results. The discipline of *statistical power analysis* can tell us how many people we need to recruit in order to be able to detect the effect we think we have. 30 | 31 | - Suppose we see an effect. People who take the medicine get well, on average, a day faster than people who don't. How do we tell if that's a real effect, as opposed to just a coincidence based on idiosyncratic properties of the group of people who we happened to recruit? We use statistical tools like *hypothesis testing* in order to figure out how confident we can be that the results we see represent a real biological phenomenon (although we can never be completely confident). 32 | 33 | ### Experiments in the Law 34 | 35 | It turns out that experimental research can be involved in building a legal case as well. The example I like best (partly because of my own history as a civil rights lawyer) is discrimination testing. This is a technique that investigators use in a number of contexts, perhaps most prominently in the housing context. The [Department of Justice](https://www.justice.gov/crt/fair-housing-testing-program-1) as well as [nonprofit fair housing organizations](https://www.huduser.gov/portal/periodicals/em/spring14/highlight3.html) often use testing to investigate claims of housing discrimination. (You may have been introduced to the concept of discrimination testers in your Professional Responsibility class, in the course of discussing the controversial disciplinary case [In re Gatti](https://law.justia.com/cases/oregon/supreme-court/2000/s45801.html), 8 P.3d 966 (Ore. 2000) (under Oregon professional responsibility rules, lawyer may not misrepresent identity for the purposes of conducting investigation into alleged wrongdoing), which was seen as a potential threat to the practice of discrimination testing.) 36 | 37 | Here's roughly how housing discrimination testing works: suppose there's reason to believe that an apartment complex discriminates against African-American rental applicants, say, by telling every African-American tenant that there are no vacancies. The investigating organization sends a white couple and an African-American couple, who are trained to behave similarly in other relevant respects, to inquire about apartments. If the two couples are given different information about the existence of vacancies, the organization concludes that it must be because of their race---and has concrete evidence of illegal discrimination. 38 | 39 | One thing that you may have noticed is that I did not describe a large-scale study in the last paragraph. Indeed, these testing organizations typically use numbers of testers that would be unlikely to support a statistically generalizable result (they tend to operate on tight budgets). Yet (as we will discuss in more detail later on) that does not mean that this evidence is not relevant or persuasive. For example, the court in [United States v. Garden Homes Mgmt., Corp.](https://law.justia.com/cases/federal/district-courts/FSupp2/156/413/2318127/), 156 F. Supp. 2d 413 (D.N.J. 2001) rejected a motion for summary judgment, holding that the evidence of three paired tests like those described above was sufficient to create an issue of fact on whether or not the defendant maintained a practice of discrimination. As the court said: 40 | 41 | > While, in the abstract, three fair housing tests might not necessarily reflect Defendants' rental practices, the tests at issue are particularly probative. They all occurred within one month and yielded virtually identical results. The timing and uniform results of these tests give rise to a permissible inference that racial discrimination is not a sporadic event but, instead, is part of the way that Defendants do business. 42 | 43 | There are a number of ways we might interpret this. We might think that juries are entitled to make their own inferences about the evidence independent of the way that a statistician would think about it, or we might think---as the court seemed to suggest in [Southern California Housing Rights Center v. Krug](https://www.leagle.com/decision/20071702564fsupp2d113811598), 564 F.Supp.2d 1138 (C.D., Cal., 2007)---that the behavior exhibited by landlords in these tests are themselves acts of discrimination in violation of the Fair Housing Act, independent of the fact that no tester actually intended to rent. See generally [Havens Realty Corp. v. Coleman](https://supreme.justia.com/cases/federal/us/455/363/), 455 U.S. 363 (1982) (tester has independent right to accurate information, sufficient to support standing under Fair Housing Act). At any rate, we will discuss this further down the road. 44 | 45 | 46 | ### From Experiments to Observations 47 | 48 | Statistical evidence of discrimination will actually be a big theme of this course. (It's one of the most prominent and interesting ways in which statistics is used in the law.) However, most of the statistical evidence we see in the law is what's known as *observational*---rather than randomly assigning people to treatment and control groups, or otherwise controlling the delivery of the treatment to people. (Indeed, even the housing tests probably can't be seen as randomized controlled trials in the fullest sense as the ideal from experimental science, as race cannot be randomly assigned to people---although we do have scientific studies where researchers have managed to come close to that, such as [a famous study](https://www.aeaweb.org/articles?id=10.1257/0002828042002561) where resumes with stereotypically racialized names were sent to employers.) 49 | 50 | For example, a number of cities have filed lawsuits against mortgage lenders, alleging that they engaged in discrimination by steering borrowers of color to higher interest-rate loans. These cities have not (as far as I know) conducted tests by, for example, sending applicants of different races in to apply for loans. Rather, they've conducted a statistical analysis of the terms of the loans offered in their communities, and filed lawsuits on the basis of a disparity across races---finding that borrowers of color typically ended up with worse loans. 51 | 52 | The worry about such statistical evidence is that it might be *confounded* by *omitted variables*. This is just a fancy stats-person way of saying what we said before about the medical test. Suppose that the city filing the suit has a lot of racial segregation and concentrated poverty---it might be the case that the victims of that segregation get worse loan terms because they've suffered financial disadvantage affecting their creditworthiness, not because of intentional discrimination by the lender. 53 | 54 | As alternative to randomization (also known as "experimental controls"), researchers use "statistical controls" to try to solve this problem. We will spend a lot of time on statistical controls in this course, so here's just a taste now. 55 | 56 | Imagine an [Age Discrimination in Employment Act](https://www.law.cornell.edu/uscode/text/29/621) lawsuit, in which the plaintiff alleges that during layoffs at a firm, older workers had a substantially higher chance of being let go. Just such a lawsuit has recently [been filed against IBM](https://www.bostonglobe.com/metro/2018/09/17/laid-off-older-workers-file-age-discrimination-complaint-against-ibm/EsCuULOUfUpZjxK5er2y8L/story.html). 57 | In such a lawsuit, the employer will invariably claim that the older workers aren't being fired because of their ages---rather, they'll claim that, for example, the company choose to retain workers with more relevant skills, and if that happened to fall harder on older workers, it's just because they failed to keep their skills up to date. (This seems to be IBM's basic defense in the noted suit.) How should the plaintiff's lawyer use statistics to try to prove their case? 58 | 59 | Here's one tool they might try. You'll probably remember the equation for a line from your high school geometry classes: 60 | 61 | $$y=ax+b$$ 62 | 63 | Just to refresh your memory: you can graph a line by starting at b, the intercept, and then just getting the rest of the points from that formula, i.e., when the point is at 1 on the x axis, it's at $a + b$ on the y axis, when it's at 2 on the x axis, it's at $2a+b$ on the y axis, and so forth. 64 | 65 | In statistics, we can go the other way: we can take a bunch of data and try, using mathematical techniques that we'll look at later, to find the line that best describes it. This is easier to think about when the y axis takes on more than two values, so let's think of it as salary (for a moment) rather than whether someone was fired or not. Also, let's follow the conventions of statistics and put the intercept first, plus sneak some Greek letters in there. 66 | 67 | So, if plaintiff is claiming that the older an employee is, the lower a raise they got last year, then we can collect a dataset of all the employees and their raises, and then set the percentage raise last year to be y and the employee's age to be x. Then we can use those mathematical techniques that I just hinted at (patience!) to find the *regression line* that best fits the data. That means finding estimates for the *coefficients* alpha and beta in: 68 | 69 | $$y = \alpha + \beta x$$ 70 | 71 | If beta is negative, that suggests that older workers are indeed getting smaller raises. Then we can use more statistical techniques which we will learn to discern whether it is negative enough to be *significant*---to give us confidence that lower raises are genuinely due to age rather than to chance. 72 | 73 | But wait! The employer still has that argument about skills and such. It turns out that regression analysis allows us to take account of those arguments. Let's say that an employee's level of skill is represented by how many training courses they took last year. What we really want to do is compare apples to apples---to compare older employees who took, say, 10 training courses last year to younger employees who took 10 courses, and older employees who took 9 courses to younger employees who took 9 courses, and so on. 74 | 75 | It turns out that you can extend our equation to draw a line to include more x variables. So let's say $x_1$ is the employee's age, and $x_2$ is the number of training courses the employee took last year. Then we can find the best values of $\beta_1$, $\beta_2$, and $\alpha$ in the following: 76 | 77 | $$y = \alpha + \beta_1 x_1 + \beta_2 x_2 $$ 78 | 79 | It turns out that (subject to some caveats and pitfalls on which we shall spend some time), the value of $\beta_1$ will be a good estimate of the effect of age on pay raises *holding the number of training courses constant*---so it gives us the apples-to-apples comparison we're looking for. And, within some limits, we can keep adding variables as the employer comes up with more and more excuses for the lower salary. 80 | 81 | Anyway, we'll be spending quite a bit of time on regression analysis, this is just a taste for now. You will hopefully be able to see that being able to make sense of these concepts will help you in your practice. This is just an introduction, we'll dig in much deeper in the weeks to come. 82 | -------------------------------------------------------------------------------- /lessons/week1/basic_intro.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "In this first week of the course, we're going to cover some core concepts of computer programming. With this, we will build a foundation to do more interesting things in the coming weeks. \n", 8 | "\n", 9 | "## What is Computer Programming?\n", 10 | "\n", 11 | "Computers basically just do one thing: they complete very simple operations at astonishing speed. \n", 12 | "\n", 13 | "For example, suppose you wanted to calculate the thousandth number of the [Fibonacci Sequence](https://www.mathsisfun.com/numbers/fibonacci-sequence.html) --- the sequence of numbers such that starts with 0 and 1, and then each subsequent number is the sum of the previous two numbers. For example: \n", 14 | "\n", 15 | "0 1 1 2 3 5 8 13 \n", 16 | "\n", 17 | "Don't go on until you are satisfied you know what the next number is. \n", 18 | "\n", 19 | "As you can imagine, it would take a fairly long time to calculate it by hand. However, a computer can do it in less than a second. I'll show you: " 20 | ] 21 | }, 22 | { 23 | "cell_type": "code", 24 | "execution_count": 1, 25 | "metadata": { 26 | "collapsed": false 27 | }, 28 | "outputs": [ 29 | { 30 | "name": "stdout", 31 | "output_type": "stream", 32 | "text": [ 33 | "the 1000th number in the Fibonacci sequence is: 26863810024485359386146727202142923967616609318986952340123175997617981700247881689338369654483356564191827856161443356312976673642210350324634850410377680367334151172899169723197082763985615764450078474174626\n" 34 | ] 35 | } 36 | ], 37 | "source": [ 38 | "digit = 3\n", 39 | "first = 0\n", 40 | "second = 1\n", 41 | "while digit < 1001:\n", 42 | " answer = first + second\n", 43 | " first = second\n", 44 | " second = answer\n", 45 | " digit += 1\n", 46 | "print(\"the \" + str(digit - 1) + \"th number in the Fibonacci sequence is: \" + str(answer))\n", 47 | " " 48 | ] 49 | }, 50 | { 51 | "cell_type": "markdown", 52 | "metadata": {}, 53 | "source": [ 54 | "This is obviously not a number you would want to try to compute by hand, or even using a pocket calculator! (Incidentally, if you looked up a list of those numbers and found a different result, try comparing it to the 999th number. People seem to differ on whether to start counting from 0 or 1 in enumerating the Fibonacci sequence.)\n", 55 | "\n", 56 | "Everything that computers do---including the system you're reading this on right now---is built up by doing very simple (\"primitive\") operations many many times. The way it works is that programmers build those primitives---basic arithmetic operations and pushing things around in memory, basically---into more complicated pieces of functionality. Then the next programmer can use that complicated piece of functionality (often called an \"abstraction\") and build some of those up into something more complicated, and so on, and so on. \n", 57 | "\n", 58 | "We will start at a much higher level, but you'll learn to do that yourself!\n", 59 | "\n", 60 | "Let's start by breaking down the Fibonacci sequence code above: \n", 61 | "\n", 62 | "```\n", 63 | "digit = 3\n", 64 | "first = 0\n", 65 | "second = 1\n", 66 | "while digit < 1001:\n", 67 | " answer = first + second\n", 68 | " first = second\n", 69 | " second = answer\n", 70 | " digit += 1\n", 71 | "print(\"the \" + str(digit - 1) + \"th number in the Fibonacci sequence is: \" + str(answer))\n", 72 | " \n", 73 | "```\n", 74 | "\n", 75 | "The first three lines are **variable assignments** --- they give a name to some piece of data. In this case, we've given the name `digit` to the number 3, and so forth. Once we give a name to some piece of data, we can refer to that name and get back that data---and we can change the data attached to the name as well. \n", 76 | "\n", 77 | "It's good to use descriptive names, so anyone else reading your code (or future you) can tell what you're trying to do. Here, I used names meant to track exactly what we're doing: the `digit` starts at 3 because we start calculating at the third digit of the Fibonacci sequence (we know the first two already). Likewise, `first` and `second` represent the two numbers we need to add up to get the third. \n", 78 | "\n", 79 | "`while digit < 1001:`\n", 80 | "\n", 81 | "The 4th line starts a **while loop**. Remember how I said that computers are really good at doing the same thing over and over? The most basic mechanism for doing so is the loop, which is just programmer-speak for \"execute a list of instructions repeatedly.\" \n", 82 | "\n", 83 | "The structure (\"syntax\") of the while loop in Python (it's different in other languages) is: \n", 84 | "\n", 85 | "1. The keyword `while` at the start of the line.\n", 86 | "\n", 87 | "2. An *expression* evaluating to a *boolean* after that. (I'll explain what the italicized terms mean in a moment.) This is known as the condition.\n", 88 | "\n", 89 | "3. A colon at the end of the line.\n", 90 | "\n", 91 | "4. An indented series of lines (\"block\") containing *statements*, known as the \"body\" of the loop.\n", 92 | "\n", 93 | "The way it works is that each of the statements in the indented block will be executed in sequence so long as the condition is true. \n", 94 | "\n", 95 | "Thus, the English translation of the Python `while digit < 1001:` is \"go look up the value of the `digit` variable. So long as it is less than 1001, execute all the indented statements that follow.\"\n", 96 | " \n", 97 | "Let's talk about some of those vocabulary words. \n", 98 | "\n", 99 | "First, most of what you can write in Python can be divided into expressions and statements. Essentially (and I'm simplifying a bit here), an **expression** is like algebra: it's a representation of some value, and its value can be substituted in for it. For example `1 + 1` is an expression, and 2 can seamlessly be substituted in for it. We say that an expression **evaluates** to its value: `1 + 1` evaluates to 2. \n", 100 | "\n", 101 | "In `while digit < 1001` the `digit < 1001` part is an expression. It evaluates to a special type of result, known as a **boolean**. In Python, the two boolean values are **True** and **False** and they mean pretty much what you would expect them to mean. So `digit < 1001` tells the computer \"go look up the value of `digit` and see if it's less than 1001. If so, replace the value of this expression by `True`; otherwise, replace it with `False`.\n", 102 | "\n", 103 | "**Statements** can be seen as instructions to the computer. They aren't meant to be evaluated to some value, but are meant to bring something about in the world inside the computer's head. We've seen a lot of statements already: the variable assignments we've looked at are all statements. They don't calculate anything, they just tell the computer \"hold onto this name for this quantity.\"\n", 104 | "\n", 105 | "If we wrote a line like `my_sum = 1 + 1` we would have an expression and a statement. What happens is that first the expression `1 + 1` is evaluated to 2, and then that value is assigned to the variable `my_sum`. We always read variable assignments right to left: evaluate all the stuff on the right side of the equals sign, and then assign whatever we get out of it to the name on the left side.\n", 106 | "\n", 107 | "Generally, you can have a lot of expressions in a line --- you could say something like `weird_quantity = 5 * (9 + 28) * 2015 / 99` and that's fine. Generally, you don't have more than one statement in a line. \n", 108 | "\n", 109 | "Sometimes, expressions do something (like statements do) in addition to evaluating to a value. Those are called *side-effects* but don't worry about that for now.\n", 110 | "\n", 111 | "Ok, let's keep going! You should be able to figure out what `answer = first + second` means--- it assigns the variable `answer` to the expression `first + second`. It looks up the values of `first` and `second` and sums them. You should see that `answer` get the value 1. \n", 112 | "\n", 113 | "The next two lines introduce one of the main reasons we use variables. As the name suggests, it's because they can *vary*. \n", 114 | "\n", 115 | "```\n", 116 | "first = second\n", 117 | "second = answer\n", 118 | "```\n", 119 | "\n", 120 | "We're reassigning our variables here! Remember, we do variable assignment right to left. So what this means is \"take the value currently attached to the name `second` and assign it to `first`, then take the variable currently attached to the name `answer` and assign it to `second.`\n", 121 | "\n", 122 | "Think about how this works in terms of the first few digits of the Fibonacci sequence. Consider the following table, where the first row is the digit we're on (first, second, etc.) and the second row is the value: \n", 123 | "\n", 124 | "| | | \\/ | | | | |\n", 125 | "|----|----|----|---|---|---|---|\n", 126 | "| 1 | 2 | 3 | 4 | 5 | 6 | 7 |\n", 127 | "| 0 | 1 | 1 | 2 | 3 | 5 | 8 |\n", 128 | "| ^1 | ^2 | | | | | |\n", 129 | "\n", 130 | "Let's imagine an arrow poing to the digit we're trying to sort out. So when we start, the arrow is pointing at 3 (the variable `digit`), because we're trying to calculate the third digit. We calculate that digit by looking to the first number of the two immediately preceeding numbers (the variable `first`, represented in the table by ^1), and adding it to the second number of the two immediately preceeding (the variable `second`, represented in the table by ^2), giving us the total (variable `answer`). \n", 131 | "\n", 132 | "But we're not done yet, because we still have 997 more numbers to calculate. So how do we calculate the 4th digit? Well, we need to add the last two digits again... the number that used to be in the variable `second` is the first digit we'll add the next time, and the current digit (variable `answer`) is the second one. In order to tell the computer that's going to happen, we reassign those variables.\n", 133 | "\n", 134 | "The last line of our loop `digit += 1` is a special syntax for *incrementing* the value of a variable---it just says \"replace the value of `digit` with its own value plus 1.\" In our chart above, that just means moving the digit forward. \n", 135 | "\n", 136 | "So, here's a representation of out computer's memory at the start of the indented block: \n", 137 | "\n", 138 | "| | | \\/ |\n", 139 | "|----|----|----|\n", 140 | "| 1 | 2 | 3 |\n", 141 | "| 0 | 1 | |\n", 142 | "| ^1 | ^2 | |\n", 143 | "\n", 144 | "And here's a representation of out computer's memory at the end of the indented block:\n", 145 | "\n", 146 | "| | | | \\/ |\n", 147 | "|---|----|----|----|\n", 148 | "| 1 | 2 | 3 | 4 |\n", 149 | "| 0 | 1 | 1 | |\n", 150 | "| | ^1 | ^2 | |\n", 151 | "\n", 152 | "The arrow indicating what digit we're about to calculate has moved to the 4th place, and the arrows indicating what digits we're going to sum up have moved to the second and third, plus we've added an answer for the latter.\n", 153 | "\n", 154 | "And finally, the magic of loops kicks in. Now that we're at the end of our indented block, the computer jumps back up to the start of the while loop. \n", 155 | "\n", 156 | "First, it checks the condition again. Is `digit` still less than 1001? Yes, it is. It's 4 now, instead of 3, but that's lots less than 1001. So now, we go back into the body of the loop, this time using the new values of our variables! \n", 157 | "\n", 158 | "After another iteration of the loop, here's what the computer knows: \n", 159 | "\n", 160 | "| | | | | \\/ |\n", 161 | "|---|---|----|----|----|\n", 162 | "| 1 | 2 | 3 | 4 | 5 |\n", 163 | "| 0 | 1 | 1 | 2 | |\n", 164 | "| | | ^1 | ^2 | |\n", 165 | "\n", 166 | "And then it keeps doing that, again and again, moving the arrow up top each time, at blinding speed. \n", 167 | "\n", 168 | "Now let's think of what happens after it calculates the 1000th digit. Here's where we are:\n", 169 | "\n", 170 | "| | | | | | | | | \\/ |\n", 171 | "|---|---|---|---|---|-----|------|------|------|\n", 172 | "| 1 | 2 | 3 | 4 | 5 | ... | 999 | 1000 | 1001 |\n", 173 | "| 0 | 1 | 1 | 2 | 3 | ... | lots | lots | |\n", 174 | "| | | | | | ... | ^1 | ^2 | |\n", 175 | "\n", 176 | "This time, when it goes back to the start of the loop, it tests the condition and finds that it's `False`. `digit` isn't under 1001 any more! \n", 177 | "\n", 178 | "So now, it jumps out of the while loop and goes to the next line: \n", 179 | "\n", 180 | "`print(\"the \" + str(digit - 1) + \"th number in the Fibonacci sequence is: \" + str(answer))`\n", 181 | "\n", 182 | "This line calls the `print()` function, which instructs the computer to print to the screen (not to a paper printer!) the expression inside the parentheses. (We'll talk about functions and what the parentheses do in a little bit.) \n", 183 | "\n", 184 | "The stuff inside the parentheses is a **string**---that is, an piece of text that the computer represents in memory, made up of **characters**. Typically we tell Python to hold onto a string by surrounding it with quotes (single or double both work, but they have to match). These are called **string literals**. Like: \n", 185 | "\n", 186 | "`my_sentence = \"Hi, I am Gowder's sentence.\"` \n", 187 | "\n", 188 | "But you can also create strings out of expressions, and use them in other expressions. One of the neat things that you can do with strings is **concatenate** them, that is, use the plus sign to sort of add them together, so that `\"the cat \" + \"in the hat\"` evaluates to `\"the cat in the hat\"`. \n", 189 | "\n", 190 | "So what that last line does is look up the last value that `answer` got (which is the 1000th digit, because we haven't calculated the 1001th yet), convert that into a string with the `str()` function (turning it from, e.g., `12345` into `\"12345\"`---this matters!), does the same with `digit`, and then concatenates them all together with the string literals there into one big string, which we print to the screen so that we can learn the answer to our math puzzle!" 191 | ] 192 | }, 193 | { 194 | "cell_type": "markdown", 195 | "metadata": { 196 | "collapsed": true 197 | }, 198 | "source": [ 199 | "## Now you try!\n", 200 | "\n", 201 | "We're at the end of our first handout. There are a couple more in this lesson, but, before you go onto the next one, try using a loop to calculate a different quantity! \n", 202 | "\n", 203 | "As you might remember from your early schooling, the factorial of a number, denoted n!, is the product of that number and all the positive integers before it. For example, 5! = 1x2x3x4x5 = 120\n", 204 | "\n", 205 | "In the next cell, use a loop to calculate 1000 factorial." 206 | ] 207 | }, 208 | { 209 | "cell_type": "code", 210 | "execution_count": null, 211 | "metadata": { 212 | "collapsed": true 213 | }, 214 | "outputs": [], 215 | "source": [] 216 | } 217 | ], 218 | "metadata": { 219 | "kernelspec": { 220 | "display_name": "Python 3", 221 | "language": "python", 222 | "name": "python3" 223 | }, 224 | "language_info": { 225 | "codemirror_mode": { 226 | "name": "ipython", 227 | "version": 3 228 | }, 229 | "file_extension": ".py", 230 | "mimetype": "text/x-python", 231 | "name": "python", 232 | "nbconvert_exporter": "python", 233 | "pygments_lexer": "ipython3", 234 | "version": "3.5.4" 235 | } 236 | }, 237 | "nbformat": 4, 238 | "nbformat_minor": 0 239 | } 240 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | # License 2 | 3 | Copyright 2018, Paul Gowder and contributors. Licensed under a [Creative 4 | Commons Attribution 4.0 International 5 | license](https://creativecommons.org/licenses/by/4.0/). Text of license 6 | below. 7 | 8 | Note: It is my (Paul Gowder’s) belief that the University of Iowa, 9 | pursuant to [its copyright 10 | policy](https://opsmanual.uiowa.edu/administrative-financial-and-facilities-policies/university-iowa-intellectual-property-policy#30.4), 11 | claims no intellectual property interest in this material. (“The 12 | University does not claim ownership of copyright in pedagogical, 13 | scholarly, artistic, or research works regardless of the mode of 14 | expression except when a work is described in section V-30.4b(2)(b) 15 | below.”) However, I make no warranties about University’s interpretation 16 | of this policy. 17 | 18 | ### Creative Commons Attribution 4.0 International Public License 19 | 20 | By exercising the Licensed Rights (defined below), You accept and agree 21 | to be bound by the terms and conditions of this Creative Commons 22 | Attribution 4.0 International Public License ("Public License"). To the 23 | extent this Public License may be interpreted as a contract, You are 24 | granted the Licensed Rights in consideration of Your acceptance of these 25 | terms and conditions, and the Licensor grants You such rights in 26 | consideration of benefits the Licensor receives from making the Licensed 27 | Material available under these terms and conditions. 28 | 29 | **Section 1 – Definitions.** 30 | 31 | 1. **Adapted Material** means material subject to 32 | Copyright and Similar Rights that is derived from or based upon the 33 | Licensed Material and in which the Licensed Material is translated, 34 | altered, arranged, transformed, or otherwise modified in a manner 35 | requiring permission under the Copyright and Similar Rights held by 36 | the Licensor. For purposes of this Public License, where the 37 | Licensed Material is a musical work, performance, or sound 38 | recording, Adapted Material is always produced where the Licensed 39 | Material is synched in timed relation with a moving image. 40 | 2. **Adapter's License** means the license You apply to 41 | Your Copyright and Similar Rights in Your contributions to Adapted 42 | Material in accordance with the terms and conditions of this Public 43 | License. 44 | 3. **Copyright and Similar Rights** means copyright 45 | and/or similar rights closely related to copyright including, 46 | without limitation, performance, broadcast, sound recording, and Sui 47 | Generis Database Rights, without regard to how the rights are 48 | labeled or categorized. For purposes of this Public License, the 49 | rights specified in Section [2(b)(1)-(2)](#s2b) are not Copyright 50 | and Similar Rights. 51 | 4. **Effective Technological Measures** means those 52 | measures that, in the absence of proper authority, may not be 53 | circumvented under laws fulfilling obligations under Article 11 of 54 | the WIPO Copyright Treaty adopted on December 20, 1996, and/or 55 | similar international agreements. 56 | 5. **Exceptions and Limitations** means fair use, fair 57 | dealing, and/or any other exception or limitation to Copyright and 58 | Similar Rights that applies to Your use of the Licensed 59 | Material. 60 | 6. **Licensed Material** means the artistic or literary 61 | work, database, or other material to which the Licensor applied this 62 | Public License. 63 | 7. **Licensed Rights** means the rights granted to You 64 | subject to the terms and conditions of this Public License, which 65 | are limited to all Copyright and Similar Rights that apply to Your 66 | use of the Licensed Material and that the Licensor has authority to 67 | license. 68 | 8. **Licensor** means the individual(s) or entity(ies) 69 | granting rights under this Public License. 70 | 9. **Share** means to provide material to the public by 71 | any means or process that requires permission under the Licensed 72 | Rights, such as reproduction, public display, public performance, 73 | distribution, dissemination, communication, or importation, and to 74 | make material available to the public including in ways that members 75 | of the public may access the material from a place and at a time 76 | individually chosen by them. 77 | 10. **Sui Generis Database Rights** means rights other 78 | than copyright resulting from Directive 96/9/EC of the European 79 | Parliament and of the Council of 11 March 1996 on the legal 80 | protection of databases, as amended and/or succeeded, as well as 81 | other essentially equivalent rights anywhere in the world. 82 | 11. **You** means the individual or entity exercising the 83 | Licensed Rights under this Public License. **Your** has a 84 | corresponding meaning. 85 | 86 | **Section 2 – Scope.** 87 | 88 | 1. **License grant**. 89 | 90 | 1. Subject to the terms and conditions of this 91 | Public License, the Licensor hereby grants You a worldwide, 92 | royalty-free, non-sublicensable, non-exclusive, irrevocable 93 | license to exercise the Licensed Rights in the Licensed Material 94 | to: 95 | 1. reproduce and Share the Licensed Material, 96 | in whole or in part; and 97 | 2. produce, reproduce, and Share Adapted 98 | Material. 99 | 2. Exceptions 100 | and Limitations. For the avoidance of doubt, where 101 | Exceptions and Limitations apply to Your use, this Public 102 | License does not apply, and You do not need to comply with its 103 | terms and 104 | conditions. 105 | 3. Term. 106 | The term of this Public License is specified in Section 107 | [6(a)](#s6a). 108 | 4. Media 109 | and formats; technical modifications allowed. The 110 | Licensor authorizes You to exercise the Licensed Rights in all 111 | media and formats whether now known or hereafter created, and to 112 | make technical modifications necessary to do so. The Licensor 113 | waives and/or agrees not to assert any right or authority to 114 | forbid You from making technical modifications necessary to 115 | exercise the Licensed Rights, including technical modifications 116 | necessary to circumvent Effective Technological Measures. For 117 | purposes of this Public License, simply making modifications 118 | authorized by this Section [2(a)(4)](#s2a4) never produces 119 | Adapted 120 | Material. 121 | 5. Downstream 122 | recipients. ::: 123 | {.para} 124 | 1. Offer 125 | from the Licensor – Licensed Material. Every 126 | recipient of the Licensed Material automatically receives an 127 | offer from the Licensor to exercise the Licensed Rights 128 | under the terms and conditions of this Public 129 | License. 130 | 2. No 131 | downstream restrictions. You may not offer or impose 132 | any additional or different terms or conditions on, or apply 133 | any Effective Technological Measures to, the Licensed 134 | Material if doing so restricts exercise of the Licensed 135 | Rights by any recipient of the Licensed Material. ::: 136 | 6. No 137 | endorsement. Nothing in this Public License constitutes 138 | or may be construed as permission to assert or imply that You 139 | are, or that Your use of the Licensed Material is, connected 140 | with, or sponsored, endorsed, or granted official status by, the 141 | Licensor or others designated to receive attribution as provided 142 | in Section [3(a)(1)(A)(i)](#s3a1Ai). 143 | 144 | 2. 145 | 146 |