<<

Syllabus & Policies General Info

Classroom: Perkins 2-072 Lecture 1: Introduction, , and Boolean Time: Mon - Fri, 2:00 - 3:15 pm Wed, 3:30 - 4:30 pm

Professor: Colin Rundel Sta 111 Office: Old Chemistry 223E Email: [email protected] Colin Rundel Office hours: Monday 12:30 - 1:30 pm May 13, 2014 Monday 3:30 - 5:00 pm or by appointment.

Course http:// stat.duke.edu/ ∼cr173/ Sta111 Su14 Website:

Sta 111 (Colin Rundel) Lec 1 May 13, 2014 1 / 25

Syllabus & Policies Syllabus & Policies Materials Grading

Homework 25% Labs 15% Textbook: and Statistical , Midterm 30% Hogg, Tanis, & Zimmerman Final 30% Pearson, 9th Edition, 2015 ISBN: 9780321923271 Grades will be curved at the end of the course after overall averages have been calculated. Exams: Midterm: Wednesday, June 4th, 2:00 - 4:30 pm Average of 90-100 guaranteed A-. Final: Thursday, June 19t h 2:00 - 4:30 pm Average of 80-90 guaranteed B-. Average of 70-80 guaranteed -. Holidays: Monday, May 26th - Memorial Day

The more evidence there is that the has mastered the material, the more generous the curve will be.

Sta 111 (Colin Rundel) Lec 1 May 13, 2014 2 / 25 Sta 111 (Colin Rundel) Lec 1 May 13, 2014 3 / 25 Syllabus & Policies Syllabus & Policies Labs Policies

Objective: Give you hands on experience with data analysis using There will not be make-ups for any of the homework, labs, or exams. statistical software. All regrade requests on homework assignments and exams should be http:// beta.rstudio.org submitted promptly. There will be no grade changes after the final exam. A gmail account is needed to register your Rstudio account, add your gmail address using the quiz on Sakai. Academic Integrity & Duke Community Standard

10 labs are planned. Excused absences

Write ups due the following Tuesday - most can be completed in class. Late work policy - for homework and lab write ups: late but during class: -10% after class on due date: -20% next day or later: no credit

Sta 111 (Colin Rundel) Lec 1 May 13, 2014 4 / 25 Sta 111 (Colin Rundel) Lec 1 May 13, 2014 5 / 25

Set Theory (Briefly) (Briefly) What is a set? Set and operations

Georg Cantor x ∈ A x is an of A A set is a gathering together into a whole of definite, distinct objects of our perception or of our thought - which are called elements of the set. A ∪ B, A + B is the of A and B {x|x ∈ A or B}

A ∩ B, AB is the of A and B {x|x ∈ A and B} A set is a grouping of distinct objects. We will denote sets using capital letters (A,B) and the elements of the set using curly braces ({}). A ⊆ B A is a of B x ∈ A ⇒ x ∈ B

A ⊂ B means A is a proper subset of BA ⊆ B and A 6= B To define a set we either enumerate all elements or use set-builder notation: U is the

The set of card suits The set of all prime ∅, {} is the

{♣, ♦, ♥, ♠} {x|x is prime} A0, A, Ac is the of AA0 = {x|x ∈/ A}

|A| is the of A

Sta 111 (Colin Rundel) Lec 1 May 13, 2014 6 / 25 Sta 111 (Colin Rundel) Lec 1 May 13, 2014 7 / 25 Set Theory (Briefly) Set Theory (Briefly) Set properties De Morgan’ Laws

Commutativity A ∪ B = B ∪ A Useful rules that allow us to relate conjunction (union / or) and disjuction A ∩ B = B ∩ A (intersection / and) using only . Associativity (A ∪ B) ∪ C = A ∪ (B ∪ C) 0 0 0 (A ∩ B) ∩ C = A ∩ (B ∩ C) (A ∪ B) = A ∩ B Distribution A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C) 0 0 0 A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C) (A ∩ B) = A ∪ B A ∪ A = A A ∩ A = A Absorption A ∪ (A ∩ B) = A A ∩ (A ∪ B) = A — A ∪ A0 = U A ∩ A0 = ∅ Sta 111 (Colin Rundel) Lec 1 May 13, 2014 8 / 25 Sta 111 (Colin Rundel) Lec 1 May 13, 2014 9 / 25

Set Theory (Briefly) / (Briefly) Some examples A little Logic / Boolean Algebra

Show the following relations are true: Logic statements are statements that must be either true or . In general we indicate logic statements using lower case letters (e.g. p,q).

1 A ∪ B ∩ C = (A ∪ B) ∩ (A ∪ C) There is a natural correspondence between set theory and logic operators:

2 (A ∪ C) ∩ A ∪ (A ∩ C) ∪ C = A ∪ C Set Theory Logic A ∪ B p or q 3 B ∪ A ∩ (B ∪ C) ∪ (B ∩ C) = B ∪ (A ∩ C) A ∩ B p and q A = B p ↔ q A ⊆ B p → q (A ∪ B)0 = A0 ∩ B0 (p or q)0 ↔ p0 and q0 (A ∩ B)0 = A0 ∪ B0 (p and q)0 ↔ p0 or q0

Sta 111 (Colin Rundel) Lec 1 May 13, 2014 10 / 25 Sta 111 (Colin Rundel) Lec 1 May 13, 2014 11 / 25 Logic / Boolean Algebra (Briefly) Introduction to Probability More Correspondence What does it to say that:

Additionally, we can construct logic statements from sets by asking if an The probability of rolling snake eyes is P(S) = 1/36? element belongs to a set, e.g. The probability of flipping a coin and getting heads is P(H) = 1/2? The probability Apple’s stock price goes up today is P(+) = 3/4? A ∪ B −→ x ∈ (A ∪ B) ↔ x ∈ A or x ∈ B Interpretations: Symmetry: If there are k equally-likely outcomes, each has Example - let A be the set of possible weather for today, P(E) = 1/k {sun, clouds, rain, snow}. Frequency: If you can repeat an experiment indefinitely, #E P(E) = lim n→∞ n Belief: If you are indifferent between winning $1 if E occurs or winning $1 if you draw a blue chip from a box with 100 × p blue chips, rest red, P(E) = p

Sta 111 (Colin Rundel) Lec 1 May 13, 2014 12 / 25 Sta 111 (Colin Rundel) Lec 1 May 13, 2014 13 / 25

Introduction to Probability Introduction to Probability Terminology space is big

Outcome space (Ω) - set of all possible outcomes (ω). Even for relatively small outcome spaces there are a lot of possible events Examples: 3 coin tosses {HHH, HHT, HTH, HTT, THH, THT, TTH, TTT} we can define. One die roll {1,2,3,4,5,6} Sum of two rolls {2,3,. . . ,11,12} Seconds waiting for bus [0, ∞) Let Ω = {ω1, ω2, ω3} then Event (E) - subset of Ω (E ⊆ Ω) that might happen, or might not E = {∅, ω , ω , ω , ω ∪ ω , ω ∪ ω , ω ∪ ω , ω ∪ ω ∪ ω , } Examples: 2 heads {HHT, HTH, THH} 1 2 3 1 2 1 3 2 3 1 2 3 Roll an even {2,4,6} 3 Wait < 2 minutes [0, 120) |E| = 8 = 2

Random (X ) - a value that depends somehow on chance We can show that for an outcome space Ω = {ω1, ω2, . . . , ωn} the total n Examples: # of heads {3, 2, 2, 1, 2, 1, 1, 0} number of possible events is 2 . # flips until heads {3, 2, 1, 1, 0, 0, 0, 0} 2ˆdie {2, 4, 8, 16, 32, 64} n E1 = ∅, E2 = ω1, E3 = ω2,..., En+1 = ωn, En+2 = ω1 ∪ ω2,..., E2n = ∪ ωi i=1

Why can we get away with exclusively using unions here?

Sta 111 (Colin Rundel) Lec 1 May 13, 2014 14 / 25 Sta 111 (Colin Rundel) Lec 1 May 13, 2014 15 / 25 Introduction to Probability Introduction to Probability Rules of Probability - Kolmogorov’s Useful Identities

(1) Non-negative: Complement Rule: P(E) ≥ 0 P(not A) = P(Ac ) = 1 − P(A) (2) :

P(E ∪ F ) = P(E) + P(F ) if E ∩ F = ∅ Difference Rule:

(2)’ Countable Addition: P(B and not A) = P(B ∩ Ac ) = P(B) − P(A) if A ⊆ B ∞  ∞  X P ∪ Ei = P(Ei ) if Ei Ej = ∅ for i 6= j i=1 i=1 Inclusion-Exclusion: (3) Total one: P(A ∪ B) = P(A) + P(B) − P(AB) P(Ω) = 1

Sta 111 (Colin Rundel) Lec 1 May 13, 2014 16 / 25 Sta 111 (Colin Rundel) Lec 1 May 13, 2014 17 / 25

Introduction to Probability Introduction to Probability Generalized Inclusion-Exclusion Equally Likely Outcomes

n X X X n+1 #(E) 1 P( ∪ Ei ) = P(Ei ) − P(Ei Ej ) + P(Ei Ej Ek ) − ... + (−1) P(E1 ... En) X ωi ∈E i=1 P(E) = = i≤n i

Probability of rolling an even number with a six sided die?

E = {2, 4, 6} and Ω = {1, 2, 3, 4, 5, 6} P(E) = 3/6 = 1/2

Sta 111 (Colin Rundel) Lec 1 May 13, 2014 18 / 25 Sta 111 (Colin Rundel) Lec 1 May 13, 2014 19 / 25 Introduction to Probability Introduction to Probability Roulette Roulette, cont.

Sta 111 (Colin Rundel) Lec 1 May 13, 2014 20 / 25 Sta 111 (Colin Rundel) Lec 1 May 13, 2014 21 / 25

Sampling Sampling Sampling Birthday Problem

Imagine an urn filled with white and black marbles Ignoring leap years, and assuming birthdays are equally likely to be any day . . . or a deck of cards of the year, what is the chance of a tie in birthdays among the students in . . . or a bingo cage this class? . . . or a hat full of raffle tickets

Two common options + one extra for completeness: Sampling without replacement Sampling with replacement P´olya urn model

Sta 111 (Colin Rundel) Lec 1 May 13, 2014 22 / 25 Sta 111 (Colin Rundel) Lec 1 May 13, 2014 23 / 25 Sampling Sampling Birthday Problem, cont. Something a little more complicated . . .

What is the probably that if you deal yourself 5 cards you will have a royal flush? (Ace, king, queen, jack, and 10 of the same suit)

Sta 111 (Colin Rundel) Lec 1 May 13, 2014 24 / 25 Sta 111 (Colin Rundel) Lec 1 May 13, 2014 25 / 25