Mathematics and Mathematics and Statistics Boot Camp Statistics Boot Camp II II David Siroky David Siroky Duke University Duke University
Jan 04, 2016
Mathematics and Mathematics and Statistics Boot Camp IIStatistics Boot Camp II
David SirokyDavid Siroky
Duke UniversityDuke University
AgendaAgenda The Language of MathematicsThe Language of Mathematics Algebra ReviewAlgebra Review ExponentsExponents LogarithmsLogarithms Problem Set ReviewProblem Set Review Probability ReviewProbability Review
Will most likely end here…Will most likely end here… Limits and Continuity Limits and Continuity Differential Calculus (Tangents, Differentiation, Differential Calculus (Tangents, Differentiation,
Extrema)Extrema) Integral Calculus (Integration Rules, Definite Integral Calculus (Integration Rules, Definite
Integrals)Integrals) Matrix Algebra (Determinants, Inverses, Matrix Algebra (Determinants, Inverses,
Eigenvalues and Eigenvectors)Eigenvalues and Eigenvectors)
The Language of The Language of Mathematics 0Mathematics 0
+ + -- XX == >> << | x || x |
AdditionAddition SubtractionSubtraction MultiplicationMultiplication DivisionDivision EqualityEquality Greater thanGreater than Less thanLess than Absolute value of xAbsolute value of x Square RootSquare Root
The Language of The Language of Mathematics IMathematics I
||
- There exists- There exists - For all- For all - Therefore- Therefore - Implies- Implies - Such that, Given- Such that, Given - Change- Change - Element (- Element ())
The Language of The Language of Mathematics IIMathematics II
- Exactly equal- Exactly equal - Roughly equal- Roughly equal - Not equal- Not equal - Summation- Summation - Product- Product - Partial Derivative- Partial Derivative - Integral- Integral
The Language of Mathematics IIIThe Language of Mathematics III
ln ln loglogbb
22
Natural Log Natural Log Log to Base Log to Base bb Mu = meanMu = mean Sigma = Std Dev.Sigma = Std Dev. Sigma sq. = Var.Sigma sq. = Var. UnionUnion IntersectionIntersection
Quick ReviewQuick Review
[e.g., [e.g., XXii]] [e.g., [e.g., y/ y/ x]x]| [e.g., Pr (Y | X)]| [e.g., Pr (Y | X)] [e.g., A U B][e.g., A U B] [e.g., [e.g., xx]]
Algebra Review – Algebra Review – 10 Commandments of 10 Commandments of
ExponentsExponents 1. A1. Am x m x AAn = n = AAm + nm + n
2. (A2. (Amm))n = n = A A m x nm x n
3. (A 3. (A xx B) B)n = n = AAn +n +BB n n
4. (A/B)4. (A/B)n n =(A=(Ann/B/Bnn) )
BB00 5. (1/A5. (1/Ann) = A) = A-n-n
6. (A6. (Amm/A/Ann) ) == A Am – n m – n
==1/A1/An - mn - m
7. A 7. A ½ ½ == AA 8. A 8. A 1/n 1/n == n nAA 9. A 9. A m/n m/n == (A (A 1/n1/n))m m
== (A (A mm))1/n 1/n = = nnAAmm
10. A10. A00 = 1 b/c A = 1 b/c A0 0
= A= A n – n n – n
= A= Ann/A/An n = 1= 1
Algebra Review – Algebra Review – Some Examples of ExponentsSome Examples of Exponents
Definition: 6Definition: 633
= 6 x 6 x 6 = 216= 6 x 6 x 6 = 216 [#2] (5[#2] (522))2 2
= 5 = 5 2 x 22 x 2 = 5 = 5 44 = 625 = 625 [#3] (3 x 4)[#3] (3 x 4)22
= 3 = 3 22 x 4 x 4 2 2 = 9 x 16 = 144= 9 x 16 = 144 [#4] (1/16)[#4] (1/16)1/41/4
= (1= (11/41/4/16/161/41/4) = [# 9] ) = [# 9] (1(11/41/4/(2/(244))1/41/4) = (1) = (11/41/4/2/24/44/4) = ½ ) = ½
Examples from Problem Set 1.Examples from Problem Set 1.
Problem Set Exponent Problem Set Exponent ExamplesExamples
Problem Set ExponentsProblem Set Exponents
Problem Set ExponentsProblem Set Exponents
Problem Set ExponentsProblem Set Exponents
Algebra Review –Algebra Review –Some of the Rules for Some of the Rules for
LogarithmsLogarithms Log (A x B)Log (A x B) Log (A/B)Log (A/B) Log (ALog (Ann)) Ln eLn exx
eeln xln x
= log (A) + log (B)= log (A) + log (B) = log (A) – log (B)= log (A) – log (B) = n log A= n log A = x= x = x= x
An Example of the First Rule for An Example of the First Rule for LogarithmsLogarithms
log 100 + log 400log 100 + log 400 [#1] Log 40,000 = [#1] Log 40,000 = log (10,000 x 4) = log (10,000 x 4) = log 10,000 + log 4 log 10,000 + log 4 =log 10=log 1044 + log 4 = + log 4 = 4 + .6 4 + .6 4.6 4.6
[#1] Log 10[#1] Log 1022 + log + log (4 x 10(4 x 1022) = log 10) = log 102 2
+ log 4 + log 10+ log 4 + log 1022 = = 2 + log 4 + 2 2 + log 4 + 2 4.6 4.6
Problem Set 1 Logarithms: 4aProblem Set 1 Logarithms: 4a
Problem Set 1 Logarithms: 4bProblem Set 1 Logarithms: 4b
Problem Set 1 Logarithms: 4cProblem Set 1 Logarithms: 4c
Last Questions from Problem Set Last Questions from Problem Set 11
Other Problem Set Topics: Other Problem Set Topics: GraphingGraphing
ProbabilityProbability TheoryTheory
Probabilities and OutcomesProbabilities and OutcomesSample space: set of all possible Sample space: set of all possible
outcomesoutcomesEvent: subset of sample spaceEvent: subset of sample spaceRandom VariablesRandom VariablesProbability DistributionProbability DistributionAn ExampleAn Example
Probability Distribution of Probability Distribution of Discrete Random variableDiscrete Random variable
List of all possible values of the List of all possible values of the variablevariable
And the probability that each will And the probability that each will occur.occur.
Must sum to 1Must sum to 1
For exampleFor example
Let M be the number of times your Let M be the number of times your computer crashes using Windows.computer crashes using Windows.
Probability that M=0 is Pr (M=0)Probability that M=0 is Pr (M=0)Probability that M=1 is Pr (M=1) etc.Probability that M=1 is Pr (M=1) etc.
Windows Crash TableWindows Crash Table
CrashesCrashes 00 11 22 33 44
Probability Probability DistributioDistributionn
.8.8 .1.1 .06.06 .03.03 .01.01
Cumulative Cumulative DistributioDistributionn
.8.8 .9.9 .96.96 .99.99 1.001.00
Windows Crash Probability Windows Crash Probability Distribution: A HistogramDistribution: A Histogram
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0 1 2 3 4
Probability Distribution
Cumulative Probability Cumulative Probability Distribution (CDF)Distribution (CDF)
0
0.2
0.4
0.6
0.8
1
0 1 2 3 4
Cumulative Probability Distribution
Bernoulli DistributionBernoulli Distribution
For Discrete Dichotomous VariablesFor Discrete Dichotomous VariablesLet G be the gender of next person Let G be the gender of next person
you meet, where G= 0 if male and G you meet, where G= 0 if male and G = 1 if female. = 1 if female.
The outcomes and probabilities are:The outcomes and probabilities are:
G = 1 with probability G = 1 with probability pp
G = 0 with probability G = 0 with probability 1-p1-p
Values of InterestValues of Interest
Probabilities, First DifferencesProbabilities, First DifferencesExpected Value of a Random Expected Value of a Random
VariableVariable
E (Y) is the long run average of E (Y) is the long run average of many repeated trials or occurrences.many repeated trials or occurrences.
Also called the expectation of Y Also called the expectation of Y
Also called the mean of Y, e.g., (Also called the mean of Y, e.g., (y y ) = ) = MuMuYY
For ExampleFor Example
You loan a friend $100 at 10 % interest.You loan a friend $100 at 10 % interest. If repaid in full you get $110If repaid in full you get $110But there is a risk of 1% that your But there is a risk of 1% that your
friend will default and you get nothing. friend will default and you get nothing.
So the amount you get is a random So the amount you get is a random variable that equal 110 with probability variable that equal 110 with probability .99 and 0 with probability .01..99 and 0 with probability .01.
On average, On average, , what you get = 110 , what you get = 110 x .99 + 0 x .01 = 108.9x .99 + 0 x .01 = 108.9
Back to Windows CrashesBack to Windows Crashes
E (M) = 0 (.8) + 1 (.1) + 2 (.06) + 3 E (M) = 0 (.8) + 1 (.1) + 2 (.06) + 3 (.03) + 4 (.01) = .35(.03) + 4 (.01) = .35
This is the expected number of This is the expected number of crashes while working on your crashes while working on your Windows OS. Windows OS.
Of course the actual number is an Of course the actual number is an integer integer
Expectation for Bernoulli RVExpectation for Bernoulli RV
E (G) = 1 x p + 0 (1-p) = pE (G) = 1 x p + 0 (1-p) = p
Or the probability that the value Or the probability that the value assumed in 1 (female).assumed in 1 (female).
Expectation of Continuous RVExpectation of Continuous RV
E (Y) = yE (Y) = y11pp11 + y + y22pp22 + … + y + … + ykk p pkk
KK
== y yiippii
i=1i=1
Other topicsOther topics
Variance, St. Dev., MomentsVariance, St. Dev., MomentsCondition ExpectationCondition Expectation IndependenceIndependenceStandard NormalStandard NormalLaw of Large NumbersLaw of Large NumbersCentral Limit TheoremCentral Limit Theorem
ReviewReview
OutcomesOutcomes ProbabilityProbability Sample SpaceSample Space EventEvent Discrete RVDiscrete RV Continuous RVContinuous RV Bernoulli RVBernoulli RV CDFCDF
Expected ValueExpected Value MomentsMoments Conditional Conditional
ExpectationExpectation Law of Iterated Law of Iterated
ExpectationsExpectations Law of Large Law of Large
NumbersNumbers