Math Bootcamp 202 Miscellaneous Factorial, combination and permutation The factorial of a positive integer n denoted by n!, is the product of all positive integers less than or equal to n. Define 0! =. For example 4! = 4 3 2. The number of k-combinations from a given set S( of ) n elements is often n denoted in elementary combinatorics texts by Ck n, or. We have k ( ) n = k n(n ) (n k + ) k(k ) = n! k!(n k)!. Two useful ( properties ) ( of combination: ) n n Symmetry, = ; k ( ) n ( k ) ( ) n n n For 0 < k < n, = +. k k k A permutation of a set S with n elements is a listing of the elements of S in some order (each element occurring exactly once). 2 Enumerating outcomes Choose 4 numbers from, 2,..., 0. Ordered, without replacement. The total number of ways to choose is 0 9 8 7.
Table : Number of possible arrangements of size r from n objects Without replacement With replacement n! Ordered n r (n r)!( ) ( ) n n + r Unordered r r Unordered, without replacement. (, 2, 3, 4) and (2,, 3, 4) are considered to be the same choice. The total number of ways to choose is 0 9 8 7 4 3 2. Ordered, with replacement. The total number of ways to choose is 0 0 0 0 = 0 4. Unordered, with replacement. The total number of ways to choose is ( ) 0 + 4 = 3! 4 4!9!. Example: Poker Probability. http : //en.wikipedia.org/wiki/p oker probability. 3 Random variable, expectation and variance 3. Bernoulli distribution Binomial theorem. (x + y) n = ( ) n n i=0 x i i y n i for any positive integer n. Random variable X. The value of X is random. We describe the possible outcome by probabilities. For example, consider tossing a coin. Denote the outcome by X. Then we get either head or tail. Let { if we get a head X = 0 if we get a tail 2
Suppose the probability of getting a head is /3, then { P (X = ) = /3 P (X = 0) = 2/3 describe the behavior of random variable X. We say X is a Bernoulli random variable, denoted by X Bernoulli(p), where 0 < p < is the probability of getting a head, or a success. 3.2 Binomial distribution We say X has a binomial distribution and denote it by X Binomial(n, p). Here X is the total number of heads when you toss a coin n times, each time having probability p of getting a head. Then we have ( ) n P (X = x) = p x ( p) n x, for x = 0,,, n. x Exercise:. Check x P (X = x) =, where the summation is over all possible values of x. 2. Find the expectation of X, or E(X) = x xp (X = x). 3. Let Y = n X. What is the distribution of Y? Solution:. x P (X = x) = ( ) n n x=0 p x x ( p) n x = (p + p) n =. 2. Denote x = k and we have xp (X = x) = x = np n x= n n! x x!(n x)! px ( p) n x = x=0 (n )! n (x )!(n x)! px ( p) n x = np = np(p + p) n = np k=0 n n! x x!(n x)! px ( p) n x ( ) n p k ( p) n k k x= ( ) n 3. P (Y = y) = P (X = n y) = p n y n y ( p) y = ( p)} n y. Thus Y Binomial(n, p). ( ) n ( p) y y { 3
3.3 Uniform distribution and exponential distribution We say X is uniformly distributed over [a, b] if the probability density function is { if a x b f(x) = b a 0 otherwise We denote it by X Unif(a, b). Here b > a. Exercise:. Draw the graph of f(x). 2. Check b f(x)dx =. a 3. Find the expectation of X, or E(X) = b xf(x)dx. a Solution: 2. b f(x)dx = b a a 3. b xf(x)dx = b x dx = a a b a dx = b a x2 2(b a) b a x b a b =. a = b2 a 2 2(b a) = b+a 2. We say X is exponentially distributed if the probability density function is { f(x) = λ e x/λ if 0 x < 0 otherwise We denote it by X Exp(λ). Here λ > 0. Exercise:. Draw the graph of f(x) for λ = /2,, 2. 2. Check f(x)dx =. 0 3. Find the expectation of X, or E(X) = xf(x)dx. 0 Solution: 2. f(x)dx = 0 0 λ e x/λ dx = e x/λ = 0 e + e 0 =. 3. xf(x)dx = x 0 0 λ e x/λ dx = xd(e x/λ ) = xe x/λ + e x/λ dx = 0 0 0 λ. 3.4 Normal distribution We say X is standard normal distribution if it has density Exercise:. Draw the graph of f(x). f(x) = 2π e x2 /2, for < x <. 4
2. Check f(x)dx =. 3. Find the expectation of X, or E(X) = xf(x)dx. Note: check out the solution to part 2 in http : //en.wikipedia.org/wiki/gaussian integral We say X is normal with mean µ and variance σ 2 if it has density f(x) = 2πσ e (x µ)2 /(2σ 2), for < x <. Exercise:. Draw the graph of f(x). 2. Check f(x)dx =. 3. Verify that E(X) = xf(x)dx = µ. 4. Verify that var(x) = E(X 2 ) E 2 (X) = σ 2. 4 Conditional probability For two events A and B, P (A B) denotes the probability of A happening given that B already happens. Then P (A B) = P (A B), P (B) where A B means the intersection of events A and B, and P (A B) denotes the probability of both A and B happening. The equality above implies that P (A B) = P (B)P (A B). For both A and B to happen, we can take two steps: first B happens, then given that B already happens, A has to happen. Similarly, we have P (B A) = P (A B), and P (A B) = P (A)P (B A). P (A) Bayes Theorem: Suppose A, A 2,..., A n is a partition of the sample space. For any event B, we have P (B A i ) = P (A i )P (B A i ) n i= P (A i)p (B A i ). 5
Example: Consider the outcome of tossing two dices. The sample space of all possible outcome is Define the following events S = {(, ), (, 2),..., (, 6), (2, ),..., (6, 6)}. A = {doubles appear} = {(, ), (2, 2),..., 6, 6} B = {the sum is between 7 and 0, 7 and 0 included} Find P (A), P (B), P (A B). Solution: P (A) = number of elements in A number of elements in S = 6 =. 36 6 P (B) = number of elements in B number of elements in S = 8 36 = 2. P (A B) = P (A B) P (B) = 2/36 8/36 = 2 8 = 9 Example: a. Four cards are dealt from the top a well-shuffled deck. What is the probability that they are four aces? b. Given that the first i cards dealt are all aces, what is the probability of getting 4 aces out of 4 draws for i =, 2, 3? Solution: Denote events Then A i = {i aces in i cards}, i =, 2, 3 P (B A i ) = P (B A i) P (A i ) B = {4 aces in 4 cards} = P (B) P (A i ) = C4 4/C4 52 Ci 4/C52 i = C 52 i 4 i Example (rare disease): A rare disease happens with probability.0. If a person has this disease, he/she will be test positive with probability.95. If a person does not have this disease, he/she will be test positive with probability.05. If a person gets a positive test result for this disease, what is the probability of he/she actually has the disease? Solution: Denote events D = {have the disease}, ND = {not have the disease} T P = {test positive}, T N = {test negative} 6
Then we have P (D) =.0, P (ND =.0 =.99). We also have Using Bayes Theorem, we have P (T P D) =.95, P (T P ND) =.05 P (D)P (T P D) P (D T P ) = P (D)P (T P D) + P (ND)P (T P ND).0.95 =.0.95 +.99.05 =.6. This means the even if the test is positive, the person only has.6, a relatively small probability of really having the disease. 5 Useful inequalities Theorem. Let a and b be any positive numbers. Let p and q be positive numbers satisfying + =. Then p q with equality if and only if a p = b q. p ap + q bq ab Theorem. For positive numbers a,, a n, we have ( n a i ) 2 n i= n a 2 i. i= Theorem. Let p and q be positive numbers satisfying + p q numbers a,, a n, b,, b n, we have =. For positive n n n a i b i ( a p i )/p ( b q i )/q. i= i= Theorem. (Jensen s Inequality) For any random variable X, if g(x) is a convex function, then E(g(X)) g(e(x)). i= 7
If g(x) is a concave function, then E(g(X)) g(e(x)). Theorem. (An inequality for the means) For positive numbers a,, a n, define arithmetic mean a A = n a i, n Then we have a H a G a A. i= geometric mean a G = (a a 2... a n ) /n, harmonic mean a H = ( n a + a 2 + + a n ). 6 Sequences and limits A sequence is a list of numbers written in a specific order. This list may have finite, or infinite number of terms. We denote an infinite sequence by {a, a 2,, a n, a n+, }, or {a n }. We say that lim a n = L if for every ɛ > 0 there is an integer N such that a n L < ɛ whenever n > N. We say that lim a n = if for every M > 0 there is an integer N such that a n > M whenever n > N. If lim a n exists and is finite, we say the sequence is convergent. If lim does not exist or is infinite, we say the sequence diverges. Properties:. lim (a n ± b n ) = lim a n ± lim b n. 2. lim ca n = c lim a n. 3. lim (a n b n ) = lim a n lim b n. a n 8
a 4. lim n bn = lim an lim bn if lim b n 0. Squeeze theorem. If a n c n b n for all n > N and lim a n = lim b n = L, then lim c n = L. Exercise. Consider the sequence {r n }. Prove that it converges if < r and diverges for all other values of r. Also { 0 if < r < lim rn = if r = We have the following terminology:. If a n > a n+ for every n, we say the sequence is decreasing. 2. If a n < a n+ for every n, we say the sequence is increasing. 3. If {a n } is either increasing or decreasing, then we say the sequence is monotonic. 4. If there exists m such that a n > m for all n, we say the sequence is bounded below, and m is a lower bound of the sequence. 5. If there exists M such that a n < M for all n, we say the sequence is bounded above, and M is a upper bound of the sequence. 6. If the sequence is both bounded above and bounded below, we say the sequence is bounded. Theorem. If {a n } is bounded and monotonic, then {a n } is convergent. 9
7 Series 7. Introduction and some tests We start with a sequence {a n }. Define the following: s = a s 2 = a + a 2. s n = a + a 2 + + a n = n i= a i The s n are called partial sums and they form a sequence {s n }. We want to look at the limit of the sequence of partial sums {s n }, or lim s n = i= a i. If this limit exists and is finite, we say the series i= a i convergent. Properties. If a n and b n are both convergent series, then. ca n is convergent, and ca n = c a n. 2. (a n ± b n ) is convergent, and (a n ± b n ) = a n ± b n. Exercise. Index shift. Write n 2 n= as a series that start at n = 3. 3 n+ Exercise. Determine whether the following series are divergent or convergent.. n= n. 2. n=2. n 2 3. n= ( )n. 4. n= 3 (n ). Theorem. If a n converges, then lim a n = 0. Divergence test. If lim a n 0, then a n diverges. 0
7.2 Common series and more tests Geometric series. n= arn. This series is convergent when < r <, and it converges to a r Telescoping series. n=. n 2 +3n+2 Harmonic series. n=. This series is divergent. We notice n n= n > On the other hand, n= n= n = + 2 n=2 n 2 x dx = ln x =. is convergent. We notice x dx = 2 x n 2 < + = 2. Integral test. Suppose f(x) is continuous, positive and decreasing on the interval [k, ), and f(n) = a n. Then. If f(x)dx is convergent, so is k n=k a n. 2. If f(x)dx is divergent, so is k n=k a n. The p series test. For k > 0, n=k p. n p converges if p > and diverges if Comparison test. Suppose we have two series a n and b n, a n > 0, b n > 0 for all n. Also a n b n for all n. Then. If b n is convergent, so is a n. 2. If a n is divergent, so is b n. Limit comparison test. Suppose we have two series a n and b n, a n > 0, b n > 0 for all n. Define a n c = lim. b n If c is positive and finite, then either both series converge or both series diverge. Alternating series test. Suppose we have a series a n, and either a n = ( ) n b n or a n = ( ) n+ b n where b n 0 for all n. If
. lim b n = 0, and 2. {b n } is decreasing sequence, then series {a n } is convergent. Ratio test. Suppose we have a series a n. Define L = lim a n+ a n. Then. if L >, a n is divergent. 2. if L <, a n is convergent. Root test. Suppose we have a series a n. Define Then. if L >, a n is divergent. 2. if L <, a n is convergent. Fact. lim n /n =. L = lim a n /n. 7.3 Strategies for convergence tests. With a quick glance does it look like the series terms do not converge to zero in the limit, i.e. does lim a n 0? If so, the series is divergent. 2. Is the series a p-series ( n= n p ) or a geometric series ( n= arn )? If so use the fact that p-series will only converge if p > and a geometric series will only converge if r <. Remember as well that often some algebraic manipulation is required to get a geometric series into the correct form. 3. Is the series similar to a p-series or a geometric series? If so, try the Comparison Test. 2
4. Is the series a rational expression involving only polynomials or polynomials under radicals (i.e. a fraction involving only polynomials or polynomials under radicals)? If so, try the Comparison Test and/or the Limit Comparison Test. Remember however, that in order to use the Comparison Test and the Limit Comparison Test the series terms all need to be positive. 5. Does the series contain factorials or constants raised to powers involving n? If so, then the Ratio Test may work. Note that if the series term contains a factorial then the only test that weve got that will work is the Ratio Test. 6. Can the series terms be written in the form a n = ( ) n b n or a n = ( ) n+ b n? If so, then the Alternating Series Test may work. 7. Can the series terms be written in the form a n = (b n ) n? If so, then the Root Test may work. 8. If a n = f(n) for some positive, decreasing function f(x) and is easy to evaluate f(x)dx then the Integral Test may work. 8 Evaluation of common series We have the following results:. n i= i = n(n+) 2. 2. n i= i2 = n(n+)(2n+) 6. 3. n i=0 rn = rn+ 4. n i=0 ( n i for r. r ) = 2 n. 5. ( ) n+ n= = ln 2. n 6. x n n=0 n! = e x for any < x <. 7. lim ( + n) n = e and lim ( n ) n = e. 3
More reading materials can be found at http : //www.math.american.edu/p eople/kalman/pdf f iles/sixways.pdf which is to prove that n= Equivalent definitions of e n 2 = π2 6. http : //cazelais.disted.camosun.bc.ca/250/e def inition.pdf 4