Pitman STA 230 / MTH 230 Probability Week 1: Intro, and Rules of Prob Office # 211c Old Chem Email wolpert@stat.duke.edu or rlw@duke or robert@duke... Office-Hours: Mon 3-4pm Class Webpage: http://stat.duke.edu/courses/Fallxx/sta230/ Sakai: Only for reporting hw & exam scores (more on req) TA Name & OH 1. Introduction and Examples What does it MEAN to say that a) The probability of Point Up for a thumbtack is P[U]=1/2? b) The probability of Heads for a 1 Euro coin is P[H]=1/2? c) The probability that IBM stock rises $1 today, P[+]=1/2? Three interpretations of probability: *) Symmetry: If there are k equally-likely outcomes, each has P[E] = 1/k *) Frequency: If you can repeat an experiment indefinitely, P[E] = lim [# of occur in n tries] / [n] n->oo *) Belief: If for some number 0 <= p <= 1 you are indifferent between winning $1 if E occurs, or winning $1 if a blue chip is drawn from a box with 10000 chips, of which 100p% are blue, then P[E] = p. Limitations and shortcomings of each... nested... agree where possible. Math Background: Should know: \sum_3^{100} (4/5)^k :: \int_0^10 x e^{-2x} dx :: \lim_{x->oo} x^3/e^x \lim_{n->oo} (1-2/n)^n :: (a+b)^n = \sum_0^n {n:k} a^k b^{n-k} \int\int (x+y) dx dy over triangle with vertices (0,0), (1,0), (0,1) For more: From class home page, click "diagnostic quiz". ------------------------------ Example: If Duke, UNC, and NCSU together have 800, 1000, 600 accounts on an NSF supercomputer, and if account names are six upper-case alphabetical letters long and start with D, U, or S respectively, what is the probability that "UABCXY" is a valid account? Answ: 1000/26^5 ------------------------------ EXPERIMENTS and OUTCOMES An "experiment" is something we do that reveals something we didn't know, that lessens our uncertainty. Sometimes we call them "random experiments", especially when the "experiment" is something like drawing a card from a well- shuffled deck or rolling a die or tossing a coin, but that's really just an attitude thing--- we can view presidential elections, sporting events, or even looking to see how many pages the textbook has as "random experiments", too, where we decrease (or "resolve") uncertainty by observing something. Some of the main things we'll study in probability include: Outcome: One of an exhaustive exclusive list of everything that might happen in a random experiment. Examples: 3 coin tosses: {HHH, HHT, HTH, HTT, THH, THT, TTH, TTT} 3 coin tosses: {0,1,2,3} 3 coin tosses: {0,1,2,3,4,5,6,7} (bits in binary notation) 3 coin tosses: {Agree, Differ} One roll die: {1,2,3,4,5,6} Two rolls: {2,3,...,11,12} Two rolls: {11,12,...,16,21,22,...,66} (36 el'ts in all) Count pages: {1,2,3,...,999,1000,...} (559) Wait for bus: [0, oo) = {x: 0 <= x < oo } Event: A thing that might happen, and then again might not Examples: 2 heads: {HHT, HTH, THH} Even number: {2,4,6} 2 heads: {2} < 2 minutes: [0,120) Random Variable: A number that depends somehow on chance Examples: # of heads in 3 tries: {3, 2, 2, 1, 2, 1, 1, 0} Heads before a tail: {3, 2, 1, 1, 0, 0, 0, 0} 2^die: 2, 4, 8, 16, 32, 64} Pages/class day: 559/28 = 19.96429 (or 559/23 = 24.30435) [Aside on Significant Digits... 1/99 - 1/100 != 0; = 0.0001010101 or 1.0100 10^-4 or 1/9900 In HW & exams, please give numerical answers to 4 digits to simplify scoring. ---------- Apology: Probability and statistics are useful and interesting for all sorts of real-world problems-- but when we're just beginning, it's easier to think about ARTIFICIALLY SIMPLE situations like rolling dice, tossing coins, or dealing cards than it is to work out the details of realistic and important problems like estimating pollution, predicting elections, or managing stock portfolios. I'll try to be more realistic sometimes, but please bear with me through the early stages with unrealistic examples. Thanks! ---------- Mathematical objects: Sample Space Omega Set of all possible "outcomes" Outcomes w Elements of Omega (seldom mentioned) Events E, F, ... Subsets of Omega Random Variable X, Y, ... Functions Omega -> IR (or -> IN or IR^2 or ...) More about events: E "and" F: Intersection (Pitman: EF) E "or" F: Union (Pitman: E u F) "not" E: Complement (Pitman: E^c) \0: Empty Set Impossibility Omega: Sample Space Certainty "at least one of E_i": (Infinite) union U E_i "all of E_i": (Infinite) intersection A E_i De Morgan's Rules (obvious from Venn (MasterCard) Diagram): not (A and B) = (not A) or (not B) not (A or B) = (not A) and (not B) Probability assignment rules: ( think of *area* ) (1) Nonnegative: P(E) >= 0 (2) Addition: P(E u F) = P(E) + P(F) **IF** E F is empty (3) Total one: P(Omega) = 1 (2') Countable addition: P(U{i=1..oo} E_i) = Sum{i=1..oo} P(E_i) **IF** each Ei Ej empty for i != j ({E_i} is called a "countable partition") Note that there are lots of events--- if Omega has n elements then there are 2^n possible events (illustrate this). SO, it's usually too hard to give a probability assignment by listing the probabilities of every event. We need an easier way. When Omega is finite we can just give the prob p(i) of each "elementary outcome" {i} in Omega; by (2) these determine everything by P(E) = sum { p(e): e in E }. This can even work for some infinite sets Omega (like the integers) whose elements can all be enumerated in a list {e_1, e_2, ...}. Some sets Omega are "too big" for this--- for example, there are just too many real numbers (on a line) or the points in the plane to enumerate them all. If we want to "pick a point at random from the unit square" or to "pick a number between zero and one", then we might want P(E) to be related to *area* or *length*, which cannot be computed by summing up any function of the infinitely many points. We'll come back to this kind of problem later (they're fun); that's when we'll start using calculus in this course. First let's do some examples of probability assignments following the rules. For each question give: (i) Omega (ii) A rule for computing P(E) for every event E in Omega a) Toss a thumbtack that falls Up with probability 52% (note 52% of live births are boys; this could instead be a gender question) b) Roll two fair dice. c) Toss a coin until first Head; count # of tails (only): Omega = {0,1,2,3,...} P(E)= ???? P(Even # of tails precede 1st head) = ???? ============== Why rules????????? Try: P(E) = lim{n->oo} #(E {1,2,...,n}) / n Does this make sense for all sets E?????? Try to find one for which it doesn't. --------- Suppose we define P() ONLY for the sets it Does make sense for. Are we okay now??? Well, no. Alas there are sets E, F with P(E) and P(F) well-defined, but for which P(EF) CANNOT be defined meaningfully.... ============ ============ Tue Ends, Thu Begins ============ ============ Consequences of the rules ("Propositions"), or How to compute probabilities: 4.1 P(E^c) = 1 - P(E) 4.2 P(E) <= P(F) if E subset F ("E implies F", E->F) 4.3 P(EuF) = P(E) + P(F) - P(EF) (extension of Rule #3) 4.4 P(UEi) = Sum{i}(P(Ei) - Sum{i prod((366-(1:35))/365) or prod(seq(365,366-35)/365) or ... [1] 0.1856168 ------------------------------------------------------------ Matlab: >> prod((366-(1:35))/365) or prod(linspace(365,366-35)/365)... ans = 0.1856168 ------------------------------------------------------------ Maple: evalf(product((366-i)/365,i=1..35)); 0.1856168 ------------------------------------------------------------ Mathematica: In[1]:= N[Product[(366-i)/365,{i,1,35}]] Out[1]= 0.1856168 ------------------------------------------------------------ c: #include main(int ac, char **av) { int i, n; double p; n = (ac>1) ? atoi(av[1]) : 35; if(ac>1) n = atoi(av[1]); else exit(fprintf(stderr, "Usage: %s \n", *av)); for(i=0,p=1; i prod((366-40):365/365) = 0.1087682 > prod((366-22):365/365) = 0.5243047 ( <---R ) > prod((366-23):365/365) = 0.4927028 Note: At least 23 students in class guarantees at least 50% chance of tie. Q: In fact some b'days are more common than others (say, 9 mo. after 1st weekend in spring, or maybe after a 3-day power outage from a hurricane....); how will this affect the B'day Problem answers? Will that make ties MORE likely or LESS likely??? ------------------------------------------------------------ Limits: Sometimes we need to use approximations to compute the probability of something--- and so we'll need to know that P[ at least one of E_n occurs ] = lim P(E_n) IF E_n c E_{n+1} P[ all of F_n occur ] = lim P(F_n) IF F_{n+1} c F_n (i.e., INCREASING unions and DECREASING intersections are okay) (Prove "continuity" using ctbl additivity, telescoping series) EXAMPLE: What's the chance of at least one head if we toss a fair coin forever? ANSW: P[No Head in first n tosses] = (1/2)^n -> P[At least one H in n tries] = 1 - 2^{-n} -> 1 What's the chance of all tails if we toss a fair coin forever? ANSW: P[all tails for n tosses] = (1/2)^n -> 0 Put one brass ring and n silver ones in a hat, for n'th draw; what's the chance we /ever/ draw the brass one? ANSW: P[no luck in 1st n tries] = (1/2)(2/3)(3/4)...(n/n+1) = 1/n+1, so P[NEVER get brass ring] = 0. Put one brass ring and n^2 silver ones in a hat, at time n; NOW what's the chance we ever draw the brass one? ANSW: P[no luck in 1st n tries] = (1/2)(4/5)(9/10)...(n^2/n^2+1) -> 0.272... so P[NEVER get brass ring] = 1 - ... = 0.727... ========== What IS probability??? 0. Symmetry? Try to find equally-likely outcomes. 1. Asymptotic Frequency: P(E) = lim_{n->oo} (#E in n tries)/n 2. Degrees of belief: P(E) = fraction of brass rings needed for betting on event or ring to be equally attractive ==========